* A few script fixes and updates for 3.78.

This commit is contained in:
Paul Smith 1999-09-17 03:15:37 +00:00
parent 45e04a5860
commit a63f51340b
17 changed files with 145 additions and 60 deletions

View file

@ -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> 1999-09-15 Paul D. Smith <psmith@gnu.org>
* Version 3.77.97 released. * Version 3.77.97 released.

View file

@ -471,10 +471,14 @@ dist-hook:
# Note: check-loadavg is NOT a prerequisite of check-local, since # 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 # there's no uptime utility, and the test it does doesn't make sense
# on MSDOS anyway. # on MSDOS anyway.
check-local: check-loadavg check-regression check-local: check-shell check-regression
@echo "=========================" \ @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
echo "Regression passed: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC)"; \ dashes=`echo "$$banner" | sed s/./=/g`; \
echo "=========================" echo; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"; \
echo
.PHONY: check-loadavg check-shell check-regression .PHONY: check-loadavg check-shell check-regression

4
NEWS
View file

@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*- GNU make NEWS -*-indented-text-*-
History of user-visible changes. 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. Copyright (C) 1992,93,94,95,96,97,98,1999 Free Software Foundation, Inc.
See the end for copying conditions. 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. manual, which is contained in this distribution as the file make.texinfo.
Please send GNU make bug reports to bug-make@gnu.org. 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.
Version 3.78 Version 3.78

View file

@ -104,8 +104,8 @@ To build:
and `rm' programs (the latter from Fileutils). and `rm' programs (the latter from Fileutils).
8. To run the test suite, type "make check". This requires a Unix 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 shell (I used the DJGPP port of Bash 2.03), Perl, Sed, Fileutils
Sh-utils. and Sh-utils.
Notes: Notes:

View 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 some high-level goals, and that you'll port the current tests to
whatever you do :). 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 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 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. 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 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 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 do that for explicit rules, too. I heard a rumor that some versions

View file

@ -3,7 +3,7 @@ AC_REVISION([$Id$])
AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required. AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required.
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir. 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) AM_CONFIG_HEADER(config.h)
dnl Regular configure stuff dnl Regular configure stuff

1
main.c
View file

@ -2403,6 +2403,7 @@ define_makeflags (all, makefile)
/* Construct the value in FLAGSTRING. /* Construct the value in FLAGSTRING.
We allocate enough space for a preceding dash and trailing null. */ We allocate enough space for a preceding dash and trailing null. */
flagstring = (char *) alloca (1 + flagslen + 1); flagstring = (char *) alloca (1 + flagslen + 1);
bzero (flagstring, 1 + flagslen + 1);
p = flagstring; p = flagstring;
words = 1; words = 1;
*p++ = '-'; *p++ = '-';

View 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> 1999-09-15 Paul D. Smith <psmith@gnu.org>
* test_driver.pl (touch): Rewrite this function. Previously it * test_driver.pl (touch): Rewrite this function. Previously it
used to use utime() to hard-set the time based on the current used to use utime() to hard-set the time based on the current
local clock. This fails badly on networked filesystems where the local clock, or, if the file didn't exist, it merely created it.
FS server clock is skewed from the local clock: normally modifying This mirrors exactly what real UNIX touch does, but it fails badly
a file causes it to get a mod time based on the _server's_ clock. on networked filesystems where the FS server clock is skewed from
Hard-setting it based on the _local_ clock causes gratuitous the local clock: normally modifying a file causes it to get a mod
errors and makes the tests unreliable except on local filesystems. time based on the _server's_ clock. Hard-setting it based on the
The new function will simply modify the file, allowing the _local_ clock causes gratuitous errors and makes the tests
filesystem to set the mod time as it sees fit. 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 * scripts/features/parallelism: The second test output could
change depending on how fast some scripts completed; use "sleep" change depending on how fast some scripts completed; use "sleep"

View file

@ -9,7 +9,6 @@
# [-verbose] # [-verbose]
# [-keep] # [-keep]
# [-make <make prog>] # [-make <make prog>]
# [-work <work dir>]
# (and others) # (and others)
require "test_driver.pl"; require "test_driver.pl";
@ -27,11 +26,14 @@ sub valid_option
} }
return 1; return 1;
} }
elsif ($option =~ /^-work([-_]?dir)?$/)
{ # This doesn't work--it _should_! Someone needs to fix this badly.
$workdir = shift @argv; #
return 1; # elsif ($option =~ /^-work([-_]?dir)?$/)
} # {
# $workdir = shift @argv;
# return 1;
# }
return 0; return 0;
} }
@ -120,16 +122,6 @@ sub set_defaults
$make_path = "make"; $make_path = "make";
$tmpfilesuffix = "mk"; $tmpfilesuffix = "mk";
$pwd = &get_this_pwd; $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 sub set_more_defaults
@ -137,6 +129,36 @@ sub set_more_defaults
local($string); local($string);
local($index); 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 = `$make_path -v -f /dev/null 2> /dev/null`;
$string =~ /^(GNU Make [^,\n]*)/; $string =~ /^(GNU Make [^,\n]*)/;

View file

@ -1,3 +1,5 @@
# -*-perl-*-
$description = "This script tests to make sure that Make looks for $description = "This script tests to make sure that Make looks for
default makefiles in the correct order (GNUmakefile,makefile,Makefile)"; 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. # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
# Just test what we can here (avoid Makefile versus makefile test). # 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" # Create another makefile called "makefile"
open(MAKEFILE,"> makefile"); open(MAKEFILE,"> makefile");
@ -45,7 +47,7 @@ unlink $makefile;
# DOS/WIN32 platforms preserve case, but Makefile is the same file as 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). # 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"; $answer = "It chose makefile\n";

View file

@ -18,7 +18,7 @@ all: ; \@echo 'running rules.'
$makefile $makefile2: $makefile_orig $makefile $makefile2: $makefile_orig
\@echo 'rebuilding \$\@.' \@echo 'rebuilding \$\@.'
\@touch \$\@ \@echo >> \$\@
include $makefile2 include $makefile2
@ -54,11 +54,11 @@ SHELL = /bin/sh
all: ; @echo hello all: ; @echo hello
a : b ; touch $@ a : b ; echo >> $@
b : c ; [ -f $@ ] || touch $@ b : c ; [ -f $@ ] || echo >> $@
c: ; touch $@ c: ; echo >> $@
include $(F) include $(F)
EOM EOM
@ -74,7 +74,7 @@ sleep(2);
&run_make_with_options($makefile3, "F=a", &get_logfile, 0); &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)); &compare_output($answer,&get_logfile(1));
# Now try with the file we're not updating being the actual file we're # 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); &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)); &compare_output($answer,&get_logfile(1));
unlink('a','b','c'); unlink('a','b','c');

View file

@ -20,7 +20,7 @@ open(MAKEFILE,"> $makefile");
# On WIN32 systems, the user's path is found in %Path% ($Path) # 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; print MAKEFILE <<EOF;
foo = bletch null \@ garf foo = bletch null \@ garf

View file

@ -15,12 +15,13 @@ defined per the following list:
'override' defined by override in makefile 'override' defined by override in makefile
'automatic' Automatic variable\n"; 'automatic' Automatic variable\n";
# On WIN32 systems, HOME is meaningless. SystemRoot should be defined though. # On WIN32 systems, HOME is meaningless. SystemRoot should be defined
# With DJGPP, HOME is not guaranteed to be defined. Use DJDIR instead. # though. With DJGPP, HOME is not guaranteed to be defined. Use DJDIR
# instead.
# #
$homevar = (($osname =~ /Windows/i) $homevar = (($port_type eq 'Windows') ? "SystemRoot"
? "SystemRoot" : (($port_type eq 'DOS') ? "DJDIR"
: (($osname =~ /DOS/i) ? "DJDIR" : "HOME")); : "HOME"));
open(MAKEFILE,"> $makefile"); open(MAKEFILE,"> $makefile");

View file

@ -25,7 +25,7 @@ SHELL = /bin/sh
define test define test
if [ ! -f test-file ]; then \ if [ ! -f test-file ]; then \
touch test-file; sleep 2; rm -f test-file; \ echo >> test-file; sleep 2; rm -f test-file; \
else \ else \
echo $@ FAILED; \ echo $@ FAILED; \
fi fi

View file

@ -9,8 +9,8 @@ open(MAKEFILE, "> $makefile");
print MAKEFILE <<'EOMAKE'; print MAKEFILE <<'EOMAKE';
final: intermediate ; touch $@ final: intermediate ; echo >> $@
intermediate: orig ; touch $@ intermediate: orig ; echo >> $@
EOMAKE EOMAKE
@ -19,11 +19,11 @@ close(MAKEFILE);
&touch('orig'); &touch('orig');
&run_make_with_options($makefile, "", &get_logfile); &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)); &compare_output($answer, &get_logfile(1));
&run_make_with_options($makefile, "-Worig -n", &get_logfile); &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)); &compare_output($answer, &get_logfile(1));
unlink('orig', 'intermediate', 'final'); unlink('orig', 'intermediate', 'final');

View file

@ -1,4 +1,6 @@
$description = "The following test creates a makefile to test the MAKECMDGOALS variable."; # -*-perl-*-
$description = "Test the MAKECMDGOALS variable.";
$details = "\ $details = "\
We construct a makefile with various targets, all of which print out We construct a makefile with various targets, all of which print out

View file

@ -153,7 +153,7 @@ sub toplevel
{ {
print "\n$num_failed Test"; print "\n$num_failed Test";
print "s" unless $num_failed == 1; 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; return 0;
} }
else else
@ -363,9 +363,21 @@ sub run_each_test
$testpath = "$workpath$pathsep$testname"; $testpath = "$workpath$pathsep$testname";
# Leave enough space in the extensions to append a number, even # Leave enough space in the extensions to append a number, even
# though it needs to fit into 8+3 limits. # though it needs to fit into 8+3 limits.
$log_filename = "$testpath.l"; if ($port_host eq 'DOS') {
$diff_filename = "$testpath.d"; $logext = 'l';
$base_filename = "$testpath.b"; $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"; $tmp_filename = "$testpath.$tmpfilesuffix";
&setup_for_test; # suite-defined &setup_for_test; # suite-defined
@ -602,7 +614,7 @@ sub compare_output
print "\nCreating Difference File ...\n"; print "\nCreating Difference File ...\n";
} }
# Create the difference file # 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); &run_command_with_output(&get_difffile,$command);
return 0; return 0;
@ -1030,7 +1042,7 @@ sub num_suffix
local($num) = @_; local($num) = @_;
if (--$num > 0) { if (--$num > 0) {
return "$num"; return "$extext$num";
} }
return ""; return "";