]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
AC_SUBST: don't underquote the variable name
authorNick Bowler <nbowler@draconx.ca>
Thu, 16 Aug 2012 03:54:53 +0000 (21:54 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 16 Aug 2012 03:54:53 +0000 (21:54 -0600)
Consider the following:

% cat >configure.ac <<'EOF'
AC_INIT([test], [0])

m4_define([FOO], [baz])
AC_SUBST([FOO], [bar])

AC_CONFIG_FILES([test])
AC_OUTPUT
EOF

% cat >test.in <<'EOF'
@FOO@
EOF

This produces no error messages at autoconf time and none at configure
time.  Nevertheless, the substituted value of FOO is the empty string,
instead of bar, as expected.  Sure enough, in the output variables
section of config.log, we see FOO='' instead of FOO='bar'.  Looking
at the generated configure script, we see that AC_SUBST has produced
baz=bar in the output, instead of the expected FOO=bar.  But this is
the only place: everywhere else is still using FOO.

* lib/autoconf/general.m4 (AC_SUBST): Add another layer of
quoting.
* THANKS: Update.

Signed-off-by: Eric Blake <eblake@redhat.com>
THANKS
lib/autoconf/general.m4

diff --git a/THANKS b/THANKS
index d90237d4d576d01eb81e3a795239a7baff25d380..be83c285ff70424aad9a11d0bb97c6836421b453 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -302,7 +302,7 @@ Nathanael Nerode            neroden@gcc.gnu.org
 Nelson H. F. Beebe          beebe@math.utah.edu
 Nicolas Joly                njoly@pasteur.fr
 Nicolás Lichtmaier          jnl@synapsis-sa.com.ar
-Nick Bowler                 nbowler@elliptictech.com
+Nick Bowler                 nbowler@draconx.ca
 NightStrike                 nightstrike@gmail.com
 Nishio Futoshi              fut_nis@d3.dion.ne.jp
 Noah Elliott                elliott@hera.llnl.gov
index d06fdf5a99ba45c1abddc7b9209f33fef32bae5d..51cee303f433a5e57d4763dc3ed5acae896911a0 100644 (file)
@@ -2180,7 +2180,7 @@ m4_define([AC_SUBST],
   [m4_fatal([$0: `$1' is not a valid shell variable name])])]dnl
 [AC_SUBST_TRACE([$1])]dnl
 [m4_pattern_allow([^$1$])]dnl
-[m4_ifvaln([$2], [$1=$2])[]]dnl
+[m4_ifvaln([$2], [[$1]=$2])[]]dnl
 [m4_set_add([_AC_SUBST_VARS], [$1])])# AC_SUBST