| @@ -1,173 +1,183 @@ | | | @@ -1,173 +1,183 @@ |
1 | # $NetBSD: Makefile,v 1.4 2014/11/28 11:47:00 bsiegert Exp $ | | 1 | # $NetBSD: Makefile,v 1.5 2015/06/10 20:20:42 ryoon Exp $ |
2 | | | 2 | |
3 | GCC_PKGNAME= gcc49 | | 3 | GCC_PKGNAME= gcc49 |
4 | .include "version.mk" | | 4 | .include "version.mk" |
5 | | | 5 | |
6 | DISTNAME= gcc-${GCC49_DIST_VERSION} | | 6 | DISTNAME= gcc-${GCC49_DIST_VERSION} |
7 | PKGNAME= ${GCC_PKGNAME}-${GCC49_DIST_VERSION} | | 7 | PKGNAME= ${GCC_PKGNAME}-${GCC49_DIST_VERSION} |
8 | | | 8 | |
9 | ## When bumping the PKGREVISION of this package the PKGREVISION of | | 9 | ## When bumping the PKGREVISION of this package the PKGREVISION of |
10 | ## lang/gcc49-libs needs to be bump to be at least 1 more than the | | 10 | ## lang/gcc49-libs needs to be bump to be at least 1 more than the |
11 | ## PKGREVISION of this package! | | 11 | ## PKGREVISION of this package! |
12 | PKGREVISION= 1 | | 12 | PKGREVISION= 1 |
13 | | | 13 | |
14 | CATEGORIES= lang | | 14 | CATEGORIES= lang |
15 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC49_DIST_VERSION}/} | | 15 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC49_DIST_VERSION}/} |
16 | EXTRACT_SUFX= .tar.bz2 | | 16 | EXTRACT_SUFX= .tar.bz2 |
17 | | | 17 | |
18 | MAINTAINER= pkgsrc-users@NetBSD.org | | 18 | MAINTAINER= pkgsrc-users@NetBSD.org |
19 | HOMEPAGE= http://gcc.gnu.org/ | | 19 | HOMEPAGE= http://gcc.gnu.org/ |
20 | COMMENT= The GNU Compiler Collection (GCC) - 4.9 Release Series | | 20 | COMMENT= The GNU Compiler Collection (GCC) - 4.9 Release Series |
21 | LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 | | 21 | LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 |
22 | | | 22 | |
23 | DISTFILES= ${DEFAULT_DISTFILES} | | 23 | DISTFILES= ${DEFAULT_DISTFILES} |
24 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} | | 24 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} |
25 | | | 25 | |
26 | NOT_FOR_PLATFORM= Interix-*-* | | 26 | NOT_FOR_PLATFORM= Interix-*-* |
27 | | | 27 | |
28 | USE_LANGUAGES= c c++ | | 28 | USE_LANGUAGES= c c++ |
29 | USE_TOOLS+= gmake makeinfo sed:run | | 29 | USE_TOOLS+= gmake makeinfo sed:run |
30 | | | 30 | |
31 | GNU_CONFIGURE= yes | | 31 | GNU_CONFIGURE= yes |
32 | ## Build outside ${WRKSRC} | | 32 | ## Build outside ${WRKSRC} |
33 | OBJDIR= ../build | | 33 | OBJDIR= ../build |
34 | CONFIGURE_DIRS= ${OBJDIR} | | 34 | CONFIGURE_DIRS= ${OBJDIR} |
35 | CONFIGURE_SCRIPT= ../${DISTNAME}/configure | | 35 | CONFIGURE_SCRIPT= ../${DISTNAME}/configure |
36 | GCC_SUBPREFIX= ${GCC_PKGNAME} | | 36 | GCC_SUBPREFIX= ${GCC_PKGNAME} |
37 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} | | 37 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} |
38 | GCC_TARGET_MACHINE?= ${MACHINE_GNU_PLATFORM} | | 38 | GCC_TARGET_MACHINE?= ${MACHINE_GNU_PLATFORM} |
39 | GNU_CONFIGURE_PREFIX= ${GCC_PREFIX} | | 39 | GNU_CONFIGURE_PREFIX= ${GCC_PREFIX} |
40 | INFO_FILES= yes | | 40 | INFO_FILES= yes |
41 | | | 41 | |
42 | UNLIMIT_RESOURCES+= datasize | | 42 | UNLIMIT_RESOURCES+= datasize |
43 | UNLIMIT_RESOURCES+= stacksize | | 43 | UNLIMIT_RESOURCES+= stacksize |
44 | | | 44 | |
45 | SUBST_CLASSES+= vars | | 45 | SUBST_CLASSES+= vars |
46 | SUBST_STAGE.vars= pre-configure | | 46 | SUBST_STAGE.vars= pre-configure |
47 | SUBST_FILES.vars= gcc/Makefile.in | | 47 | SUBST_FILES.vars= gcc/Makefile.in |
48 | SUBST_VARS.vars= GCC_TARGET_MACHINE | | 48 | SUBST_VARS.vars= GCC_TARGET_MACHINE |
49 | | | 49 | |
50 | .include "../../mk/bsd.prefs.mk" | | 50 | .include "../../mk/bsd.prefs.mk" |
51 | | | 51 | |
52 | LANGS= c | | 52 | LANGS= c |
53 | | | 53 | |
54 | # In some cases LINKER_RPATH_FLAG needs a trailing space. | | 54 | # In some cases LINKER_RPATH_FLAG needs a trailing space. |
55 | LINKER_RPATH_FLAG:= ${LINKER_RPATH_FLAG:S/-rpath/& /} | | 55 | LINKER_RPATH_FLAG:= ${LINKER_RPATH_FLAG:S/-rpath/& /} |
56 | | | 56 | |
57 | ## The Library rpath to use in end programs. | | 57 | ## The Library rpath to use in end programs. |
58 | LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} | | 58 | LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} |
59 | | | 59 | |
60 | # The "-static-libstdc++ -static-libgcc" flags are normally added to the | | 60 | # The "-static-libstdc++ -static-libgcc" flags are normally added to the |
61 | # boot-ldflags by configure but because we are supply the boot-ldflags | | 61 | # boot-ldflags by configure but because we are supply the boot-ldflags |
62 | # we mash supply them. | | 62 | # we mash supply them. |
63 | BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET} | | 63 | BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET} |
64 | # Needed on Darwin when LDFLAGS point to a SDK | | 64 | # Needed on Darwin when LDFLAGS point to a SDK |
65 | BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*} | | 65 | BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*} |
66 | | | 66 | |
67 | ## For target librarys and libjava programs. | | 67 | ## For target librarys and libjava programs. |
68 | CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q} | | 68 | CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q} |
69 | | | 69 | |
70 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} | | 70 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} |
71 | CONFIGURE_ARGS+= --enable-shared | | 71 | CONFIGURE_ARGS+= --enable-shared |
72 | CONFIGURE_ARGS+= --enable-long-long | | 72 | CONFIGURE_ARGS+= --enable-long-long |
73 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} | | 73 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} |
74 | CONFIGURE_ARGS+= --enable-libssp | | 74 | CONFIGURE_ARGS+= --enable-libssp |
75 | CONFIGURE_ARGS+= --enable-threads=posix | | 75 | CONFIGURE_ARGS+= --enable-threads=posix |
76 | CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} | | 76 | CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} |
77 | .if ${OPSYS} == "NetBSD" | | 77 | .if ${OPSYS} == "NetBSD" |
78 | CONFIGURE_ARGS+= --with-gnu-ld --with-ld=/usr/bin/ld | | 78 | CONFIGURE_ARGS+= --with-gnu-ld --with-ld=/usr/bin/ld |
79 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/bin/as | | 79 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/bin/as |
80 | MAKE_ENV+= ac_cv_func_clock_gettime=yes | | 80 | MAKE_ENV+= ac_cv_func_clock_gettime=yes |
81 | MAKE_ENV+= ac_cv_func_gethostbyname_r=no | | 81 | MAKE_ENV+= ac_cv_func_gethostbyname_r=no |
82 | .endif | | 82 | .endif |
83 | .if ${OPSYS} == "DragonFly" | | 83 | .if ${OPSYS} == "DragonFly" |
84 | CONFIGURE_ARGS+= --disable-bootstrap | | 84 | CONFIGURE_ARGS+= --disable-bootstrap |
85 | .endif | | 85 | .endif |
86 | .if ${OPSYS} == "Darwin" | | 86 | .if ${OPSYS} == "Darwin" |
87 | # See ${WRKSRC}/libgcc/config/t-slibgcc-darwin: It uses strip(1) to | | 87 | # See ${WRKSRC}/libgcc/config/t-slibgcc-darwin: It uses strip(1) to |
88 | # create a stub library, not just to remove symbols, so we must not | | 88 | # create a stub library, not just to remove symbols, so we must not |
89 | # let strip(1) be a no-op regardless of ${INSTALL_UNSTRIPPED} or the | | 89 | # let strip(1) be a no-op regardless of ${INSTALL_UNSTRIPPED} or the |
90 | # build fails for missing files. | | 90 | # build fails for missing files. |
91 | CONFIGURE_ARGS+= STRIP_FOR_TARGET=${TOOLS_PLATFORM.strip} | | 91 | CONFIGURE_ARGS+= STRIP_FOR_TARGET=${TOOLS_PLATFORM.strip} |
92 | .endif | | 92 | .endif |
93 | | | 93 | |
94 | .if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*) | | 94 | .if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*) |
95 | CONFIGURE_ARGS+= --with-dwarf2 | | 95 | CONFIGURE_ARGS+= --with-dwarf2 |
96 | CONFIGURE_ARGS+= --disable-libitm | | 96 | CONFIGURE_ARGS+= --disable-libitm |
97 | .endif | | 97 | .endif |
98 | | | 98 | |
99 | .if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-powerpc) | | 99 | .if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-powerpc) |
100 | CONFIGURE_ARGS+= --disable-multilib | | 100 | CONFIGURE_ARGS+= --disable-multilib |
101 | .endif | | 101 | .endif |
102 | | | 102 | |
103 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386) | | 103 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386) |
104 | CONFIGURE_ARGS+= --with-arch=i486 --with-tune=i486 | | 104 | CONFIGURE_ARGS+= --with-arch=i486 --with-tune=i486 |
105 | .endif | | 105 | .endif |
106 | | | 106 | |
107 | .include "options.mk" | | 107 | .include "options.mk" |
108 | | | 108 | |
109 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into | | 109 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into |
110 | # a binary so we need to make sure we give it the installed sed and not | | 110 | # a binary so we need to make sure we give it the installed sed and not |
111 | # the tool wrapped one. | | 111 | # the tool wrapped one. |
112 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} | | 112 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} |
113 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} | | 113 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} |
114 | | | 114 | |
115 | .if ${OPSYS} == "SunOS" | | 115 | .if !empty(MACHINE_PLATFORM:MSunOS-5.1[123456789]-*) |
116 | # Causes multilib build problems with specific compiler combinations | | 116 | # Causes multilib build problems with specific compiler combinations |
117 | MAKE_ENV+= gcc_cv_ld_as_needed=no | | 117 | MAKE_ENV+= gcc_cv_ld_as_needed=no |
118 | # Determine whether to use binutils | | 118 | # Determine whether to use binutils |
119 | . if exists(/usr/sfw/bin/gobjdump) | | 119 | . if exists(/usr/sfw/bin/gobjdump) |
120 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump | | 120 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump |
121 | . endif | | 121 | . endif |
122 | . if exists(/usr/bin/ld) | | 122 | . if exists(/usr/bin/ld) |
123 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/bin/ld | | 123 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/bin/ld |
124 | . else | | 124 | . else |
125 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld | | 125 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld |
126 | . endif | | 126 | . endif |
127 | . if exists(/usr/sfw/bin/gas) | | 127 | . if exists(/usr/sfw/bin/gas) |
128 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas | | 128 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas |
129 | . elif exists(/usr/ccs/bin/as) | | 129 | . elif exists(/usr/ccs/bin/as) |
130 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as | | 130 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as |
131 | . else | | 131 | . else |
132 | BUILDLINK_DEPMETHOD.binutils= full | | 132 | BUILDLINK_DEPMETHOD.binutils= full |
133 | . include "../../devel/binutils/buildlink3.mk" | | 133 | . include "../../devel/binutils/buildlink3.mk" |
134 | CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas | | 134 | CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas |
135 | . endif | | 135 | . endif |
| | | 136 | .else # Solaris 10 |
| | | 137 | . if exists(/usr/sfw/bin/gobjdump) |
| | | 138 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump |
| | | 139 | . endif |
| | | 140 | BUILDLINK_API_DEPENDS.binutils+= binutils>=2.23 |
| | | 141 | BUILDLINK_DEPMETHOD.binutils= full |
| | | 142 | . include "../../devel/binutils/buildlink3.mk" |
| | | 143 | CONFIGURE_ENV+= OBJCOPY=${PREFIX}/bin/gobjcopy |
| | | 144 | CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas |
| | | 145 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld |
136 | .endif | | 146 | .endif |
137 | | | 147 | |
138 | pre-configure: | | 148 | pre-configure: |
139 | ${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR} | | 149 | ${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR} |
140 | | | 150 | |
141 | TEST_TARGET= -k check || ${TRUE} | | 151 | TEST_TARGET= -k check || ${TRUE} |
142 | pre-test: | | 152 | pre-test: |
143 | ${RUN} \ | | 153 | ${RUN} \ |
144 | if runtest --version >/dev/null 2>/dev/null ; then \ | | 154 | if runtest --version >/dev/null 2>/dev/null ; then \ |
145 | : ; \ | | 155 | : ; \ |
146 | else \ | | 156 | else \ |
147 | ${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \ | | 157 | ${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \ |
148 | exit 1 ; \ | | 158 | exit 1 ; \ |
149 | fi | | 159 | fi |
150 | post-test: | | 160 | post-test: |
151 | ${RUN} cd ${WRKSRC} && cd ${OBJDIR} && \ | | 161 | ${RUN} cd ${WRKSRC} && cd ${OBJDIR} && \ |
152 | ${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log | | 162 | ${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log |
153 | @${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log" | | 163 | @${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log" |
154 | | | 164 | |
155 | post-install: | | 165 | post-install: |
156 | ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || \ | | 166 | ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || \ |
157 | ( cd ${DESTDIR}${GCC_PREFIX}/bin ; ${LN} -f gcc cc ) | | 167 | ( cd ${DESTDIR}${GCC_PREFIX}/bin ; ${LN} -f gcc cc ) |
158 | .if !empty(PKG_OPTIONS:Mgcc-java) | | 168 | .if !empty(PKG_OPTIONS:Mgcc-java) |
159 | ${RM} -f ${DESTDIR}${JAVA_HOME}/bin/javadoc | | 169 | ${RM} -f ${DESTDIR}${JAVA_HOME}/bin/javadoc |
160 | ${RM} -f ${DESTDIR}${JAVA_HOME}/jre/lib/${JAVA_ARCH}/libjawt.so | | 170 | ${RM} -f ${DESTDIR}${JAVA_HOME}/jre/lib/${JAVA_ARCH}/libjawt.so |
161 | .endif | | 171 | .endif |
162 | .if !empty(MACHINE_PLATFORM:MSunOS-*-*86*) && ${OS_VERSION} != "5.11" | | 172 | .if !empty(MACHINE_PLATFORM:MSunOS-*-*86*) && ${OS_VERSION} != "5.11" |
163 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 || ${TRUE} | | 173 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 || ${TRUE} |
164 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 || ${TRUE} | | 174 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 || ${TRUE} |
165 | .endif | | 175 | .endif |
166 | | | 176 | |
167 | GENERATE_PLIST+= \ | | 177 | GENERATE_PLIST+= \ |
168 | cd ${DESTDIR}${PREFIX} && \ | | 178 | cd ${DESTDIR}${PREFIX} && \ |
169 | ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT} ; | | 179 | ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT} ; |
170 | | | 180 | |
171 | .include "../../mk/dlopen.buildlink3.mk" | | 181 | .include "../../mk/dlopen.buildlink3.mk" |
172 | .include "../../mk/pthread.buildlink3.mk" | | 182 | .include "../../mk/pthread.buildlink3.mk" |
173 | .include "../../mk/bsd.pkg.mk" | | 183 | .include "../../mk/bsd.pkg.mk" |