diff options
-rw-r--r-- | mk/compiler.mk | 25 | ||||
-rw-r--r-- | mk/compiler/gcc.mk | 20 |
2 files changed, 19 insertions, 26 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk index 80b43e80bba..b7074d982e6 100644 --- a/mk/compiler.mk +++ b/mk/compiler.mk @@ -1,4 +1,4 @@ -# $NetBSD: compiler.mk,v 1.74 2010/11/17 08:40:22 obache Exp $ +# $NetBSD: compiler.mk,v 1.75 2012/04/13 03:03:36 sbd Exp $ # # This Makefile fragment implements handling for supported C/C++/Fortran # compilers. @@ -33,28 +33,12 @@ # compiler. The chain should always end in a real compiler. # This should only be set in /etc/mk.conf. # -# USE_PKGSRC_GCC -# Force using the appropriate version of GCC from pkgsrc based on -# GCC_REQD instead of the native compiler. -# -# This should be disabled only for debugging. -# # COMPILER_USE_SYMLINKS # If set to yes, use symlinks for the compiler drivers, otherwise # shell scripts are created. The default is yes. # # The following variables may be set by a package: # -# GCC_REQD -# A list of version numbers used to determine the minimum -# version of GCC required by a package. This value should only -# be appended to by a package Makefile. -# -# NOTE: Be conservative when setting GCC_REQD, as lang/gcc3 is -# known not to build on some platforms, e.g. Darwin. If gcc3 is -# required, set GCC_REQD=3.0 so that we do not try to pull in -# lang/gcc3 unnecessarily and have it fail. -# # USE_LANGUAGES # Lists the languages used in the source code of the package, # and is used to determine the correct compilers to install. @@ -95,13 +79,6 @@ USE_LANGUAGES+= c COMPILER_USE_SYMLINKS?= yes -# For environments where there is an external gcc too, but pkgsrc -# should use the pkgsrc one for consistency. -# -.if defined(USE_PKGSRC_GCC) -_USE_PKGSRC_GCC= yes -.endif - _COMPILERS= ccc gcc icc ido mipspro mipspro-ucode \ sunpro xlc hp pcc clang _PSEUDO_COMPILERS= ccache distcc f2c g95 diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk index e255c6804a1..6ef48e36046 100644 --- a/mk/compiler/gcc.mk +++ b/mk/compiler/gcc.mk @@ -1,4 +1,4 @@ -# $NetBSD: gcc.mk,v 1.115 2012/04/13 02:30:45 sbd Exp $ +# $NetBSD: gcc.mk,v 1.116 2012/04/13 03:03:36 sbd Exp $ # # This is the compiler definition for the GNU Compiler Collection. # @@ -8,6 +8,12 @@ # When set to "yes", the native gcc is used, no matter which # compiler version a package requires. # +# USE_PKGSRC_GCC +# Force using the appropriate version of GCC from pkgsrc based on +# GCC_REQD instead of the native compiler. +# +# This should be disabled only for debugging. +# # Package-settable variables: # # GCC_REQD @@ -17,6 +23,11 @@ # ONLY_FOR_COMPILER for that purpose. This is a list of version # numbers, of which the maximum version is the definitive one. # +# NOTE: Be conservative when setting GCC_REQD, as lang/gcc3 is +# known not to build on some platforms, e.g. Darwin. If gcc3 is +# required, set GCC_REQD=3.0 so that we do not try to pull in +# lang/gcc3 unnecessarily and have it fail. +# # System-defined variables: # # CC_VERSION @@ -33,7 +44,7 @@ COMPILER_GCC_MK= defined _VARGROUPS+= gcc -_USER_VARS.gcc= USE_NATIVE_GCC +_USER_VARS.gcc= USE_NATIVE_GCC USE_PKGSRC_GCC _PKG_VARS.gcc= GCC_REQD _SYS_VARS.gcc= CC_VERSION CC_VERSION_STRING LANGUAGES.gcc _DEF_VARS.gcc= \ @@ -62,6 +73,7 @@ _DEF_VARS.gcc= \ .include "../../mk/bsd.prefs.mk" USE_NATIVE_GCC?= no +USE_PKGSRC_GCC?= no GCC_REQD+= 2.8.0 @@ -395,6 +407,10 @@ _USE_GCC_SHLIB?= yes .if !empty(USE_NATIVE_GCC:M[yY][eE][sS]) && !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) _USE_PKGSRC_GCC= no +.elif !empty(USE_PKGSRC_GCC:M[yY][eE][sS]) +# For environments where there is an external gcc too, but pkgsrc +# should use the pkgsrc one for consistency. +_USE_PKGSRC_GCC= yes .endif .if defined(_IGNORE_GCC) |