2011-09-16 06:31:20 -04:00
|
|
|
# $OpenBSD: Makefile,v 1.63 2011/09/16 10:31:20 espie Exp $
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2010-11-13 11:26:41 -05:00
|
|
|
ONLY_FOR_ARCHS = alpha i386 m68k sparc sparc64 powerpc vax amd64
|
2007-09-15 20:27:05 -04:00
|
|
|
#BROKEN=adjust for types changes
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
V = 4.2.4
|
|
|
|
FULL_VERSION = $V
|
|
|
|
FULL_PKGVERSION = $V
|
2009-12-20 05:15:36 -05:00
|
|
|
BOOTSTRAP_GEN = 3
|
2009-12-20 05:40:05 -05:00
|
|
|
# XXX this needs libc.so.53.0 to build on i386
|
2009-04-16 14:36:48 -04:00
|
|
|
ADASTRAP = adastrap-i386-$V-${BOOTSTRAP_GEN}.tgz
|
|
|
|
|
2010-07-10 09:33:46 -04:00
|
|
|
PKGNAME-main = gcc-${FULL_PKGVERSION}
|
|
|
|
PKGNAME-c++ = g++-${FULL_PKGVERSION}
|
|
|
|
PKGNAME-estdc = libstdc++-${FULL_PKGVERSION}
|
|
|
|
PKGNAME-f95 = g95-${FULL_PKGVERSION}
|
|
|
|
PKGNAME-java = gcj-${FULL_PKGVERSION}
|
|
|
|
PKGNAME-objc = gobjc-${FULL_PKGVERSION}
|
|
|
|
PKGNAME-ada = gnat-${FULL_PKGVERSION}
|
|
|
|
|
2011-07-18 15:06:36 -04:00
|
|
|
REVISION-main = 4
|
2011-09-16 06:31:20 -04:00
|
|
|
REVISION-c++ = 7
|
|
|
|
REVISION-f95 = 7
|
2011-07-18 15:06:36 -04:00
|
|
|
REVISION-java = 5
|
2011-09-16 06:31:20 -04:00
|
|
|
REVISION-objc = 6
|
|
|
|
REVISION-ada = 6
|
2010-07-10 09:33:46 -04:00
|
|
|
EPOCH = 0
|
|
|
|
|
2009-06-04 14:24:20 -04:00
|
|
|
SHARED_LIBS = estdc++ 11.0 \
|
2006-07-31 05:50:53 -04:00
|
|
|
gfortran 2.0 \
|
|
|
|
-org-w3c-dom 1.0 \
|
|
|
|
-org-xml-sax 1.0 \
|
2009-06-04 14:24:20 -04:00
|
|
|
gcj 0.0 \
|
|
|
|
ffi 0.0 \
|
|
|
|
gcj-tools 0.0 \
|
|
|
|
gij 0.0 \
|
2006-07-31 05:50:53 -04:00
|
|
|
objc 2.0 \
|
|
|
|
objc_gc 2.0 \
|
|
|
|
ssp 0.0 \
|
|
|
|
gomp 1.0
|
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
MAINTAINER = Marc Espie <espie@openbsd.org>
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2010-10-18 15:20:41 -04:00
|
|
|
USE_GROFF = Yes
|
2011-09-15 13:25:34 -04:00
|
|
|
PSEUDO_FLAVORS = no_c++ no_fortran no_objc no_java no_ada
|
|
|
|
FLAVOR ?=
|
|
|
|
|
|
|
|
ONLY_FOR_ARCHS-ada = i386
|
|
|
|
ONLY_FOR_ARCHS-java = amd64 sparc64 i386
|
|
|
|
|
|
|
|
MULTI_PACKAGES = -main
|
|
|
|
|
|
|
|
BUILD = c
|
|
|
|
|
|
|
|
.if !${FLAVOR:L:Mno_fortran}
|
|
|
|
MULTI_PACKAGES += -f95
|
|
|
|
BUILD += fortran
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !${FLAVOR:L:Mno_objc}
|
|
|
|
MULTI_PACKAGES += -objc
|
|
|
|
BUILD += objc
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !${FLAVOR:L:Mno_java}
|
|
|
|
MULTI_PACKAGES += -java
|
|
|
|
. for _a in ${MACHINE_ARCH} ${ARCH}
|
|
|
|
. if ${ONLY_FOR_ARCHS-java:M${_a}}
|
|
|
|
BUILD += java
|
|
|
|
. endif
|
|
|
|
. endfor
|
2009-06-04 14:24:20 -04:00
|
|
|
.endif
|
2011-09-15 13:25:34 -04:00
|
|
|
|
|
|
|
.if !${FLAVOR:L:Mno_ada}
|
|
|
|
MULTI_PACKAGES += -ada
|
|
|
|
. for _a in ${MACHINE_ARCH} ${ARCH}
|
|
|
|
. if ${ONLY_FOR_ARCHS-ada:M${_a}}
|
|
|
|
BUILD += ada
|
|
|
|
. endif
|
|
|
|
. endfor
|
2006-07-31 05:50:53 -04:00
|
|
|
.endif
|
|
|
|
|
2011-09-15 13:25:34 -04:00
|
|
|
.if !${FLAVOR:L:Mno_c++} || ${BUILD:Mjava}
|
|
|
|
MULTI_PACKAGES += -c++ -estdc
|
|
|
|
BUILD += c++
|
2006-11-25 11:26:46 -05:00
|
|
|
.endif
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
DISTFILES = ${DISTNAME}.tar.bz2
|
|
|
|
SUPDISTFILES = ${ADASTRAP}:0
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2010-11-26 09:17:17 -05:00
|
|
|
BUILD_DEPENDS += devel/autoconf/2.59
|
2010-11-17 03:05:12 -05:00
|
|
|
BUILD_DEPENDS += devel/metaauto
|
2009-04-16 14:36:48 -04:00
|
|
|
USE_LIBTOOL = Yes
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2010-11-17 03:05:12 -05:00
|
|
|
BUILD_DEPENDS += devel/bison
|
2006-07-31 05:50:53 -04:00
|
|
|
|
|
|
|
|
2010-11-22 04:20:34 -05:00
|
|
|
REGRESS_DEPENDS = devel/dejagnu \
|
|
|
|
devel/autogen
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
DISTNAME = gcc-${FULL_VERSION}
|
2006-07-31 05:50:53 -04:00
|
|
|
|
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
MASTER_SITES = ${MASTER_SITE_GCC:=releases/gcc-$(FULL_VERSION)/}
|
|
|
|
MASTER_SITES0 = ftp://quatramaran.ens.fr/pub/espie/
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
CONFIGURE_STYLE = gnu
|
|
|
|
MODGNU_CONFIG_GUESS_DIRS = ${WRKSRC} ${WRKSRC}/gcc
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
LANGS = c
|
2011-09-15 13:25:34 -04:00
|
|
|
.if ${BUILD:Mc++}
|
2009-04-16 14:36:48 -04:00
|
|
|
LANGS := ${LANGS},c++
|
2010-11-17 03:05:12 -05:00
|
|
|
REGRESS_DEPENDS += libstdc++->=4.2,<4.3|libstdc++->=4.2v0,<4.3v0:${BUILD_PKGPATH},-estdc
|
2006-07-31 05:50:53 -04:00
|
|
|
.endif
|
2011-09-15 13:25:34 -04:00
|
|
|
.if ${BUILD:Mfortran}
|
2009-04-16 14:36:48 -04:00
|
|
|
LANGS := ${LANGS},fortran
|
|
|
|
CONFIGURE_ARGS += --with-gmp=${LOCALBASE}
|
2006-07-31 05:50:53 -04:00
|
|
|
.endif
|
2011-09-15 13:25:34 -04:00
|
|
|
.if ${BUILD:Mobjc}
|
2009-04-16 14:36:48 -04:00
|
|
|
LANGS := ${LANGS},objc
|
2006-07-31 05:50:53 -04:00
|
|
|
.endif
|
2011-09-15 13:25:34 -04:00
|
|
|
.if ${BUILD:Mjava}
|
2009-04-16 14:36:48 -04:00
|
|
|
LANGS := ${LANGS},java
|
2010-11-17 03:05:12 -05:00
|
|
|
BUILD_DEPENDS += archivers/zip>=2.3p0
|
2009-04-16 14:36:48 -04:00
|
|
|
CONFIGURE_ARGS += --enable-libgcj
|
2006-07-31 05:50:53 -04:00
|
|
|
.endif
|
2011-09-15 13:25:34 -04:00
|
|
|
.if ${BUILD:Mada}
|
2009-04-16 14:36:48 -04:00
|
|
|
LANGS := ${LANGS},ada
|
|
|
|
DISTFILES += ${ADASTRAP}:0
|
|
|
|
CONFIGURE_ENV = ADAC=${WRKDIR}/bin/egcc GNATBIND=${WRKDIR}/bin/gnatbind
|
|
|
|
MAKE_ENV = ADAC=${WRKDIR}/bin/egcc GNATBIND=${WRKDIR}/bin/gnatbind
|
|
|
|
CC = ${WRKDIR}/bin/egcc
|
2010-11-17 03:05:12 -05:00
|
|
|
REGRESS_DEPENDS += ${BUILD_PKGPATH},-ada
|
2006-07-31 05:50:53 -04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
post-extract:
|
|
|
|
.for f in egcc gnatbind gnatmake gnatlink
|
|
|
|
echo "#! /bin/sh" >${WRKDIR}/bin/$f
|
|
|
|
echo 'GNAT_ROOT=${WRKDIR}/bootstrap GCC_ROOT=${WRKDIR}/bootstrap exec ${WRKDIR}/bootstrap/bin/$f "$$@"' >>${WRKDIR}/bin/$f
|
|
|
|
chmod a+x ${WRKDIR}/bin/$f
|
|
|
|
.endfor
|
|
|
|
ln -s /usr/bin/nm ${WRKDIR}/bin/enm
|
|
|
|
echo "# This file automatically generated" >> ${WRKSRC}/libversions
|
|
|
|
.for l v in ${SHARED_LIBS}
|
|
|
|
echo "LIB$l_LTVERSION = -version-info ${v:S/./:/}" >> ${WRKSRC}/libversions
|
|
|
|
.endfor
|
|
|
|
|
2006-11-25 11:26:46 -05:00
|
|
|
post-install:
|
2011-09-15 13:25:34 -04:00
|
|
|
.if ${BUILD:Mada} == "yes"
|
2006-11-25 11:26:46 -05:00
|
|
|
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/gcc/*/$V/adainclude
|
|
|
|
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/gcc/*/$V/adalib
|
|
|
|
.endif
|
|
|
|
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/gcc/*/$V/include
|
2009-04-16 14:36:48 -04:00
|
|
|
CONFIGURE_ENV += am_cv_func_iconv=no
|
|
|
|
CONFIGURE_ENV += ac_cv_prog_CONFIGURED_M4=/usr/bin/m4
|
2006-07-31 05:50:53 -04:00
|
|
|
|
|
|
|
# Note: the configure target passes CFLAGS to the configure script anyways.
|
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
CFLAGS = -O2 -g
|
2006-07-31 05:50:53 -04:00
|
|
|
|
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
CONFIGURE_ARGS += \
|
2006-07-31 05:50:53 -04:00
|
|
|
--verbose \
|
|
|
|
--program-transform-name=s,^,e, \
|
|
|
|
--disable-nls \
|
|
|
|
--disable-checking \
|
|
|
|
--with-system-zlib \
|
|
|
|
--disable-libmudflap \
|
|
|
|
--disable-libgomp \
|
2007-06-19 17:23:37 -04:00
|
|
|
--disable-tls \
|
2006-07-31 05:50:53 -04:00
|
|
|
--with-as=/usr/bin/as \
|
|
|
|
--with-ld=/usr/bin/ld \
|
|
|
|
--with-gnu-ld \
|
|
|
|
--with-gnu-as \
|
2009-04-16 14:36:48 -04:00
|
|
|
--enable-threads=posix \
|
2009-06-06 21:22:05 -04:00
|
|
|
--enable-wchar_t \
|
2006-07-31 05:50:53 -04:00
|
|
|
--enable-languages=${LANGS}
|
|
|
|
|
|
|
|
# This is needed, as internal cpp is no longer compatible with the
|
|
|
|
# visible beast
|
2009-04-16 14:36:48 -04:00
|
|
|
CONFIGURE_ARGS += --enable-cpp
|
2006-07-31 05:50:53 -04:00
|
|
|
|
|
|
|
CONFIGURE_ARGS += --with-gnu-as
|
|
|
|
CONFIGURE_ARGS += --with-gnu-ld
|
|
|
|
CONFIGURE_ARGS += ${CONFIGURE_SHARED}
|
|
|
|
|
|
|
|
post-patch:
|
|
|
|
cd ${WRKDIST}/libstdc++-v3 && AUTOCONF_VERSION=2.59 autoconf
|
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
SEPARATE_BUILD = flavored
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
USE_GMAKE = yes
|
2006-07-31 05:50:53 -04:00
|
|
|
|
|
|
|
# you shouldn't skip bootstrap unless you know what you're doing
|
|
|
|
# use bootstrap-lean if you're pressed for space
|
2009-04-16 14:36:48 -04:00
|
|
|
ALL_TARGET = bootstrap
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
MAKE_FLAGS = libstdc___la_LDFLAGS='-version-info 31:0:0 -lm'
|
2006-07-31 05:50:53 -04:00
|
|
|
|
|
|
|
|
2006-10-20 09:43:18 -04:00
|
|
|
.if ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "amd64"
|
2009-04-16 14:36:48 -04:00
|
|
|
PKG_ARGS += -DPIC=1
|
2006-07-31 05:50:53 -04:00
|
|
|
.else
|
2009-04-16 14:36:48 -04:00
|
|
|
PKG_ARGS += -DPIC=0
|
2006-07-31 05:50:53 -04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${MACHINE_ARCH} == "powerpc"
|
2009-04-16 14:36:48 -04:00
|
|
|
PKG_ARGS += -DPPC=1
|
2006-07-31 05:50:53 -04:00
|
|
|
.else
|
2009-04-16 14:36:48 -04:00
|
|
|
PKG_ARGS += -DPPC=0
|
2006-07-31 05:50:53 -04:00
|
|
|
.endif
|
2009-01-19 16:39:29 -05:00
|
|
|
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
|
2009-04-16 14:36:48 -04:00
|
|
|
PKG_ARGS += -DI386=1
|
2006-08-01 04:58:11 -04:00
|
|
|
.else
|
2009-04-16 14:36:48 -04:00
|
|
|
PKG_ARGS += -DI386=0
|
2006-08-01 04:58:11 -04:00
|
|
|
.endif
|
2006-07-31 05:50:53 -04:00
|
|
|
|
2010-11-22 04:20:34 -05:00
|
|
|
RUN_DEPENDS = gcc-${FULL_PKGVERSION}v0:${PKGPATH}
|
2009-04-16 14:36:48 -04:00
|
|
|
WANTLIB = c
|
2006-11-25 11:26:46 -05:00
|
|
|
|
2009-04-16 14:36:48 -04:00
|
|
|
RUN_DEPENDS-main =
|
|
|
|
RUN_DEPENDS-estdc =
|
2009-06-04 14:24:20 -04:00
|
|
|
RUN_DEPENDS-java =
|
2006-11-25 11:26:46 -05:00
|
|
|
|
2010-11-17 03:05:12 -05:00
|
|
|
RUN_DEPENDS-c++ = ${RUN_DEPENDS} libstdc++->=4.2,<4.3|libstdc++->=4.2v0,<4.3v0:${PKGPATH},-estdc
|
2009-04-16 14:36:48 -04:00
|
|
|
WANTLIB-estdc = c m
|
2009-06-04 14:24:20 -04:00
|
|
|
WANTLIB-java = c m pthread z
|
2006-11-25 11:26:46 -05:00
|
|
|
|
2010-11-17 03:05:12 -05:00
|
|
|
LIB_DEPENDS-f95 = devel/gmp>=4.2 \
|
|
|
|
devel/mpfr
|
2010-11-07 14:12:42 -05:00
|
|
|
WANTLIB-f95 = ${WANTLIB} gmp mpfr
|
2006-07-31 05:50:53 -04:00
|
|
|
.include <bsd.port.mk>
|
2009-04-16 14:36:48 -04:00
|
|
|
|
|
|
|
ADA_PACKAGE = ${PACKAGE_REPOSITORY}/i386/all/${PKGNAME-ada}${PKG_SUFX}
|
|
|
|
GCC_PACKAGE = ${PACKAGE_REPOSITORY}/i386/all/${PKGNAME-main}${PKG_SUFX}
|
|
|
|
|
|
|
|
adastrap: ${ADA_PACKAGE} ${GCC_PACKAGE}
|
|
|
|
mkdir -p ${WRKDIR}/prepare/bootstrap
|
|
|
|
cd ${WRKDIR}/prepare/bootstrap && tar zxf ${ADA_PACKAGE}
|
|
|
|
cd ${WRKDIR}/prepare/bootstrap && tar zxf ${GCC_PACKAGE}
|
|
|
|
rm -rf ${WRKDIR}/prepare/bootstrap/{+*,info,man}
|
|
|
|
cd ${WRKDIR}/prepare && tar zcf ${FULLDISTDIR}/${ADASTRAP} bootstrap
|
|
|
|
|