openbsd-ports/lang/gcc/4.2/Makefile

244 lines
5.7 KiB
Makefile
Raw Normal View History

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
#BROKEN=adjust for types changes
2006-07-31 05:50:53 -04:00
V = 4.2.4
FULL_VERSION = $V
FULL_PKGVERSION = $V
2009-12-20 05:15:36 -05:00
BOOTSTRAP_GEN = 3
# XXX this needs libc.so.53.0 to build on i386
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}
REVISION-main = 4
2011-09-16 06:31:20 -04:00
REVISION-c++ = 7
REVISION-f95 = 7
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
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 \
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
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
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
.endif
.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
.if !${FLAVOR:L:Mno_c++} || ${BUILD:Mjava}
MULTI_PACKAGES += -c++ -estdc
BUILD += c++
.endif
2006-07-31 05:50:53 -04:00
DISTFILES = ${DISTNAME}.tar.bz2
SUPDISTFILES = ${ADASTRAP}:0
2006-07-31 05:50:53 -04:00
BUILD_DEPENDS += devel/autoconf/2.59
2010-11-17 03:05:12 -05:00
BUILD_DEPENDS += devel/metaauto
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
DISTNAME = gcc-${FULL_VERSION}
2006-07-31 05:50:53 -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
CONFIGURE_STYLE = gnu
MODGNU_CONFIG_GUESS_DIRS = ${WRKSRC} ${WRKSRC}/gcc
2006-07-31 05:50:53 -04:00
LANGS = c
.if ${BUILD:Mc++}
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
.if ${BUILD:Mfortran}
LANGS := ${LANGS},fortran
CONFIGURE_ARGS += --with-gmp=${LOCALBASE}
2006-07-31 05:50:53 -04:00
.endif
.if ${BUILD:Mobjc}
LANGS := ${LANGS},objc
2006-07-31 05:50:53 -04:00
.endif
.if ${BUILD:Mjava}
LANGS := ${LANGS},java
2010-11-17 03:05:12 -05:00
BUILD_DEPENDS += archivers/zip>=2.3p0
CONFIGURE_ARGS += --enable-libgcj
2006-07-31 05:50:53 -04:00
.endif
.if ${BUILD:Mada}
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
post-install:
.if ${BUILD:Mada} == "yes"
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
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.
CFLAGS = -O2 -g
2006-07-31 05:50:53 -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 \
--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 \
--enable-threads=posix \
--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
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
SEPARATE_BUILD = flavored
2006-07-31 05:50:53 -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
ALL_TARGET = bootstrap
2006-07-31 05:50:53 -04:00
MAKE_FLAGS = libstdc___la_LDFLAGS='-version-info 31:0:0 -lm'
2006-07-31 05:50:53 -04:00
.if ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "amd64"
PKG_ARGS += -DPIC=1
2006-07-31 05:50:53 -04:00
.else
PKG_ARGS += -DPIC=0
2006-07-31 05:50:53 -04:00
.endif
.if ${MACHINE_ARCH} == "powerpc"
PKG_ARGS += -DPPC=1
2006-07-31 05:50:53 -04:00
.else
PKG_ARGS += -DPPC=0
2006-07-31 05:50:53 -04:00
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
PKG_ARGS += -DI386=1
.else
PKG_ARGS += -DI386=0
.endif
2006-07-31 05:50:53 -04:00
2010-11-22 04:20:34 -05:00
RUN_DEPENDS = gcc-${FULL_PKGVERSION}v0:${PKGPATH}
WANTLIB = c
RUN_DEPENDS-main =
RUN_DEPENDS-estdc =
RUN_DEPENDS-java =
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
WANTLIB-estdc = c m
WANTLIB-java = c m pthread z
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>
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