| @@ -1,144 +1,148 @@ | | | @@ -1,144 +1,148 @@ |
1 | # $NetBSD: Makefile,v 1.18 2013/03/21 22:47:24 wiz Exp $ | | 1 | # $NetBSD: Makefile,v 1.19 2013/03/23 19:10:45 wiz Exp $ |
2 | | | 2 | |
3 | GCC_PKGNAME= gcc47 | | 3 | GCC_PKGNAME= gcc47 |
4 | .include "version.mk" | | 4 | .include "version.mk" |
5 | | | 5 | |
6 | DISTNAME= gcc-${GCC_DIST_VERSION} | | 6 | DISTNAME= gcc-${GCC_DIST_VERSION} |
7 | PKGNAME= ${GCC_PKGNAME}-${GCC_DIST_VERSION} | | 7 | PKGNAME= ${GCC_PKGNAME}-${GCC_DIST_VERSION} |
8 | ## When bumping the PKGREVISION of this package the PKGREVISION of | | 8 | ## When bumping the PKGREVISION of this package the PKGREVISION of |
9 | ## lang/gcc47-libs needs to be bump to be at least 1 more than the | | 9 | ## lang/gcc47-libs needs to be bump to be at least 1 more than the |
10 | ## PKGREVISION of this package! | | 10 | ## PKGREVISION of this package! |
11 | PKGREVISION= 2 | | 11 | PKGREVISION= 2 |
12 | CATEGORIES= lang | | 12 | CATEGORIES= lang |
13 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_DIST_VERSION}/} | | 13 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_DIST_VERSION}/} |
14 | EXTRACT_SUFX= .tar.bz2 | | 14 | EXTRACT_SUFX= .tar.bz2 |
15 | | | 15 | |
16 | MAINTAINER= sbd@NetBSD.org | | 16 | MAINTAINER= sbd@NetBSD.org |
17 | HOMEPAGE= http://gcc.gnu.org/ | | 17 | HOMEPAGE= http://gcc.gnu.org/ |
18 | COMMENT= The GNU Compiler Collection (GCC) - 4.7 Release Series | | 18 | COMMENT= The GNU Compiler Collection (GCC) - 4.7 Release Series |
19 | LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 | | 19 | LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 |
20 | | | 20 | |
21 | DISTFILES= ${DEFAULT_DISTFILES} | | 21 | DISTFILES= ${DEFAULT_DISTFILES} |
22 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} | | 22 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} |
23 | | | 23 | |
24 | NOT_FOR_PLATFORM= Interix-*-* | | 24 | NOT_FOR_PLATFORM= Interix-*-* |
25 | | | 25 | |
26 | USE_TOOLS+= gmake makeinfo sed:run | | 26 | USE_TOOLS+= gmake makeinfo sed:run |
27 | | | 27 | |
28 | GNU_CONFIGURE= yes | | 28 | GNU_CONFIGURE= yes |
29 | ## Build outside ${WRKSRC} | | 29 | ## Build outside ${WRKSRC} |
30 | OBJDIR= ../build | | 30 | OBJDIR= ../build |
31 | CONFIGURE_DIRS= ${OBJDIR} | | 31 | CONFIGURE_DIRS= ${OBJDIR} |
32 | CONFIGURE_SCRIPT= ../${DISTNAME}/configure | | 32 | CONFIGURE_SCRIPT= ../${DISTNAME}/configure |
33 | GCC_SUBPREFIX= ${GCC_PKGNAME} | | 33 | GCC_SUBPREFIX= ${GCC_PKGNAME} |
34 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} | | 34 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} |
35 | GCC_TARGET_MACHINE?= ${MACHINE_GNU_PLATFORM} | | 35 | GCC_TARGET_MACHINE?= ${MACHINE_GNU_PLATFORM} |
36 | GNU_CONFIGURE_PREFIX= ${GCC_PREFIX} | | 36 | GNU_CONFIGURE_PREFIX= ${GCC_PREFIX} |
37 | INFO_FILES= yes | | 37 | INFO_FILES= yes |
38 | | | 38 | |
39 | UNLIMIT_RESOURCES+= datasize | | 39 | UNLIMIT_RESOURCES+= datasize |
40 | UNLIMIT_RESOURCES+= stacksize | | 40 | UNLIMIT_RESOURCES+= stacksize |
41 | | | 41 | |
42 | SUBST_CLASSES+= vars | | 42 | SUBST_CLASSES+= vars |
43 | SUBST_STAGE.vars= pre-configure | | 43 | SUBST_STAGE.vars= pre-configure |
44 | SUBST_FILES.vars= gcc/Makefile.in | | 44 | SUBST_FILES.vars= gcc/Makefile.in |
45 | SUBST_VARS.vars= GCC_TARGET_MACHINE | | 45 | SUBST_VARS.vars= GCC_TARGET_MACHINE |
46 | | | 46 | |
47 | .include "../../mk/bsd.prefs.mk" | | 47 | .include "../../mk/bsd.prefs.mk" |
48 | | | 48 | |
49 | LANGS= c | | 49 | LANGS= c |
50 | | | 50 | |
51 | ## The Library rpath to use in end programs. | | 51 | ## The Library rpath to use in end programs. |
52 | LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} | | 52 | LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} |
53 | | | 53 | |
54 | # The "-static-libstdc++ -static-libgcc" flags are normally added to the | | 54 | # The "-static-libstdc++ -static-libgcc" flags are normally added to the |
55 | # boot-ldflags by configure but because we are supply the boot-ldflags | | 55 | # boot-ldflags by configure but because we are supply the boot-ldflags |
56 | # we mash supply them. | | 56 | # we mash supply them. |
57 | BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET} | | 57 | BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET} |
58 | # Needed on Darwin when LDFLAGS point to a SDK | | 58 | # Needed on Darwin when LDFLAGS point to a SDK |
59 | BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*} | | 59 | BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*} |
60 | | | 60 | |
61 | ## For target librarys and libjava programs. | | 61 | ## For target librarys and libjava programs. |
62 | CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q} | | 62 | CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q} |
63 | | | 63 | |
64 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} | | 64 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} |
65 | CONFIGURE_ARGS+= --enable-shared | | 65 | CONFIGURE_ARGS+= --enable-shared |
66 | CONFIGURE_ARGS+= --enable-long-long | | 66 | CONFIGURE_ARGS+= --enable-long-long |
67 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} | | 67 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} |
68 | CONFIGURE_ARGS+= --enable-libssp | | 68 | CONFIGURE_ARGS+= --enable-libssp |
69 | CONFIGURE_ARGS+= --enable-threads=posix | | 69 | CONFIGURE_ARGS+= --enable-threads=posix |
70 | CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} | | 70 | CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} |
71 | .if ${OPSYS} == "NetBSD" | | 71 | .if ${OPSYS} == "NetBSD" |
72 | CONFIGURE_ARGS+= --with-gnu-ld --with-ld=/usr/bin/ld | | 72 | CONFIGURE_ARGS+= --with-gnu-ld --with-ld=/usr/bin/ld |
73 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/bin/as | | 73 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/bin/as |
74 | MAKE_ENV+= ac_cv_func_clock_gettime=yes | | 74 | MAKE_ENV+= ac_cv_func_clock_gettime=yes |
75 | .endif | | 75 | .endif |
76 | .if ${OPSYS} == "DragonFly" | | 76 | .if ${OPSYS} == "DragonFly" |
77 | CONFIGURE_ARGS+= --disable-bootstrap | | 77 | CONFIGURE_ARGS+= --disable-bootstrap |
78 | .endif | | 78 | .endif |
79 | | | 79 | |
| | | 80 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386) |
| | | 81 | CONFIGURE_ARGS+= --with-arch=i486 --with-tune=i486 |
| | | 82 | .endif |
| | | 83 | |
80 | .include "options.mk" | | 84 | .include "options.mk" |
81 | | | 85 | |
82 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into | | 86 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into |
83 | # a binary so we need to make sure we give it the installed sed and not | | 87 | # a binary so we need to make sure we give it the installed sed and not |
84 | # the tool wrapped one. | | 88 | # the tool wrapped one. |
85 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} | | 89 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} |
86 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} | | 90 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} |
87 | | | 91 | |
88 | # Determine whether to use binutils | | 92 | # Determine whether to use binutils |
89 | .if ${OPSYS} == "SunOS" | | 93 | .if ${OPSYS} == "SunOS" |
90 | . if exists(/usr/sfw/bin/gobjdump) | | 94 | . if exists(/usr/sfw/bin/gobjdump) |
91 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump | | 95 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump |
92 | . endif | | 96 | . endif |
93 | . if exists(/usr/bin/ld) | | 97 | . if exists(/usr/bin/ld) |
94 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/bin/ld | | 98 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/bin/ld |
95 | . else | | 99 | . else |
96 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld | | 100 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld |
97 | . endif | | 101 | . endif |
98 | . if exists(/usr/sfw/bin/gas) | | 102 | . if exists(/usr/sfw/bin/gas) |
99 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas | | 103 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas |
100 | . elif exists(/usr/ccs/bin/as) | | 104 | . elif exists(/usr/ccs/bin/as) |
101 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as | | 105 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as |
102 | . else | | 106 | . else |
103 | BUILDLINK_DEPMETHOD.binutils= full | | 107 | BUILDLINK_DEPMETHOD.binutils= full |
104 | . include "../../devel/binutils/buildlink3.mk" | | 108 | . include "../../devel/binutils/buildlink3.mk" |
105 | CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas | | 109 | CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas |
106 | . endif | | 110 | . endif |
107 | .endif | | 111 | .endif |
108 | | | 112 | |
109 | pre-configure: | | 113 | pre-configure: |
110 | ${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR} | | 114 | ${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR} |
111 | | | 115 | |
112 | TEST_TARGET= -k check || ${TRUE} | | 116 | TEST_TARGET= -k check || ${TRUE} |
113 | pre-test: | | 117 | pre-test: |
114 | ${RUN} \ | | 118 | ${RUN} \ |
115 | if runtest --version >/dev/null 2>/dev/null ; then \ | | 119 | if runtest --version >/dev/null 2>/dev/null ; then \ |
116 | : ; \ | | 120 | : ; \ |
117 | else \ | | 121 | else \ |
118 | ${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \ | | 122 | ${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \ |
119 | exit 1 ; \ | | 123 | exit 1 ; \ |
120 | fi | | 124 | fi |
121 | post-test: | | 125 | post-test: |
122 | ${RUN} cd ${WRKSRC} && cd ${OBJDIR} && \ | | 126 | ${RUN} cd ${WRKSRC} && cd ${OBJDIR} && \ |
123 | ${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log | | 127 | ${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log |
124 | @${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log" | | 128 | @${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log" |
125 | | | 129 | |
126 | post-install: | | 130 | post-install: |
127 | ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || \ | | 131 | ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || \ |
128 | ( cd ${DESTDIR}${GCC_PREFIX}/bin ; ${LN} -f gcc cc ) | | 132 | ( cd ${DESTDIR}${GCC_PREFIX}/bin ; ${LN} -f gcc cc ) |
129 | .if !empty(PKG_OPTIONS:Mgcc-java) | | 133 | .if !empty(PKG_OPTIONS:Mgcc-java) |
130 | ${RM} -f ${DESTDIR}${JAVA_HOME}/bin/javadoc | | 134 | ${RM} -f ${DESTDIR}${JAVA_HOME}/bin/javadoc |
131 | ${RM} -f ${DESTDIR}${JAVA_HOME}/jre/lib/${JAVA_ARCH}/libjawt.so | | 135 | ${RM} -f ${DESTDIR}${JAVA_HOME}/jre/lib/${JAVA_ARCH}/libjawt.so |
132 | .endif | | 136 | .endif |
133 | .if !empty(MACHINE_PLATFORM:MSunOS-*-*86*) && ${OS_VERSION} != "5.11" | | 137 | .if !empty(MACHINE_PLATFORM:MSunOS-*-*86*) && ${OS_VERSION} != "5.11" |
134 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 || ${TRUE} | | 138 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 || ${TRUE} |
135 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 || ${TRUE} | | 139 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 || ${TRUE} |
136 | .endif | | 140 | .endif |
137 | | | 141 | |
138 | GENERATE_PLIST+= \ | | 142 | GENERATE_PLIST+= \ |
139 | cd ${DESTDIR}${PREFIX} && \ | | 143 | cd ${DESTDIR}${PREFIX} && \ |
140 | ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT} ; | | 144 | ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT} ; |
141 | | | 145 | |
142 | .include "../../mk/dlopen.buildlink3.mk" | | 146 | .include "../../mk/dlopen.buildlink3.mk" |
143 | .include "../../mk/pthread.buildlink3.mk" | | 147 | .include "../../mk/pthread.buildlink3.mk" |
144 | .include "../../mk/bsd.pkg.mk" | | 148 | .include "../../mk/bsd.pkg.mk" |