From 93f03548500fbe1dda5140d30fe8a48d4686ed70 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Fri, 11 Jan 2002 01:11:44 +0000 Subject: [PATCH] Reverse the sense of EXPORT_SYMS. If EXPORT_SYMS is not defined, no symbols are exported from the module. This is the typical configuration for most device drivers and standalone modules; only infrastructure modules or those with special requirements typically need to export symbols. Don't print the objcopy commands as they are run when converting symbols; they're bulky and annoying in many cases. --- sys/conf/kmod.mk | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 72e93a16b9b2..dbec48f6a43a 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -52,8 +52,8 @@ # This file contains a default list of interfaces. # # EXPORT_SYMS A list of symbols that should be exported from the module, -# or the name of a file containing a list of symbols, or NO -# to export no symbols. If missing, all global symbols are +# or the name of a file containing a list of symbols, or YES +# to export all symbols. If not defined, no symbols are # exported. # # +++ targets +++ @@ -153,13 +153,15 @@ ${PROG}: ${FULLPROG} ${FULLPROG}: ${KMOD}.kld ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld -.if defined(EXPORT_SYMS) +EXPORT_SYMS?= NO +.if ${EXPORT_SYMS} != YES CLEANFILES+= ${.OBJDIR}/export_syms .endif ${KMOD}.kld: ${OBJS} ${LD} ${LDFLAGS} -r -d -o ${.TARGET} ${OBJS} .if defined(EXPORT_SYMS) +.if ${EXPORT_SYMS} != YES .if ${EXPORT_SYMS} == NO touch ${.OBJDIR}/export_syms .elif !exists(${.CURDIR}/${EXPORT_SYMS}) @@ -169,7 +171,8 @@ ${KMOD}.kld: ${OBJS} .endif awk -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \ ${.OBJDIR}/export_syms | \ - xargs -t -J% ${OBJCOPY} % ${.TARGET} + xargs -J% ${OBJCOPY} % ${.TARGET} +.endif .endif