diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2015-04-04 00:42:09 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2015-04-04 00:42:09 +0000 |
commit | 44dfc90bcd426f5f12c49e21eace0fe5d1edd2f0 (patch) | |
tree | 4d580f376425f895285036aeae5ff7da4741e715 | |
parent | e247370125655f0c959f224089b349eef7280c4c (diff) | |
download | FreeBSD-src-44dfc90bcd426f5f12c49e21eace0fe5d1edd2f0.zip FreeBSD-src-44dfc90bcd426f5f12c49e21eace0fe5d1edd2f0.tar.gz |
MFC r280179,r280180:
r280179:
Add LIB_CXX so that C++ libraries will use CXX to link.
This adds some extra dependencies directly to Makefile.inc1 as
atf is still a prebuild library in stable/10. If r273449 is MFCd
these can come out.
r280180:
Document LIB and LIB_CXX.
-rw-r--r-- | Makefile.inc1 | 10 | ||||
-rw-r--r-- | lib/atf/libatf-c++/Makefile | 2 | ||||
-rw-r--r-- | share/mk/bsd.README | 7 | ||||
-rw-r--r-- | share/mk/bsd.lib.mk | 9 |
4 files changed, 26 insertions, 2 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index abb30b7..243f5f5 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1574,6 +1574,10 @@ _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/lib/libstdc++__L: lib/msun__L .endif +.if ${MK_LIBCPLUSPLUS} != "no" +_prebuild_libs+= lib/libc++ +.endif + lib/libgeom__L: lib/libexpat__L .if defined(WITH_ATF) || ${MK_TESTS} != "no" @@ -1583,6 +1587,12 @@ lib/libgeom__L: lib/libexpat__L MAKE+= -DWITH_ATF .endif _lib_atf= lib/atf +.if ${MK_GNUCXX} != no +lib/atf__L: gnu/lib/libstdc++__L +.endif +.if ${MK_LIBCPLUSPLUS} != "no" +lib/atf__L: lib/libc++__L lib/msun__L +.endif .endif .if ${MK_LIBTHR} != "no" diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile index 3cbbfa3..ea8434d 100644 --- a/lib/atf/libatf-c++/Makefile +++ b/lib/atf/libatf-c++/Makefile @@ -27,7 +27,7 @@ .include <bsd.init.mk> -LIB= atf-c++ +LIB_CXX= atf-c++ PRIVATELIB= true SHLIB_MAJOR= 2 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" |