1*0a6a1f1dSLionel Sambuc# $NetBSD: Makefile,v 1.20 2015/01/29 21:12:10 joerg Exp $ 218a5822eSThomas Veerman 318a5822eSThomas VeermanREQUIRETOOLS= yes 418a5822eSThomas VeermanNOLINT= # defined 518a5822eSThomas Veerman 6*0a6a1f1dSLionel Sambuc.include <bsd.init.mk> 718a5822eSThomas Veerman 884d9c625SLionel Sambuc.include "Makefile.inc" 984d9c625SLionel Sambuc 1018a5822eSThomas VeermanLIB= stdc++ 1118a5822eSThomas Veerman 1218a5822eSThomas VeermanLIBDPLIBS+= m ${.CURDIR}/../../../../../lib/libm 1318a5822eSThomas Veerman 14*0a6a1f1dSLionel Sambuc#COPTS+= -pthread 15*0a6a1f1dSLionel Sambuc#LDFLAGS+= -pthread 16*0a6a1f1dSLionel Sambuc.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" 17*0a6a1f1dSLionel SambucCOPTS.random.cc+= ${${ACTIVE_CC} == "clang":? -mrdrnd :} 18c8f3b109SBen Gras.endif 19c8f3b109SBen Gras 20*0a6a1f1dSLionel SambucCXXFLAGS.clang+= -stdlib=libstdc++ -std=c++11 -D_GLIBCXX_ABI_TAG_CXX11= 21*0a6a1f1dSLionel SambucCXXFLAGS+= ${CXXFLAGS.${ACTIVE_CC}} 2218a5822eSThomas VeermanCWARNFLAGS.clang+= -Wno-logical-op-parentheses \ 2318a5822eSThomas Veerman -Wno-deprecated-writable-strings -Wno-parentheses 2418a5822eSThomas Veerman 25*0a6a1f1dSLionel Sambuc.include "${.CURDIR}/../libsupc++/Makefile.common" 26*0a6a1f1dSLionel Sambuc 27*0a6a1f1dSLionel Sambuc.if exists(${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH}/defs.mk) && ${MKGCC} != "no" 28*0a6a1f1dSLionel Sambuc.include "${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH}/defs.mk" 2918a5822eSThomas Veerman 30341705a4SLionel Sambuc.if defined(__MINIX) 31341705a4SLionel Sambuc# by itself, libstdc++ think it is version 6, so use the same number here 32341705a4SLionel Sambuc# as this is the exact same code, and will allow us to provide this library 33*0a6a1f1dSLionel Sambuc# from the base system (here), or through the gcc48 package. 34341705a4SLionel SambucSHLIB_MAJOR= 6 35341705a4SLionel Sambuc.else 3618a5822eSThomas VeermanSHLIB_MAJOR= 7 37341705a4SLionel Sambuc.endif # defined(__MINIX) 38*0a6a1f1dSLionel SambucSHLIB_MINOR= 3 3918a5822eSThomas Veerman 4018a5822eSThomas VeermanSUBDIR= include 4118a5822eSThomas Veerman 4218a5822eSThomas VeermanSRCS= ${LIBSUPCXXSRCS} ${LIBSTDCXXSRCS} 4318a5822eSThomas Veerman# affects profiling; can't switch it off just for profiling easily. 4418a5822eSThomas Veerman#CXXFLAGS+= ${G_SECTION_FLAGS} 4518a5822eSThomas Veerman#CXXFLAGS+= -ffunction-sections -fdata-sections 4618a5822eSThomas VeermanCXXFLAGS+= -fno-implicit-templates -fdiagnostics-show-location=once 4718a5822eSThomas VeermanCPPFLAGS+= -I${DIST}/libstdc++-v3/include 48*0a6a1f1dSLionel SambucCPPFLAGS+= -I${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH} 49*0a6a1f1dSLionel Sambuc# include backwards compatible code 50*0a6a1f1dSLionel SambucCPPFLAGS+= -D_GLIBCXX_SHARED -DGTHREAD_USE_WEAK -DSUPPORTS_WEAK 5118a5822eSThomas Veerman 5218a5822eSThomas VeermanCONF= ${DIST}/libstdc++-v3/config 5318a5822eSThomas Veerman 5418a5822eSThomas VeermanGLIBCPP_INCLUDE_DIR= ${DESTDIR}/usr/include/g++ 5518a5822eSThomas Veerman 56*0a6a1f1dSLionel Sambuc# Template instantiation bug workaround for -O<2/s 57*0a6a1f1dSLionel SambucCOPTS.cp-demangle.c = -Wno-stack-protector 5818a5822eSThomas VeermanCOPTS.cp-demangle.c = -Wno-stack-protector 5918a5822eSThomas VeermanCOPTS.fstream-inst.cc = -Wno-stack-protector 6018a5822eSThomas VeermanCOPTS.locale-inst.cc = -Wno-stack-protector 6118a5822eSThomas VeermanCOPTS.misc-inst.cc = -Wno-stack-protector 6218a5822eSThomas VeermanCOPTS.ostream-inst.cc = -Wno-stack-protector 6318a5822eSThomas VeermanCOPTS.valarray-inst.cc = -Wno-stack-protector 6418a5822eSThomas VeermanCOPTS.wlocale-inst.cc = -Wno-stack-protector 65*0a6a1f1dSLionel SambucCOPTS.concept-inst.cc= -fimplicit-templates 66*0a6a1f1dSLionel SambucCOPTS.hashtable_c++0x.cc= -fimplicit-templates 67*0a6a1f1dSLionel SambucCOPTS.bitmap_allocator.cc = -fimplicit-templates 6818a5822eSThomas VeermanCPPFLAGS.strstream.cc= -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated 6918a5822eSThomas Veerman 7018a5822eSThomas Veerman# XXX also need this for some PCHs. 7118a5822eSThomas VeermanCPPFLAGS.atomic.cc = -std=gnu++0x 7218a5822eSThomas VeermanCPPFLAGS.compatibility-c++0x.cc = -std=gnu++0x 7318a5822eSThomas VeermanCPPFLAGS.functexcept.cc = -std=gnu++0x 7418a5822eSThomas VeermanCPPFLAGS.hash_c++0x.cc = -std=gnu++0x 7518a5822eSThomas VeermanCPPFLAGS.hashtable_c++0x.cc = -std=gnu++0x 7618a5822eSThomas VeermanCPPFLAGS.limits.cc = -std=gnu++0x 7718a5822eSThomas VeermanCPPFLAGS.system_error.cc = -std=gnu++0x 7818a5822eSThomas VeermanCPPFLAGS.fstream-inst.cc = -std=gnu++0x 7918a5822eSThomas VeermanCPPFLAGS.string-inst.cc = -std=gnu++0x 8018a5822eSThomas VeermanCPPFLAGS.wstring-inst.cc = -std=gnu++0x 8118a5822eSThomas VeermanCPPFLAGS.mutex.cc = -std=gnu++0x 8218a5822eSThomas VeermanCPPFLAGS.condition_variable.cc = -std=gnu++0x 8318a5822eSThomas VeermanCPPFLAGS.chrono.cc = -std=gnu++0x 8418a5822eSThomas VeermanCPPFLAGS.thread.cc = -std=gnu++0x 8518a5822eSThomas VeermanCPPFLAGS.future.cc = -std=gnu++0x 8618a5822eSThomas Veerman 8718a5822eSThomas VeermanCPPFLAGS.cp-demangle.cc += -DIN_GLIBCPP_V3 8818a5822eSThomas VeermanCPPFLAGS.concept-inst.cc += -D_GLIBCXX_CONCEPT_CHECKS 8918a5822eSThomas VeermanCPPFLAGS.parallel_list.cc += -D_GLIBCXX_PARALLEL 9018a5822eSThomas VeermanCPPFLAGS.parallel_settings.cc += -D_GLIBCXX_PARALLEL 9118a5822eSThomas VeermanCPPFLAGS.compatibility-parallel_list.cc += -D_GLIBCXX_PARALLEL 92*0a6a1f1dSLionel Sambuc 93*0a6a1f1dSLionel Sambuccp-demangle.d cp-demangle.o: cp-demangle.h 9418a5822eSThomas Veerman 9518a5822eSThomas Veerman# XXX 9618a5822eSThomas VeermanMKDEPFLAGS+= -I$(GLIBCPP_INCLUDE_DIR)/backward 9718a5822eSThomas Veerman 98*0a6a1f1dSLionel SambucGLIBCXX_SRCDIR= ${DIST}/libstdc++-v3 99*0a6a1f1dSLionel Sambuc 100*0a6a1f1dSLionel SambucBUILDSYMLINKS+= \ 101*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_CCODECVT_CC} codecvt_members.cc \ 102*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_CCOLLATE_CC} collate_members.cc \ 103*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_CCTYPE_CC} ctype_members.cc \ 104*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_CMESSAGES_CC} messages_members.cc \ 105*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_CMONEY_CC} monetary_members.cc \ 106*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_CNUMERIC_CC} numeric_members.cc \ 107*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_CTIME_CC} time_members.cc \ 108*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_ATOMICITY_SRCDIR}/atomicity.h atomicity.cc \ 109*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_CLOCALE_CC} c++locale.cc \ 110*0a6a1f1dSLionel Sambuc ${GLIBCXX_SRCDIR}/${G_BASIC_FILE_CC} basic_file.cc \ 111*0a6a1f1dSLionel Sambuc ${DIST}/libiberty/cp-demangle.c cp-demangle.c \ 112*0a6a1f1dSLionel Sambuc ${DIST}/libiberty/cp-demangle.h cp-demangle.h 113*0a6a1f1dSLionel Sambuc 114*0a6a1f1dSLionel Sambuc.if ${HAVE_LIBGCC_EH} == "no" 115*0a6a1f1dSLionel SambucG_CONFIGLINKS:= ${G_CONFIGLINKS:S,libgcc/config/arm/unwind-arm.h,libgcc/unwind-generic.h,} 116*0a6a1f1dSLionel Sambuc.endif 117*0a6a1f1dSLionel Sambuc 118*0a6a1f1dSLionel Sambuc.if ${MKGCC} != "no" 119*0a6a1f1dSLionel Sambuc.if defined(G_CONFIGLINKS) && !empty(G_CONFIGLINKS) 120*0a6a1f1dSLionel SambucBUILDSYMLINKS+= ${G_CONFIGLINKS} 121*0a6a1f1dSLionel Sambuc.for _src _dst in ${G_CONFIGLINKS} 122*0a6a1f1dSLionel SambucDPSRCS+= ${_dst} 123*0a6a1f1dSLionel Sambuc.endfor 124*0a6a1f1dSLionel Sambuc.endif 125*0a6a1f1dSLionel Sambuc.endif 126*0a6a1f1dSLionel Sambuc 127*0a6a1f1dSLionel Sambuc.for f in compatibility-c++0x compatibility-atomic-c++0x \ 128*0a6a1f1dSLionel Sambuc compatibility-thread-c++0x compatibility-chrono chrono \ 129*0a6a1f1dSLionel Sambuc condition_variable debug functexcept functional future \ 130*0a6a1f1dSLionel Sambuc hash_c++0x hashtable_c++0x limits mutex placeholders \ 131*0a6a1f1dSLionel Sambuc random regex shared_ptr system_error thread 132*0a6a1f1dSLionel SambucCOPTS.${f}.cc+= -std=gnu++11 133*0a6a1f1dSLionel Sambuc.endfor 134*0a6a1f1dSLionel Sambuc 13518a5822eSThomas Veerman.include <bsd.lib.mk> 13618a5822eSThomas Veerman.include <bsd.subdir.mk> 13718a5822eSThomas Veerman.include <bsd.info.mk> 13818a5822eSThomas Veerman 13918a5822eSThomas Veerman.PATH: ${DIST}/libstdc++-v3/src \ 140*0a6a1f1dSLionel Sambuc ${DIST}/libstdc++-v3/src/c++98 \ 141*0a6a1f1dSLionel Sambuc ${DIST}/libstdc++-v3/src/c++11 \ 14218a5822eSThomas Veerman ${DIST}/libstdc++-v3/libsupc++ \ 143*0a6a1f1dSLionel Sambuc ${DIST}/libstdc++-v3/config/os/bsd/netbsd \ 14418a5822eSThomas Veerman ${CONF}/locale/generic \ 145*0a6a1f1dSLionel Sambuc ${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH} 14618a5822eSThomas Veerman 147*0a6a1f1dSLionel Sambuc${OBJS}: ${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH}/defs.mk 14818a5822eSThomas Veerman.else 14918a5822eSThomas Veerman.include <bsd.prog.mk> # do nothing 15018a5822eSThomas Veerman.endif 151