Skip to content

Commit

Permalink
Use the options framework to select which language frontends to build
Browse files Browse the repository at this point in the history
besides C. Just as before, the default is to build c++, java, fortran
and objc. Option java implies option c++.
  • Loading branch information
hans committed Jul 12, 2011
1 parent 1ecefc9 commit e324744
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 36 deletions.
35 changes: 2 additions & 33 deletions lang/gcc44/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.22 2011/07/11 23:26:32 wiz Exp $
# $NetBSD: Makefile,v 1.23 2011/07/12 18:05:58 hans Exp $

DISTNAME= gcc-${GCC_VERSION}
PKGNAME= gcc44-${GCC_VERSION}
PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/}
EXTRACT_SUFX= .tar.bz2
Expand Down Expand Up @@ -68,38 +69,6 @@ REPLACE_BASH+= gcc/dbgcnt.def
REPLACE_BASH+= gcc/testsuite/gcc.test-framework/gen_directive_tests
REPLACE_BASH+= libstdc++-v3/scripts/run_doxygen

# Optional languages - change as required
# Ada could be added although there is a bootstrapping issue. See
# ../gcc34-ada for guidance
BUILD_DEFS+= BUILD_CXX BUILD_FORTRAN BUILD_JAVA BUILD_OBJC
BUILD_CXX?= YES
BUILD_FORTRAN?= YES
BUILD_JAVA?= YES
BUILD_OBJC?= YES

LANGS= c

#.if !empty(BUILD_CXX:M[aA][dD][aA])
#LANGS+= ada
#.endif

.if !empty(BUILD_CXX:M[Yy][Ee][Ss])
LANGS+= c++
.endif

.if !empty(BUILD_FORTRAN:M[Yy][Ee][Ss])
LANGS+= fortran
.endif

.if !empty(BUILD_JAVA:M[Yy][Ee][Ss])
LANGS+= java
REPLACE_PYTHON= libjava/contrib/aot-compile.py.in
.endif

.if !empty(BUILD_OBJC:M[Yy][Ee][Ss])
LANGS+= objc
.endif

CONFIGURE_ARGS+= --prefix=${GCC_PREFIX:Q}
CONFIGURE_ARGS+= --enable-languages=${LANGS:Q}
CONFIGURE_ARGS+= --with-system-zlib
Expand Down
43 changes: 40 additions & 3 deletions lang/gcc44/options.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# $NetBSD: options.mk,v 1.3 2011/04/14 19:38:13 hans Exp $
# $NetBSD: options.mk,v 1.4 2011/07/12 18:05:58 hans Exp $

PKG_OPTIONS_VAR= PKG_OPTIONS.gcc44
PKG_SUPPORTED_OPTIONS= nls
PKG_SUGGESTED_OPTIONS=
PKG_SUPPORTED_OPTIONS= nls c++ fortran java objc #ada
PKG_SUGGESTED_OPTIONS= c++ fortran java objc
.if ${OPSYS} == "NetBSD"
PKG_SUGGESTED_OPTIONS+= nls
.endif

PKG_OPTIONS_LEGACY_VARS+= BUILD_CXX:c++
PKG_OPTIONS_LEGACY_VARS+= BUILD_FORTRAN:fortran
PKG_OPTIONS_LEGACY_VARS+= BUILD_JAVA:java
PKG_OPTIONS_LEGACY_VARS+= BUILD_OBJC:objc

.include "../../mk/bsd.options.mk"

###
Expand All @@ -20,3 +25,35 @@ USE_TOOLS+= msgfmt
.else
CONFIGURE_ARGS+= --disable-nls
.endif

###
### Optional languages
### Ada could be added although there is a bootstrapping issue. See
### ../gcc34-ada for guidance
###

LANGS= c

.if !empty(PKG_OPTIONS:Mjava)
. if empty(PKG_OPTIONS:Mc++)
PKG_OPTIONS+= c++
. endif
LANGS+= java
REPLACE_PYTHON= libjava/contrib/aot-compile.in
.endif

.if !empty(PKG_OPTIONS:Mc++)
LANGS+= c++
.endif

.if !empty(PKG_OPTIONS:Mfortran)
LANGS+= fortran
.endif

.if !empty(PKG_OPTIONS:Mobjc)
LANGS+= objc
.endif

#.if !empty(PKG_OPTIONS:Mada)
#LANGS+= ada
#.endif

0 comments on commit e324744

Please sign in to comment.