summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-04-08 12:51:20 +0000
committerPaul Smith <psmith@gnu.org>2005-04-08 12:51:20 +0000
commit3daf8df6ee835b9edcc068af33ae97910bb8d934 (patch)
treea90131bc43bd817abd1850df4ade8d58339d3334
parent4923580e3a5b3d9e7ff29ef1e5a5339cc7619a4b (diff)
downloadgunmake-3daf8df6ee835b9edcc068af33ae97910bb8d934.tar.gz
Fix some Savannah bugs.
Updates to docs (still need more work here) and NEWS file. New language.
-rw-r--r--ChangeLog31
-rw-r--r--NEWS23
-rw-r--r--doc/make.texi54
-rw-r--r--glob/ChangeLog5
-rw-r--r--glob/glob.c2
-rw-r--r--job.c8
-rw-r--r--main.c50
-rw-r--r--po/ChangeLog4
-rw-r--r--po/LINGUAS2
-rw-r--r--read.c2
-rw-r--r--remake.c6
-rw-r--r--signame.c2
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/scripts/features/parallelism7
-rw-r--r--tests/scripts/targets/SECONDARY13
-rw-r--r--variable.c4
16 files changed, 165 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index 7747b99..03cb071 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
diff --git a/NEWS b/NEWS
index 5b26b3b..3a350da 100644
--- a/NEWS
+++ b/NEWS
@@ -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
diff --git a/doc/make.texi b/doc/make.texi
index 0ecd35a..0b2ada9 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -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
diff --git a/glob/ChangeLog b/glob/ChangeLog
index 75c6888..e4879b5 100644
--- a/glob/ChangeLog
+++ b/glob/ChangeLog
@@ -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>
diff --git a/glob/glob.c b/glob/glob.c
index 4bbf7bb..80d667c 100644
--- a/glob/glob.c
+++ b/glob/glob.c
@@ -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
);
diff --git a/job.c b/job.c
index 28d1e6b..48048d1 100644
--- a/job.c
+++ b/job.c
@@ -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;
}
diff --git a/main.c b/main.c
index 750ded3..014c41f 100644
--- a/main.c
+++ b/main.c
@@ -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 (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 we didn't find a correctly spelled PATH we define PATH as
+ * either the first mispelled value or an empty string
*/
- 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 */
{
diff --git a/po/ChangeLog b/po/ChangeLog
index 1ccde26..59cafe9 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -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).
diff --git a/po/LINGUAS b/po/LINGUAS
index 868fe2d..99a6d87 100644
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -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?
diff --git a/read.c b/read.c
index 772ef8c..15455b8 100644
--- a/read.c
+++ b/read.c
@@ -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;
}
diff --git a/remake.c b/remake.c
index eb34c92..f7cfafb 100644
--- a/remake.c
+++ b/remake.c
@@ -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);
diff --git a/signame.c b/signame.c
index a6c2a38..3091032 100644
--- a/signame.c
+++ b/signame.c
@@ -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)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 72575e8..698cffb 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -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.
diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
index cd75392..f500352 100644
--- a/tests/scripts/features/parallelism
+++ b/tests/scripts/features/parallelism
@@ -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;
diff --git a/tests/scripts/targets/SECONDARY b/tests/scripts/targets/SECONDARY
index a6c5dab..cf580b5 100644
--- a/tests/scripts/targets/SECONDARY
+++ b/tests/scripts/targets/SECONDARY
@@ -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;
diff --git a/variable.c b/variable.c
index 4c38316..7e26646 100644
--- a/variable.c
+++ b/variable.c
@@ -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);
}