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
|
# $NetBSD: Makefile,v 1.48 2004/01/24 13:51:14 grant Exp $
#
DISTNAME= gcc-3.3
PKGREVISION= 6
PKGNAME= ${DISTNAME:S/gcc/gcc3/}
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-3.3/}
EXTRACT_SUFX= .tar.bz2
MAINTAINER= tech-pkg@NetBSD.org
HOMEPAGE= http://www.gnu.org/software/gcc/gcc.html
COMMENT= GNU Compiler Collection, version 3
CONFLICTS+= gcc-3* pgcc-[0-9]*
NOT_FOR_PLATFORM= Darwin-*-*
USE_BUILDLINK2= YES
USE_PKGINSTALL= YES
USE_GNU_TOOLS+= make
HAS_CONFIGURE= YES
CONFIGURE_ARGS+= --prefix=${GCC_PREFIX}
UNLIMIT_RESOURCES= datasize
FILES_SUBST+= DISTNAME=${DISTNAME} GCC_PREFIX=${GCC_PREFIX}
MESSAGE_SUBST+= DISTNAME=${DISTNAME}
PLIST_SUBST+= DISTNAME=${DISTNAME}
TEXINFO_REQD= 4.2
.include "../../mk/bsd.prefs.mk"
BUILD_DEFS+= PKG_GCC3_JAVA
INFO_DIR= ${GCC_PREFIX:S|^${PREFIX}/||}/info
INFO_FILES= cpp.info g77.info gcc.info gccint.info cppinternals.info
.if defined(PKG_GCC3_JAVA)
INFO_FILES+= fastjar.info gcj.info
.endif
.if ${OPSYS} == "NetBSD" && exists(/usr/include/pthread.h)
CONFIGURE_ARGS+= --host=${MACHINE_GNU_ARCH}--netbsdelf2.0
PTHREAD_OPTS+= require native
.include "../../mk/pthread.buildlink2.mk"
CPPFLAGS+= -I${BUILDLINK_DIR}/include
CFLAGS+= -I${BUILDLINK_DIR}/include
.else
CONFIGURE_ARGS+= --host=${MACHINE_GNU_PLATFORM}
.endif
# java takes hours to build, so make it optional
.if !defined(PKG_GCC3_JAVA)
CONFIGURE_ARGS+= --enable-languages="c,c++,f77,objc,ada"
.endif
.if ${OPSYS} == "NetBSD" && !defined(USE_BINUTILS)
AS_VERSION!= ${AS} --version | ${AWK} '{ \
split($$3, v, /[.]/); \
printf "%02d%02d%02d%02d\n",v[1],v[2],v[3],v[4]; \
exit; \
}'
USE_BINUTILS!= ${TEST} ${AS_VERSION} -lt 02130201 && echo YES || echo NO
.endif
.if defined(USE_BINUTILS) && ${USE_BINUTILS} == "YES"
DEPENDS= binutils>=2.13.2.1:../../devel/binutils
CONFIGURE_ARGS+= --with-as=${PREFIX}/${MACHINE_GNU_PLATFORM}/bin/as
#. include "../../devel/binutils/buildlink2.mk"
.endif
.if ${OPSYS} == "NetBSD" || ${OPSYS} == "Linux"
CONFIGURE_ARGS+= --enable-shared
.else
. if ${OPSYS} == "SunOS"
CONFIGURE_ARGS+= --enable-shared
. else
CONFIGURE_ARGS+= --disable-shared
. endif
. if ${CC:M*gcc*} == ""
ALL_TARGET= bootstrap
. endif
.endif
GCC_PREFIX= ${PREFIX}/${DISTNAME}
GCC_VERSION= ${PKGVERSION:C|nb.*||}
GCC_ARCHDIR= ${GCC_PREFIX}/lib/gcc-lib/${MACHINE_GNU_PLATFORM}/${GCC_VERSION}
PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC
pre-configure:
${MKDIR} ${BUILD_DIRS}
cd ${WRKSRC} && contrib/gcc_update --touch
post-build:
@${SED} ${FILES_SUBST_SED} ${FILESDIR}/gcc3.mk > ${WRKDIR}/gcc3.mk
post-install:
.if ${OPSYS} == "SunOS"
-cd ${GCC_ARCHDIR}/include && ${RM} -f fixed && ${RMDIR} v7 v9
.endif
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/${DISTNAME}
${INSTALL_DATA} ${WRKDIR}/gcc3.mk ${PREFIX}/share/examples/${DISTNAME}/mk.conf
${LN} -f ${GCC_PREFIX}/bin/gcc ${GCC_PREFIX}/bin/cc
# ${LN} -f ${GCC_PREFIX}/bin/g77 ${GCC_PREFIX}/bin/f77
${CP} -f ${PKGDIR}/PLIST ${PLIST_SRC}
${FIND} ${GCC_PREFIX} \( -type f -o -type l \) -print \
| ${SORT} | ${SED} -e "s,${PREFIX}/,,g" \
>> ${PLIST_SRC}
${FIND} ${GCC_PREFIX} -type d -print \
| ${SORT} -r | ${SED} -e "s,${PREFIX}/,@dirrm ,g" \
>> ${PLIST_SRC}
.include "../../mk/bsd.pkg.mk"
# do not allow gcc to find libintl.h (or anything else) in ${LOCALBASE}.
# if it can, it expects it can have libintl, and linking fails miserably.
CFLAGS:= ${CFLAGS:S|-I${LOCALBASE}/include||}
CPPFLAGS:= ${CPPFLAGS:S|-I${LOCALBASE}/include||}
# Make bootstrap with compiler != gcc possible.
CONFIGURE_ENV+= LDFLAGS="${_STRIPFLAG_CC}"
MAKE_ENV+= GCC_PREFIX="${GCC_PREFIX}"
# On NetBSD, the gcc-2.95.3 for:
#
# alpha
#
# have an optimization bug when compiling with -O2 that is tickled by:
#
# java/parse.o
#
# note that we don't override CFLAGS and CPPFLAGS because we want the
# crosscompiled compiler to be build with optimization. This only
# disables optimization for the stage 1 build.
#
.if ${OPSYS} == "NetBSD"
. if ${MACHINE_ARCH} == "alpha"
CONFIG_CFLAGS= ${CFLAGS:C/-O[0-9]*//g}
CONFIG_CPPFLAGS= ${CPPFLAGS:C/-O[0-9]*//g}
CONFIGURE_ENV+= CFLAGS="${CONFIG_CFLAGS}" CPPFLAGS="${CONFIG_CPPFLAGS}"
. endif
.endif
|