modernize gcc build: pseudo-flavors, multi-packages, and ONLY_FOR_ARCHS-*

(prevent bulk from building gcc 4 twice, once for java, once for objc)
This commit is contained in:
espie 2011-09-15 17:25:34 +00:00
parent 20f0ceada9
commit 340195f8f9
4 changed files with 100 additions and 57 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.23 2011/09/11 18:20:51 jasper Exp $
# $OpenBSD: Makefile,v 1.24 2011/09/15 17:25:34 espie Exp $
# uses gcj which is only supported on select archs
ONLY_FOR_ARCHS= i386 amd64 sparc64
@ -6,7 +6,7 @@ ONLY_FOR_ARCHS= i386 amd64 sparc64
COMMENT= essential libraries for java
DISTNAME= classpath-0.98
REVISION= 6
REVISION= 7
CATEGORIES= lang java
@ -35,7 +35,7 @@ USE_GROFF = Yes
BUILD_DEPENDS= archivers/zip \
lang/antlr3>=3.4p0
RUN_DEPENDS= lang/gcc/4.2,-java,java \
RUN_DEPENDS= lang/gcc/4.2,-java \
lang/antlr3>=3.4p0
LIB_DEPENDS= x11/gtk+2 \

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.50 2011/07/18 19:06:36 naddy Exp $
# $OpenBSD: Makefile,v 1.51 2011/09/15 17:25:34 espie Exp $
ONLY_FOR_ARCHS = alpha amd64 i386 m68k sparc sparc64 powerpc vax
@ -34,18 +34,16 @@ EPOCH = 0
MAINTAINER = Marc Espie <espie@openbsd.org>
PSEUDO_FLAVORS = c++ fortran objc java ada
PSEUDO_FLAVORS = no_c++ no_fortran no_objc no_java no_ada
.include <bsd.own.mk>
# currently broken on i386 ? so empty
ONLY_FOR_ARCHS-ada =
# not really interesting either
ONLY_FOR_ARCHS-java =
FLAVOR ?= c++ fortran objc ada
.if ${FLAVOR:L:Mjava}
FLAVOR += c++
.endif
FLAVOR ?=
BUILD_DEPENDS = devel/autoconf/2.13
BUILD_DEPENDS += devel/metaauto
@ -55,6 +53,41 @@ BUILD_DEPENDS += devel/bison
MULTI_PACKAGES = -main
BUILD = c
.if !${FLAVOR:L:Mno_fortran}
MULTI_PACKAGES += -g77
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
.endif
.if !${FLAVOR:L:Mno_c++} || ${BUILD:Mjava}
MULTI_PACKAGES += -c++ -estdc
BUILD += c++
.endif
USE_GROFF = Yes
REGRESS_DEPENDS = devel/dejagnu
@ -72,36 +105,24 @@ MODGNU_CONFIG_GUESS_DIRS = ${WRKSRC} ${WRKSRC}/gcc
LANGS = c
.if ${FLAVOR:L:Mc++}
.if ${BUILD:Mc++}
LANGS := ${LANGS},c++
MULTI_PACKAGES += -c++ -estdc
.endif
.if ${FLAVOR:L:Mfortran}
.if ${BUILD:Mfortran}
LANGS := ${LANGS},f77
MULTI_PACKAGES += -g77
.endif
.if ${FLAVOR:L:Mobjc}
.if ${BUILD:Mobjc}
LANGS := ${LANGS},objc
MULTI_PACKAGES += -objc
.endif
.if ${FLAVOR:L:Mjava}
.if ${BUILD:Mjava}
LANGS := ${LANGS},java
MULTI_PACKAGES += -java
CONFIGURE_ARGS += --enable-java-gc=system-boehm
.endif
BUILD_ADA = No
.if ${FLAVOR:L:Mada}
MULTI_PACKAGES += -ada
# currently broken everywhere
. if ${MACHINE_ARCH:L} == "i386"
#BUILD_ADA = yes
. endif
.endif
.if ${BUILD_ADA:L} == "yes"
.if ${BUILD:Mada}
LANGS := ${LANGS},ada
DISTFILES += ${ADASTRAP}:0
CONFIGURE_ENV = ADAC=${WRKDIR}/bin/egcc GNATBIND=${WRKDIR}/bin/gnatbind
@ -112,7 +133,7 @@ post-build:
.endif
post-extract:
.if ${BUILD_ADA:L} == "yes"
.if ${BUILD:Mada} == "yes"
. 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
@ -125,7 +146,7 @@ post-extract:
.endfor
post-install:
.if ${BUILD_ADA:L} == "yes"
.if ${BUILD:Mada}
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/gcc-lib/*/$V/adainclude
.endif
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/gcc-lib/*/$V/include
@ -143,7 +164,7 @@ CONFIGURE_ARGS = \
# visible beast
CONFIGURE_ARGS += --enable-cpp
.if ${FLAVOR:L:Mjava}
.if ${BUILD:Mjava}
CONFIGURE_ARGS += --enable-sjlj-exceptions
# No way around it, java wants a pure parser
BUILD_DEPENDS += devel/bison

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.61 2011/07/18 19:06:36 naddy Exp $
# $OpenBSD: Makefile,v 1.62 2011/09/15 17:25:34 espie Exp $
ONLY_FOR_ARCHS = alpha i386 m68k sparc sparc64 powerpc vax amd64
#BROKEN=adjust for types changes
@ -42,18 +42,47 @@ SHARED_LIBS = estdc++ 11.0 \
MAINTAINER = Marc Espie <espie@openbsd.org>
USE_GROFF = Yes
PSEUDO_FLAVORS = c++ fortran objc java ada
.if ${MACHINE_ARCH} == "i386"
FLAVOR ?= c++ fortran objc ada java
.endif
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "sparc64"
FLAVOR ?= c++ fortran objc java
.else
FLAVOR ?= c++ fortran objc
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:Mjava}
FLAVOR += c++
.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
.endif
.if !${FLAVOR:L:Mno_c++} || ${BUILD:Mjava}
MULTI_PACKAGES += -c++ -estdc
BUILD += c++
.endif
DISTFILES = ${DISTNAME}.tar.bz2
@ -66,8 +95,6 @@ USE_LIBTOOL = Yes
BUILD_DEPENDS += devel/bison
MULTI_PACKAGES = -main
REGRESS_DEPENDS = devel/dejagnu \
devel/autogen
@ -81,29 +108,24 @@ CONFIGURE_STYLE = gnu
MODGNU_CONFIG_GUESS_DIRS = ${WRKSRC} ${WRKSRC}/gcc
LANGS = c
.if ${FLAVOR:L:Mc++}
.if ${BUILD:Mc++}
LANGS := ${LANGS},c++
MULTI_PACKAGES += -c++ -estdc
REGRESS_DEPENDS += libstdc++->=4.2,<4.3|libstdc++->=4.2v0,<4.3v0:${BUILD_PKGPATH},-estdc
.endif
.if ${FLAVOR:L:Mfortran}
.if ${BUILD:Mfortran}
LANGS := ${LANGS},fortran
MULTI_PACKAGES += -f95
CONFIGURE_ARGS += --with-gmp=${LOCALBASE}
.endif
.if ${FLAVOR:L:Mobjc}
.if ${BUILD:Mobjc}
LANGS := ${LANGS},objc
MULTI_PACKAGES += -objc
.endif
.if ${FLAVOR:L:Mjava}
.if ${BUILD:Mjava}
LANGS := ${LANGS},java
MULTI_PACKAGES += -java
BUILD_DEPENDS += archivers/zip>=2.3p0
CONFIGURE_ARGS += --enable-libgcj
.endif
.if ${FLAVOR:L:Mada}
.if ${BUILD:Mada}
LANGS := ${LANGS},ada
MULTI_PACKAGES += -ada
DISTFILES += ${ADASTRAP}:0
CONFIGURE_ENV = ADAC=${WRKDIR}/bin/egcc GNATBIND=${WRKDIR}/bin/gnatbind
MAKE_ENV = ADAC=${WRKDIR}/bin/egcc GNATBIND=${WRKDIR}/bin/gnatbind
@ -124,7 +146,7 @@ post-extract:
.endfor
post-install:
.if ${FLAVOR:L:Mada}
.if ${BUILD:Mada} == "yes"
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/gcc/*/$V/adainclude
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/gcc/*/$V/adalib
.endif

View File

@ -1,4 +1,4 @@
# $OpenBSD: gcc4.port.mk,v 1.13 2011/05/20 08:12:53 sthen Exp $
# $OpenBSD: gcc4.port.mk,v 1.14 2011/09/15 17:25:35 espie Exp $
MODGCC4_ARCHES?=
MODGCC4_LANGS?=
@ -58,9 +58,9 @@ _MODGCC4_LINKS += egfortran gfortran
. endif
. if ${MODGCC4_LANGS:L:Mjava}
BUILD_DEPENDS += gcj->=4.2,<4.3|gcj->=4.2v0,<4.3v0:lang/gcc/4.2,-java,java
BUILD_DEPENDS += gcj->=4.2,<4.3|gcj->=4.2v0,<4.3v0:lang/gcc/4.2,-java
MODGCC4_GCJWANTLIB = gcj
MODGCC4_GCJLIBDEP = gcj->=4.2,<4.3|gcj->=4.2v0,<4.3v0:lang/gcc/4.2,-java,java
MODGCC4_GCJLIBDEP = gcj->=4.2,<4.3|gcj->=4.2v0,<4.3v0:lang/gcc/4.2,-java
_MODGCC4_LINKS += egcj gcj egcjh gcjh ejar gjar egij gij
. endif