summaryrefslogtreecommitdiffstats
path: root/share/mk
diff options
context:
space:
mode:
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/bsd.README7
-rw-r--r--share/mk/bsd.lib.mk9
2 files changed, 15 insertions, 1 deletions
diff --git a/share/mk/bsd.README b/share/mk/bsd.README
index 9740dac..8121c63 100644
--- a/share/mk/bsd.README
+++ b/share/mk/bsd.README
@@ -334,6 +334,13 @@ with the current needs of the BSD tree.
It sets/uses the following variables:
+LIB The name of the library to build.
+
+LIB_CXX The name of the library to build. It also causes
+ <bsd.lib.mk> to link the library with the
+ standard C++ library. LIB_CXX overrides the value
+ of LIB if LIB is also set.
+
LIBDIR Target directory for libraries.
LINTLIBDIR Target directory for lint libraries.
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index b87bc6c..bda3d47 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -4,6 +4,13 @@
.include <bsd.init.mk>
+.if defined(LIB_CXX)
+LIB= ${LIB_CXX}
+_LD= ${CXX}
+.else
+_LD= ${CC}
+.endif
+
# Set up the variables controlling shared libraries. After this section,
# SHLIB_NAME will be defined only if we are to create a shared library.
# SHLIB_LINK will be defined only if we are to create a link to it.
@@ -208,7 +215,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS}
.if defined(SHLIB_LINK)
@${INSTALL_SYMLINK} ${SHLIB_NAME} ${SHLIB_LINK}
.endif
- ${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
+ ${_LD} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
-o ${.TARGET} -Wl,-soname,${SONAME} \
`NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
.if ${MK_CTF} != "no"
OpenPOWER on IntegriCloud