]> sourceware.org Git - automake.git/commitdiff
* lib/Automake/Variable.pm (_do_recursive_traversal): Do not
authorAlexandre Duret-Lutz <adl@gnu.org>
Sat, 29 Nov 2003 21:47:27 +0000 (21:47 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sat, 29 Nov 2003 21:47:27 +0000 (21:47 +0000)
update @_substfroms and @_substfroms for undefined variables.
* tests/substre2.test: New file.
* tests/Makefile.am (TESTS): Add substre2.test.

ChangeLog
doc/stamp-vti
doc/version.texi
lib/Automake/Variable.pm
tests/Makefile.am
tests/Makefile.in
tests/substre2.test [new file with mode: 0755]

index e6c59c6a0798a1f13b7eca10ae7b2d292642214b..36208e046efa711e31addba87039c74d1d04d306 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2003-11-29  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * lib/Automake/Variable.pm (_do_recursive_traversal): Do not
+       update @_substfroms and @_substfroms for undefined variables.
+       * tests/substre2.test: New file.
+       * tests/Makefile.am (TESTS): Add substre2.test.
+
        * lib/Automake/VarDef.pm (value): Rename as ...
        (raw_value): ... this.
        (value): New method, strip # and \\\n.
index efe9b44337f59781feabc59ed4107a144ef39fb3..3ba12101688d79cce2e9eb363422be5e1b6a72c4 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 27 November 2003
+@set UPDATED 29 November 2003
 @set UPDATED-MONTH November 2003
 @set EDITION 1.7g
 @set VERSION 1.7g
index efe9b44337f59781feabc59ed4107a144ef39fb3..3ba12101688d79cce2e9eb363422be5e1b6a72c4 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 27 November 2003
+@set UPDATED 29 November 2003
 @set UPDATED-MONTH November 2003
 @set EDITION 1.7g
 @set VERSION 1.7g
index d9d0977039254084fb715e05287267468957a757..0cd72cced021f26ec1e913e88b7063bd0263a696 100644 (file)
@@ -1323,13 +1323,14 @@ sub _do_recursive_traversal ($$&&$$)
                  $to = $3;
                  $from = quotemeta $2;
                }
-             push @_substfroms, $from;
-             push @_substtos, $to;
 
              my $subvar = var ($subvarname);
              # Don't recurse into undefined variables.
              next unless $subvar;
 
+             push @_substfroms, $from;
+             push @_substtos, $to;
+
              my @res = $subvar->_do_recursive_traversal ($parent,
                                                          $fun_item,
                                                          $fun_collect,
index a5284cb152c6ac6470efdc1b8c11224e82cc71c2..0234298f63baa8b0dfd3e785af3f849b925045cc 100644 (file)
@@ -445,6 +445,7 @@ subpkg2.test \
 subst.test \
 subst2.test \
 substref.test \
+substre2.test \
 substtarg.test \
 suffix.test \
 suffix2.test \
index df3c4a15fcaf0d702cb06e659a7a517f7b59305b..955568d13d6ac70a89c0530a6fde965731ec8611 100644 (file)
@@ -559,6 +559,7 @@ subpkg2.test \
 subst.test \
 subst2.test \
 substref.test \
+substre2.test \
 substtarg.test \
 suffix.test \
 suffix2.test \
diff --git a/tests/substre2.test b/tests/substre2.test
new file mode 100755 (executable)
index 0000000..e67b736
--- /dev/null
@@ -0,0 +1,55 @@
+#! /bin/sh
+# Copyright (C) 2003  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Test for bug in variable substitution references, where
+# undefined variables break later substitutions.
+
+required=gcc
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+
+foo = foo.a foo.b $(doesnt_exist)
+bar = bar.a bar.b
+var1 = $(foo:.a=1.c) $(doesnt_exist:.b=2.c) $(bar:.a=3.c)
+var2 = $(var1:.b=4.c)
+
+bin_PROGRAMS = foo
+foo_SOURCES = $(var2)
+
+OBJEXT = obj
+echorule:
+       @echo BEG: $(foo_OBJECTS) :END
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+$MAKE echorule >output
+cat output
+grep 'BEG: foo1.obj foo4.obj bar3.obj bar4.obj :END' output
This page took 0.037588 seconds and 5 git commands to generate.