1 # $NetBSD: Makefile.inc,v 1.11 2012/09/18 07:05:15 skrll Exp $
3 .ifndef _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_
4 _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_=1
9 DIST= ${TOP}/external/gpl3/gcc/dist
11 GCCARCH= ${.CURDIR}/../gcc/arch/${MACHINE_ARCH}
13 CPPFLAGS+= -DLOCALEDIR=\"/usr/share/locale\" -DNETBSD_NATIVE
14 HOST_CPPFLAGS+= -I${.CURDIR}/..
16 # Link in the GMP/MPFR/MPC headers since we don't install them
17 BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl3/gmp/lib/libgmp/arch/${MACHINE_ARCH}/gmp.h gmp.h
18 BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl3/mpfr/dist/mpfr.h mpfr.h
19 BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl3/mpfr/dist/mpf2mpfr.h mpf2mpfr.h
20 BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl2/mpc/dist/src/mpc.h mpc.h
21 BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl2/mpc/dist/src/mpc-log.h mpc-log.h
24 DPSRCS+= gmp.h mpfr.h mpf2mpfr.h mpc.h mpc-log.h
26 .if ${USETOOLS} == "yes"
27 COMPATOBJDIR!= cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
28 NBCOMPATLIB= -L${COMPATOBJDIR} -lnbcompat
32 BUILD_PREFIX= ${C_BUILD_PREFIX}
34 LIBIBERTYOBJ!= cd ${.CURDIR}/../../lib/libiberty && ${PRINTOBJDIR}
35 FRONTENDOBJ!= cd ${.CURDIR}/../frontend && ${PRINTOBJDIR}
36 BACKENDOBJ!= cd ${.CURDIR}/../backend && ${PRINTOBJDIR}
37 LIBCPPOBJ!= cd ${.CURDIR}/../libcpp && ${PRINTOBJDIR}
38 LIBDECNUMBEROBJ!= cd ${.CURDIR}/../libdecnumber && ${PRINTOBJDIR}
40 HOSTLIBIBERTYOBJ!= cd ${.CURDIR}/../host-libiberty && ${PRINTOBJDIR}
41 HOSTLIBIBERTY= ${HOSTLIBIBERTYOBJ}/libiberty/libiberty.a
43 BASEVER!= cat ${GNUHOSTDIST}/gcc/BASE-VER
45 #DEVPHASE!= cat ${GNUHOSTDIST}/gcc/DEV-PHASE
47 .if ${DEVPHASE} == "release" || ${DEVPHASE} == ""
50 DATESTAMP!= cat ${GNUHOSTDIST}/gcc/DATESTAMP
53 BASEVERSTR= "\"$(BASEVER)\""
55 DEVPHASESTR= "\" $(DEVPHASE)\""
60 DATESTAMPSTR= "\" $(DATESTAMP)\""
65 # XXX pull this out of our configs
66 G_BUGURL=<http://www.NetBSD.org/Misc/send-pr.html>
67 G_BUGURL_s="\"${G_BUG_URL}\""
68 G_PKGVERSION=(NetBSD nb1 20120916)
69 G_PKGVERSION_s="\"${G_PKGVERSION} \""
71 VER_CPPFLAGS= -DBUGURL=${G_BUGURL_s} \
72 -DPKGVERSION=${G_PKGVERSION_s} \
73 -DBASEVER="\"${BASEVER}"\" \
74 -DDATESTAMP=${DATESTAMPSTR} \
75 -DDEVPHASE=${DEVPHASE} \
76 -DREVISION=${REVISION}
77 CPPFLAGS.version.c= ${VER_CPPFLAGS}
79 .include "${GCCARCH}/defs.mk"
82 .if ${G_ENABLE_SHARED} == "yes" && ${G_SHLIB_LINK} != ""
83 CPPFLAGS+= -DENABLE_SHARED_LIBGCC
86 .if empty(G_SHLIB_MULTILIB)
87 CPPFLAGS+= -DNO_SHARED_LIBGCC_MULTILIB
91 # This depends on the "extern inline" mess, so downgrade to something safe.
92 # CPPFLAGS is applied after CFLAGS, which gets the -std=gnu99
95 NOCLANGERROR= # defined