diff options
| author | Stefan Becker <stefanb@gpartner-nvidia.com> | 2016-04-07 13:28:42 +0300 |
|---|---|---|
| committer | Stefan Becker <stefanb@gpartner-nvidia.com> | 2016-04-12 12:31:46 +0300 |
| commit | 187bf08e7fc847da6dc8482383fa5c8364f0ac50 (patch) | |
| tree | 3ac5c8045bd10041c6636231a34912d932f87884 /dep.cc | |
| parent | cd060c5ce8dc4128e3bf3dcbed57e36ef93486d5 (diff) | |
[C++] Add support for .POSIX:
Add a global flag that is set to "true" when .POSIX: is encountered. The
flag will switch the bash flags from "-c" to "-ec", i.e. enable correct
error handling of shell command lines.
Fixes https://github.com/google/kati/issues/48
Change-Id: Ieea386742b05b52d209b74e640e14212f0e2da88
Diffstat (limited to 'dep.cc')
| -rw-r--r-- | dep.cc | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -25,6 +25,7 @@ #include "eval.h" #include "fileutil.h" +#include "flags.h" #include "log.h" #include "rule.h" #include "stats.h" @@ -261,6 +262,10 @@ class DepBuilder { for (Symbol t : targets) phony_.insert(t); } + if (GetRuleInputs(Intern(".POSIX"), &targets, &loc)) { + // .POSIX: enables bash -e command line option globally + g_flags.posix_shell = true; + } if (GetRuleInputs(Intern(".KATI_RESTAT"), &targets, &loc)) { for (Symbol t : targets) restat_.insert(t); @@ -287,7 +292,6 @@ class DepBuilder { ".EXPORT_ALL_VARIABLES", ".NOTPARALLEL", ".ONESHELL", - ".POSIX", NULL }; for (const char** p = kUnsupportedBuiltinTargets; *p; p++) { |
