From 80dfae5fe2432fd72dead5aebe4a1592aaf39281 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 13 Sep 2010 07:29:02 +0000 Subject: [PATCH] Simplify atomic selection --- sys/modules/opensolaris/Makefile | 8 ++++++-- sys/modules/zfs/Makefile | 13 ++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/modules/opensolaris/Makefile b/sys/modules/opensolaris/Makefile index eef8ffd6e35d..ca4f12a39f6f 100644 --- a/sys/modules/opensolaris/Makefile +++ b/sys/modules/opensolaris/Makefile @@ -8,8 +8,12 @@ SRCS= opensolaris.c \ opensolaris_kmem.c \ opensolaris_misc.c -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc64" -.PATH: ${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} +_A=${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic +.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S) +.PATH: ${_A}/${MACHINE_CPUARCH} +SRCS+= opensolaris_atomic.S +.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S) +.PATH: ${_A}/${MACHINE_ARCH} SRCS+= opensolaris_atomic.S .else SRCS+= opensolaris_atomic.c diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index e4cf297fc7df..d0a6f44bde3e 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -27,12 +27,15 @@ SRCS+= opensolaris_uio.c SRCS+= opensolaris_vfs.c SRCS+= opensolaris_zone.c -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc64" -.PATH: ${SUNW}/common/atomic/${MACHINE_ARCH} -SRCS+= opensolaris_atomic.S +_A=${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic +.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S) +.PATH: ${_A}/${MACHINE_CPUARCH} +SRCS+= opensolaris_atomic.S +.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S) +.PATH: ${_A}/${MACHINE_ARCH} +SRCS+= opensolaris_atomic.S .else -.PATH: ${.CURDIR}/../../cddl/compat/opensolaris/kern -SRCS+= opensolaris_atomic.c +SRCS+= opensolaris_atomic.c .endif .PATH: ${SUNW}/uts/common/fs