diff options
author | marino <marino> | 2012-07-08 19:57:10 +0000 |
---|---|---|
committer | marino <marino> | 2012-07-08 19:57:10 +0000 |
commit | d3c530c8b1db122ee4165a13713eeba0e7e9cdaf (patch) | |
tree | 4da9ca3823611acfbc8bd00bcb40f6fbfd554be5 /mk | |
parent | 800cc780d15b918fdfa2ee04a89a147b5f1c2d5e (diff) | |
download | pkgsrc-d3c530c8b1db122ee4165a13713eeba0e7e9cdaf.tar.gz |
compiler.mk/gcc.mk: Add support for USE_LANGUAGES+= ada
All recent packages featuring Ada code have a hard dependency on the
lang/gnat-aux compiler package. The valid values for USE_LANGUAGES
are c, c99, c++, fortran, fortran77, java, objc, so specifying a
specific compiler was necessary up into now.
One problem with lang/gnat-aux is that it is installed at ${LOCALBASE}
where the lang/gccXX compilers are installed at ${LOCALBASE}/gccXX.
The latter compilers have no possibility of sharing conflicting files
unlike lang/gnat-aux. Rather than fundamentally update the GCC 4.6-based
lang/gnat-aux to avoid these conflicts, a new Ada-capable compiler
based on GCC 4.7 was created with the intent of being supported by
mk/compiler.mk and mk/compiler/gcc.mk.
The Ada packages will be effectively migrated from lang/gnat-aux to the
new lang/gcc-aux compiler, but lang/gcc-aux will remain as a standalone
package as it is the only GCC 4.6-based compiler that builds on
DragonFly and serves it as a world and kernel compile option.
In addition to the current language wrappers, lang/gcc-aux adds
wrappers for "ada" (unique to gcc-aux, hardlinked to gcc driver),
and the gnat, gnatmake, gnatbind, gnatlink, gnatchop, gnatprep,
and gnatls programs. Supporting all of these allows the wrapper
system to be used with Ada packages; currently wrappers are mostly
disabled on them.
The lang/gcc47 implicitly adds support for the "objc-c++" language by
adding it to the USE_LANGUAGES list, but it wasn't really supported.
An attempt was made to better support objc-c++, but this new enumeration
probably still needs work or needs to be removed completely.
Logic for Ada support:
1) All lang/gccXX compilers have version numbers ranging from 2.8.1 to 9.
2) lang/gcc-aux uses the release date as its version number in the form of
YYYYMMDD with a minimum value of 20120614, so there is no version
overlap.
3) When at least one element of USE_LANGUAGES is "ada", the value of
20120614 is added to the set of GCC_REQD which selects lang/gcc-aux.
4) The _NEED_NEWER_GCC check is disabled. It fails and isn't relevant;
unless a package sets GCC_REQD over 20120614, the only way to select
lang/gcc-aux is to specify the Ada language and only one compiler
known to gcc.mk can support it.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/compiler.mk | 14 | ||||
-rw-r--r-- | mk/compiler/gcc.mk | 87 | ||||
-rw-r--r-- | mk/wrapper/bsd.wrapper.mk | 4 |
3 files changed, 97 insertions, 8 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk index c8a28c4972c..96215d63a49 100644 --- a/mk/compiler.mk +++ b/mk/compiler.mk @@ -1,4 +1,4 @@ -# $NetBSD: compiler.mk,v 1.76 2012/06/27 13:36:08 jperkin Exp $ +# $NetBSD: compiler.mk,v 1.77 2012/07/08 19:57:10 marino Exp $ # # This Makefile fragment implements handling for supported C/C++/Fortran # compilers. @@ -42,8 +42,8 @@ # USE_LANGUAGES # Lists the languages used in the source code of the package, # and is used to determine the correct compilers to install. -# Valid values are: c, c99, c++, fortran, fortran77, java, objc. -# The default is "c". +# Valid values are: c, c99, c++, fortran, fortran77, java, objc, +# obj-c++, and ada. The default is "c". # # The following variables are defined, and available for testing in # package Makefiles: @@ -163,10 +163,12 @@ _WRAP_EXTRA_ARGS.LD+= ${_LINKER_ABI_FLAG.${ABI}} _FAIL_WRAPPER.CC= ${WRKDIR}/.compiler/bin/c-fail-wrapper _FAIL_WRAPPER.CXX= ${WRKDIR}/.compiler/bin/c++-fail-wrapper _FAIL_WRAPPER.FC= ${WRKDIR}/.compiler/bin/fortran-fail-wrapper +_FAIL_WRAPPER.ADA= ${WRKDIR}/.compiler/bin/ada-fail-wrapper ${_FAIL_WRAPPER.CC}: fail-wrapper ${_FAIL_WRAPPER.CXX}: fail-wrapper ${_FAIL_WRAPPER.FC}: fail-wrapper +${_FAIL_WRAPPER.ADA}: fail-wrapper .PHONY: fail-wrapper fail-wrapper: .USE @@ -184,7 +186,7 @@ fail-wrapper: .USE ${ECHO} 'exit 1' ${RUN}${CHMOD} +x ${.TARGET} -.if empty(USE_LANGUAGES:Mc) && empty(USE_LANGUAGES:Mobjc) +.if empty(USE_LANGUAGES:Mc) && empty(USE_LANGUAGES:Mobjc) && empty(USE_LANGUAGES:Mobjc-c++) PKG_CC:= ${_FAIL_WRAPPER.CC} ALL_ENV+= CPP=${CPP:Q} override-tools: ${_FAIL_WRAPPER.CC} @@ -198,5 +200,9 @@ override-tools: ${_FAIL_WRAPPER.CXX} PKG_FC:= ${_FAIL_WRAPPER.FC} override-tools: ${_FAIL_WRAPPER.FC} .endif +.if empty(USE_LANGUAGES:Mada) +PKG_ADA:= ${_FAIL_WRAPPER.ADA} +override-tools: ${_FAIL_WRAPPER.ADA} +.endif .endif # BSD_COMPILER_MK diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk index ccedd899875..342d8eac2e9 100644 --- a/mk/compiler/gcc.mk +++ b/mk/compiler/gcc.mk @@ -1,4 +1,4 @@ -# $NetBSD: gcc.mk,v 1.121 2012/06/26 15:48:53 jperkin Exp $ +# $NetBSD: gcc.mk,v 1.122 2012/07/08 19:57:10 marino Exp $ # # This is the compiler definition for the GNU Compiler Collection. # @@ -50,9 +50,11 @@ _SYS_VARS.gcc= CC_VERSION CC_VERSION_STRING LANGUAGES.gcc _DEF_VARS.gcc= \ CCPATH CPPPATH CXXPATH \ F77PATH FCPATH \ + ADAPATH GMKPATH GLKPATH GDBPATH CHPPATH GLSPATH GNTPATH PRPPATH \ IMAKEOPTS \ LDFLAGS \ PKG_CC PKG_CPP PKG_CXX PKG_FC \ + PKG_ADA PKG_GMK PKG_GLK PKG_GDB PKG_CHP PKG_GLK PKG_GNT PKG_PRP \ _CC _COMPILER_RPATH_FLAG _COMPILER_STRIP_VARS \ _GCCBINDIR _GCC_ARCHDIR _GCC_BIN_PREFIX _GCC_CC \ _GCC_CPP _GCC_CXX _GCC_DEPENDENCY _GCC_DEPENDS \ @@ -61,6 +63,7 @@ _DEF_VARS.gcc= \ _GCC_PREFIX _GCC_REQD _GCC_STRICTEST_REQD _GCC_SUBPREFIX \ _GCC_TEST_DEPENDS _GCC_NEEDS_A_FORTRAN _GCC_VARS _GCC_VERSION \ _GCC_VERSION_STRING \ + _GCC_ADA _GCC_GMK _GCC_GLK _GCC_GDB _GCC_CHP _GCC_GLS _GCC_GNT _GCC_PRP \ _IGNORE_GCC _IGNORE_GCC3CXX _IGNORE_GCC3F77 _IGNORE_GCC3OBJC \ _IS_BUILTIN_GCC \ _LANGUAGES.gcc \ @@ -82,6 +85,12 @@ GCC_REQD+= 2.8.0 GCC_REQD+= 3.0 .endif +# Only one compiler defined here supports Ada: lang/gcc-aux +# If the Ada language is requested, force lang/gcc-aux to be selected +.if !empty(USE_LANGUAGES:Mada) +GCC_REQD+= 20120614 +.endif + # _GCC_DIST_VERSION is the highest version of GCC installed by the pkgsrc # without the PKGREVISIONs. # @@ -111,6 +120,9 @@ _GCC46_PATTERNS= 4.6 4.6.* # _GCC46_PATTERNS matches N s.t. 4.7 <= N. _GCC47_PATTERNS= 4.[7-9] 4.[7-9].* 4.[1-9][0-9]* [4-9]* +# _GCC_AUX_PATTERNS matches 8-digit date YYYYMMDD* +_GCC_AUX_PATTERNS= 20[1-2][0-9][0-1][0-9][0-3][0-9]* + # _CC is the full path to the compiler named by ${CC} if it can be found. .if !defined(_CC) _CC:= ${CC:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//} @@ -233,10 +245,16 @@ _NEED_GCC46= yes _NEED_GCC47= yes . endif .endfor +.for _pattern_ in ${_GCC_AUX_PATTERNS} +. if !empty(_GCC_REQD:M${_pattern_}) +_NEED_GCC_AUX= yes +_NEED_NEWER_GCC=NO +. endif +.endfor .if !empty(_NEED_GCC2:M[nN][oO]) && !empty(_NEED_GCC3:M[nN][oO]) && \ !empty(_NEED_GCC34:M[nN][oO]) && !empty(_NEED_GCC44:M[nN][oO]) && \ !empty(_NEED_GCC45:M[nN][oO]) && !empty(_NEED_GCC46:M[nN][oO]) && \ - !empty(_NEED_GCC47:M[nN][oO]) + !empty(_NEED_GCC47:M[nN][oO]) && !empty(_NEED_GCC_AUX:M[nN][oO]) _NEED_GCC47= yes .endif @@ -256,6 +274,8 @@ LANGUAGES.gcc= c c++ fortran fortran77 java objc LANGUAGES.gcc= c c++ fortran fortran77 java objc .elif !empty(_NEED_GCC47:M[yY][eE][sS]) LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ +.elif !empty(_NEED_GCC_AUX:M[yY][eE][sS]) +LANGUAGES.gcc= c c++ fortran fortran77 objc ada .endif _LANGUAGES.gcc= # empty .for _lang_ in ${USE_LANGUAGES} @@ -405,6 +425,26 @@ _GCC_DEPENDENCY= gcc47>=${_GCC_REQD}:../../lang/gcc47 _USE_GCC_SHLIB?= yes . endif . endif +.elif !empty(_NEED_GCC_AUX:M[yY][eE][sS]) +# +# We require Ada-capable compiler in the lang/gcc-aux directory. +# +_GCC_PKGBASE= gcc-aux +. if !empty(PKGPATH:Mlang/gcc-aux) +_IGNORE_GCC= yes +MAKEFLAGS+= _IGNORE_GCC=yes +. endif +. if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) +_GCC_PKGSRCDIR= ../../lang/gcc-aux +_GCC_DEPENDENCY= gcc-aux>=${_GCC_REQD}:../../lang/gcc-aux +. if !empty(_LANGUAGES.gcc:Mc++) || \ + !empty(_LANGUAGES.gcc:Mfortran) || \ + !empty(_LANGUAGES.gcc:Mfortran77) || \ + !empty(_LANGUAGES.gcc:Mada) || \ + !empty(_LANGUAGES.gcc:Mobjc) +_USE_GCC_SHLIB?= yes +. endif +. endif .endif _GCC_DEPENDS= ${_GCC_PKGBASE}>=${_GCC_REQD} @@ -600,6 +640,49 @@ F77PATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gfortran PKG_FC:= ${_GCC_FC} PKGSRC_FORTRAN?= gfortran .endif +.if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}ada) +_GCC_VARS+= ADA GMK GLK GBD CHP PRP GLS GNT +_GCC_ADA= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}ada +_GCC_GMK= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatmake +_GCC_GLK= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatlink +_GCC_GBD= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatbind +_GCC_CHP= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatchop +_GCC_PRP= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatprep +_GCC_GLS= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatls +_GCC_GNT= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnat +_ALIASES.ADA= ada +_ALIASES.GMK= gnatmake +_ALIASES.GLK= gnatlink +_ALIASES.GBD= gnatbind +_ALIASES.CHP= gnatchop +_ALIASES.PRP= gnatprep +_ALIASES.GLS= gnatls +_ALIASES.GNT= gnat +ADAPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}ada +GMKPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatmake +GLKPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatlink +GBDPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatbind +CHPPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatchop +PRPPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatprep +GLSPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatls +GNTPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnat +PKG_ADA:= ${_GCC_ADA} +PKG_GMK:= ${_GCC_GMK} +PKG_GLK:= ${_GCC_GLK} +PKG_GBD:= ${_GCC_GBD} +PKG_CHP:= ${_GCC_CHP} +PKG_PRP:= ${_GCC_PRP} +PKG_GLS:= ${_GCC_GLS} +PKG_GNT:= ${_GCC_GNT} +PKGSRC_ADA?= ada +PKGSRC_GMK?= gnatmake +PKGSRC_GLK?= gnatlink +PKGSRC_GBD?= gnatbind +PKGSRC_CHP?= gnatchop +PKGSRC_PRP?= gnatprep +PKGSRC_GLS?= gnatls +PKGSRC_GNT?= gnat +.endif _COMPILER_STRIP_VARS+= ${_GCC_VARS} # Pass the required flags to imake to tell it we're using gcc on Solaris. diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk index d55424f8882..8650ec66f37 100644 --- a/mk/wrapper/bsd.wrapper.mk +++ b/mk/wrapper/bsd.wrapper.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.wrapper.mk,v 1.86 2011/08/04 13:32:05 obache Exp $ +# $NetBSD: bsd.wrapper.mk,v 1.87 2012/07/08 19:57:10 marino Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -174,7 +174,7 @@ WRAPPER_${_wrappee_}= ${WRAPPER_BINDIR}/${${_wrappee_}} .endfor # _WRAPPEES _WRAP_ALIASES.AS= as -_WRAP_ALIASES.CC= cc gcc +_WRAP_ALIASES.CC= cc gcc ada _WRAP_ALIASES.CXX= c++ g++ CC cxx _WRAP_ALIASES.CPP= cpp _WRAP_ALIASES.FC= f77 g77 |