svn commit: r212538 - head/sys/conf

Warner Losh imp at FreeBSD.org
Mon Sep 13 07:16:48 UTC 2010


Author: imp
Date: Mon Sep 13 07:16:48 2010
New Revision: 212538
URL: http://svn.freebsd.org/changeset/base/212538

Log:
  Use MACHINE_CPUARCH as appropriate
  Define __KLD_SHARED to be yes or no depending on if the target uses shared
  binaries for klds or not (this also eliminates 4 uses of MACHINE_ARCH).

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Mon Sep 13 07:15:01 2010	(r212537)
+++ head/sys/conf/kmod.mk	Mon Sep 13 07:16:48 2010	(r212538)
@@ -81,6 +81,13 @@ OBJCOPY?=	objcopy
 
 .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
 
+# amd64 and mips use direct linking for kmod, all others use shared binaries
+.if ${MACHINE_CPUARCH} != amd64 && ${MACHINE_CPUARCH} != mips
+__KLD_SHARED=yes
+.else
+__KLD_SHARED=no
+.endif
+
 .if ${CC:T:Micc} == "icc"
 CFLAGS:=	${CFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/}
 .else
@@ -128,15 +135,15 @@ CFLAGS+=	-fno-common
 LDFLAGS+=	-d -warn-common
 
 CFLAGS+=	${DEBUG_FLAGS}
-.if ${MACHINE_ARCH} == amd64
+.if ${MACHINE_CPUARCH} == amd64
 CFLAGS+=	-fno-omit-frame-pointer
 .endif
 
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
+.if ${MACHINE_CPUARCH} == powerpc
 CFLAGS+=	-mlongcall -fno-omit-frame-pointer
 .endif
 
-.if ${MACHINE_ARCH} == "mips"
+.if ${MACHINE_CPUARCH} == mips
 CFLAGS+=	-G0 -fno-pic -mno-abicalls -mlong-calls
 .endif
 
@@ -190,7 +197,7 @@ ${PROG}.symbols: ${FULLPROG}
 	${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET}
 .endif
 
-.if ${MACHINE_ARCH} != amd64 && ${MACHINE_ARCH} != mips
+.if ${__KLD_SHARED} == yes
 ${FULLPROG}: ${KMOD}.kld
 	${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld
 .if !defined(DEBUG_FLAGS)
@@ -203,7 +210,7 @@ EXPORT_SYMS?=	NO
 CLEANFILES+=	export_syms
 .endif
 
-.if ${MACHINE_ARCH} != amd64 && ${MACHINE_ARCH} != mips
+.if ${__KLD_SHARED} == yes
 ${KMOD}.kld: ${OBJS}
 .else
 ${FULLPROG}: ${OBJS}
@@ -223,8 +230,7 @@ ${FULLPROG}: ${OBJS}
 	    export_syms | xargs -J% ${OBJCOPY} % ${.TARGET}
 .endif
 .endif
-.if !defined(DEBUG_FLAGS) && \
-    (${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == mips)
+.if !defined(DEBUG_FLAGS) && ${__KLD_SHARED} == no
 	${OBJCOPY} --strip-debug ${.TARGET}
 .endif
 


More information about the svn-src-head mailing list