| @@ -1,212 +1,160 @@ | | | @@ -1,212 +1,160 @@ |
1 | # $NetBSD: Makefile,v 1.6 2011/10/13 10:43:10 hans Exp $ | | 1 | # $NetBSD: Makefile,v 1.7 2011/10/13 10:54:24 hans Exp $ |
2 | | | 2 | |
3 | DISTNAME= gcc-${GCC_VERSION} | | 3 | DISTNAME= gcc-${GCC_VERSION} |
4 | PKGNAME= gcc46-${GCC_VERSION} | | 4 | PKGNAME= gcc46-${GCC_VERSION} |
5 | PKGREVISION= 1 | | 5 | PKGREVISION= 1 |
6 | CATEGORIES= lang | | 6 | CATEGORIES= lang |
7 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/} | | 7 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/} |
8 | EXTRACT_SUFX= .tar.bz2 | | 8 | EXTRACT_SUFX= .tar.bz2 |
9 | | | 9 | |
10 | MAINTAINER= kuehro@gmx.de | | 10 | MAINTAINER= kuehro@gmx.de |
11 | HOMEPAGE= http://gcc.gnu.org/ | | 11 | HOMEPAGE= http://gcc.gnu.org/ |
12 | COMMENT= GNU Compiler Collection 4.6 | | 12 | COMMENT= GNU Compiler Collection 4.6 |
13 | LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 | | 13 | LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 |
14 | | | 14 | |
15 | PKG_DESTDIR_SUPPORT= user-destdir | | 15 | PKG_DESTDIR_SUPPORT= user-destdir |
16 | | | 16 | |
17 | USE_TOOLS+= awk:run bash:run perl chmod \ | | 17 | USE_TOOLS+= awk:run bash:run chmod \ |
18 | gmake:run makeinfo bison flex gm4 \ | | 18 | gmake:run makeinfo bison flex gm4 \ |
19 | sed:run unzip | | 19 | sed:run |
20 | | | | |
21 | DEPENDS+= zip-[0-9]*:../../archivers/zip | | | |
22 | | | 20 | |
23 | GCC_VERSION= 4.6.1 | | 21 | GCC_VERSION= 4.6.1 |
24 | | | 22 | |
25 | GCC_SUBPREFIX= gcc46 | | 23 | GCC_SUBPREFIX= gcc46 |
26 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} | | 24 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} |
27 | FILES_SUBST+= PKGNAME=${PKGNAME} | | 25 | FILES_SUBST+= PKGNAME=${PKGNAME} |
28 | MESSAGE_SUBST+= GCC_PREFIX=${GCC_PREFIX} | | 26 | MESSAGE_SUBST+= GCC_PREFIX=${GCC_PREFIX} |
29 | | | 27 | |
30 | | | 28 | |
31 | # To avoid GNU surprises | | 29 | # To avoid GNU surprises |
32 | CONFIG_SHELL= ${TOOLS_PATH.bash} | | 30 | CONFIG_SHELL= ${TOOLS_PATH.bash} |
33 | | | 31 | |
34 | NOT_FOR_PLATFORM= Interix-*-* | | 32 | NOT_FOR_PLATFORM= Interix-*-* |
35 | UNLIMIT_RESOURCES+= datasize | | 33 | UNLIMIT_RESOURCES+= datasize |
36 | UNLIMIT_RESOURCES+= stacksize | | 34 | UNLIMIT_RESOURCES+= stacksize |
37 | | | 35 | |
38 | .include "../../mk/bsd.prefs.mk" | | 36 | .include "../../mk/bsd.prefs.mk" |
39 | .include "options.mk" | | 37 | .include "options.mk" |
40 | | | 38 | |
41 | # Determine whether to use binutils | | 39 | # Determine whether to use binutils |
42 | .if ${OPSYS} == "SunOS" | | 40 | .if ${OPSYS} == "SunOS" |
43 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump | | 41 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump |
44 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld | | 42 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld |
45 | . if !exists(/usr/sfw/bin/gas) | | 43 | . if !exists(/usr/sfw/bin/gas) |
46 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as | | 44 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as |
47 | . else | | 45 | . else |
48 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas | | 46 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas |
49 | . endif | | 47 | . endif |
50 | .endif | | 48 | .endif |
51 | | | 49 | |
52 | | | 50 | |
53 | # REPLACE_AWK+= gcc/testsuite/gcc.test-framework/test-framework.awk \ | | 51 | # REPLACE_AWK+= gcc/testsuite/gcc.test-framework/test-framework.awk \ |
54 | # gcc/mkmap-symver.awk \ | | 52 | # gcc/mkmap-symver.awk \ |
55 | # gcc/optc-gen.awk \ | | 53 | # gcc/optc-gen.awk \ |
56 | # gcc/mkmap-flat.awk \ | | 54 | # gcc/mkmap-flat.awk \ |
57 | # gcc/opt-gather.awk \ | | 55 | # gcc/opt-gather.awk \ |
58 | # gcc/opth-gen.awk \ | | 56 | # gcc/opth-gen.awk \ |
59 | # gcc/opt-functions.awk | | 57 | # gcc/opt-functions.awk |
60 | | | 58 | |
61 | REPLACE_BASH+= contrib/dg-cmp-results.sh | | 59 | REPLACE_BASH+= contrib/dg-cmp-results.sh |
62 | REPLACE_BASH+= contrib/reghunt/bin/gcc-svn-patchlist | | 60 | REPLACE_BASH+= contrib/reghunt/bin/gcc-svn-patchlist |
63 | REPLACE_BASH+= contrib/reghunt/bin/gcc-svn-update | | 61 | REPLACE_BASH+= contrib/reghunt/bin/gcc-svn-update |
64 | REPLACE_BASH+= contrib/reghunt/bin/gcc-svn-update-fix | | 62 | REPLACE_BASH+= contrib/reghunt/bin/gcc-svn-update-fix |
65 | REPLACE_BASH+= contrib/reghunt/bin/reg-hunt | | 63 | REPLACE_BASH+= contrib/reghunt/bin/reg-hunt |
66 | REPLACE_BASH+= contrib/reghunt/bin/reg-test | | 64 | REPLACE_BASH+= contrib/reghunt/bin/reg-test |
67 | REPLACE_BASH+= contrib/reghunt/date_based/reg_periodic | | 65 | REPLACE_BASH+= contrib/reghunt/date_based/reg_periodic |
68 | REPLACE_BASH+= contrib/reghunt/date_based/reg_search | | 66 | REPLACE_BASH+= contrib/reghunt/date_based/reg_search |
69 | REPLACE_BASH+= gcc/dbgcnt.def | | 67 | REPLACE_BASH+= gcc/dbgcnt.def |
70 | REPLACE_BASH+= gcc/testsuite/gcc.test-framework/gen_directive_tests | | 68 | REPLACE_BASH+= gcc/testsuite/gcc.test-framework/gen_directive_tests |
71 | REPLACE_BASH+= libstdc++-v3/scripts/run_doxygen | | 69 | REPLACE_BASH+= libstdc++-v3/scripts/run_doxygen |
72 | | | 70 | |
73 | # Optional languages - change as required | | | |
74 | # Ada could be added although there is a bootstrapping issue. See | | | |
75 | # ../gcc34-ada for guidance | | | |
76 | BUILD_DEFS+= BUILD_CXX BUILD_FORTRAN BUILD_JAVA BUILD_OBJC | | | |
77 | BUILD_CXX?= YES | | | |
78 | BUILD_FORTRAN?= YES | | | |
79 | BUILD_JAVA?= NO | | | |
80 | BUILD_OBJC?= YES | | | |
81 | | | | |
82 | LANGS= c | | | |
83 | | | | |
84 | #.if !empty(BUILD_CXX:M[aA][dD][aA]) | | | |
85 | #LANGS+= ada | | | |
86 | #.endif | | | |
87 | | | | |
88 | .if !empty(BUILD_CXX:M[Yy][Ee][Ss]) | | | |
89 | LANGS+= c++ | | | |
90 | .endif | | | |
91 | | | | |
92 | .if !empty(BUILD_FORTRAN:M[Yy][Ee][Ss]) | | | |
93 | LANGS+= fortran | | | |
94 | .endif | | | |
95 | | | | |
96 | .if !empty(BUILD_JAVA:M[Yy][Ee][Ss]) | | | |
97 | LANGS+= java | | | |
98 | .endif | | | |
99 | | | | |
100 | .if !empty(BUILD_OBJC:M[Yy][Ee][Ss]) | | | |
101 | LANGS+= objc | | | |
102 | .endif | | | |
103 | | | | |
104 | | | 71 | |
105 | CONFIGURE_ARGS+= --prefix=${GCC_PREFIX:Q} | | 72 | CONFIGURE_ARGS+= --prefix=${GCC_PREFIX:Q} |
106 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} | | 73 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} |
107 | CONFIGURE_ARGS+= --with-system-zlib | | | |
108 | CONFIGURE_ARGS+= --enable-shared | | 74 | CONFIGURE_ARGS+= --enable-shared |
109 | CONFIGURE_ARGS+= --enable-__cxa_atexit | | | |
110 | CONFIGURE_ARGS+= --enable-long-long | | 75 | CONFIGURE_ARGS+= --enable-long-long |
111 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} | | 76 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} |
112 | CONFIGURE_ARGS+= --enable-libssp | | 77 | CONFIGURE_ARGS+= --enable-libssp |
113 | CONFIGURE_ARGS+= --enable-threads=posix | | 78 | CONFIGURE_ARGS+= --enable-threads=posix |
114 | CONFIGURE_ARGS+= --with-gmp=${BUILDLINK_PREFIX.gmp} | | 79 | CONFIGURE_ARGS+= --with-gmp=${BUILDLINK_PREFIX.gmp} |
115 | CONFIGURE_ARGS+= --with-mpfr=${BUILDLINK_PREFIX.mpfr} | | 80 | CONFIGURE_ARGS+= --with-mpfr=${BUILDLINK_PREFIX.mpfr} |
116 | CONFIGURE_ARGS+= --with-gxx-include-dir=${GCC_PREFIX}/include/c++/ | | | |
117 | .if ${OPSYS} == "NetBSD" | | 81 | .if ${OPSYS} == "NetBSD" |
118 | .include "../../devel/binutils/buildlink3.mk" | | 82 | .include "../../devel/binutils/buildlink3.mk" |
119 | .include "../../devel/libelf/buildlink3.mk" | | 83 | .include "../../devel/libelf/buildlink3.mk" |
120 | CONFIGURE_ARGS+= --with-ld=${PREFIX}/bin/gnu-ld | | 84 | CONFIGURE_ARGS+= --with-ld=${PREFIX}/bin/gnu-ld |
121 | CONFIGURE_ARGS+= --with-libelf=${PREFIX} | | 85 | CONFIGURE_ARGS+= --with-libelf=${PREFIX} |
122 | MAKE_ENV+= ac_cv_func_clock_gettime=yes | | 86 | MAKE_ENV+= ac_cv_func_clock_gettime=yes |
123 | .endif | | 87 | .endif |
124 | .if ${OPSYS} == "Linux" | | 88 | .if ${OPSYS} == "Linux" |
125 | CONFIGURE_ARGS+= --disable-libquadmath --disable-libquadmath-support | | 89 | CONFIGURE_ARGS+= --disable-libquadmath --disable-libquadmath-support |
126 | .endif | | 90 | .endif |
127 | | | 91 | |
128 | CONFIGURE_ENV+= CONFIG_SHELL=${CONFIG_SHELL} | | 92 | CONFIGURE_ENV+= CONFIG_SHELL=${CONFIG_SHELL} |
129 | | | 93 | |
130 | # ${WRKSRC}/gcc-4.4.1/libjava/contrib/aotcompile.py.in stores the path to | | | |
131 | # a 'make' program so we need to make sure we give it the installed 'make' and not | | | |
132 | # the tool wrapped one. | | | |
133 | CONFIGURE_ENV+= PKGSRC_MAKE=${TOOLS_PATH.gmake} | | | |
134 | MAKE_ENV+= PKGSRC_MAKE=${TOOLS_PATH.gmake} | | | |
135 | | | | |
136 | | | | |
137 | # fastjar-0.93 from pkgsrc/archivers/fastjar seems to trigger a build | | | |
138 | # failure (seen on NetBSD-5.0/i386) when building java. So in case | | | |
139 | # the fastjar package is installed, make sure the configure script | | | |
140 | # doesn't pick it up. | | | |
141 | CONFIGURE_ENV+= JAR=no | | | |
142 | MAKE_ENV+= JAR=no | | | |
143 | MAKE_ENV+= ac_cv_prog_JAR=no | | | |
144 | | | | |
145 | MAKE_ENV+= ICONVPREFIX=${BUILDLINK_PREFIX.iconv} | | 94 | MAKE_ENV+= ICONVPREFIX=${BUILDLINK_PREFIX.iconv} |
146 | MAKE_ENV+= SHELL=${CONFIG_SHELL} | | 95 | MAKE_ENV+= SHELL=${CONFIG_SHELL} |
147 | MAKE_ENV+= ac_cv_path_ac_cv_prog_chmod=${TOOLS_CHMOD} | | 96 | MAKE_ENV+= ac_cv_path_ac_cv_prog_chmod=${TOOLS_CHMOD} |
148 | | | 97 | |
149 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into | | 98 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into |
150 | # a binary so we need to make sure we give it the installed sed and not | | 99 | # a binary so we need to make sure we give it the installed sed and not |
151 | # the tool wrapped one. | | 100 | # the tool wrapped one. |
152 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} | | 101 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} |
153 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} | | 102 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} |
154 | | | 103 | |
155 | CPPFLAGS+= -I${BUILDLINK_DIR}/include | | 104 | CPPFLAGS+= -I${BUILDLINK_DIR}/include |
156 | CFLAGS+= -I${BUILDLINK_DIR}/include | | 105 | CFLAGS+= -I${BUILDLINK_DIR}/include |
157 | | | 106 | |
158 | | | 107 | |
159 | # Somone should fix this so it will match the NetBSD system compiler | | 108 | # Somone should fix this so it will match the NetBSD system compiler |
160 | #.if ${OPSYS} == "NetBSD" | | 109 | #.if ${OPSYS} == "NetBSD" |
161 | #GCC_PLATFORM= ${LOWER_ARCH}--${LOWER_OPSYS}${APPEND_ELF} | | 110 | #GCC_PLATFORM= ${LOWER_ARCH}--${LOWER_OPSYS}${APPEND_ELF} |
162 | #CONFIGURE_ARGS+= --host=${GCC_PLATFORM:Q} | | 111 | #CONFIGURE_ARGS+= --host=${GCC_PLATFORM:Q} |
163 | #MAKE_ENV+= AR=/usr/bin/ar | | 112 | #MAKE_ENV+= AR=/usr/bin/ar |
164 | #.endif # NetBSD | | 113 | #.endif # NetBSD |
165 | | | 114 | |
166 | LIBS.SunOS+= -lgmp | | 115 | LIBS.SunOS+= -lgmp |
167 | | | 116 | |
168 | pre-configure: | | 117 | pre-configure: |
169 | .if ${OPSYS} == "DragonFly" | | 118 | .if ${OPSYS} == "DragonFly" |
170 | ${CP} ${FILESDIR}/dragonfly.h ${WRKSRC}/gcc/config/dragonfly.h | | 119 | ${CP} ${FILESDIR}/dragonfly.h ${WRKSRC}/gcc/config/dragonfly.h |
171 | ${CP} ${FILESDIR}/dragonfly-spec.h ${WRKSRC}/gcc/config/dragonfly-spec.h | | 120 | ${CP} ${FILESDIR}/dragonfly-spec.h ${WRKSRC}/gcc/config/dragonfly-spec.h |
172 | ${CP} ${FILESDIR}/i386-dragonfly.h ${WRKSRC}/gcc/config/i386/dragonfly.h | | 121 | ${CP} ${FILESDIR}/i386-dragonfly.h ${WRKSRC}/gcc/config/i386/dragonfly.h |
173 | ${CP} ${FILESDIR}/i386-dragonfly64.h ${WRKSRC}/gcc/config/i386/dragonfly64.h | | 122 | ${CP} ${FILESDIR}/i386-dragonfly64.h ${WRKSRC}/gcc/config/i386/dragonfly64.h |
174 | .endif | | 123 | .endif |
175 | | | 124 | |
176 | .if ${OPSYS} == "NetBSD" | | 125 | .if ${OPSYS} == "NetBSD" |
177 | ${CP} ${WRKSRC}/gcc/config/freebsd-stdint.h ${WRKSRC}/gcc/config/netbsd-stdint.h | | 126 | ${CP} ${WRKSRC}/gcc/config/freebsd-stdint.h ${WRKSRC}/gcc/config/netbsd-stdint.h |
178 | .endif | | 127 | .endif |
179 | | | 128 | |
180 | do-configure: | | 129 | do-configure: |
181 | ${MKDIR} ${WRKDIR}/obj | | 130 | ${MKDIR} ${WRKDIR}/obj |
182 | cd ${WRKDIR}/obj; ${SETENV} ${CONFIGURE_ENV} ${CONFIG_SHELL} ${WRKSRC}/configure ${CONFIGURE_ARGS} | | 131 | cd ${WRKDIR}/obj; ${SETENV} ${CONFIGURE_ENV} ${CONFIG_SHELL} ${WRKSRC}/configure ${CONFIGURE_ARGS} |
183 | | | 132 | |
184 | do-build: | | 133 | do-build: |
185 | (${_ULIMIT_CMD} cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} -j${MAKE_JOBS:U1:Q} ) | | 134 | (${_ULIMIT_CMD} cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} -j${MAKE_JOBS:U1:Q} ) |
186 | | | 135 | |
187 | do-test: | | 136 | do-test: |
188 | #.if (${MACHINE_GNU_ARCH} == "x86_64") | | 137 | #.if (${MACHINE_GNU_ARCH} == "x86_64") |
189 | # (cd ${FILESDIR} && ${CP} netbsd64macro.dfs ${WRKSRC}/gcc/testsuite/ada/acats/support/macro.dfs) | | 138 | # (cd ${FILESDIR} && ${CP} netbsd64macro.dfs ${WRKSRC}/gcc/testsuite/ada/acats/support/macro.dfs) |
190 | #.endif | | 139 | #.endif |
191 | (cd ${WRKDIR}/obj && ${GMAKE} -k check) | | 140 | (cd ${WRKDIR}/obj && ${GMAKE} -k check) |
192 | | | 141 | |
193 | do-install: | | 142 | do-install: |
194 | (cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} install DESTDIR=${DESTDIR} \ | | 143 | (cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} install DESTDIR=${DESTDIR} \ |
195 | && ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || ${LN} -f ${DESTDIR}${GCC_PREFIX}/bin/gcc ${DESTDIR}${GCC_PREFIX}/bin/cc) | | 144 | && ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || ${LN} -f ${DESTDIR}${GCC_PREFIX}/bin/gcc ${DESTDIR}${GCC_PREFIX}/bin/cc) |
196 | | | 145 | |
197 | .if ${OPSYS} == "SunOS" && ${OS_VERSION} != "5.11" && | | 146 | .if ${OPSYS} == "SunOS" && ${OS_VERSION} != "5.11" && |
198 | !empty(MACHINE_ARCH:M*86*) | | 147 | !empty(MACHINE_ARCH:M*86*) |
199 | post-install: | | 148 | post-install: |
200 | -${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 | | 149 | -${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 |
201 | -${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 | | 150 | -${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 |
202 | .endif | | 151 | .endif |
203 | | | 152 | |
204 | GENERATE_PLIST+= \ | | 153 | GENERATE_PLIST+= \ |
205 | cd ${DESTDIR}${PREFIX} && ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print \ | | 154 | cd ${DESTDIR}${PREFIX} && ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print \ |
206 | | ${SORT} ; | | 155 | | ${SORT} ; |
207 | | | 156 | |
208 | .include "../../devel/gmp/buildlink3.mk" | | 157 | .include "../../devel/gmp/buildlink3.mk" |
209 | .include "../../math/mpcomplex/buildlink3.mk" | | 158 | .include "../../math/mpcomplex/buildlink3.mk" |
210 | .include "../../devel/zlib/buildlink3.mk" | | | |
211 | .include "../../math/mpfr/buildlink3.mk" | | 159 | .include "../../math/mpfr/buildlink3.mk" |
212 | .include "../../mk/bsd.pkg.mk" | | 160 | .include "../../mk/bsd.pkg.mk" |