| @@ -1,189 +1,190 @@ | | | @@ -1,189 +1,190 @@ |
1 | # $NetBSD: Makefile,v 1.2 2017/01/25 15:17:41 adam Exp $ | | 1 | # $NetBSD: Makefile,v 1.3 2017/05/28 01:29:42 maya Exp $ |
2 | | | 2 | |
3 | GCC_PKGNAME= gcc6 | | 3 | GCC_PKGNAME= gcc6 |
4 | .include "version.mk" | | 4 | .include "version.mk" |
5 | | | 5 | |
6 | DISTNAME= gcc-${GCC6_DIST_VERSION} | | 6 | DISTNAME= gcc-${GCC6_DIST_VERSION} |
7 | PKGNAME= ${GCC_PKGNAME}-${GCC6_DIST_VERSION} | | 7 | PKGNAME= ${GCC_PKGNAME}-${GCC6_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/gcc6-libs needs to be bump to be at least 1 more than the | | 9 | ## lang/gcc6-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= 1 |
11 | CATEGORIES= lang | | 12 | CATEGORIES= lang |
12 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC6_DIST_VERSION}/} | | 13 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC6_DIST_VERSION}/} |
13 | EXTRACT_SUFX= .tar.bz2 | | 14 | EXTRACT_SUFX= .tar.bz2 |
14 | | | 15 | |
15 | MAINTAINER= pkgsrc-users@NetBSD.org | | 16 | MAINTAINER= pkgsrc-users@NetBSD.org |
16 | HOMEPAGE= http://gcc.gnu.org/ | | 17 | HOMEPAGE= http://gcc.gnu.org/ |
17 | COMMENT= The GNU Compiler Collection (GCC) - 6 Release Series | | 18 | COMMENT= The GNU Compiler Collection (GCC) - 6 Release Series |
18 | 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 |
19 | | | 20 | |
20 | DISTFILES= ${DEFAULT_DISTFILES} | | 21 | DISTFILES= ${DEFAULT_DISTFILES} |
21 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} | | 22 | EXTRACT_ONLY= ${DEFAULT_DISTFILES} |
22 | | | 23 | |
23 | NOT_FOR_PLATFORM= Interix-*-* | | 24 | NOT_FOR_PLATFORM= Interix-*-* |
24 | | | 25 | |
25 | USE_LANGUAGES= c c++ | | 26 | USE_LANGUAGES= c c++ |
26 | USE_TOOLS+= gmake makeinfo sed:run tar:build | | 27 | USE_TOOLS+= gmake makeinfo sed:run tar:build |
27 | | | 28 | |
28 | GNU_CONFIGURE= yes | | 29 | GNU_CONFIGURE= yes |
29 | ## Build outside ${WRKSRC} | | 30 | ## Build outside ${WRKSRC} |
30 | OBJDIR= ../build | | 31 | OBJDIR= ../build |
31 | CONFIGURE_DIRS= ${OBJDIR} | | 32 | CONFIGURE_DIRS= ${OBJDIR} |
32 | CONFIGURE_SCRIPT= ../${DISTNAME}/configure | | 33 | CONFIGURE_SCRIPT= ../${DISTNAME}/configure |
33 | GCC_SUBPREFIX= ${GCC_PKGNAME} | | 34 | GCC_SUBPREFIX= ${GCC_PKGNAME} |
34 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} | | 35 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} |
35 | GNU_CONFIGURE_PREFIX= ${GCC_PREFIX} | | 36 | GNU_CONFIGURE_PREFIX= ${GCC_PREFIX} |
36 | INFO_FILES= yes | | 37 | INFO_FILES= yes |
37 | CONFIGURE_ARGS+= --disable-libstdcxx-pch | | 38 | CONFIGURE_ARGS+= --disable-libstdcxx-pch |
38 | | | 39 | |
39 | UNLIMIT_RESOURCES+= datasize | | 40 | UNLIMIT_RESOURCES+= datasize |
40 | UNLIMIT_RESOURCES+= stacksize | | 41 | UNLIMIT_RESOURCES+= stacksize |
41 | | | 42 | |
42 | SUBST_CLASSES+= vars | | 43 | SUBST_CLASSES+= vars |
43 | SUBST_MESSAGE.vars= Setting target machine name path in ${SUBST_FILES.vars} | | 44 | SUBST_MESSAGE.vars= Setting target machine name path in ${SUBST_FILES.vars} |
44 | SUBST_STAGE.vars= pre-configure | | 45 | SUBST_STAGE.vars= pre-configure |
45 | SUBST_FILES.vars= gcc/Makefile.in | | 46 | SUBST_FILES.vars= gcc/Makefile.in |
46 | SUBST_VARS.vars= GCC_TARGET_MACHINE | | 47 | SUBST_VARS.vars= GCC_TARGET_MACHINE |
47 | | | 48 | |
48 | .include "../../mk/bsd.prefs.mk" | | 49 | .include "../../mk/bsd.prefs.mk" |
49 | | | 50 | |
50 | LANGS= c | | 51 | LANGS= c |
51 | | | 52 | |
52 | # In some cases LINKER_RPATH_FLAG needs a trailing space. | | 53 | # In some cases LINKER_RPATH_FLAG needs a trailing space. |
53 | LINKER_RPATH_FLAG:= ${LINKER_RPATH_FLAG:S/-rpath/& /} | | 54 | LINKER_RPATH_FLAG:= ${LINKER_RPATH_FLAG:S/-rpath/& /} |
54 | | | 55 | |
55 | ## The Library rpath to use in end programs. | | 56 | ## The Library rpath to use in end programs. |
56 | LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} | | 57 | LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} |
57 | | | 58 | |
58 | # The "-static-libstdc++ -static-libgcc" flags are normally added to the | | 59 | # The "-static-libstdc++ -static-libgcc" flags are normally added to the |
59 | # boot-ldflags by configure but because we are supply the boot-ldflags | | 60 | # boot-ldflags by configure but because we are supply the boot-ldflags |
60 | # we mash supply them. | | 61 | # we mash supply them. |
61 | BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET} | | 62 | BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET} |
62 | # Needed on Darwin when LDFLAGS point to a SDK | | 63 | # Needed on Darwin when LDFLAGS point to a SDK |
63 | BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*} | | 64 | BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*} |
64 | # GCC does not understand this option; remove it, or stage build will fail | | 65 | # GCC does not understand this option; remove it, or stage build will fail |
65 | BUILDLINK_TRANSFORM+= rm:-stdlib=libc++ | | 66 | BUILDLINK_TRANSFORM+= rm:-stdlib=libc++ |
66 | | | 67 | |
67 | .include "options.mk" | | 68 | .include "options.mk" |
68 | | | 69 | |
69 | ## For graphite support. | | 70 | ## For graphite support. |
70 | .if !empty(PKG_OPTIONS:Mgcc-graphite) | | 71 | .if !empty(PKG_OPTIONS:Mgcc-graphite) |
71 | | | 72 | |
72 | post-extract: | | 73 | post-extract: |
73 | ${TAR} -jxf ${DISTDIR}/${ISL14}.tar.bz2 -C ${WRKSRC} | | 74 | ${TAR} -jxf ${DISTDIR}/${ISL14}.tar.bz2 -C ${WRKSRC} |
74 | ${MV} ${WRKSRC}/${ISL14} ${WRKSRC}/isl | | 75 | ${MV} ${WRKSRC}/${ISL14} ${WRKSRC}/isl |
75 | .endif | | 76 | .endif |
76 | | | 77 | |
77 | ## For target librarys and libjava programs. | | 78 | ## For target librarys and libjava programs. |
78 | CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q} | | 79 | CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q} |
79 | | | 80 | |
80 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} | | 81 | CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} |
81 | CONFIGURE_ARGS+= --enable-shared | | 82 | CONFIGURE_ARGS+= --enable-shared |
82 | CONFIGURE_ARGS+= --enable-long-long | | 83 | CONFIGURE_ARGS+= --enable-long-long |
83 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} | | 84 | CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} |
84 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-*) | | 85 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-*) |
85 | # on NetBSD, use the native SSP code in libc | | 86 | # on NetBSD, use the native SSP code in libc |
86 | CONFIGURE_ARGS+= --disable-libssp | | 87 | CONFIGURE_ARGS+= --disable-libssp |
87 | .else | | 88 | .else |
88 | CONFIGURE_ARGS+= --enable-libssp | | 89 | CONFIGURE_ARGS+= --enable-libssp |
89 | .endif | | 90 | .endif |
90 | CONFIGURE_ARGS+= --enable-threads=posix | | 91 | CONFIGURE_ARGS+= --enable-threads=posix |
91 | CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} | | 92 | CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} |
92 | | | 93 | |
93 | # multilib on Darwin requires fat-binaries | | 94 | # multilib on Darwin requires fat-binaries |
94 | CONFIGURE_ARGS.Darwin+= --disable-multilib | | 95 | CONFIGURE_ARGS.Darwin+= --disable-multilib |
95 | .if !empty(OSX_SDK_PATH) | | 96 | .if !empty(OSX_SDK_PATH) |
96 | CONFIGURE_ARGS.Darwin+= --with-sysroot=${OSX_SDK_PATH} | | 97 | CONFIGURE_ARGS.Darwin+= --with-sysroot=${OSX_SDK_PATH} |
97 | .endif | | 98 | .endif |
98 | CONFIGURE_ARGS.NetBSD+= --with-gnu-ld --with-ld=/usr/bin/ld | | 99 | CONFIGURE_ARGS.NetBSD+= --with-gnu-ld --with-ld=/usr/bin/ld |
99 | CONFIGURE_ARGS.NetBSD+= --with-gnu-as --with-as=/usr/bin/as | | 100 | CONFIGURE_ARGS.NetBSD+= --with-gnu-as --with-as=/usr/bin/as |
100 | MAKE_ENV.NetBSD+= ac_cv_func_clock_gettime=yes | | 101 | MAKE_ENV.NetBSD+= ac_cv_func_clock_gettime=yes |
101 | MAKE_ENV.NetBSD+= ac_cv_func_gethostbyname_r=no | | 102 | MAKE_ENV.NetBSD+= ac_cv_func_gethostbyname_r=no |
102 | MAKE_ENV.NetBSD+= ac_cv_func_freelocale=no | | 103 | MAKE_ENV.NetBSD+= ac_cv_func_freelocale=no |
103 | MAKE_ENV.NetBSD+= ac_cv_func_newlocale=no | | 104 | MAKE_ENV.NetBSD+= ac_cv_func_newlocale=no |
104 | MAKE_ENV.NetBSD+= ac_cv_func_uselocale=no | | 105 | MAKE_ENV.NetBSD+= ac_cv_func_uselocale=no |
105 | | | 106 | |
106 | CONFIGURE_ARGS.DragonFly+= --disable-bootstrap | | 107 | CONFIGURE_ARGS.DragonFly+= --disable-bootstrap |
107 | | | 108 | |
108 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386) | | 109 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386) |
109 | CONFIGURE_ARGS+= --with-arch=i486 --with-tune=i486 | | 110 | CONFIGURE_ARGS+= --with-arch=i486 --with-tune=i486 |
110 | .endif | | 111 | .endif |
111 | | | 112 | |
112 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64) || !empty(MACHINE_PLATFORM:MLinux-*-x86_64) | | 113 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64) || !empty(MACHINE_PLATFORM:MLinux-*-x86_64) |
113 | CONFIGURE_ARGS+= --with-arch=nocona --with-tune=nocona --with-fpmath=sse | | 114 | CONFIGURE_ARGS+= --with-arch=nocona --with-tune=nocona --with-fpmath=sse |
114 | .endif | | 115 | .endif |
115 | | | 116 | |
116 | .if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*) | | 117 | .if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*) |
117 | CONFIGURE_ARGS+= --with-dwarf2 | | 118 | CONFIGURE_ARGS+= --with-dwarf2 |
118 | .endif | | 119 | .endif |
119 | | | 120 | |
120 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into | | 121 | # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into |
121 | # a binary so we need to make sure we give it the installed sed and not | | 122 | # a binary so we need to make sure we give it the installed sed and not |
122 | # the tool wrapped one. | | 123 | # the tool wrapped one. |
123 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} | | 124 | MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} |
124 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} | | 125 | MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} |
125 | | | 126 | |
126 | # Determine whether to use binutils | | 127 | # Determine whether to use binutils |
127 | .if ${OPSYS} == "SunOS" | | 128 | .if ${OPSYS} == "SunOS" |
128 | . if exists(/usr/sfw/bin/gobjdump) | | 129 | . if exists(/usr/sfw/bin/gobjdump) |
129 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump | | 130 | CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump |
130 | . endif | | 131 | . endif |
131 | . if exists(/usr/bin/ld) | | 132 | . if exists(/usr/bin/ld) |
132 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/bin/ld | | 133 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/bin/ld |
133 | . else | | 134 | . else |
134 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld | | 135 | CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld |
135 | . endif | | 136 | . endif |
136 | . if exists(/usr/sfw/bin/gas) | | 137 | . if exists(/usr/sfw/bin/gas) |
137 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas | | 138 | CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas |
138 | . elif exists(/usr/ccs/bin/as) | | 139 | . elif exists(/usr/ccs/bin/as) |
139 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as | | 140 | CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as |
140 | . else | | 141 | . else |
141 | BUILDLINK_DEPMETHOD.binutils= full | | 142 | BUILDLINK_DEPMETHOD.binutils= full |
142 | . include "../../devel/binutils/buildlink3.mk" | | 143 | . include "../../devel/binutils/buildlink3.mk" |
143 | CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas | | 144 | CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas |
144 | . endif | | 145 | . endif |
145 | .endif | | 146 | .endif |
146 | | | 147 | |
147 | .if ${OS_VARIANT} == "SmartOS" | | 148 | .if ${OS_VARIANT} == "SmartOS" |
148 | SUBST_CLASSES+= ccs | | 149 | SUBST_CLASSES+= ccs |
149 | SUBST_STAGE.ccs= pre-configure | | 150 | SUBST_STAGE.ccs= pre-configure |
150 | SUBST_FILES.ccs= contrib/make_sunver.pl | | 151 | SUBST_FILES.ccs= contrib/make_sunver.pl |
151 | SUBST_SED.ccs= -e 's,/usr/ccs/bin,/usr/bin,g' | | 152 | SUBST_SED.ccs= -e 's,/usr/ccs/bin,/usr/bin,g' |
152 | .endif | | 153 | .endif |
153 | | | 154 | |
154 | pre-configure: | | 155 | pre-configure: |
155 | ${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR} | | 156 | ${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR} |
156 | | | 157 | |
157 | TEST_TARGET= -k check || ${TRUE} | | 158 | TEST_TARGET= -k check || ${TRUE} |
158 | pre-test: | | 159 | pre-test: |
159 | ${RUN} \ | | 160 | ${RUN} \ |
160 | if runtest --version >/dev/null 2>/dev/null ; then \ | | 161 | if runtest --version >/dev/null 2>/dev/null ; then \ |
161 | : ; \ | | 162 | : ; \ |
162 | else \ | | 163 | else \ |
163 | ${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \ | | 164 | ${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \ |
164 | exit 1 ; \ | | 165 | exit 1 ; \ |
165 | fi | | 166 | fi |
166 | post-test: | | 167 | post-test: |
167 | ${RUN} cd ${WRKSRC} && cd ${OBJDIR} && \ | | 168 | ${RUN} cd ${WRKSRC} && cd ${OBJDIR} && \ |
168 | ${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log | | 169 | ${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log |
169 | ${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log" | | 170 | ${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log" |
170 | | | 171 | |
171 | post-install: | | 172 | post-install: |
172 | ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || \ | | 173 | ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || \ |
173 | ( cd ${DESTDIR}${GCC_PREFIX}/bin ; ${LN} -f gcc cc ) | | 174 | ( cd ${DESTDIR}${GCC_PREFIX}/bin ; ${LN} -f gcc cc ) |
174 | .if !empty(PKG_OPTIONS:Mgcc-java) | | 175 | .if !empty(PKG_OPTIONS:Mgcc-java) |
175 | ${RM} -f ${DESTDIR}${JAVA_HOME}/bin/javadoc | | 176 | ${RM} -f ${DESTDIR}${JAVA_HOME}/bin/javadoc |
176 | ${RM} -f ${DESTDIR}${JAVA_HOME}/jre/lib/${JAVA_ARCH}/libjawt.so | | 177 | ${RM} -f ${DESTDIR}${JAVA_HOME}/jre/lib/${JAVA_ARCH}/libjawt.so |
177 | .endif | | 178 | .endif |
178 | .if !empty(MACHINE_PLATFORM:MSunOS-*-*86*) && ${OS_VERSION} != "5.11" | | 179 | .if !empty(MACHINE_PLATFORM:MSunOS-*-*86*) && ${OS_VERSION} != "5.11" |
179 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 || ${TRUE} | | 180 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32 || ${TRUE} |
180 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 || ${TRUE} | | 181 | ${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64 || ${TRUE} |
181 | .endif | | 182 | .endif |
182 | | | 183 | |
183 | GENERATE_PLIST+= \ | | 184 | GENERATE_PLIST+= \ |
184 | cd ${DESTDIR}${PREFIX} && \ | | 185 | cd ${DESTDIR}${PREFIX} && \ |
185 | ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT} ; | | 186 | ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print | ${SORT} ; |
186 | | | 187 | |
187 | .include "../../mk/dlopen.buildlink3.mk" | | 188 | .include "../../mk/dlopen.buildlink3.mk" |
188 | .include "../../mk/pthread.buildlink3.mk" | | 189 | .include "../../mk/pthread.buildlink3.mk" |
189 | .include "../../mk/bsd.pkg.mk" | | 190 | .include "../../mk/bsd.pkg.mk" |