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