blob: f27b5617177020fc8baa3a4de802584fcfd3f366 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
# $NetBSD: Makefile.common,v 1.2 2014/05/20 19:12:36 adam Exp $
GCC_PKGNAME= gcc48
.include "../../lang/gcc48/version.mk"
DISTNAME= gcc-${GCC48_DIST_VERSION}
## When bumping the PKGREVISION of this package the PKGREVISION of
## lang/gcc48-* needs to be bump to be at least 1 more than the
## PKGREVISION of this package!
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC48_DIST_VERSION}/}
EXTRACT_SUFX= .tar.bz2
MAINTAINER= sbd@NetBSD.org
HOMEPAGE= http://gcc.gnu.org/
LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3
DISTFILES= ${DEFAULT_DISTFILES}
EXTRACT_ONLY= ${DEFAULT_DISTFILES}
DISTINFO_FILE= ${.CURDIR}/../../lang/gcc48/distinfo
PATCHDIR= ${.CURDIR}/../../lang/gcc48/patches
NOT_FOR_PLATFORM= Interix-*-*
USE_LANGUAGES= c c++
USE_TOOLS+= gmake makeinfo sed:run
USE_LIBTOOL= yes
GNU_CONFIGURE= yes
## Build outside ${WRKSRC}
OBJDIR= ../build
CONFIGURE_DIRS= ${OBJDIR}
CONFIGURE_SCRIPT= ../${DISTNAME}/configure
GCC_SUBPREFIX= ${GCC_PKGNAME}
GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX}
GNU_CONFIGURE_PREFIX= ${GCC_PREFIX}
INFO_FILES= yes
PLIST_VARS+= java darwin unix
JAVA_MACHINE_ARCH= ${MACHINE_ARCH:S/x86_64/amd64/}
PLIST_SUBST+= JAVA_MACHINE_ARCH=${JAVA_MACHINE_ARCH}
# Errors in libgo/runtime/runtime.h
#BUILDLINK_TRANSFORM+= rm:-Werror
# segfault of gcj (Java) related programs
#BUILDLINK_TRANSFORM+= rename:-O2:-O1
UNLIMIT_RESOURCES+= datasize
UNLIMIT_RESOURCES+= stacksize
SUBST_CLASSES+= vars
SUBST_MESSAGE.vars= Setting target machine name path in ${SUBST_FILES.vars}
SUBST_STAGE.vars= pre-configure
SUBST_FILES.vars= gcc/Makefile.in
SUBST_VARS.vars= GCC_TARGET_MACHINE
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "Darwin"
PLIST.darwin= yes
.else
PLIST.unix= yes
.endif
# In some cases LINKER_RPATH_FLAG needs a trailing space.
LINKER_RPATH_FLAG:= ${LINKER_RPATH_FLAG:S/-rpath/& /}
## The Library rpath to use in end programs.
LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*}
# The "-static-libstdc++ -static-libgcc" flags are normally added to the
# boot-ldflags by configure but because we are supply the boot-ldflags
# we mash supply them.
BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET}
# Needed on Darwin when LDFLAGS point to a SDK
BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*}
# GCC does not understand this option; remove it, or stage build will fail
BUILDLINK_TRANSFORM+= rm:-stdlib=libc++
## For target librarys and libjava programs.
CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q}
CONFIGURE_ARGS+= --enable-languages=${LANGS:S/ /,/g:Q}
CONFIGURE_ARGS+= --enable-shared
CONFIGURE_ARGS+= --enable-long-long
CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q}
CONFIGURE_ARGS+= --enable-libssp
CONFIGURE_ARGS+= --enable-threads=posix
CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q}
.if ${OPSYS} == "NetBSD"
#CONFIGURE_ARGS+= --disable-lto
CONFIGURE_ARGS+= --with-gnu-ld --with-ld=/usr/bin/ld
CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/bin/as
MAKE_ENV+= ac_cv_func_clock_gettime=yes
# for libjava's configure script
MAKE_ENV+= ac_cv_func_gethostbyname_r=no
.endif
.if ${OPSYS} == "DragonFly"
CONFIGURE_ARGS+= --disable-bootstrap
.endif
.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386)
CONFIGURE_ARGS+= --with-arch=i486 --with-tune=i486
.endif
# ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into
# a binary so we need to make sure we give it the installed sed and not
# the tool wrapped one.
MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED}
MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED}
# Determine whether to use binutils
.if ${OPSYS} == "SunOS"
. if exists(/usr/sfw/bin/gobjdump)
CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump
. endif
. if exists(/usr/bin/ld)
CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/bin/ld
. else
CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld
. endif
. if exists(/usr/sfw/bin/gas)
CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas
. elif exists(/usr/ccs/bin/as)
CONFIGURE_ARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as
. else
BUILDLINK_DEPMETHOD.binutils= full
. include "../../devel/binutils/buildlink3.mk"
CONFIGURE_ARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas
. endif
.endif
pre-configure:
${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR}
TEST_TARGET= -k check || ${TRUE}
pre-test:
${RUN} \
if runtest --version >/dev/null 2>/dev/null ; then \
: ; \
else \
${ECHO} "ERROR: Please install devel/dejagnu in order to run the test suite." ; \
exit 1 ; \
fi
post-test:
${RUN} cd ${WRKSRC} && cd ${OBJDIR} && \
${SHELL} ${WRKSRC}/contrib/test_summary >${WRKDIR}/test_summary.log
@${INFO_MSG} "Test summary are available in ${WRKDIR}/test_summary.log"
.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
|