1# $NetBSD: Makefile,v 1.5 2015/09/23 03:39:30 mrg Exp $ 2 3REQUIRETOOLS= yes 4NOLINT= # defined 5 6.include <bsd.init.mk> 7 8.include "Makefile.inc" 9 10LIB= stdc++ 11 12LIBDPLIBS+= m ${.CURDIR}/../../../../../lib/libm 13 14#COPTS+= -pthread 15#LDFLAGS+= -pthread 16.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" 17COPTS.random.cc+= ${${ACTIVE_CC} == "clang":? -mrdrnd :} 18.endif 19 20CXXFLAGS.clang+= -stdlib=libstdc++ -std=c++11 -D_GLIBCXX_ABI_TAG_CXX11= 21CXXFLAGS+= ${CXXFLAGS.${ACTIVE_CC}} 22CWARNFLAGS.clang+= -Wno-logical-op-parentheses \ 23 -Wno-deprecated-writable-strings -Wno-parentheses 24 25.include "${.CURDIR}/../libsupc++/Makefile.common" 26 27.if exists(${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH}/defs.mk) && ${MKGCC} != "no" 28.include "${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH}/defs.mk" 29 30SHLIB_MAJOR= 7 31SHLIB_MINOR= 3 32 33SUBDIR= include 34 35SRCS= ${LIBSUPCXXSRCS} ${LIBSTDCXXSRCS} 36# affects profiling; can't switch it off just for profiling easily. 37#CXXFLAGS+= ${G_SECTION_FLAGS} 38#CXXFLAGS+= -ffunction-sections -fdata-sections 39CXXFLAGS+= -fno-implicit-templates -fdiagnostics-show-location=once 40CPPFLAGS+= -I${DIST}/libstdc++-v3/include 41CPPFLAGS+= -I${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH} 42# include backwards compatible code 43CPPFLAGS+= -D_GLIBCXX_SHARED -DGTHREAD_USE_WEAK -DSUPPORTS_WEAK 44 45CONF= ${DIST}/libstdc++-v3/config 46 47GLIBCPP_INCLUDE_DIR= ${DESTDIR}/usr/include/g++ 48 49# Template instantiation bug workaround for -O<2/s 50COPTS.cp-demangle.c = -Wno-stack-protector 51COPTS.cp-demangle.c = -Wno-stack-protector 52COPTS.fstream-inst.cc = -Wno-stack-protector 53COPTS.locale-inst.cc = -Wno-stack-protector 54COPTS.misc-inst.cc = -Wno-stack-protector 55COPTS.ostream-inst.cc = -Wno-stack-protector 56COPTS.valarray-inst.cc = -Wno-stack-protector 57COPTS.wlocale-inst.cc = -Wno-stack-protector 58COPTS.concept-inst.cc= -fimplicit-templates 59COPTS.hashtable_c++0x.cc= -fimplicit-templates 60COPTS.bitmap_allocator.cc = -fimplicit-templates 61CPPFLAGS.strstream.cc= -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated 62 63# XXX also need this for some PCHs. 64CPPFLAGS.atomic.cc = -std=gnu++0x 65CPPFLAGS.compatibility-c++0x.cc = -std=gnu++0x 66CPPFLAGS.functexcept.cc = -std=gnu++0x 67CPPFLAGS.hash_c++0x.cc = -std=gnu++0x 68CPPFLAGS.hashtable_c++0x.cc = -std=gnu++0x 69CPPFLAGS.limits.cc = -std=gnu++0x 70CPPFLAGS.system_error.cc = -std=gnu++0x 71CPPFLAGS.fstream-inst.cc = -std=gnu++0x 72CPPFLAGS.string-inst.cc = -std=gnu++0x 73CPPFLAGS.wstring-inst.cc = -std=gnu++0x 74CPPFLAGS.mutex.cc = -std=gnu++0x 75CPPFLAGS.condition_variable.cc = -std=gnu++0x 76CPPFLAGS.chrono.cc = -std=gnu++0x 77CPPFLAGS.thread.cc = -std=gnu++0x 78CPPFLAGS.future.cc = -std=gnu++0x 79 80CPPFLAGS.cp-demangle.cc += -DIN_GLIBCPP_V3 81CPPFLAGS.concept-inst.cc += -D_GLIBCXX_CONCEPT_CHECKS 82CPPFLAGS.parallel_list.cc += -D_GLIBCXX_PARALLEL 83CPPFLAGS.parallel_settings.cc += -D_GLIBCXX_PARALLEL 84CPPFLAGS.compatibility-parallel_list.cc += -D_GLIBCXX_PARALLEL 85 86cp-demangle.d cp-demangle.o: cp-demangle.h 87 88# XXX 89MKDEPFLAGS+= -I$(GLIBCPP_INCLUDE_DIR)/backward 90 91GLIBCXX_SRCDIR= ${DIST}/libstdc++-v3 92 93BUILDSYMLINKS+= \ 94 ${GLIBCXX_SRCDIR}/${G_CCODECVT_CC} codecvt_members.cc \ 95 ${GLIBCXX_SRCDIR}/${G_CCOLLATE_CC} collate_members.cc \ 96 ${GLIBCXX_SRCDIR}/${G_CCTYPE_CC} ctype_members.cc \ 97 ${GLIBCXX_SRCDIR}/${G_CMESSAGES_CC} messages_members.cc \ 98 ${GLIBCXX_SRCDIR}/${G_CMONEY_CC} monetary_members.cc \ 99 ${GLIBCXX_SRCDIR}/${G_CNUMERIC_CC} numeric_members.cc \ 100 ${GLIBCXX_SRCDIR}/${G_CTIME_CC} time_members.cc \ 101 ${GLIBCXX_SRCDIR}/${G_ATOMICITY_SRCDIR}/atomicity.h atomicity.cc \ 102 ${GLIBCXX_SRCDIR}/${G_CLOCALE_CC} c++locale.cc \ 103 ${GLIBCXX_SRCDIR}/${G_BASIC_FILE_CC} basic_file.cc \ 104 ${DIST}/libiberty/cp-demangle.c cp-demangle.c \ 105 ${DIST}/libiberty/cp-demangle.h cp-demangle.h 106 107.if ${HAVE_LIBGCC_EH} == "no" 108G_CONFIGLINKS:= ${G_CONFIGLINKS:S,libgcc/config/arm/unwind-arm.h,libgcc/unwind-generic.h,} 109.endif 110 111.if ${MKGCC} != "no" 112.if defined(G_CONFIGLINKS) && !empty(G_CONFIGLINKS) 113BUILDSYMLINKS+= ${G_CONFIGLINKS} 114.for _src _dst in ${G_CONFIGLINKS} 115DPSRCS+= ${_dst} 116.endfor 117.endif 118.endif 119 120.for f in compatibility-c++0x compatibility-atomic-c++0x \ 121 compatibility-thread-c++0x compatibility-chrono chrono \ 122 condition_variable debug functexcept functional future \ 123 hash_c++0x hashtable_c++0x limits mutex placeholders \ 124 random regex shared_ptr system_error thread 125COPTS.${f}.cc+= -std=gnu++11 126.endfor 127 128.include <bsd.lib.mk> 129.include <bsd.subdir.mk> 130.include <bsd.info.mk> 131 132.PATH: ${DIST}/libstdc++-v3/src \ 133 ${DIST}/libstdc++-v3/src/c++98 \ 134 ${DIST}/libstdc++-v3/src/c++11 \ 135 ${DIST}/libstdc++-v3/libsupc++ \ 136 ${DIST}/libstdc++-v3/config/os/bsd/netbsd \ 137 ${CONF}/locale/generic \ 138 ${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH} 139 140${OBJS}: ${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH}/defs.mk 141.else 142.include <bsd.prog.mk> # do nothing 143.endif 144