Author: dim
Date: Sat Sep 8 11:34:22 2012
New Revision: 240236
URL: http://svn.freebsd.org/changeset/base/240236
Log:
MFC r239680:
Add libcxxrt's objects (prefixing them with cxxrt_ to avoid collisions)
to libc++.a and libc++_p.a, to make static linking of C++ executables
with libc++ easier. This is similar to the approach used in libstdc++.
MFC r239686:
When using -stdlib=libc++, add the correct dependency to .depend in
bsd.prog.mk.
Submitted by: Yamaya Takashi <[email protected]>
MFC r239695:
For building libstdc++ and libsupc++, filter out any -stdlib=libc++
option from CXXFLAGS, otherwise these libraries will not build.
Similarly, filter out any -std=xxx options that aren't supported.
Submitted by: Yamaya Takashi <[email protected]>
Modified:
stable/9/gnu/lib/libstdc++/Makefile
stable/9/gnu/lib/libsupc++/Makefile
stable/9/lib/libc++/Makefile
stable/9/share/mk/bsd.prog.mk
Directory Properties:
stable/9/gnu/lib/libstdc++/ (props changed)
stable/9/gnu/lib/libsupc++/ (props changed)
stable/9/lib/libc++/ (props changed)
stable/9/share/mk/ (props changed)
Modified: stable/9/gnu/lib/libstdc++/Makefile
==============================================================================
--- stable/9/gnu/lib/libstdc++/Makefile Sat Sep 8 08:46:43 2012
(r240235)
+++ stable/9/gnu/lib/libstdc++/Makefile Sat Sep 8 11:34:22 2012
(r240236)
@@ -22,6 +22,7 @@ CFLAGS+= -I${GCCLIB}/include -I${SRCDIR}
CFLAGS+= -frandom-seed=RepeatabilityConsideredGood
CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections \
-Wno-deprecated
+CXXFLAGS:=
${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]}
PO_CXXFLAGS= ${CXXFLAGS:N-ffunction-sections}
DPADD= ${LIBM}
Modified: stable/9/gnu/lib/libsupc++/Makefile
==============================================================================
--- stable/9/gnu/lib/libsupc++/Makefile Sat Sep 8 08:46:43 2012
(r240235)
+++ stable/9/gnu/lib/libsupc++/Makefile Sat Sep 8 11:34:22 2012
(r240236)
@@ -24,6 +24,7 @@ CFLAGS+= -I${GCCLIB}/include -I${SRCDIR}
CFLAGS+= -I${.CURDIR}/../libstdc++ -I.
CFLAGS+= -frandom-seed=RepeatabilityConsideredGood
CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections
+CXXFLAGS:=
${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]}
PO_CXXFLAGS= ${CXXFLAGS:N-ffunction-sections}
HDRS= exception new typeinfo cxxabi.h exception_defines.h
Modified: stable/9/lib/libc++/Makefile
==============================================================================
--- stable/9/lib/libc++/Makefile Sat Sep 8 08:46:43 2012
(r240235)
+++ stable/9/lib/libc++/Makefile Sat Sep 8 11:34:22 2012
(r240236)
@@ -35,8 +35,25 @@ SRCS+= algorithm.cpp\
utility.cpp\
valarray.cpp
+CXXRT_SRCS+= libelftc_dem_gnu3.c\
+ terminate.cc\
+ dynamic_cast.cc\
+ memory.cc\
+ auxhelper.cc\
+ exception.cc\
+ stdexcept.cc\
+ typeinfo.cc\
+ guard.cc
+
+.for _S in ${CXXRT_SRCS}
+STATICOBJS+= cxxrt_${_S:R}.o
+cxxrt_${_S}:
+ ln -sf ${LIBCXXRTDIR}/${_S} ${.TARGET}
+.endfor
+
WARNS= 0
-CXXFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -std=c++0x -nostdlib -DLIBCXXRT
+CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT
+CXXFLAGS+= -std=c++0x
DPADD= ${LIBCXXRT}
LDADD= -lcxxrt
Modified: stable/9/share/mk/bsd.prog.mk
==============================================================================
--- stable/9/share/mk/bsd.prog.mk Sat Sep 8 08:46:43 2012
(r240235)
+++ stable/9/share/mk/bsd.prog.mk Sat Sep 8 11:34:22 2012
(r240236)
@@ -131,10 +131,14 @@ _EXTRADEPEND:
.else
echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE}
.if defined(PROG_CXX)
+.if !empty(CXXFLAGS:M-stdlib=libc++)
+ echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE}
+.else
echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}
.endif
.endif
.endif
+.endif
.if !target(install)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"