* Various changes and fixes. See ChangeLog.

This commit is contained in:
Paul Smith 1999-12-08 20:13:50 +00:00
parent 4d5c556f00
commit 1a35bfb45b
12 changed files with 209 additions and 69 deletions

View File

@ -1,3 +1,30 @@
1999-12-08 Paul D. Smith <psmith@gnu.org>
* dir.c (dir_setup_glob): On 64 bit ReliantUNIX (5.44 and above)
in LFS mode, stat() is actually a macro for stat64(). Assignment
doesn't work in that case. So, stat is a macro, make a local
wrapper function to invoke it.
(local_stat): Wrapper function, if needed.
Reported by Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>.
1999-12-02 Paul D. Smith <psmith@gnu.org>
* remake.c (update_file): Move the considered test outside the
double-colon loop, _but_ make sure we test the double_colon target
not the "current" target. If we stop early because one
double-colon target is running, mark all the rest considered and
try to start their prerequisites (so they're marked considered).
Fix for PR/1476 suggested by Tim Magill <tim.magill@telops.gte.com>.
1999-11-22 Rob Tulloh <rob_tulloh@dev.tivoli.com>
* function.c (windows32_openpipe, func_shell): Correct Windows32
problem where $(shell nosuchfile) would incorrectly exit make. The
fix is to print the error and let make continue.
Reported by David Masterson <David.Masterson@kla-tencor.com>.
* w32/subproc/misc.c (arr2envblk): Memory leak fix.
1999-11-21 Paul D. Smith <psmith@gnu.org> 1999-11-21 Paul D. Smith <psmith@gnu.org>
Rework GNU make debugging to provide different levels of output. Rework GNU make debugging to provide different levels of output.
@ -9,6 +36,12 @@
debug_flag with invocations of debugging macros. debug_flag with invocations of debugging macros.
* make.h: Remove debug_flag and DEBUGPR, add db_level. * make.h: Remove debug_flag and DEBUGPR, add db_level.
1999-11-18 Paul Eggert <eggert@twinsun.com>
* acinclude.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a problem
with the QNX 4.25 shell, which doesn't propagate exit status of
failed commands inside shell assignments.
1999-11-17 Paul D. Smith <psmith@gnu.org> 1999-11-17 Paul D. Smith <psmith@gnu.org>
* function.c (func_if): Find the end of the arg list by testing * function.c (func_if): Find the end of the arg list by testing

View File

@ -8,7 +8,7 @@ make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c \
rule.c implicit.c default.c variable.c expand.c function.c \ rule.c implicit.c default.c variable.c expand.c function.c \
vpath.c version.c ar.c arscan.c remote-$(REMOTE).c \ vpath.c version.c ar.c arscan.c remote-$(REMOTE).c \
commands.h dep.h filedef.h job.h make.h rule.h variable.h \ commands.h dep.h filedef.h job.h make.h rule.h variable.h \
signame.c signame.h \ debug.h signame.c signame.h \
getopt.c getopt1.c getopt.h getopt.c getopt1.c getopt.h
make_LDADD = $(LIBOBJS) @ALLOCA@ $(GLOBLIB) make_LDADD = $(LIBOBJS) @ALLOCA@ $(GLOBLIB)

10
NEWS
View File

@ -32,11 +32,11 @@ Version 3.79
makefile is always run serially regardless of the value of -j. Any makefile is always run serially regardless of the value of -j. Any
submakes will still be run in parallel if -j was specified. submakes will still be run in parallel if -j was specified.
* The -d (--debug) option has changed: it now takes an optional numeric * The -d (--debug) option has changed: it now allows optional flags
argument. By default only a minimal set of debugging output is controlling the amount and type of debugging output. By default only
generated, displaying information about what "normal" files (not a minimal amount information is generated, displaying the names of
makefiles) were deemed out of date and in need of being rebuilt. "normal" targets (not makefiles) were deemed out of date and in need
Various values control the amount of detail in the debugging output. of being rebuilt.
Version 3.78 Version 3.78

View File

@ -101,7 +101,10 @@ dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
AC_DEFUN(AC_SYS_LARGEFILE_FLAGS, AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
[AC_CACHE_CHECK([for $1 value to request large file support], [AC_CACHE_CHECK([for $1 value to request large file support],
ac_cv_sys_largefile_$1, ac_cv_sys_largefile_$1,
[ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || { [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2
then
ac_cv_sys_largefile_$1=`cat conftest.1`
else
ac_cv_sys_largefile_$1=no ac_cv_sys_largefile_$1=no
ifelse($1, CFLAGS, ifelse($1, CFLAGS,
[case "$host_os" in [case "$host_os" in
@ -127,7 +130,8 @@ changequote([, ])dnl
AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
CC="$ac_save_CC" CC="$ac_save_CC"
fi]) fi])
}])]) fi
rm -f conftest*])])
dnl Internal subroutine of AC_SYS_LARGEFILE. dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL) dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)

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.78.1) AM_INIT_AUTOMAKE(make, 3.78.90a)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
dnl Regular configure stuff dnl Regular configure stuff

View File

@ -1,5 +1,5 @@
/* Builtin function expansion for GNU Make. /* Builtin function expansion for GNU Make.
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc. Copyright (C) 1988,1989,1991-1997,1999 Free Software Foundation, Inc.
This file is part of GNU Make. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify GNU Make is free software; you can redistribute it and/or modify
@ -1232,30 +1232,42 @@ windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0)) if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
fatal (NILF, _("CreatePipe() failed (e=%d)\n"), GetLastError()); fatal (NILF, _("CreatePipe() failed (e=%d)\n"), GetLastError());
hProcess = process_init_fd(hIn, hChildOutWr, hErr); hProcess = process_init_fd(hIn, hChildOutWr, hErr);
if (!hProcess) if (!hProcess)
fatal (NILF, _("windows32_openpipe (): process_init_fd() failed\n")); fatal (NILF, _("windows32_openpipe (): process_init_fd() failed\n"));
else
process_register(hProcess);
/* make sure that CreateProcess() has Path it needs */ /* make sure that CreateProcess() has Path it needs */
sync_Path_environment(); sync_Path_environment();
if (!process_begin(hProcess, command_argv, envp, command_argv[0], NULL)) if (!process_begin(hProcess, command_argv, envp, command_argv[0], NULL)) {
/* register process for wait */
process_register(hProcess);
/* set the pid for returning to caller */
*pid_p = (int) hProcess; *pid_p = (int) hProcess;
else
fatal (NILF, _("windows32_openpipe (): unable to launch process (e=%d)\n"),
process_last_err(hProcess));
/* set up to read data from child */ /* set up to read data from child */
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY); pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
/* this will be closed almost right away */ /* this will be closed almost right away */
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND); pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
} else {
/* reap/cleanup the failed process */
process_cleanup(hProcess);
/* close handles which were duplicated, they weren't used */
CloseHandle(hIn);
CloseHandle(hErr);
/* close pipe handles, they won't be used */
CloseHandle(hChildOutRd);
CloseHandle(hChildOutWr);
/* set status for return */
pipedes[0] = pipedes[1] = -1;
*pid_p = -1;
}
} }
#endif #endif
@ -1374,6 +1386,13 @@ func_shell (o, argv, funcname)
#ifdef WINDOWS32 #ifdef WINDOWS32
windows32_openpipe (pipedes, &pid, command_argv, envp); windows32_openpipe (pipedes, &pid, command_argv, envp);
if (pipedes[0] < 0) {
/* open of the pipe failed, mark as failed execution */
shell_function_completed = -1;
return o;
} else
#else /* WINDOWS32 */ #else /* WINDOWS32 */
# ifdef __MSDOS__ # ifdef __MSDOS__

View File

@ -311,41 +311,50 @@ update_file (file, depth)
register int status = 0; register int status = 0;
register struct file *f; register struct file *f;
for (f = file->double_colon ? file->double_colon : file; f != 0; f = f->prev) f = file->double_colon ? file->double_colon : file;
/* Prune the dependency graph: if we've already been here on _this_
pass through the dependency graph, we don't have to go any further.
We won't reap_children until we start the next pass, so no state
change is possible below here until then. */
if (f->considered == considered)
{
DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
return 0;
}
/* This loop runs until we start a double colon rule, or until the
chain is exhausted. */
for (; f != 0; f = f->prev)
{ {
/* Prune the dependency graph: if we've already been here on _this_
pass through the dependency graph, we don't have to go any further.
We won't reap_children until we start the next pass, so no state
change is possible below here until then. */
if (f->considered == considered)
{
DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
continue;
}
f->considered = considered; f->considered = considered;
status |= update_file_1 (f, depth); status |= update_file_1 (f, depth);
check_renamed (f); check_renamed (f);
if (status != 0 && !keep_going_flag) if (status != 0 && !keep_going_flag)
return status; break;
switch (f->command_state) if (f->command_state == cs_running
{ || f->command_state == cs_deps_running)
case cs_finished: {
/* The file is done being remade. */
break;
case cs_running:
case cs_deps_running:
/* Don't run the other :: rules for this /* Don't run the other :: rules for this
file until this rule is finished. */ file until this rule is finished. */
return 0; status = 0;
break;
}
}
default: /* Process the remaining rules in the double colon chain so they're marked
assert (f->command_state == cs_running); considered. Start their prerequisites, too. */
break; for (; f != 0 ; f = f->prev)
} {
struct dep *d;
f->considered = considered;
for (d = f->deps; d != 0; d = d->next)
status |= update_file (d->file, depth + 1);
} }
return status; return status;

View File

@ -1,3 +1,9 @@
1999-12-01 Paul D. Smith <psmith@gnu.org>
* scripts/features/double_colon: Add a test for PR/1476: Try
double-colon rules as non-goal targets and during parallel builds
to make sure they're handled serially.
1999-11-17 Paul D. Smith <psmith@gnu.org> 1999-11-17 Paul D. Smith <psmith@gnu.org>
* scripts/functions/if: Add a test for PR/1429: put some text * scripts/functions/if: Add a test for PR/1429: put some text

View File

@ -1,43 +1,107 @@
$description = "The following test creates a makefile to test Double-Colon\n" # -*-perl-*-
."Rules. They are rules which are written with '::' instead\n" $description = "Test handling of double-colon rules.";
."of ':' after the target names. This tells make that each \n"
."of these rules are independent of the others and each rule's\n"
."commands are executed if the target is older than any \n"
."dependencies of that rule.";
$details = "The makefile created by this test contains two double-colon \n" $details = "\
."rules for foo; each with their own commands. When make is run,\n" We test these features:
."each command should be executed in the sequence that they are \n"
."found. The command is a simple echo statement.";
open(MAKEFILE,"> $makefile"); - Multiple commands for the same (double-colon) target
- Different prerequisites for targets: only out-of-date
ones are rebuilt.
- Double-colon targets that aren't the goal target.
Then we do the same thing for parallel builds: double-colon
targets should always be built serially.";
# The Contents of the MAKEFILE ... # The Contents of the MAKEFILE ...
print MAKEFILE "foo:: bar.h \n" open(MAKEFILE,"> $makefile");
."\t\@echo Executing rule foo FIRST\n"
."foo2: bar.h \n"
."foo:: bar2.h \n"
."\t\@echo Executing rule foo SECOND\n";
# END of Contents of MAKEFILE print MAKEFILE <<'EOF';
all: baz
foo:: f1.h ; @echo foo FIRST
foo:: f2.h ; @echo foo SECOND
bar:: ; @echo aaa; sleep 1; echo aaa done
bar:: ; @echo bbb
baz:: ; @echo aaa
baz:: ; @echo bbb
biz:: ; @echo aaa
biz:: two ; @echo bbb
two: ; @echo two
f1.h f2.h: ; @echo $@
EOF
close(MAKEFILE); close(MAKEFILE);
&touch("bar.h","bar2.h"); # TEST 0: A simple double-colon rule that isn't the goal target.
&run_make_with_options($makefile, &run_make_with_options($makefile, "all", &get_logfile, 0);
"", $answer = "aaa\nbbb\n";
&get_logfile, &compare_output($answer, &get_logfile(1));
0);
# TEST 1: As above, in parallel
$answer = "Executing rule foo FIRST\n" &run_make_with_options($makefile, "-j10 all", &get_logfile, 0);
."Executing rule foo SECOND\n"; $answer = "aaa\nbbb\n";
&compare_output($answer, &get_logfile(1));
&compare_output($answer,&get_logfile(1)); # TEST 2: A simple double-colon rule that is the goal target
unlink("bar.h","bar2.h"); &run_make_with_options($makefile, "bar", &get_logfile, 0);
$answer = "aaa\naaa done\nbbb\n";
&compare_output($answer, &get_logfile(1));
# TEST 3: As above, in parallel
&run_make_with_options($makefile, "-j10 bar", &get_logfile, 0);
$answer = "aaa\naaa done\nbbb\n";
&compare_output($answer, &get_logfile(1));
# TEST 4: Each double-colon rule is supposed to be run individually
&touch('f2.h');
&touch('foo');
&run_make_with_options($makefile, "foo", &get_logfile, 0);
$answer = "f1.h\nfoo FIRST\n";
&compare_output($answer, &get_logfile(1));
# TEST 5: Again, in parallel.
&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0);
$answer = "f1.h\nfoo FIRST\n";
&compare_output($answer, &get_logfile(1));
# TEST 6: Each double-colon rule is supposed to be run individually
&touch('f1.h');
unlink('f2.h');
&touch('foo');
&run_make_with_options($makefile, "foo", &get_logfile, 0);
$answer = "f2.h\nfoo SECOND\n";
&compare_output($answer, &get_logfile(1));
# TEST 7: Again, in parallel.
&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0);
$answer = "f2.h\nfoo SECOND\n";
&compare_output($answer, &get_logfile(1));
# TEST 8: I don't grok why this is different than the above, but it is...
&run_make_with_options($makefile, "-j10 biz", &get_logfile, 0);
$answer = "aaa\ntwo\nbbb\n";
&compare_output($answer, &get_logfile(1));
unlink('foo','f1.h','f2.h');
1; 1;

View File

@ -58,4 +58,6 @@ $answer = "$make_name: `a' is up to date.\n";
$answer = "$make_name: `a' is up to date.\n"; $answer = "$make_name: `a' is up to date.\n";
&compare_output($answer, &get_logfile(1)); &compare_output($answer, &get_logfile(1));
unlink('a', 'b', 'c');
1; 1;

View File

@ -114,6 +114,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
v->recursive = recursive; v->recursive = recursive;
v->expanding = 0; v->expanding = 0;
v->per_target = 0; v->per_target = 0;
v->append = 0;
v->export = v_default; v->export = v_default;
v->next = set->table[hashval]; v->next = set->table[hashval];
set->table[hashval] = v; set->table[hashval] = v;

View File

@ -59,5 +59,7 @@ arr2envblk(char **arr, char **envblk_out)
ptr += strlen(tmp[arrcnt]) + 1; ptr += strlen(tmp[arrcnt]) + 1;
arrcnt++; arrcnt++;
} }
free(tmp);
return TRUE; return TRUE;
} }