237 |
$debug || |
$debug || |
238 |
{ |
{ |
239 |
trap 'status=$?; rm -rf $tmp && exit $status' 0 |
trap 'status=$?; rm -rf $tmp && exit $status' 0 |
240 |
trap '(exit $?); exit' 1 2 13 15 |
trap '(exit 1); exit 1' 1 2 13 15 |
241 |
} |
} |
242 |
|
|
243 |
# Create a (secure) tmp directory for tmp files. |
# Create a (secure) tmp directory for tmp files. |
252 |
} || |
} || |
253 |
{ |
{ |
254 |
echo "$me: cannot create a temporary directory in $TMPDIR" >&2 |
echo "$me: cannot create a temporary directory in $TMPDIR" >&2 |
255 |
(exit 1); exit; |
(exit 1); exit 1; |
256 |
} |
} |
257 |
|
|
258 |
# Running m4. |
# Running m4. |
282 |
*) exec >&2 |
*) exec >&2 |
283 |
echo "$me: invalid number of arguments." |
echo "$me: invalid number of arguments." |
284 |
echo "$help" |
echo "$help" |
285 |
(exit 1); exit ;; |
(exit 1); exit 1 ;; |
286 |
esac |
esac |
287 |
|
|
288 |
# Unless specified, the output is stdout. |
# Unless specified, the output is stdout. |
294 |
cat >$infile |
cat >$infile |
295 |
elif test ! -r "$infile"; then |
elif test ! -r "$infile"; then |
296 |
echo "$me: $infile: No such file or directory" >&2 |
echo "$me: $infile: No such file or directory" >&2 |
297 |
(exit 1); exit |
(exit 1); exit 1 |
298 |
fi |
fi |
299 |
|
|
300 |
# Output is produced into FD 4. Prepare it. |
# Output is produced into FD 4. Prepare it. |
316 |
: >$tmp/forbidden.rx |
: >$tmp/forbidden.rx |
317 |
: >$tmp/allowed.rx |
: >$tmp/allowed.rx |
318 |
$run_m4f -Dm4_warnings=$m4_warnings $infile >$tmp/configure || |
$run_m4f -Dm4_warnings=$m4_warnings $infile >$tmp/configure || |
319 |
{ (exit 1); exit; } |
{ (exit 1); exit 1; } |
320 |
|
|
321 |
if test "x$outfile" != x-; then |
if test "x$outfile" != x-; then |
322 |
chmod +x $outfile |
chmod +x $outfile |
429 |
`$verbose "-v verbose=1"` \ |
`$verbose "-v verbose=1"` \ |
430 |
-f "$tmp/finalize.awk" <$tmp/configure >&4 || |
-f "$tmp/finalize.awk" <$tmp/configure >&4 || |
431 |
{ test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2 |
{ test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2 |
432 |
(exit 1); exit; } |
(exit 1); exit 1; } |
433 |
test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2 |
test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2 |
434 |
;; # End of the task script. |
;; # End of the task script. |
435 |
|
|
691 |
trace_opt="$trace_opt -t $base_name -t m4_$base_name" |
trace_opt="$trace_opt -t $base_name -t m4_$base_name" |
692 |
echo "$base_name$trace_format" | |
echo "$base_name$trace_format" | |
693 |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 || |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 || |
694 |
{ (exit 1); exit; } |
{ (exit 1); exit 1; } |
695 |
echo "m4_$base_name$trace_format" | |
echo "m4_$base_name$trace_format" | |
696 |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 || |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 || |
697 |
{ (exit 1); exit; } |
{ (exit 1); exit 1; } |
698 |
else |
else |
699 |
# MACRO_NAME is not a builtin. |
# MACRO_NAME is not a builtin. |
700 |
trace_opt="$trace_opt -t $macro_name" |
trace_opt="$trace_opt -t $macro_name" |
701 |
echo "$trace" | |
echo "$trace" | |
702 |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 || |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 || |
703 |
{ (exit 1); exit; } |
{ (exit 1); exit 1; } |
704 |
fi |
fi |
705 |
echo >>$tmp/trace.m4 |
echo >>$tmp/trace.m4 |
706 |
done |
done |
740 |
' >&4 || |
' >&4 || |
741 |
{ |
{ |
742 |
echo "$me: tracing failed" >&2 |
echo "$me: tracing failed" >&2 |
743 |
(exit 1); exit |
(exit 1); exit 1 |
744 |
} |
} |
745 |
;; |
;; |
746 |
|
|
750 |
## ------------ ## |
## ------------ ## |
751 |
|
|
752 |
*) echo "$me: internal error: unknown task: $task" >&2 |
*) echo "$me: internal error: unknown task: $task" >&2 |
753 |
(exit 1); exit |
(exit 1); exit 1 |
754 |
esac |
esac |
755 |
|
|
756 |
(exit $status); exit |
(exit $status); exit $status |