make flags analysis: embed in a subshell
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 3 May 2013 10:47:59 +0000 (12:47 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 3 May 2013 10:47:59 +0000 (12:47 +0200)
So that we won't have to worry about leaking temporary variables,
and similar stuff.

* lib/am/header-vars.am (am__make_dryrun, am__make_keepgoing): Here.
(am__make_running_with_option): Minor adjustments.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/header-vars.am

index 72a1877..11779f5 100644 (file)
@@ -36,7 +36,6 @@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 ## no argument.  Actually, the only supported option at the moment
 ## is '-n' (support for '-k' will be added soon).
 am__make_running_with_option = \
-  { \
     case $${am__target_option-} in \
         ?) ;; \
         *) echo "am__make_running_with_option: internal error: invalid" \
@@ -89,22 +88,20 @@ am__make_running_with_option = \
       case $$am__flg in \
         *$$am__target_option*) am__has_opt=yes; break;; \
       esac; \
-    done;\
-    unset am__skip_next am__flg am__flags am__target_option; \
-    test $$am__has_opt = yes; \
-  }
+    done; \
+    test $$am__has_opt = yes
 
 ## Shell code that determines whether make is running in "dry mode"
 ## ("make -n") or not.  Useful in rules that invoke make recursively,
 ## and are thus executed also with "make -n" -- either because they
 ## are declared as dependencies to '.MAKE' (NetBSD make), or because
 ## their recipes contain the "$(MAKE)" string (GNU and Solaris make).
-am__make_dryrun = { am__target_option=n; $(am__make_running_with_option); }
+am__make_dryrun = (am__target_option=n; $(am__make_running_with_option))
 
 ## Shell code that determines whether make is running in "keep-going mode"
 ## ("make -k") or not.  Useful in rules that must recursively descend into
 ## subdirectories, and decide whther to stop at the first error or not.
-am__make_keepgoing = { am__target_option=k; $(am__make_running_with_option); }
+am__make_keepgoing = (am__target_option=k; $(am__make_running_with_option))
 
 ## Some derived variables that have been found to be useful.
 pkgdatadir = $(datadir)/@PACKAGE@