Fix some Savannah bugs.

Updates to docs (still need more work here) and NEWS file.
New language.
This commit is contained in:
Paul Smith 2005-04-08 12:51:20 +00:00
parent 4923580e3a
commit 3daf8df6ee
16 changed files with 165 additions and 52 deletions

View File

@ -1,3 +1,16 @@
2005-04-07 Paul D. Smith <psmith@gnu.org>
* main.c (main) [WINDOWS32]: Export PATH to sub-shells, not Path.
* variable.c (sync_Path_environment): Ditto.
Patch by Alessandro Vesely. Fixes Savannah bug #12209.
* main.c (main): Define the .FEATURES variable.
* NEWS: Announce .FEATURES.
* doc/make.texi (Special Variables): Document .FEATURES.
* remake.c (check_dep): If a file is .PHONY, update it even if
it's marked intermediate. Fixes Savannah bug #12331.
2005-03-15 Boris Kolpackov <boris@kolpackov.net>
* file.c (expand_deps): Factor out the second expansion and
@ -7,20 +20,34 @@
prerequisites of the .SUFFIXES special target first. Fixes
Savannah bug #12320.
2005-03-13 Paul D. Smith <psmith@gnu.org>
* main.c (main) [MSDOS]: Export SHELL in MSDOS. Requested by Eli
Zaretskii.
2005-03-11 Paul D. Smith <psmith@gnu.org>
* signame.c (strsignal): HAVE_DECL_SYS_SIGLIST is 0 when not
available, not undefined (from Earnie Boyd).
2005-03-10 Boris Kolpackov <boris@kolpackov.net>
* implicit.c (pattern_search): Mark an intermediate target as
precious if it happened to be a prerequisite of some (other)
target. Fixes Savannah bug #12267.
2005-03-09 Paul D. Smith <psmith@gnu.org>
* read.c (eval_makefile): Add alloca(0).
(eval_buffer): Ditto.
2005-03-09 Boris Kolpackov <boris@kolpackov.net>
* main.c (main): Use o_file instead of o_default when defining
the .DEFAULT_TARGET special variable.
* read.c (eval): Use define_variable_global() instead of
define_variable() when setting new value for the .DEFAULT_TARGET
special variable. Fixes Savannah bug #12266.
special variable. Fixes Savannah bug #12266.
2005-03-04 Boris Kolpackov <boris@kolpackov.net>

23
NEWS
View File

@ -18,15 +18,15 @@ Version 3.81beta3
* WARNING: Backward-incompatibility!
GNU make now implements a generic "second expansion" feature on the
prerequisites of both explicit and implicit (pattern) targets. After
the rule has been parsed, the prerequisites are expanded a second
time, this time with all the automatic variables in scope. This means
that in addition to using standard SysV $$@ in prerequisites lists,
you can also use complex functions such as $$(patsubst f%r,b%o,$$@) etc.
This behavior applies to implicit rules, as well, where the second
expansion occurs after the rule is matched.
However, this means that you need to double-quote any "$" in your
filenames; instead of "foo: boo$$bar" you must write "foo: foo$$$$bar"
prerequisites of both explicit and implicit (pattern) rules. After
all rules have been parsed the prerequisites are expanded again, this
time with all the automatic variables in scope. This means that in
addition to using standard SysV $$@ in prerequisites lists, you can
also use complex functions such as $$(notdir $$@) etc. This behavior
applies to implicit rules, as well, where the second expansion occurs
after the rule is matched. However, this means that you need to
double-quote any "$" in your filenames; instead of "foo: boo$$bar" you
must write "foo: foo$$$$bar"
* New command-line option: -L (--check-symlink-times). On systems that
support symbolic links, if this option is given then GNU make will
@ -50,6 +50,8 @@ Version 3.81beta3
load average accordingly.
* New special variables available in this release:
- .FEATURES: Contains a list of special features available in this
version of GNU make.
- .DEFAULT_TARGET: Contains the name of the default target make will
use if no targets are provided on the command line. It can be set
to change the default target.
@ -84,7 +86,8 @@ Version 3.81beta3
should not be impacted.
* New translations for Swedish, Chinese (simplified), Ukrainian,
Belarusian, Finnish, and Irish. Many updated translations.
Belarusian, Finnish, Kinyarwandan, and Irish. Many updated
translations.
Version 3.80

View File

@ -1270,22 +1270,26 @@ variable definitions.
@cindex makefiles, and special variables
@cindex special variables
GNU @code{make} also supports a special variable. Note that any value
you assign to this variable will be ignored; it will always return its
special value.
GNU @code{make} also supports other special variables. Unless
otherwise documented here, these values lose their special properties
if they are set by a makefile or on the command line.
@table @code
@vindex $(.VARIABLES)
@vindex .VARIABLES @r{(list of variables)}
The first special variable is @code{.VARIABLES}. When expanded, the
value consists of a list of the @emph{names} of all global variables
defined in all makefiles read up until that point. This includes
variables which have empty values, as well as built-in variables
(@pxref{Implicit Variables, , Variables Used by Implicit Rules}), but
does not include any variables which are only defined in a
target-specific context.
@item .VARIABLES
Expands to a list of the @emph{names} of all global variables defined
so far. This includes variables which have empty values, as well as
built-in variables (@pxref{Implicit Variables, , Variables Used by
Implicit Rules}), but does not include any variables which are only
defined in a target-specific context. Note that any value you assign
to this variable will be ignored; it will always return its special
value.
@c @vindex $(.TARGETS)
@c @vindex .TARGETS @r{(list of targets)}
@c @item .TARGETS
@c The second special variable is @code{.TARGETS}. When expanded, the
@c value consists of a list of all targets defined in all makefiles read
@c up until that point. Note it's not enough for a file to be simply
@ -1294,6 +1298,36 @@ target-specific context.
@c file must appear as a target, on the left-hand side of a ``:'', to be
@c considered a target for the purposes of this variable.
@vindex $(.FEATURES)
@vindex .FEATURES @r{(list of supported features)}
@item .FEATURES
Expands to a list of special features supported by this version of
@code{make}. Possible values include:
@table @samp
@item target-specific
Supports target-specific and pattern-specific variable assignments.
@xref{Target-specific, ,Target-specific Variable Values}.
@item order-only
Supports order-only prerequisites. @xref{Prerequisite Types, ,Types
of Prerequisites}.
@item second-expansion
Supports secondary expansion of prerequisite lists.
@item jobserver
Supports ``job server'' enhanced parallel builds. @xref{Parallel,
,Parallel Execution}.
@item check-symlink
Supports the @code{-L} (@code{--check-symlink-times}) flag.
@xref{Options Summary, ,Summary of Options}.
@end table
@end table
@node Remaking Makefiles, Overriding Makefiles, Special Variables, Makefiles
@section How Makefiles Are Remade

View File

@ -1,3 +1,8 @@
2005-03-11 Paul D. Smith <psmith@gnu.org>
* glob.c (glob_in_dir): Change FNM_CASEFOLD to be enabled if
HAVE_CASE_INSENSITIVE_FS is defined.
2003-01-30 Paul D. Smith <psmith@gnu.org>
* glob.h: Patch for FreeBSD by Mike Barcroft <mike@freebsd.org>

View File

@ -1303,7 +1303,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
{
int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
| ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
#if defined _AMIGA || defined VMS
#if defined HAVE_CASE_INSENSITIVE_FS
| FNM_CASEFOLD
#endif
);

8
job.c
View File

@ -525,6 +525,8 @@ child_handler (int sig UNUSED)
extern int shell_function_pid, shell_function_completed;
static int reap_lock = 0;
/* Reap all dead children, storing the returned status and the new command
state (`cs_finished') in the `file' member of the `struct child' for the
dead child, and removing the child from the chain. In addition, if BLOCK
@ -545,6 +547,9 @@ reap_children (int block, int err)
# define REAP_MORE dead_children
#endif
if (reap_lock)
fatal (NILF, _("INTERNAL: reap_children invoked while reap_lock set."));
/* As long as:
We have at least one child outstanding OR a shell function in progress,
@ -1470,6 +1475,7 @@ start_waiting_job (struct child *c)
}
/* Start the first command; reap_children will run later command lines. */
reap_lock = 1;
start_job_command (c);
switch (f->command_state)
@ -1500,6 +1506,8 @@ start_waiting_job (struct child *c)
break;
}
reap_lock = 0;
return 1;
}

50
main.c
View File

@ -1,6 +1,6 @@
/* Argument parsing and main program of GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1994, 1995, 1996, 1997, 1998, 1999,
2002, 2003 Free Software Foundation, Inc.
2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify
@ -763,11 +763,9 @@ find_and_set_default_shell (char *token)
sh_found = 1;
} else {
char *p;
struct variable *v = lookup_variable ("Path", 4);
struct variable *v = lookup_variable ("PATH", 4);
/*
* Search Path for shell
*/
/* Search Path for shell */
if (v && v->value) {
char *ep;
@ -1093,7 +1091,20 @@ main (int argc, char **argv, char **envp)
/* Initialize the special variables. */
define_variable (".VARIABLES", 10, "", o_default, 0)->special = 1;
/* define_variable (".TARGETS", 8, "", o_default, 0); */
/* define_variable (".TARGETS", 8, "", o_default, 0)->special = 1; */
/* Set up .FEATURES */
define_variable (".FEATURES", 9,
"target-specific order-only second-expansion",
o_default, 0);
#ifdef MAKE_JOBSERVER
do_variable_definition (NILF, ".FEATURES", "jobserver",
o_default, f_append, 0);
#endif
#ifdef MAKE_SYMLINKS
do_variable_definition (NILF, ".FEATURES", "check-symlink",
o_default, f_append, 0);
#endif
/* Read in variables from the environment. It is important that this be
done before $(MAKE) is figured out so its definitions will not be
@ -1110,9 +1121,10 @@ main (int argc, char **argv, char **envp)
#ifdef WINDOWS32
if (!unix_path && strneq(envp[i], "PATH=", 5))
unix_path = ep+1;
else if (!windows32_path && !strnicmp(envp[i], "Path=", 5)) {
else if (!strnicmp(envp[i], "Path=", 5)) {
do_not_define = 1; /* it gets defined after loop exits */
windows32_path = ep+1;
if (!windows32_path)
windows32_path = ep+1;
}
#endif
/* The result of pointer arithmetic is cast to unsigned int for
@ -1136,28 +1148,22 @@ main (int argc, char **argv, char **envp)
subprocesses, which seems silly to me but... */
if (strncmp (envp[i], "SHELL=", 6) == 0)
{
#ifndef __MSDOS__
v->export = v_noexport;
#endif
shell_var.name = "SHELL";
shell_var.value = xstrdup (ep + 1);
}
}
}
#ifdef WINDOWS32
/*
* Make sure that this particular spelling of 'Path' is available
/* If we didn't find a correctly spelled PATH we define PATH as
* either the first mispelled value or an empty string
*/
if (windows32_path)
define_variable("Path", 4, windows32_path, o_env, 1)->export = v_export;
else if (unix_path)
define_variable("Path", 4, unix_path, o_env, 1)->export = v_export;
else
define_variable("Path", 4, "", o_env, 1)->export = v_export;
/*
* PATH defaults to Path iff PATH not found and Path is found.
*/
if (!unix_path && windows32_path)
define_variable("PATH", 4, windows32_path, o_env, 1)->export = v_export;
if (!unix_path)
define_variable("PATH", 4,
windows32_path ? windows32_path : "",
o_env, 1)->export = v_export;
#endif
#else /* For Amiga, read the ENV: device, ignoring all dirs */
{

View File

@ -1,3 +1,7 @@
2005-04-06 Paul D. Smith <psmith@gnu.org>
* LINGUAS: Added a new translation for Kinywarwanda (rw).
2005-02-09 Paul D. Smith <psmith@gnu.org>
* LINGUAS: Added a new translation for Irish (ga).

View File

@ -1,5 +1,5 @@
# Set of available languages: 20 languages
be da de es fi fr ga gl he hr ja ko nl pl pt_BR sv ru tr uk zh_CN
be da de es fi fr ga gl he hr ja ko nl pl pt_BR ru rw sv tr uk zh_CN
# Can't seem to get en@quot and en@boldquot to build properly?

2
read.c
View File

@ -405,6 +405,7 @@ eval_makefile (char *filename, int flags)
fclose (ebuf.fp);
free (ebuf.bufstart);
alloca (0);
return r;
}
@ -436,6 +437,7 @@ eval_buffer (char *buffer)
reading_file = curfile;
alloca (0);
return r;
}

View File

@ -909,10 +909,10 @@ check_dep (struct file *file, unsigned int depth,
++depth;
start_updating (file);
if (!file->intermediate)
/* If this is a non-intermediate file, update it and record
whether it is newer than THIS_MTIME. */
if (file->phony || !file->intermediate)
{
/* If this is a non-intermediate file, update it and record
whether it is newer than THIS_MTIME. */
FILE_TIMESTAMP mtime;
dep_status = update_file (file, depth);
check_renamed (file);

View File

@ -234,7 +234,7 @@ strsignal (int signal)
{
static char buf[] = "Signal 12345678901234567890";
#if !defined(HAVE_DECL_SYS_SIGLIST)
#if ! HAVE_DECL_SYS_SIGLIST
static char sig_initted = 0;
if (!sig_initted)

View File

@ -1,3 +1,7 @@
2005-04-07 Paul D. Smith <psmith@gnu.org>
* scripts/targets/SECONDARY: Add a test for Savannah bug #12331.
2005-03-15 Boris Kolpackov <boris@kolpackov.net>
* scripts/variables/automatic: Add a test for Savannah bug #12320.

View File

@ -97,4 +97,11 @@ $answer = "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n";
unlink('1.inc', '2.inc');
# Test shell functions within commands: make sure they're not reducing our
# parallelism.
run_make_test('.PHONY: all
all: ; @echo $(shell echo hi)
','','hi');
1;

View File

@ -108,5 +108,18 @@ $answer = "$make_name: `final' is up to date.\n";
unlink('source', 'final', 'intermediate');
# TEST #8 -- test the "global" .SECONDARY, with .PHONY.
touch('version2');
run_make_test('
.PHONY: version
.SECONDARY:
version2: version ; @echo GOOD
all: version2',
'all', 'GOOD');
unlink('version2');
# This tells the test driver that the perl test script executed properly.
1;

View File

@ -1430,7 +1430,7 @@ print_file_variables (struct file *file)
void
sync_Path_environment (void)
{
char *path = allocated_variable_expand ("$(Path)");
char *path = allocated_variable_expand ("$(PATH)");
static char *environ_path = NULL;
if (!path)
@ -1447,7 +1447,7 @@ sync_Path_environment (void)
* Create something WINDOWS32 world can grok
*/
convert_Path_to_windows32 (path, ';');
environ_path = concat ("Path", "=", path);
environ_path = concat ("PATH", "=", path);
putenv (environ_path);
free (path);
}