for signals other than 0 - exit with code 1.
* m4sh.m4 (AS_TMPDIR): Likewise.
* autoconf.in: Likewise. Also don't rely on exit == exit $?.
* autoheader.in: Likewise.
* autoreconf.in: Likewise.
* tests/torture.at (Signal handling): New test for the above.
+2001-06-02 Pavel Roskin <proski@gnu.org>
+
+ * acgeneral.m4 (_AC_INIT_PREPARE): Don't rely on $? in the traps
+ for signals other than 0 - exit with code 1.
+ * m4sh.m4 (AS_TMPDIR): Likewise.
+ * autoconf.in: Likewise. Also don't rely on exit == exit $?.
+ * autoheader.in: Likewise.
+ * autoreconf.in: Likewise.
+ * tests/torture.at (Signal handling): New test for the above.
+
2001-06-01 Akim Demaille <akim@epita.fr>
* m4sugar.m4 (m4_defn, m4_undefine, m4_popdef): Clarify the error
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
- trap 'ac_status=$?; ac_signal='$ac_signal'; AS_EXIT([$ac_status])' $ac_signal
+ trap 'ac_signal='$ac_signal'; AS_EXIT([1])' $ac_signal
done
ac_signal=0
$debug ||
{
trap 'status=$?; rm -rf $tmp && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
+ trap '(exit 1); exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
} ||
{
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
- (exit 1); exit;
+ (exit 1); exit 1;
}
# Running m4.
*) exec >&2
echo "$me: invalid number of arguments."
echo "$help"
- (exit 1); exit ;;
+ (exit 1); exit 1 ;;
esac
# Unless specified, the output is stdout.
cat >$infile
elif test ! -r "$infile"; then
echo "$me: $infile: No such file or directory" >&2
- (exit 1); exit
+ (exit 1); exit 1
fi
# Output is produced into FD 4. Prepare it.
: >$tmp/forbidden.rx
: >$tmp/allowed.rx
$run_m4f -Dm4_warnings=$m4_warnings $infile >$tmp/configure ||
- { (exit 1); exit; }
+ { (exit 1); exit 1; }
if test "x$outfile" != x-; then
chmod +x $outfile
`$verbose "-v verbose=1"` \
-f "$tmp/finalize.awk" <$tmp/configure >&4 ||
{ test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
- (exit 1); exit; }
+ (exit 1); exit 1; }
test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
;; # End of the task script.
trace_opt="$trace_opt -t $base_name -t m4_$base_name"
echo "$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
- { (exit 1); exit; }
+ { (exit 1); exit 1; }
echo "m4_$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
- { (exit 1); exit; }
+ { (exit 1); exit 1; }
else
# MACRO_NAME is not a builtin.
trace_opt="$trace_opt -t $macro_name"
echo "$trace" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
- { (exit 1); exit; }
+ { (exit 1); exit 1; }
fi
echo >>$tmp/trace.m4
done
' >&4 ||
{
echo "$me: tracing failed" >&2
- (exit 1); exit
+ (exit 1); exit 1
}
;;
## ------------ ##
*) echo "$me: internal error: unknown task: $task" >&2
- (exit 1); exit
+ (exit 1); exit 1
esac
-(exit $status); exit
+(exit $status); exit $status
$debug ||
{
trap 'status=$?; rm -rf $tmp && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
+ trap '(exit 1); exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
} ||
{
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
- (exit 1); exit
+ (exit 1); exit 1
}
# Preach.
More sophisticated templates can also be produced, see the
documentation.
EOF
- $warning_error && { (exit 1); exit; }
+ $warning_error && { (exit 1); exit 1; }
fi
acconfigs=
*in ) infile=configure.in;;
* )
echo "$me: no input file" >&2
- exit 1;;
+ (exit 1); exit 1;;
esac;;
1) infile=$1 ;;
*) exec >&2
echo "$me: invalid number of arguments."
echo "$help"
- (exit 1); exit ;;
+ (exit 1); exit 1;;
esac
# Set up autoconf.
--trace AH_OUTPUT:'ac_verbatim_$1="\
$2"' \
--trace AC_DEFINE_TRACE_LITERAL:'syms="$$syms $1"' \
- $infile >$tmp/traces.sh || { (exit 1); exit; }
+ $infile >$tmp/traces.sh || { (exit 1); exit 1; }
$verbose $me: sourcing $tmp/traces.sh >&2
if (set -e && . $tmp/traces.sh) >/dev/null 2>&1; then
. $tmp/traces.sh
else
echo "$me: error: shell error while sourcing $tmp/traces.sh" >&2
- (exit 1); exit
+ (exit 1); exit 1
fi
# Support "outfile[:infile]", defaulting infile="outfile.in".
case "$config_h" in
"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2
- (exit 1); exit ;;
+ (exit 1); exit 1 ;;
*:*) config_h_in=`echo "$config_h" | sed 's/.*://'`
config_h=`echo "$config_h" | sed 's/:.*//'` ;;
*) config_h_in="$config_h.in" ;;
fi
fi
-(exit $status); exit
+(exit $status); exit $status
$debug ||
{
trap 'status=$?; rm -rf $tmp && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
+ trap '(exit 1); exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
} ||
{
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
- (exit 1); exit
+ (exit 1); exit 1
}
# When debugging, it is convenient that all the related temporary
$debug ||
{
trap 'status=$?; rm -rf $tmp && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
+ trap '(exit 1); exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
} ||
{
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
- (exit 1); exit;
+ (exit 1); exit 1;
}
# Running m4.
*) exec >&2
echo "$me: invalid number of arguments."
echo "$help"
- (exit 1); exit ;;
+ (exit 1); exit 1 ;;
esac
# Unless specified, the output is stdout.
cat >$infile
elif test ! -r "$infile"; then
echo "$me: $infile: No such file or directory" >&2
- (exit 1); exit
+ (exit 1); exit 1
fi
# Output is produced into FD 4. Prepare it.
: >$tmp/forbidden.rx
: >$tmp/allowed.rx
$run_m4f -Dm4_warnings=$m4_warnings $infile >$tmp/configure ||
- { (exit 1); exit; }
+ { (exit 1); exit 1; }
if test "x$outfile" != x-; then
chmod +x $outfile
`$verbose "-v verbose=1"` \
-f "$tmp/finalize.awk" <$tmp/configure >&4 ||
{ test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
- (exit 1); exit; }
+ (exit 1); exit 1; }
test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
;; # End of the task script.
trace_opt="$trace_opt -t $base_name -t m4_$base_name"
echo "$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
- { (exit 1); exit; }
+ { (exit 1); exit 1; }
echo "m4_$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
- { (exit 1); exit; }
+ { (exit 1); exit 1; }
else
# MACRO_NAME is not a builtin.
trace_opt="$trace_opt -t $macro_name"
echo "$trace" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
- { (exit 1); exit; }
+ { (exit 1); exit 1; }
fi
echo >>$tmp/trace.m4
done
' >&4 ||
{
echo "$me: tracing failed" >&2
- (exit 1); exit
+ (exit 1); exit 1
}
;;
## ------------ ##
*) echo "$me: internal error: unknown task: $task" >&2
- (exit 1); exit
+ (exit 1); exit 1
esac
-(exit $status); exit
+(exit $status); exit $status
$debug ||
{
trap 'status=$?; rm -rf $tmp && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
+ trap '(exit 1); exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
} ||
{
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
- (exit 1); exit
+ (exit 1); exit 1
}
# Preach.
More sophisticated templates can also be produced, see the
documentation.
EOF
- $warning_error && { (exit 1); exit; }
+ $warning_error && { (exit 1); exit 1; }
fi
acconfigs=
*in ) infile=configure.in;;
* )
echo "$me: no input file" >&2
- exit 1;;
+ (exit 1); exit 1;;
esac;;
1) infile=$1 ;;
*) exec >&2
echo "$me: invalid number of arguments."
echo "$help"
- (exit 1); exit ;;
+ (exit 1); exit 1;;
esac
# Set up autoconf.
--trace AH_OUTPUT:'ac_verbatim_$1="\
$2"' \
--trace AC_DEFINE_TRACE_LITERAL:'syms="$$syms $1"' \
- $infile >$tmp/traces.sh || { (exit 1); exit; }
+ $infile >$tmp/traces.sh || { (exit 1); exit 1; }
$verbose $me: sourcing $tmp/traces.sh >&2
if (set -e && . $tmp/traces.sh) >/dev/null 2>&1; then
. $tmp/traces.sh
else
echo "$me: error: shell error while sourcing $tmp/traces.sh" >&2
- (exit 1); exit
+ (exit 1); exit 1
fi
# Support "outfile[:infile]", defaulting infile="outfile.in".
case "$config_h" in
"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2
- (exit 1); exit ;;
+ (exit 1); exit 1 ;;
*:*) config_h_in=`echo "$config_h" | sed 's/.*://'`
config_h=`echo "$config_h" | sed 's/:.*//'` ;;
*) config_h_in="$config_h.in" ;;
fi
fi
-(exit $status); exit
+(exit $status); exit $status
$debug ||
{
trap 'status=$?; rm -rf $tmp && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
+ trap '(exit 1); exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
} ||
{
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
- (exit 1); exit
+ (exit 1); exit 1
}
# When debugging, it is convenient that all the related temporary
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
- trap 'ac_status=$?; ac_signal='$ac_signal'; AS_EXIT([$ac_status])' $ac_signal
+ trap 'ac_signal='$ac_signal'; AS_EXIT([1])' $ac_signal
done
ac_signal=0
$debug ||
{
trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap 'AS_EXIT([$?])' 1 2 13 15
+ trap 'AS_EXIT([1])' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
$debug ||
{
trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap 'AS_EXIT([$?])' 1 2 13 15
+ trap 'AS_EXIT([1])' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
AT_CHECK([cd at-dir && $at_here/configure], [], [ignore])
AT_CLEANUP(at-dir foo.in foo)
+
+
+## ----------------- ##
+## Signal handling. ##
+## ----------------- ##
+
+AT_SETUP([Signal handling])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+kill -2 $$
+exit 77
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([], 1, ignore, ignore)
+
+AT_CLEANUP