Fix some Savannah bugs.
authorPaul Smith <psmith@gnu.org>
Fri, 8 Apr 2005 12:51:20 +0000 (12:51 +0000)
committerPaul Smith <psmith@gnu.org>
Fri, 8 Apr 2005 12:51:20 +0000 (12:51 +0000)
Updates to docs (still need more work here) and NEWS file.
New language.

16 files changed:
ChangeLog
NEWS
doc/make.texi
glob/ChangeLog
glob/glob.c
job.c
main.c
po/ChangeLog
po/LINGUAS
read.c
remake.c
signame.c
tests/ChangeLog
tests/scripts/features/parallelism
tests/scripts/targets/SECONDARY
variable.c

index 7747b993e767c779d5c9f496b547627c004d0534..03cb0719cac23236aa8087dbda9aaf55c000e917 100644 (file)
--- 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
        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 5b26b3bfdabbb34699555adfd9edbf3a45951315..3a350da27fb0dbdaee2b3478a44b9194adad9095 100644 (file)
--- 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.
 
 \f
 Version 3.80
index 0ecd35a7458a49dc873e0a1e909d0f1b10bf4063..0b2ada9b832908a114115580353a6e3e75b032f5 100644 (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
 
index 75c688816d5436448f9e7211561e6006b88a8b7e..e4879b5f3f4d5658cd3516c361ceec37fc0d34de 100644 (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>
index 4bbf7bb013b3f66b16b901436288efb55cdd2b1b..80d667cafe161736a754750d9df7868d2fa7d465 100644 (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
                                   );
diff --git a/job.c b/job.c
index 28d1e6b8c387866cd49f60cbf6fe9631ddea112d..48048d1ba5fa9c9ac0fc3e944136243c1b91fdb2 100644 (file)
--- 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 750ded3b330f41b6a403193a8dc7ba936fc80c1c..014c41ff615ef9106890298842a812dffe2d80a5 100644 (file)
--- 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 */
     {
index 1ccde26fb843e75613f64c7967008df6cfc90b71..59cafe932b5664c25345eaf2f59833b21be05b4f 100644 (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).
index 868fe2d3fe31a761c99b0c32ecf057d024b934cb..99a6d8729eb316221120de65a1174cdf434d35ee 100644 (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?
diff --git a/read.c b/read.c
index 772ef8c1e9700e711b37eb7c12b92b6e63e57992..15455b872574a1f02a1a2d3f63845ddc5389ba4b 100644 (file)
--- 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;
 }
 
index eb34c924d7d6b85add045139747d3ab844f4c26f..f7cfafb9aabd22ba17ddf2c4532ac2902944eddc 100644 (file)
--- 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);
index a6c2a38e56656bc89e0e9b1d67c19518bbb2ba50..3091032543850834a0f25e2c1778fa1132d256a3 100644 (file)
--- 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)
index 72575e850331c78232630df15762def9f2067d79..698cffb77a6133e9a3631035e0ee78d0bfcec0d2 100644 (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.
index cd753928fcf0ee9bdaba4d7586037cb6bd36ff14..f5003522d1844b9ddba066f7033065887566f392 100644 (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;
index a6c5dab60e6b70dfeb621b4487f5c12ce9d386bf..cf580b5caf8c626421dbe181cbcef3a0fc6b2710 100644 (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;
index 4c383160abaa036a76493afdd1cec386f268daa0..7e26646c1a25011db3e969bf6a25328bd2a90f89 100644 (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);
 }