diff options
author | jperkin <jperkin@pkgsrc.org> | 2012-07-27 10:34:00 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2012-07-27 10:34:00 +0000 |
commit | c9e21d595ca4ff6063d9f73b6d9defe9f2338547 (patch) | |
tree | 1d34d2793efbb21b68c715ec083424077857b966 /mk | |
parent | 5269af7246bae025515cfa78644a1335c212558b (diff) | |
download | pkgsrc-c9e21d595ca4ff6063d9f73b6d9defe9f2338547.tar.gz |
Ensure LC_ALL=C is set when determining the gcc version. Add a comment
explaining why we currently have to hardcode 'env' rather than use SETENV
or PKGSRC_SETENV.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/compiler/gcc.mk | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk index 15cc8979271..391e252218e 100644 --- a/mk/compiler/gcc.mk +++ b/mk/compiler/gcc.mk @@ -1,4 +1,4 @@ -# $NetBSD: gcc.mk,v 1.124 2012/07/13 16:11:29 jperkin Exp $ +# $NetBSD: gcc.mk,v 1.125 2012/07/27 10:34:00 jperkin Exp $ # # This is the compiler definition for the GNU Compiler Collection. # @@ -144,17 +144,14 @@ MAKEFLAGS+= _CC=${_CC:Q} .endif .if !defined(_GCC_VERSION) -# FIXME: ALL_ENV is not set at this point, so LC_ALL must be set -# explicitly. In the show-all and show-var targets, it appears -# nevertheless because "References to undefined variables are not -# expanded" when using the := operator. -. if defined(SETENV) -_GCC_VERSION_STRING!= \ - ( ${PKGSRC_SETENV} ${ALL_ENV} LC_ALL=C ${_CC} -v 2>&1 | ${GREP} 'gcc version') 2>/dev/null || ${ECHO} 0 -. else +# +# FIXME: Ideally we'd use PKGSRC_SETENV here, but not enough of the tools +# infrastructure is loaded for SETENV to be defined when mk/compiler.mk is +# included first. LC_ALL is required here for similar reasons, as ALL_ENV +# is not defined at this stage. +# _GCC_VERSION_STRING!= \ - ( ${_CC} -v 2>&1 | ${GREP} 'gcc version') 2>/dev/null || ${ECHO} 0 -. endif + ( env LC_ALL=C ${_CC} -v 2>&1 | ${GREP} 'gcc version') 2>/dev/null || ${ECHO} 0 . if !empty(_GCC_VERSION_STRING:Megcs*) _GCC_VERSION= 2.8.1 # egcs is considered to be gcc-2.8.1. . elif !empty(_GCC_VERSION_STRING:Mgcc*) |