summaryrefslogtreecommitdiffstats
path: root/share/mk
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2006-10-25 09:43:38 +0000
committerru <ru@FreeBSD.org>2006-10-25 09:43:38 +0000
commita84b99eeb9833427f4a830003715e07d7f3aab5c (patch)
treedbd0a5d6f53e6f5ee8968ef58589377acaba360f /share/mk
parent956fcf47f78e6d9b84b72fb62a84defe032fef37 (diff)
downloadFreeBSD-src-a84b99eeb9833427f4a830003715e07d7f3aab5c.zip
FreeBSD-src-a84b99eeb9833427f4a830003715e07d7f3aab5c.tar.gz
- Don't pass an empty ``NM='' to lorder(1) when NM is unset.
- Don't redundantly use "env". - Protect NM value with quotes, just in case.
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/bsd.lib.mk20
1 files changed, 17 insertions, 3 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 53692d0..530ac15 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -154,7 +154,11 @@ _LIBS= lib${LIB}.a
lib${LIB}.a: ${OBJS} ${STATICOBJS}
@${ECHO} building static ${LIB} library
@rm -f ${.TARGET}
- @${AR} cq ${.TARGET} `env NM=${NM} lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
+.if !defined(NM)
+ @${AR} cq ${.TARGET} `lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
+.else
+ @${AR} cq ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
+.endif
${RANLIB} ${.TARGET}
.endif
@@ -167,7 +171,11 @@ POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po}
lib${LIB}_p.a: ${POBJS}
@${ECHO} building profiled ${LIB} library
@rm -f ${.TARGET}
- @${AR} cq ${.TARGET} `env NM=${NM} lorder ${POBJS} | tsort -q` ${ARADD}
+.if !defined(NM)
+ @${AR} cq ${.TARGET} `lorder ${POBJS} | tsort -q` ${ARADD}
+.else
+ @${AR} cq ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD}
+.endif
${RANLIB} ${.TARGET}
.endif
@@ -185,9 +193,15 @@ ${SHLIB_NAME}: ${SOBJS}
.if defined(SHLIB_LINK)
@ln -fs ${.TARGET} ${SHLIB_LINK}
.endif
+.if !defined(NM)
@${CC} ${LDFLAGS} -shared -Wl,-x \
-o ${.TARGET} -Wl,-soname,${SONAME} \
- `env NM=${NM} lorder ${SOBJS} | tsort -q` ${LDADD}
+ `lorder ${SOBJS} | tsort -q` ${LDADD}
+.else
+ @${CC} ${LDFLAGS} -shared -Wl,-x \
+ -o ${.TARGET} -Wl,-soname,${SONAME} \
+ `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
+.endif
.endif
.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
OpenPOWER on IntegriCloud