From: Akim Demaille Date: Wed, 27 Sep 2000 10:02:27 +0000 (+0000) Subject: * autoheader.sh: Fix trap (EXIT) status. X-Git-Tag: autoconf-2.50~605 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c916e13f94db97ff89d32a4614e98f1427841ac1;p=thirdparty%2Fautoconf.git * autoheader.sh: Fix trap (EXIT) status. * autoreconf.sh: Likewise. * autoupdate.sh: Likewise. * autoconf.sh: Change `exit' to `{ (exit 1); exit; }' after m4 and awk commands to ensure exit state is in a defined state. --- diff --git a/ChangeLog b/ChangeLog index 9c3432110..fec69e285 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-09-27 J. David Anglin + + * autoheader.sh: Fix trap (EXIT) status. + * autoreconf.sh: Likewise. + * autoupdate.sh: Likewise. + * autoconf.sh: Change `exit' to `{ (exit 1); exit; }' after m4 and + awk commands to ensure exit state is in a defined state. + 2000-09-25 Alexandre Oliva * tests/semantics.m4 (AC_PROG_CPP with warning): Simplified. diff --git a/autoconf.in b/autoconf.in index 2b56600c8..78e9804b9 100644 --- a/autoconf.in +++ b/autoconf.in @@ -299,7 +299,8 @@ case $task in ## --------------------------------- ## script) # M4 expansion. - $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || exit + $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || + { (exit 1); exit; } # You can add your own prefixes to pattern if you want to check for # them too. @@ -554,7 +555,8 @@ EOF do # The request may be several lines long, hence sed has to quit. trace_opt="$trace_opt -t "`echo "$trace" | sed -e 's/:.*//;q'` - echo "$trace" | $AWK -f $tmp/translate.awk >>$tmp/trace.m4 || exit + echo "$trace" | $AWK -f $tmp/translate.awk >>$tmp/trace.m4 || + { (exit 1); exit; } done echo "divert(0)dnl" >>$tmp/trace.m4 diff --git a/autoconf.sh b/autoconf.sh index 2b56600c8..78e9804b9 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -299,7 +299,8 @@ case $task in ## --------------------------------- ## script) # M4 expansion. - $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || exit + $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || + { (exit 1); exit; } # You can add your own prefixes to pattern if you want to check for # them too. @@ -554,7 +555,8 @@ EOF do # The request may be several lines long, hence sed has to quit. trace_opt="$trace_opt -t "`echo "$trace" | sed -e 's/:.*//;q'` - echo "$trace" | $AWK -f $tmp/translate.awk >>$tmp/trace.m4 || exit + echo "$trace" | $AWK -f $tmp/translate.awk >>$tmp/trace.m4 || + { (exit 1); exit; } done echo "divert(0)dnl" >>$tmp/trace.m4 diff --git a/autoheader.in b/autoheader.in index 1dd9b0ce8..d7eb14dde 100644 --- a/autoheader.in +++ b/autoheader.in @@ -88,6 +88,7 @@ for autoconf in "$AUTOCONF" \ done debug=false localdir=. +status=0 tmp= verbose=: warning_all=false @@ -179,7 +180,7 @@ done $debug || { trap 'status=$?; rm -rf $tmp && exit $status' 0 - trap 'exit $?' 1 2 13 15 + trap '(exit $?); exit' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -194,7 +195,7 @@ $debug || } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - exit 1; + (exit 1); exit } # Preach. @@ -217,7 +218,7 @@ if ($warning_all || $warning_obsolete) && More sophisticated templates can also be produced, see the documentation. EOF - $warning_error && exit 1 + $warning_error && { (exit 1); exit; } fi acconfigs= @@ -230,7 +231,7 @@ case $# in *) exec >&2 echo "$me: invalid number of arguments." echo "$help" - exit 1 ;; + (exit 1); exit ;; esac # Set up autoconf. @@ -249,7 +250,7 @@ $autoconf \ $2"' \ --trace AC_DEFINE:'syms="$$syms $1"' \ --trace AC_DEFINE_UNQUOTED:'syms="$$syms $1"' \ - $infile >$tmp/traces.sh || exit 1 + $infile >$tmp/traces.sh || { (exit 1); exit; } $verbose $me: sourcing $tmp/traces.sh >&2 . $tmp/traces.sh @@ -271,7 +272,8 @@ syms=`for sym in $syms; do echo $sym; done | config_h=`echo "$config_h" | sed -e 's/ .*//'` # Support "outfile[:infile]", defaulting infile="outfile.in". case "$config_h" in -"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;; +"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2 + (exit 1); exit ;; *:*) config_h_in=`echo "$config_h" | sed 's/.*://'` config_h=`echo "$config_h" | sed 's/:.*//'` ;; *) config_h_in="$config_h.in" ;; @@ -305,7 +307,6 @@ test -f $config_h.bot && cat $config_h.bot >>$tmp/config.hin # Check that all the symbols have a template. $verbose $me: checking completeness of the template >&2 -status=0 # Regexp for a white space. w='[ ]' if test -n "$syms"; then @@ -336,4 +337,4 @@ if test $status = 0; then fi fi -exit $status +(exit $status); exit diff --git a/autoheader.sh b/autoheader.sh index 1dd9b0ce8..d7eb14dde 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -88,6 +88,7 @@ for autoconf in "$AUTOCONF" \ done debug=false localdir=. +status=0 tmp= verbose=: warning_all=false @@ -179,7 +180,7 @@ done $debug || { trap 'status=$?; rm -rf $tmp && exit $status' 0 - trap 'exit $?' 1 2 13 15 + trap '(exit $?); exit' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -194,7 +195,7 @@ $debug || } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - exit 1; + (exit 1); exit } # Preach. @@ -217,7 +218,7 @@ if ($warning_all || $warning_obsolete) && More sophisticated templates can also be produced, see the documentation. EOF - $warning_error && exit 1 + $warning_error && { (exit 1); exit; } fi acconfigs= @@ -230,7 +231,7 @@ case $# in *) exec >&2 echo "$me: invalid number of arguments." echo "$help" - exit 1 ;; + (exit 1); exit ;; esac # Set up autoconf. @@ -249,7 +250,7 @@ $autoconf \ $2"' \ --trace AC_DEFINE:'syms="$$syms $1"' \ --trace AC_DEFINE_UNQUOTED:'syms="$$syms $1"' \ - $infile >$tmp/traces.sh || exit 1 + $infile >$tmp/traces.sh || { (exit 1); exit; } $verbose $me: sourcing $tmp/traces.sh >&2 . $tmp/traces.sh @@ -271,7 +272,8 @@ syms=`for sym in $syms; do echo $sym; done | config_h=`echo "$config_h" | sed -e 's/ .*//'` # Support "outfile[:infile]", defaulting infile="outfile.in". case "$config_h" in -"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;; +"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2 + (exit 1); exit ;; *:*) config_h_in=`echo "$config_h" | sed 's/.*://'` config_h=`echo "$config_h" | sed 's/:.*//'` ;; *) config_h_in="$config_h.in" ;; @@ -305,7 +307,6 @@ test -f $config_h.bot && cat $config_h.bot >>$tmp/config.hin # Check that all the symbols have a template. $verbose $me: checking completeness of the template >&2 -status=0 # Regexp for a white space. w='[ ]' if test -n "$syms"; then @@ -336,4 +337,4 @@ if test $status = 0; then fi fi -exit $status +(exit $status); exit diff --git a/autoreconf.in b/autoreconf.in index adffd6ba4..09ce386a5 100644 --- a/autoreconf.in +++ b/autoreconf.in @@ -100,6 +100,7 @@ install=false localdir=. # m4dir -- local Autoconf extensions. Typically `m4'. m4dir= +status=0 # symlink -- when --install, use symlinks instead. symlink=false verbose=: @@ -241,7 +242,7 @@ fi $debug || { trap 'status=$?; rm -rf $tmp && exit $status' 0 - trap 'exit $?' 1 2 13 15 + trap '(exit $?); exit' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -256,7 +257,7 @@ $debug || } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - exit 1; + (exit 1); exit } # When debugging, it is convenient that all the related temporary @@ -275,7 +276,7 @@ cat >$tmp/alflags.sed <$tmp/update.sh <<\EOF test -f "$1" || exit 0 test x`ls -1dt "$@" 2>/dev/null | sed 1q` != x"$1" diff --git a/autoreconf.sh b/autoreconf.sh index adffd6ba4..09ce386a5 100644 --- a/autoreconf.sh +++ b/autoreconf.sh @@ -100,6 +100,7 @@ install=false localdir=. # m4dir -- local Autoconf extensions. Typically `m4'. m4dir= +status=0 # symlink -- when --install, use symlinks instead. symlink=false verbose=: @@ -241,7 +242,7 @@ fi $debug || { trap 'status=$?; rm -rf $tmp && exit $status' 0 - trap 'exit $?' 1 2 13 15 + trap '(exit $?); exit' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -256,7 +257,7 @@ $debug || } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - exit 1; + (exit 1); exit } # When debugging, it is convenient that all the related temporary @@ -275,7 +276,7 @@ cat >$tmp/alflags.sed <$tmp/update.sh <<\EOF test -f "$1" || exit 0 test x`ls -1dt "$@" 2>/dev/null | sed 1q` != x"$1" diff --git a/bin/autoconf.in b/bin/autoconf.in index 2b56600c8..78e9804b9 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -299,7 +299,8 @@ case $task in ## --------------------------------- ## script) # M4 expansion. - $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || exit + $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || + { (exit 1); exit; } # You can add your own prefixes to pattern if you want to check for # them too. @@ -554,7 +555,8 @@ EOF do # The request may be several lines long, hence sed has to quit. trace_opt="$trace_opt -t "`echo "$trace" | sed -e 's/:.*//;q'` - echo "$trace" | $AWK -f $tmp/translate.awk >>$tmp/trace.m4 || exit + echo "$trace" | $AWK -f $tmp/translate.awk >>$tmp/trace.m4 || + { (exit 1); exit; } done echo "divert(0)dnl" >>$tmp/trace.m4 diff --git a/bin/autoheader.in b/bin/autoheader.in index 1dd9b0ce8..d7eb14dde 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -88,6 +88,7 @@ for autoconf in "$AUTOCONF" \ done debug=false localdir=. +status=0 tmp= verbose=: warning_all=false @@ -179,7 +180,7 @@ done $debug || { trap 'status=$?; rm -rf $tmp && exit $status' 0 - trap 'exit $?' 1 2 13 15 + trap '(exit $?); exit' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -194,7 +195,7 @@ $debug || } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - exit 1; + (exit 1); exit } # Preach. @@ -217,7 +218,7 @@ if ($warning_all || $warning_obsolete) && More sophisticated templates can also be produced, see the documentation. EOF - $warning_error && exit 1 + $warning_error && { (exit 1); exit; } fi acconfigs= @@ -230,7 +231,7 @@ case $# in *) exec >&2 echo "$me: invalid number of arguments." echo "$help" - exit 1 ;; + (exit 1); exit ;; esac # Set up autoconf. @@ -249,7 +250,7 @@ $autoconf \ $2"' \ --trace AC_DEFINE:'syms="$$syms $1"' \ --trace AC_DEFINE_UNQUOTED:'syms="$$syms $1"' \ - $infile >$tmp/traces.sh || exit 1 + $infile >$tmp/traces.sh || { (exit 1); exit; } $verbose $me: sourcing $tmp/traces.sh >&2 . $tmp/traces.sh @@ -271,7 +272,8 @@ syms=`for sym in $syms; do echo $sym; done | config_h=`echo "$config_h" | sed -e 's/ .*//'` # Support "outfile[:infile]", defaulting infile="outfile.in". case "$config_h" in -"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;; +"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2 + (exit 1); exit ;; *:*) config_h_in=`echo "$config_h" | sed 's/.*://'` config_h=`echo "$config_h" | sed 's/:.*//'` ;; *) config_h_in="$config_h.in" ;; @@ -305,7 +307,6 @@ test -f $config_h.bot && cat $config_h.bot >>$tmp/config.hin # Check that all the symbols have a template. $verbose $me: checking completeness of the template >&2 -status=0 # Regexp for a white space. w='[ ]' if test -n "$syms"; then @@ -336,4 +337,4 @@ if test $status = 0; then fi fi -exit $status +(exit $status); exit diff --git a/bin/autoreconf.in b/bin/autoreconf.in index adffd6ba4..09ce386a5 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -100,6 +100,7 @@ install=false localdir=. # m4dir -- local Autoconf extensions. Typically `m4'. m4dir= +status=0 # symlink -- when --install, use symlinks instead. symlink=false verbose=: @@ -241,7 +242,7 @@ fi $debug || { trap 'status=$?; rm -rf $tmp && exit $status' 0 - trap 'exit $?' 1 2 13 15 + trap '(exit $?); exit' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -256,7 +257,7 @@ $debug || } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - exit 1; + (exit 1); exit } # When debugging, it is convenient that all the related temporary @@ -275,7 +276,7 @@ cat >$tmp/alflags.sed <$tmp/update.sh <<\EOF test -f "$1" || exit 0 test x`ls -1dt "$@" 2>/dev/null | sed 1q` != x"$1"