# $NetBSD: Makefile.common,v 1.20 2022/07/22 07:09:25 mrg Exp $
DIST= ${GCCDIST}
GNUHOSTDIST= ${DIST}
GCC_MACHINE_ARCH=${MACHINE_ARCH:S/earmv5/earm/}
# Support src/compat builds
.if defined(MLIBDIR) && exists(${.CURDIR}/../libstdc++-v3/arch/${MLIBDIR}/defs.mk)
LIBSTDCXX_MACHINE_ARCH=${MLIBDIR}
.else
LIBSTDCXX_MACHINE_ARCH=${GCC_MACHINE_ARCH}
.endif
# Make sure we get G_*_SOURCES, etc.*, for the .for loops
.include "${.CURDIR}/../libstdc++-v3/arch/${LIBSTDCXX_MACHINE_ARCH}/defs.mk"
# Deal with renamed sources. Needs to match a loop in libstdc++-v3/Makefile.
BUILD_CPP98_SOURCES= ${G_CPP98_SOURCES:Ncodecvt.cc} \
c98-codecvt.cc
BUILD_CPP11_SOURCES= ${G_CPP11_SOURCES:Ncodecvt.cc:Ncow-string-inst.cc:Nostream-inst.cc:Nstring-inst.cc} \
c11-codecvt.cc \
c11-cow-string-inst.cc \
c11-ostream-inst.cc \
c11-string-inst.cc
BUILD_CPP17_SOURCES= ${G_CPP17_SOURCES:Ncow-string-inst.cc:Nostream-inst.cc:Nstring-inst.cc} \
c17-cow-string-inst.cc \
c17-ostream-inst.cc \
c17-string-inst.cc
LIBSTDCXXSRCS= ${G_SRC_SOURCES} \
${BUILD_CPP98_SOURCES} \
${BUILD_CPP11_SOURCES} \
${BUILD_CPP17_SOURCES}
# XXX XXX dir.o doesn't have <deque> stuff properly, leave it out for now
#LIBSTDCXXSRCS+= ${G_FILESYSTEM_SOURCES}
LIBSUPCXXSRCS= ${G_LIBSUPCXX_SOURCES} ${G_LIBSUPCXX_C_SOURCES}
CPPFLAGS+= -I${DIST}/gcc
CPPFLAGS+= -I${DIST}/include
CPPFLAGS+= -I${DIST}/libstdc++-v3/libsupc++
CPPFLAGS+= -I${DIST}/libgcc
CPPFLAGS+= -I${.CURDIR}/../libstdc++-v3/arch/${LIBSTDCXX_MACHINE_ARCH} -I.
CPPFLAGS+= -DHAVE_STDLIB_H -DHAVE_STRING_H
CPPFLAGS.cp-demangle.c=-DIN_GLIBCPP_V3
.for _f in ${BUILD_CPP98_SOURCES}
COPTS.${_f}+= -std=gnu++98
.endfor
STD_GNU11= \
eh_aux_runtime.cc \
eh_ptr.cc \
eh_terminate.cc \
eh_throw.cc \
guard.cc \
atexit_thread.cc \
nested_exception.cc \
new_handler.cc \
new_op.cc \
new_opnt.cc
.for _f in ${STD_GNU11} ${BUILD_CPP11_SOURCES:M*.cc}
COPTS.${_f}+= -std=gnu++11
.endfor
STD_GNU14= \
del_ops.cc \
del_opvs.cc
.for _f in ${STD_GNU14} ${G_FILESYSTEM_SOURCES:M*.cc}
COPTS.${_f}+= -std=gnu++17 -Wno-sized-deallocation
.endfor
STD_GNU1Z= \
new_opa.cc \
new_opant.cc \
new_opva.cc \
new_opvant.cc \
del_opa.cc \
del_opant.cc \
del_opsa.cc \
del_opva.cc \
del_opvant.cc \
del_opvsa.cc
.for _f in ${STD_GNU1Z}
COPTS.${_f}+= -std=gnu++1z
.endfor
.for _f in ${BUILD_CPP17_SOURCES}
COPTS.${_f}+= -std=gnu++17 -fimplicit-templates
.endfor
.for _f in dir ops fs_dir fs_ops cow-fs_dir cow-fs_ops
${_f}.o ${_f}.d ${_f}.pico ${_f}.po: bits/largefile-config.h
.endfor
bits/largefile-config.h:
mkdir -p bits
touch bits/largefile-config.h
CLEANFILES+= bits/largefile-config.h