* A few script fixes and updates for 3.78.
authorPaul Smith <psmith@gnu.org>
Fri, 17 Sep 1999 03:15:37 +0000 (03:15 +0000)
committerPaul Smith <psmith@gnu.org>
Fri, 17 Sep 1999 03:15:37 +0000 (03:15 +0000)
17 files changed:
ChangeLog
Makefile.DOS.template
NEWS
README.DOS.template
TODO.private
configure.in
main.c
tests/ChangeLog
tests/run_make_tests.pl
tests/scripts/features/default_names
tests/scripts/features/reinvoke
tests/scripts/functions/foreach
tests/scripts/functions/origin
tests/scripts/options/dash-l
tests/scripts/options/dash-n
tests/scripts/variables/MAKECMDGOALS
tests/test_driver.pl

index 5c84a1ec28878172fa10980bd211da48559f627e..25c432dcabd913513f5f737486399e972954e892 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+1999-09-17  Paul D. Smith  <psmith@gnu.org>
+
+       * Version 3.78 released.
+
+1999-09-16  Paul D. Smith  <psmith@gnu.org>
+
+       * main.c (define_makeflags): Zero out FLAGSTRING to avoid
+       uninitialized memory reads when checking *p != '-' in the loop.
+
 1999-09-15  Paul D. Smith  <psmith@gnu.org>
 
        * Version 3.77.97 released.
index 80cb22a111c7660c3e3c9659b4778ffb4dd6278a..7970c929b963e388df58f5ac100f387cc293a469 100644 (file)
@@ -471,10 +471,14 @@ dist-hook:
 # Note: check-loadavg is NOT a prerequisite of check-local, since
 # there's no uptime utility, and the test it does doesn't make sense
 # on MSDOS anyway.
-check-local: check-loadavg check-regression
-       @echo "=========================" \
-       echo "Regression passed: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC)"; \
-       echo "========================="
+check-local: check-shell check-regression
+       @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
+       dashes=`echo "$$banner" | sed s/./=/g`; \
+       echo; \
+       echo "$$dashes"; \
+       echo "$$banner"; \
+       echo "$$dashes"; \
+       echo
 
 .PHONY: check-loadavg check-shell check-regression
 
diff --git a/NEWS b/NEWS
index 3f775fd5aeafb7087d00ae2304a5fd442ee16bd2..6cc6fb95beb3acb40fe7ad07b810b5bc7635292d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 GNU make NEWS                                               -*-indented-text-*-
   History of user-visible changes.
-  21 Jul 1999
+  17 Sep 1999
 
 Copyright (C) 1992,93,94,95,96,97,98,1999 Free Software Foundation, Inc.
 See the end for copying conditions.
@@ -9,6 +9,8 @@ All changes mentioned here are more fully described in the GNU make
 manual, which is contained in this distribution as the file make.texinfo.
 
 Please send GNU make bug reports to bug-make@gnu.org.
+See the README file and the GNU make manual for details on sending bug
+reports.
 \f
 Version 3.78
 
index 40a6cbf62541eeeb0d1476e0f1310d39becfc925..4d78677129856bcfb22bcfffc316bec83e55bd06 100644 (file)
@@ -104,8 +104,8 @@ To build:
       and `rm' programs (the latter from Fileutils).
 
    8. To run the test suite, type "make check".  This requires a Unix
-      shell (I used the DJGPP port of Bash 2.03), Perl, Fileutils and
-      Sh-utils.
+      shell (I used the DJGPP port of Bash 2.03), Perl, Sed, Fileutils
+      and Sh-utils.
 
 
 Notes:
index ea2c99ec41f0014dc9cbcb0313de7985c134c969..5af0544940054f1a153d1c269a7a5d17d98e446d 100644 (file)
@@ -36,9 +36,6 @@ feel free to make whatever changes you like to the current tests, given
 some high-level goals, and that you'll port the current tests to
 whatever you do :).
 
-If someone does this work I'll be able to start including the test suite
-with make itself, which would be very cool.
-
 
 The Rest of the List
 --------------------
@@ -60,6 +57,8 @@ The Rest of the List
      that's OK.  I have paperwork for their work so if you want to do
      this one talk to me to get what they've already done.
 
+     [K R Praveen <praveen@cair.res.in>]
+
  3) Currently you can use "%.foo %.bar : %.baz" to mean that one
     invocation of the rule builds both targets.  GNU make needs a way to
     do that for explicit rules, too.  I heard a rumor that some versions
index ff594d4e5e55cf4bc614a53f220103bf66e2b904..27686532b3d63a296d9ecf4f9536ed8bce4d800a 100644 (file)
@@ -3,7 +3,7 @@ AC_REVISION([$Id$])
 AC_PREREQ(2.13)dnl             dnl Minimum Autoconf version required.
 AC_INIT(vpath.c)dnl            dnl A distinctive file to look for in srcdir.
 
-AM_INIT_AUTOMAKE(make, 3.77.97)
+AM_INIT_AUTOMAKE(make, 3.78)
 AM_CONFIG_HEADER(config.h)
 
 dnl Regular configure stuff
diff --git a/main.c b/main.c
index 0810a9259de6d813d91db0a1992d86c80cb482d7..132421bfa7fb9686d958408296fd1b53e0d7ab36 100644 (file)
--- a/main.c
+++ b/main.c
@@ -2403,6 +2403,7 @@ define_makeflags (all, makefile)
   /* Construct the value in FLAGSTRING.
      We allocate enough space for a preceding dash and trailing null.  */
   flagstring = (char *) alloca (1 + flagslen + 1);
+  bzero (flagstring, 1 + flagslen + 1);
   p = flagstring;
   words = 1;
   *p++ = '-';
index dd763b1ba620bb6886596bd346b0033db0390e42..b40612f68cd8723a44d0a4685410195dc2c7e1dc 100644 (file)
@@ -1,14 +1,45 @@
+1999-09-16  Paul D. Smith  <psmith@gnu.org>
+
+       * scripts/features/reinvoke: Remove invocations of "touch" in
+       makefiles.  See the comments on the touch function rewrite below.
+       Note that UNIX touch behaves the same way if the file already
+       exists: it sets the time to the _local_ time.  We don't want
+       this.  This is probably a good tip for makefile writers in
+       general, actually... where practical.
+       * scripts/options/dash-l: Ditto.
+       * scripts/options/dash-n: Ditto.
+
+       * test_driver.pl (run_each_test): In retrospect, I don't like the
+       .lN/.bN/.dN postfix required by DOS.  So, for non-DOS systems I
+       changed it back to use .log, .base, and .diff.
+
+       * run_make_tests.pl (set_more_defaults): Move the check for the
+       make pathname to here from set_defaults (that's too early since it
+       happens before the command line processing).
+       Create a new variable $port_type, calculated from $osname, to
+       specify what kind of system we're running on.  We should integrate
+       the VOS stuff here, too.
+       (valid_option): Comment out the workdir/-work stuff so people
+       won't be fooled into thinking it works... someone needs to fix
+       this, though!
+
+       * scripts/functions/origin: Use $port_type instead of $osname.
+       * scripts/functions/foreach: Ditto.
+       * scripts/features/default_names: Ditto.
+
 1999-09-15  Paul D. Smith  <psmith@gnu.org>
 
        * test_driver.pl (touch): Rewrite this function.  Previously it
        used to use utime() to hard-set the time based on the current
-       local clock.  This fails badly on networked filesystems where the
-       FS server clock is skewed from the local clock: normally modifying
-       a file causes it to get a mod time based on the _server's_ clock.
-       Hard-setting it based on the _local_ clock causes gratuitous
-       errors and makes the tests unreliable except on local filesystems.
-       The new function will simply modify the file, allowing the
-       filesystem to set the mod time as it sees fit.
+       local clock, or, if the file didn't exist, it merely created it.
+       This mirrors exactly what real UNIX touch does, but it fails badly
+       on networked filesystems where the FS server clock is skewed from
+       the local clock: normally modifying a file causes it to get a mod
+       time based on the _server's_ clock.  Hard-setting it based on the
+       _local_ clock causes gratuitous errors and makes the tests
+       unreliable except on local filesystems.  The new function will
+       simply modify the file, allowing the filesystem to set the mod
+       time as it sees fit.
 
        * scripts/features/parallelism: The second test output could
        change depending on how fast some scripts completed; use "sleep"
index 484dbe1d99c1902a5ddf2b0acf266ca7b67ab29f..4130b3d060603c4c2a242a4c101d98e4d64acde0 100755 (executable)
@@ -9,7 +9,6 @@
 #                         [-verbose]
 #                         [-keep]
 #                         [-make <make prog>]
-#                         [-work <work dir>]
 #                        (and others)
 
 require "test_driver.pl";
@@ -27,11 +26,14 @@ sub valid_option
       }
       return 1;
    }
-   elsif ($option =~ /^-work([-_]?dir)?$/)
-   {
-      $workdir = shift @argv;
-      return 1;
-   }
+
+# This doesn't work--it _should_!  Someone needs to fix this badly.
+#
+#   elsif ($option =~ /^-work([-_]?dir)?$/)
+#   {
+#      $workdir = shift @argv;
+#      return 1;
+#   }
 
    return 0;
 }
@@ -120,16 +122,6 @@ sub set_defaults
    $make_path = "make";
    $tmpfilesuffix = "mk";
    $pwd = &get_this_pwd;
-
-   # Find the full pathname of Make.  For DOS systems this is more
-   # complicated, so we ask make itself.
-
-   open(MAKEFILE,"> makefile.tmp");
-   print MAKEFILE 'all: ; @echo $(MAKE)' . "\n";
-   close(MAKEFILE);
-   $make_path = `$make_path -f makefile.tmp`;
-   chop $make_path;
-   unlink "makefile.tmp";
 }
 
 sub set_more_defaults
@@ -137,6 +129,36 @@ sub set_more_defaults
    local($string);
    local($index);
 
+   # find the type of the port.  We do this up front to have a single
+   # point of change if it needs to be tweaked.
+   #
+   # This is probably not specific enough.
+   #
+   if ($osname =~ /Windows/i) {
+     $port_type = 'W32';
+   }
+   # Bleah, the osname is so variable on DOS.  This kind of bites.
+   # Well, as far as I can tell if we check for some text at the
+   # beginning of the line with either no spaces or a single space, then
+   # a D, then either "OS", "os", or "ev" and a space.  That should
+   # match and be pretty specific.
+   elsif ($osname =~ /^([^ ]*|[^ ]* [^ ]*)D(OS|os|ev) /) {
+     $port_type = 'DOS';
+   }
+   # Everything else, right now, is UNIX.  Note that we should integrate
+   # the VOS support into this as well and get rid of $vos; we'll do
+   # that next time.
+   else {
+     $port_type = 'UNIX';
+   }
+
+   # Find the full pathname of Make.  For DOS systems this is more
+   # complicated, so we ask make itself.
+
+   $make_path = `sh -c 'echo "all:;\@echo \$(MAKE)" | $make_path -f-'`;
+   chop $make_path;
+   print "Make\t= `$make_path'\n" if $debug;
+
    $string = `$make_path -v -f /dev/null 2> /dev/null`;
 
    $string =~ /^(GNU Make [^,\n]*)/;
index 824f889b28fa07360ff8367a222d8ca1dd4278f0..501f1fc9b8ffe9b60c3ea842042e430c9a324028 100644 (file)
@@ -1,3 +1,5 @@
+#                                                                    -*-perl-*-
+
 $description = "This script tests to make sure that Make looks for
 default makefiles in the correct order (GNUmakefile,makefile,Makefile)";
 
@@ -13,7 +15,7 @@ close(MAKEFILE);
 # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
 # Just test what we can here (avoid Makefile versus makefile test).
 #
-if ($osname !~ /DOS|Windows/i)
+if ($port_type eq 'UNIX')
 {
   # Create another makefile called "makefile"
   open(MAKEFILE,"> makefile");
@@ -45,7 +47,7 @@ unlink $makefile;
 # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
 # Just test what we can here (avoid Makefile versus makefile test).
 #
-if ($osname !~ /DOS|Windows/i)
+if ($port_type eq 'UNIX')
 {
   $answer = "It chose makefile\n";
 
index 99fb46644611397133347279f1d201066d593b40..713580c5f2df7571afb65ae5aa609773fe376065 100644 (file)
@@ -18,7 +18,7 @@ all: ; \@echo 'running rules.'
 
 $makefile $makefile2: $makefile_orig
        \@echo 'rebuilding \$\@.'
-       \@touch \$\@
+       \@echo >> \$\@
 
 include $makefile2
 
@@ -54,11 +54,11 @@ SHELL = /bin/sh
 
 all: ; @echo hello
 
-a : b ; touch $@
+a : b ; echo >> $@
 
-b : c ; [ -f $@ ] || touch $@
+b : c ; [ -f $@ ] || echo >> $@
 
-c: ; touch $@
+c: ; echo >> $@
 
 include $(F)
 EOM
@@ -74,7 +74,7 @@ sleep(2);
 
 &run_make_with_options($makefile3, "F=a", &get_logfile, 0);
 
-$answer = "[ -f b ] || touch b\nhello\n";
+$answer = "[ -f b ] || echo >> b\nhello\n";
 &compare_output($answer,&get_logfile(1));
 
 # Now try with the file we're not updating being the actual file we're
@@ -82,7 +82,7 @@ $answer = "[ -f b ] || touch b\nhello\n";
 
 &run_make_with_options($makefile3, "F=b", &get_logfile, 0);
 
-$answer = "[ -f b ] || touch b\nhello\n";
+$answer = "[ -f b ] || echo >> b\nhello\n";
 &compare_output($answer,&get_logfile(1));
 
 unlink('a','b','c');
index 0c63c474d63fb282ab6b81fd0d21d0ffa50e2e7a..b80751b29aaa3135f5b7e7f35d959417ad5fcb13 100644 (file)
@@ -20,7 +20,7 @@ open(MAKEFILE,"> $makefile");
 
 # On WIN32 systems, the user's path is found in %Path% ($Path)
 #
-$pathvar = (($osname =~ /Windows/i) ? "Path" : "PATH");
+$pathvar = (($port_type eq 'Windows') ? "Path" : "PATH");
 
 print MAKEFILE <<EOF;
 foo = bletch null \@ garf
index 721d92828699c6720cf0a07ac3e4dff3b1460019..eab2d78794c32e1dae511eac8f87a0d76e0619ae 100644 (file)
@@ -15,12 +15,13 @@ defined per the following list:
 'override'             defined by override in makefile
 'automatic'            Automatic variable\n";
 
-# On WIN32 systems, HOME is meaningless. SystemRoot should be defined though.
-# With DJGPP, HOME is not guaranteed to be defined.  Use DJDIR instead.
+# On WIN32 systems, HOME is meaningless. SystemRoot should be defined
+# though.  With DJGPP, HOME is not guaranteed to be defined.  Use DJDIR
+# instead.
 #
-$homevar = (($osname =~ /Windows/i)
-           ? "SystemRoot"
-           : (($osname =~ /DOS/i) ? "DJDIR" : "HOME"));
+$homevar = (($port_type eq 'Windows') ? "SystemRoot"
+           : (($port_type eq 'DOS') ? "DJDIR"
+              : "HOME"));
 
 open(MAKEFILE,"> $makefile");
 
index 445b8696bb5fe45e096dc98c4e04be3d798e27ae..58216f9fb19eb185623ad635f48bb1034138b723 100644 (file)
@@ -25,7 +25,7 @@ SHELL = /bin/sh
 
 define test
 if [ ! -f test-file ]; then \
-  touch test-file; sleep 2; rm -f test-file; \
+  echo >> test-file; sleep 2; rm -f test-file; \
 else \
   echo $@ FAILED; \
 fi
index 97dac7a713e22eca82b28102638ac0b86be15ad2..c1f4aab8ea21ddc5784832f592644dc5d3134485 100644 (file)
@@ -9,8 +9,8 @@ open(MAKEFILE, "> $makefile");
 
 print MAKEFILE <<'EOMAKE';
 
-final: intermediate ; touch $@
-intermediate: orig ; touch $@
+final: intermediate ; echo >> $@
+intermediate: orig ; echo >> $@
 
 EOMAKE
 
@@ -19,11 +19,11 @@ close(MAKEFILE);
 &touch('orig');
 
 &run_make_with_options($makefile, "", &get_logfile);
-$answer = "touch intermediate\ntouch final\n";
+$answer = "echo >> intermediate\necho >> final\n";
 &compare_output($answer, &get_logfile(1));
 
 &run_make_with_options($makefile, "-Worig -n", &get_logfile);
-$answer = "touch intermediate\ntouch final\n";
+$answer = "echo >> intermediate\necho >> final\n";
 &compare_output($answer, &get_logfile(1));
 
 unlink('orig', 'intermediate', 'final');
index ec333586185a8a97ae1ad034c2105e4802af9d5f..879283b056714f52e1e0aa6e8a7e9442dbc52f04 100644 (file)
@@ -1,4 +1,6 @@
-$description = "The following test creates a makefile to test the MAKECMDGOALS variable.";
+#                                                                    -*-perl-*-
+
+$description = "Test the MAKECMDGOALS variable.";
 
 $details = "\
 We construct a makefile with various targets, all of which print out
index 001d2477d5f92aa65f4924bc44916df57f6216f9..8e3881365c7f6f77c5da2d8f1b179965d16c854b 100644 (file)
@@ -153,7 +153,7 @@ sub toplevel
   {
     print "\n$num_failed Test";
     print "s" unless $num_failed == 1;
-    print " Failed (See .diff files in $workdir dir for details) :-(\n\n";
+    print " Failed (See .$diffext files in $workdir dir for details) :-(\n\n";
     return 0;
   }
   else
@@ -363,9 +363,21 @@ sub run_each_test
     $testpath = "$workpath$pathsep$testname";
     # Leave enough space in the extensions to append a number, even
     # though it needs to fit into 8+3 limits.
-    $log_filename = "$testpath.l";
-    $diff_filename = "$testpath.d";
-    $base_filename = "$testpath.b";
+    if ($port_host eq 'DOS') {
+      $logext = 'l';
+      $diffext = 'd';
+      $baseext = 'b';
+      $extext = '';
+   }
+    else {
+      $logext = 'log';
+      $diffext = 'diff';
+      $baseext = 'base';
+      $extext = '.';
+    }
+    $log_filename = "$testpath.$logext";
+    $diff_filename = "$testpath.$diffext";
+    $base_filename = "$testpath.$baseext";
     $tmp_filename = "$testpath.$tmpfilesuffix";
 
     &setup_for_test;          # suite-defined
@@ -602,7 +614,7 @@ sub compare_output
       print "\nCreating Difference File ...\n";
     }
     # Create the difference file
-    local($command) = "diff -u " . &get_basefile . " " . $logfile;
+    local($command) = "diff -c " . &get_basefile . " " . $logfile;
     &run_command_with_output(&get_difffile,$command);
 
     return 0;
@@ -1030,7 +1042,7 @@ sub num_suffix
   local($num) = @_;
 
   if (--$num > 0) {
-    return "$num";
+    return "$extext$num";
   }
 
   return "";