| @@ -1,183 +1,182 @@ | | | @@ -1,183 +1,182 @@ |
1 | # $NetBSD: Makefile,v 1.38 2016/09/06 12:00:33 maya Exp $ | | 1 | # $NetBSD: Makefile,v 1.39 2016/09/06 15:04:57 maya Exp $ |
2 | | | 2 | |
3 | GCC_PKGNAME= gcc47 | | 3 | GCC_PKGNAME= gcc47 |
4 | .include "version.mk" | | 4 | .include "version.mk" |
5 | | | 5 | |
6 | DISTNAME= gcc-${GCC47_DIST_VERSION} | | 6 | DISTNAME= gcc-${GCC47_DIST_VERSION} |
7 | PKGNAME= ${GCC_PKGNAME}-${GCC47_DIST_VERSION} | | 7 | PKGNAME= ${GCC_PKGNAME}-${GCC47_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= 3 | | 11 | PKGREVISION= 3 |
12 | CATEGORIES= lang | | 12 | CATEGORIES= lang |
13 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC47_DIST_VERSION}/} | | 13 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC47_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 | GCC_REQD+= 4.4 | | 27 | GCC_REQD+= 4.4 |
28 | | | 28 | |
29 | GNU_CONFIGURE= yes | | 29 | GNU_CONFIGURE= yes |
30 | ## Build outside ${WRKSRC} | | 30 | ## Build outside ${WRKSRC} |
31 | OBJDIR= ../build | | 31 | OBJDIR= ../build |
32 | CONFIGURE_DIRS= ${OBJDIR} | | 32 | CONFIGURE_DIRS= ${OBJDIR} |
33 | CONFIGURE_SCRIPT= ../${DISTNAME}/configure | | 33 | CONFIGURE_SCRIPT= ../${DISTNAME}/configure |
34 | GCC_SUBPREFIX= ${GCC_PKGNAME} | | 34 | GCC_SUBPREFIX= ${GCC_PKGNAME} |
35 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} | | 35 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} |
36 | GCC_TARGET_MACHINE?= ${MACHINE_GNU_PLATFORM} | | 36 | GCC_TARGET_MACHINE?= ${MACHINE_GNU_PLATFORM} |
37 | GNU_CONFIGURE_PREFIX= ${GCC_PREFIX} | | 37 | GNU_CONFIGURE_PREFIX= ${GCC_PREFIX} |
38 | INFO_FILES= yes | | 38 | INFO_FILES= yes |
39 | | | 39 | |
40 | UNLIMIT_RESOURCES+= datasize | | 40 | UNLIMIT_RESOURCES+= datasize |
41 | UNLIMIT_RESOURCES+= stacksize | | 41 | UNLIMIT_RESOURCES+= stacksize |
42 | | | 42 | |
43 | SUBST_CLASSES+= vars | | 43 | SUBST_CLASSES+= vars |
44 | SUBST_STAGE.vars= pre-configure | | 44 | SUBST_STAGE.vars= pre-configure |
45 | SUBST_FILES.vars= gcc/Makefile.in | | 45 | SUBST_FILES.vars= gcc/Makefile.in |
46 | SUBST_VARS.vars= GCC_TARGET_MACHINE | | 46 | SUBST_VARS.vars= GCC_TARGET_MACHINE |
47 | | | 47 | |
48 | .include "../../mk/bsd.prefs.mk" | | 48 | .include "../../mk/bsd.prefs.mk" |
49 | | | 49 | |
50 | LANGS= c | | 50 | LANGS= c |
51 | | | 51 | |
52 | # In some cases LINKER_RPATH_FLAG needs a trailing space. | | 52 | # In some cases LINKER_RPATH_FLAG needs a trailing space. |
53 | LINKER_RPATH_FLAG:= ${LINKER_RPATH_FLAG:S/-rpath/& /} | | 53 | LINKER_RPATH_FLAG:= ${LINKER_RPATH_FLAG:S/-rpath/& /} |
54 | | | 54 | |
55 | ## The Library rpath to use in end programs. | | 55 | ## The Library rpath to use in end programs. |
56 | LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} | | 56 | LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} |
57 | | | 57 | |
58 | # The "-static-libstdc++ -static-libgcc" flags are normally added to the | | 58 | # The "-static-libstdc++ -static-libgcc" flags are normally added to the |
59 | # boot-ldflags by configure but because we are supply the boot-ldflags | | 59 | # boot-ldflags by configure but because we are supply the boot-ldflags |
60 | # we mash supply them. | | 60 | # we mash supply them. |
61 | BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET} | | 61 | BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET} |
62 | # Needed on Darwin when LDFLAGS point to a SDK | | 62 | # Needed on Darwin when LDFLAGS point to a SDK |
63 | BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*} | | 63 | BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*} |
64 | | | 64 | |
65 | # Ignore missing rpaths in "fake" library. | | 65 | # Ignore missing rpaths in "fake" library. |
66 | CHECK_SHLIBS_SKIP+= ${GCC_PKGNAME}/lib*/libgcj_bc.so* | | 66 | CHECK_SHLIBS_SKIP+= ${GCC_PKGNAME}/lib*/libgcj_bc.so* |
67 | | | 67 | |
68 | ## For target librarys and libjava programs. | | 68 | ## For target librarys and libjava programs. |
69 | CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q} | | 69 | CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q} |
70 | | | 70 | |
71 | .include "../../mk/compiler.mk" | | 71 | .include "../../mk/compiler.mk" |
72 | .if !empty(CC_VERSION:Mgcc-5.*) | | 72 | .if !empty(CC_VERSION:Mgcc-5.*) |
73 | # hangs "checking for compiler with PCH support" | | 73 | # hangs "checking for compiler with PCH support" |
74 | # similar to GCC bug 54719/54645. | | 74 | # similar to GCC bug 54719/54645. |
75 | CONFIGURE_ARGS+= --disable-libstdcxx-pch | | 75 | CONFIGURE_ARGS+= --disable-libstdcxx-pch |
76 | .endif | | 76 | .endif |
77 | | | 77 | |
78 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-*) | | 78 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-*) |
79 | # on NetBSD, use the native SSP code in libc | | 79 | # on NetBSD, use the native SSP code in libc |
80 | CONFIGURE_ARGS+= --disable-libssp | | 80 | CONFIGURE_ARGS+= --disable-libssp |
81 | .else | | 81 | .else |
82 | CONFIGURE_ARGS+= --enable-libssp | | 82 | CONFIGURE_ARGS+= --enable-libssp |
83 | .endif | | 83 | .endif |
84 | | | 84 | |
85 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} | | 85 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} |
86 | CONFIGURE_ARGS+= --enable-shared | | 86 | CONFIGURE_ARGS+= --enable-shared |
87 | CONFIGURE_ARGS+= --enable-long-long | | 87 | CONFIGURE_ARGS+= --enable-long-long |
88 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} | | 88 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} |
89 | CONFIGURE_ARGS+= --enable-libssp | | | |
90 | CONFIGURE_ARGS+= --enable-threads=posix | | 89 | CONFIGURE_ARGS+= --enable-threads=posix |
91 | CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} | | 90 | CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} |
92 | | | 91 | |
93 | CONFIGURE_ARGS.NetBSD+= --with-gnu-ld --with-ld=/usr/bin/ld | | 92 | CONFIGURE_ARGS.NetBSD+= --with-gnu-ld --with-ld=/usr/bin/ld |
94 | CONFIGURE_ARGS.NetBSD+= --with-gnu-as --with-as=/usr/bin/as | | 93 | CONFIGURE_ARGS.NetBSD+= --with-gnu-as --with-as=/usr/bin/as |
95 | MAKE_ENV.NetBSD+= ac_cv_func_clock_gettime=yes | | 94 | MAKE_ENV.NetBSD+= ac_cv_func_clock_gettime=yes |
96 | MAKE_ENV.NetBSD+= ac_cv_func_gethostbyname_r=no | | 95 | MAKE_ENV.NetBSD+= ac_cv_func_gethostbyname_r=no |
97 | | | 96 | |
98 | CONFIGURE_ARGS.DragonFly+= --disable-bootstrap | | 97 | CONFIGURE_ARGS.DragonFly+= --disable-bootstrap |
99 | | | 98 | |
100 | # See ${WRKSRC}/libgcc/config/t-slibgcc-darwin: It uses strip(1) to | | 99 | # See ${WRKSRC}/libgcc/config/t-slibgcc-darwin: It uses strip(1) to |
101 | # create a stub library, not just to remove symbols, so we must not | | 100 | # create a stub library, not just to remove symbols, so we must not |
102 | # let strip(1) be a no-op regardless of ${INSTALL_UNSTRIPPED} or the | | 101 | # let strip(1) be a no-op regardless of ${INSTALL_UNSTRIPPED} or the |
103 | # build fails for missing files. | | 102 | # build fails for missing files. |
104 | CONFIGURE_ARGS.Darwin+= STRIP_FOR_TARGET=${TOOLS_PLATFORM.strip} | | 103 | CONFIGURE_ARGS.Darwin+= STRIP_FOR_TARGET=${TOOLS_PLATFORM.strip} |
105 | | | 104 | |
106 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386) | | 105 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386) |
107 | CONFIGURE_ARGS+= --with-arch=i486 --with-tune=i486 | | 106 | CONFIGURE_ARGS+= --with-arch=i486 --with-tune=i486 |
108 | .endif | | 107 | .endif |
109 | | | 108 | |
110 | # Disable fixincludes on SmartOS, header changes result in broken includes | | 109 | # Disable fixincludes on SmartOS, header changes result in broken includes |
111 | # being generated, see https://github.com/joyent/pkgsrc/issues/270 | | 110 | # being generated, see https://github.com/joyent/pkgsrc/issues/270 |
112 | .if ${OS_VARIANT} == "SmartOS" | | 111 | .if ${OS_VARIANT} == "SmartOS" |
113 | SUBST_CLASSES+= fixinc | | 112 | SUBST_CLASSES+= fixinc |
114 | SUBST_STAGE.fixinc= pre-configure | | 113 | SUBST_STAGE.fixinc= pre-configure |
115 | SUBST_FILES.fixinc= gcc/Makefile.in | | 114 | SUBST_FILES.fixinc= gcc/Makefile.in |
116 | SUBST_SED.fixinc= -e "s,\./fixinc.sh,-c true," | | 115 | SUBST_SED.fixinc= -e "s,\./fixinc.sh,-c true," |
117 | .endif | | 116 | .endif |
118 | | | 117 | |
119 | .include "options.mk" | | 118 | .include "options.mk" |
120 | | | 119 | |
121 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into | | 120 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into |
122 | # a binary so we need to make sure we give it the installed sed and not | | 121 | # a binary so we need to make sure we give it the installed sed and not |
123 | # the tool wrapped one. | | 122 | # the tool wrapped one. |
124 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} | | 123 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} |
125 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} | | 124 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} |
126 | | | 125 | |
127 | # Determine whether to use binutils | | 126 | # Determine whether to use binutils |
128 | .if ${OPSYS} == "SunOS" | | 127 | .if ${OPSYS} == "SunOS" |
129 | . if exists(/usr/sfw/bin/gobjdump) | | 128 | . if exists(/usr/sfw/bin/gobjdump) |
130 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump | | 129 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump |
131 | . endif | | 130 | . endif |
132 | . if exists(/usr/bin/ld) | | 131 | . if exists(/usr/bin/ld) |
133 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/bin/ld | | 132 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/bin/ld |
134 | . else | | 133 | . else |
135 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld | | 134 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld |
136 | . endif | | 135 | . endif |
137 | . if exists(/usr/sfw/bin/gas) | | 136 | . if exists(/usr/sfw/bin/gas) |
138 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas | | 137 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas |
139 | . elif exists(/usr/ccs/bin/as) | | 138 | . elif exists(/usr/ccs/bin/as) |
140 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as | | 139 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as |
141 | . else | | 140 | . else |
142 | BUILDLINK_DEPMETHOD.binutils= full | | 141 | BUILDLINK_DEPMETHOD.binutils= full |
143 | . include "../../devel/binutils/buildlink3.mk" | | 142 | . include "../../devel/binutils/buildlink3.mk" |
144 | CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas | | 143 | CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas |
145 | . endif | | 144 | . endif |
146 | .endif | | 145 | .endif |
147 | | | 146 | |
148 | pre-configure: | | 147 | pre-configure: |
149 | ${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR} | | 148 | ${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR} |
150 | | | 149 | |
151 | TEST_TARGET= -k check || ${TRUE} | | 150 | TEST_TARGET= -k check || ${TRUE} |
152 | pre-test: | | 151 | pre-test: |
153 | ${RUN} \ | | 152 | ${RUN} \ |
154 | if runtest --version >/dev/null 2>/dev/null ; then \ | | 153 | if runtest --version >/dev/null 2>/dev/null ; then \ |
155 | : ; \ | | 154 | : ; \ |
156 | else \ | | 155 | else \ |
157 | ${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \ | | 156 | ${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \ |
158 | exit 1 ; \ | | 157 | exit 1 ; \ |
159 | fi | | 158 | fi |
160 | post-test: | | 159 | post-test: |
161 | ${RUN} cd ${WRKSRC} && cd ${OBJDIR} && \ | | 160 | ${RUN} cd ${WRKSRC} && cd ${OBJDIR} && \ |
162 | ${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log | | 161 | ${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log |
163 | @${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log" | | 162 | @${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log" |
164 | | | 163 | |
165 | post-install: | | 164 | post-install: |
166 | ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || \ | | 165 | ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || \ |
167 | ( cd ${DESTDIR}${GCC_PREFIX}/bin ; ${LN} -f gcc cc ) | | 166 | ( cd ${DESTDIR}${GCC_PREFIX}/bin ; ${LN} -f gcc cc ) |
168 | .if !empty(PKG_OPTIONS:Mgcc-java) | | 167 | .if !empty(PKG_OPTIONS:Mgcc-java) |
169 | ${RM} -f ${DESTDIR}${JAVA_HOME}/bin/javadoc | | 168 | ${RM} -f ${DESTDIR}${JAVA_HOME}/bin/javadoc |
170 | ${RM} -f ${DESTDIR}${JAVA_HOME}/jre/lib/${JAVA_ARCH}/libjawt.so | | 169 | ${RM} -f ${DESTDIR}${JAVA_HOME}/jre/lib/${JAVA_ARCH}/libjawt.so |
171 | .endif | | 170 | .endif |
172 | .if !empty(MACHINE_PLATFORM:MSunOS-*-*86*) && ${OS_VERSION} != "5.11" | | 171 | .if !empty(MACHINE_PLATFORM:MSunOS-*-*86*) && ${OS_VERSION} != "5.11" |
173 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 || ${TRUE} | | 172 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 || ${TRUE} |
174 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 || ${TRUE} | | 173 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 || ${TRUE} |
175 | .endif | | 174 | .endif |
176 | | | 175 | |
177 | GENERATE_PLIST+= \ | | 176 | GENERATE_PLIST+= \ |
178 | cd ${DESTDIR}${PREFIX} && \ | | 177 | cd ${DESTDIR}${PREFIX} && \ |
179 | ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT} ; | | 178 | ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT} ; |
180 | | | 179 | |
181 | .include "../../mk/dlopen.buildlink3.mk" | | 180 | .include "../../mk/dlopen.buildlink3.mk" |
182 | .include "../../mk/pthread.buildlink3.mk" | | 181 | .include "../../mk/pthread.buildlink3.mk" |
183 | .include "../../mk/bsd.pkg.mk" | | 182 | .include "../../mk/bsd.pkg.mk" |