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