* Fix test suite on DOS (PR/1344)
authorPaul Smith <psmith@gnu.org>
Fri, 8 Oct 1999 06:32:24 +0000 (06:32 +0000)
committerPaul Smith <psmith@gnu.org>
Fri, 8 Oct 1999 06:32:24 +0000 (06:32 +0000)
* Fix target-specific vars bug (PR/1378)

ChangeLog
tests/ChangeLog
tests/scripts/features/targetvars
variable.c

index e3b31667ba32fd61de5c4a577634d4c1d44bc56d..69917cf6c35d343bb7d451f2c146cc4bb94729ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+1999-10-08  Paul D. Smith  <psmith@gnu.org>
+
+       * variable.c (initialize_file_variables): Always recurse to
+       initialize the parent's file variables: the parent might not have
+       any rules to run so it might not have been initialized before
+       this--we need this to set up the chain properly for
+       target-specific variables.
+
 1999-09-23  Paul D. Smith  <psmith@gnu.org>
 
        * Version 3.78.1 released.
index 871cab98477d0bde8527a275f0ebd02b94239ef9..ef2ef625e2075506ec1b357e0d4da9c09c0fe709 100644 (file)
@@ -1,3 +1,8 @@
+1999-10-08  Paul D. Smith  <psmith@gnu.org>
+
+       * scripts/features/targetvars: Add a check for PR/1378:
+       "Target-specific vars don't inherit correctly"
+
 1999-09-29  Paul D. Smith  <psmith@gnu.org>
 
        * test_driver.pl (get_osname): Change $fancy_file_names to
index e9fe09206a89d0245a1d17777fb79b7416f286a7..83bf9edffaa7f544e7224117e194898cc7533868 100644 (file)
@@ -105,4 +105,24 @@ $answer = "qvar = qvar\nqvar =\n";
 &compare_output($answer,&get_logfile(1));
 
 
+# TEST #8
+# For PR/1378: Target-specific vars don't inherit correctly
+
+$makefile2 = &get_tmpfile;
+
+open(MAKEFILE,"> $makefile2");
+print MAKEFILE <<'EOF';
+foo: FOO = foo
+bar: BAR = bar
+foo: bar
+bar: baz
+baz: ; @echo $(FOO) $(BAR)
+EOF
+close(MAKEFILE);
+
+&run_make_with_options("$makefile2", "", &get_logfile);
+$answer = "foo bar\n";
+&compare_output($answer, &get_logfile(1));
+
+
 1;
index 377daf59ea8171bae7114b4dc89469aff128ff20..4eebb3744d1330a93ed3dca9130d718146bfb72c 100644 (file)
@@ -238,8 +238,7 @@ initialize_file_variables (file)
     l->next = &global_setlist;
   else
     {
-      if (file->parent->variables == 0)
-       initialize_file_variables (file->parent);
+      initialize_file_variables (file->parent);
       l->next = file->parent->variables;
     }
 }