- Add whitespace to command line invocation in features/recursion
authorPaul Smith <psmith@gnu.org>
Thu, 1 Jul 2010 07:16:00 +0000 (07:16 +0000)
committerPaul Smith <psmith@gnu.org>
Thu, 1 Jul 2010 07:16:00 +0000 (07:16 +0000)
- Set up .FEATURES with separate calls for optional features, as some
  compilers don't like conditionals inside macro invocations.

ChangeLog
main.c
tests/ChangeLog
tests/scripts/features/recursion

index 58eb673bee28519176cb98664d2fd09b3653010b..0768309c2b5302bd3e3244b42ef6a4b664d2a2ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-01  Paul Smith  <psmith@gnu.org>
+
+       * main.c (main): Append optional features using separate calls.
+       Not as efficient but not all compilers allow conditionals inside
+       macro calls.  Fixes Savannah bug #29244.
+
 2010-01-10  Paul Smith  <psmith@gnu.org>
 
        * make.h (patheq): Rename strieq() to patheq() for clarity.
diff --git a/main.c b/main.c
index f45f60866745edcadcc501adc6770b38053c9d7f..20b445a085cfc5f3bb0704952a7ed1fafc3954b6 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1124,20 +1124,25 @@ main (int argc, char **argv, char **envp)
   /* define_variable_cname (".TARGETS", "", o_default, 0)->special = 1; */
   define_variable_cname (".RECIPEPREFIX", "", o_default, 0)->special = 1;
 
-  /* Set up .FEATURES */
+  /* Set up .FEATURES
+     We must do this in multiple calls because define_variable_cname() is
+     a macro and some compilers (MSVC) don't like conditionals in macros.  */
   define_variable_cname (".FEATURES",
                          "target-specific order-only second-expansion else-if"
-                         "shortest-stem undefine"
+                         " shortest-stem undefine",
+                         o_default, 0);
 #ifndef NO_ARCHIVES
-                         "archives"
+  do_variable_definition (NILF, ".FEATURES", "archives",
+                          o_default, f_append, 0);
 #endif
 #ifdef MAKE_JOBSERVER
-                         "jobserver"
+  do_variable_definition (NILF, ".FEATURES", "jobserver",
+                          o_default, f_append, 0);
 #endif
 #ifdef MAKE_SYMLINKS
-                         "check-symlink"
+  do_variable_definition (NILF, ".FEATURES", "check-symlink",
+                          o_default, f_append, 0);
 #endif
-                         , o_default, 0);
 
   /* Read in variables from the environment.  It is important that this be
      done before $(MAKE) is figured out so its definitions will not be
@@ -3182,7 +3187,11 @@ die (int status)
         directory.  Must wait until after remove_intermediates(), or unlinks
          of relative pathnames fail.  */
       if (directory_before_chdir != 0)
-       chdir (directory_before_chdir);
+        {
+          /* If it fails we don't care: shut up GCC.  */
+          int _x;
+          _x = chdir (directory_before_chdir);
+        }
 
       log_working_directory (0);
     }
index eaacaece92fdf5f12187fa9cdbd7d6e2b66a21c4..c8f3aab2d2531d74a3014a8c463bd25aa94f512d 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-01  Paul Smith  <psmith@gnu.org>
+
+       * scripts/features/recursion: Add a space to separate command-line
+       args.  Fixes Savannah bug #29968.
+
 2009-11-12  Boris Kolpackov  <boris@codesynthesis.com>
 
        * scripts/features/vpath3: Test for the new library search
@@ -6,7 +11,7 @@
 2009-10-06  Boris Kolpackov  <boris@codesynthesis.com>
 
        * scripts/features/se_explicit: Enable the test for now fixed
-       savannah bug 25780.
+       Savannah bug 25780.
 
 2009-10-06  Boris Kolpackov  <boris@codesynthesis.com>
 
index b9dfd4f42fc74cf58f6708d27f4e7a0e5be0647e..a6b8f9095a1d678711a229c921dd5480adc36389 100644 (file)
@@ -16,7 +16,7 @@ last:
        @echo MAKELEVEL = $(MAKELEVEL)
        @echo THE END
 ',
-              ('CFLAGS=-O -w' . ($parallel_jobs ? '-j 2' : '')),
+              ('CFLAGS=-O -w' . ($parallel_jobs ? ' -j 2' : '')),
               ($vos
                ? "#MAKE#: Entering directory `#PWD#'
 make 'CFLAGS=-O' -f #MAKEFILE# foo