summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2010-07-06 06:37:42 +0000
committerPaul Smith <psmith@gnu.org>2010-07-06 06:37:42 +0000
commitc7b469f0f337247acb83067d8f4aa4dc76b8a9a9 (patch)
treeb3b657564a46ef50c7478480f2659064b7e0d12d /main.c
parentc78b7265bd1ee374a5e515d79448d0e3452b5ede (diff)
downloadgunmake-c7b469f0f337247acb83067d8f4aa4dc76b8a9a9.tar.gz
- Enhance .POSIX to set -e when invoking shells, as demanded by a
backward-incompatible change in the 2008 POSIX specification. - Add the .SHELLFLAGS variable so people can choose their own shell flags. - Add tests for this. - Add documentation for this.
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/main.c b/main.c
index 20b445a..c972e65 100644
--- a/main.c
+++ b/main.c
@@ -1123,26 +1123,27 @@ main (int argc, char **argv, char **envp)
define_variable_cname (".VARIABLES", "", o_default, 0)->special = 1;
/* define_variable_cname (".TARGETS", "", o_default, 0)->special = 1; */
define_variable_cname (".RECIPEPREFIX", "", o_default, 0)->special = 1;
+ define_variable_cname (".SHELLFLAGS", "-c", o_default, 0);
/* 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",
- o_default, 0);
+ {
+ const char *features = "target-specific order-only second-expansion"
+ " else-if shortest-stem undefine"
#ifndef NO_ARCHIVES
- do_variable_definition (NILF, ".FEATURES", "archives",
- o_default, f_append, 0);
+ " archives"
#endif
#ifdef MAKE_JOBSERVER
- do_variable_definition (NILF, ".FEATURES", "jobserver",
- o_default, f_append, 0);
+ " jobserver"
#endif
#ifdef MAKE_SYMLINKS
- do_variable_definition (NILF, ".FEATURES", "check-symlink",
- o_default, f_append, 0);
+ " check-symlink"
#endif
+ ;
+
+ define_variable_cname (".FEATURES", features, 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