pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/compiler Did you know that the := operator behaves ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2198017772e1
branches:  trunk
changeset: 396599:2198017772e1
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Jul 28 06:55:24 2009 +0000

description:
Did you know that the := operator behaves funnily? Example:

exclam  != echo ${DEFINED_LATER:Q} value
colon   := ${DEFINED_LATER} value

DEFINED_LATER = later

show:
        @echo ${exclam}
        @echo ${colon}

Don't expect them to be the same.

diffstat:

 mk/compiler/gcc.mk |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r d599b0d4ccc7 -r 2198017772e1 mk/compiler/gcc.mk
--- a/mk/compiler/gcc.mk        Tue Jul 28 06:36:44 2009 +0000
+++ b/mk/compiler/gcc.mk        Tue Jul 28 06:55:24 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.98 2009/07/08 21:25:30 markd Exp $
+# $NetBSD: gcc.mk,v 1.99 2009/07/28 06:55:24 rillig Exp $
 #
 # This is the compiler definition for the GNU Compiler Collection.
 #
@@ -100,8 +100,12 @@
 .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.
 _GCC_VERSION_STRING!=  \
-       ( ${SETENV} ${ALL_ENV} ${_CC} -v 2>&1 | ${GREP} 'gcc version' ) 2>/dev/null || ${ECHO} 0
+       ( ${SETENV} ${ALL_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*)



Home | Main Index | Thread Index | Old Index