593 |
map { split /,/ } @warning)); |
map { split /,/ } @warning)); |
594 |
|
|
595 |
# GNU m4 appends when using --error-output. |
# GNU m4 appends when using --error-output. |
596 |
unlink ($tcache . $req->id); |
unlink ($tcache . $req->id . "t"); |
597 |
|
|
598 |
# Run m4. |
# Run m4. |
599 |
# |
# |
601 |
# |
# |
602 |
# Be extremely cautious to reverse the includes when talking to M4: |
# Be extremely cautious to reverse the includes when talking to M4: |
603 |
# it doesn't speak the same --include as we do. |
# it doesn't speak the same --include as we do. |
604 |
|
# |
605 |
|
# We don't output directly to the cache files, to avoid problems |
606 |
|
# when we are interrupted (that leaves corrupted files). |
607 |
my $command = ("$m4" |
my $command = ("$m4" |
608 |
. join (' --include=', '', reverse @include) |
. join (' --include=', '', reverse @include) |
609 |
. " --define=m4_warnings=$m4_warnings" |
. " --define=m4_warnings=$m4_warnings" |
610 |
. ' --debug=aflq' |
. ' --debug=aflq' |
611 |
. " --error-output=$tcache" . $req->id |
. " --error-output=$tcache" . $req->id . "t" |
612 |
. join (' --trace=', '', sort @macro) |
. join (' --trace=', '', sort @macro) |
613 |
. " @ARGV" |
. " @ARGV" |
614 |
. ' </dev/null' |
. ' </dev/null' |
615 |
. " >$ocache" . $req->id); |
. " >$ocache" . $req->id . "t"); |
616 |
verbose "running: $command"; |
verbose "running: $command"; |
617 |
system $command; |
system $command; |
618 |
if ($?) |
if ($?) |
620 |
verbose "$m4: failed with exit status: " . ($? >> 8) . "\n"; |
verbose "$m4: failed with exit status: " . ($? >> 8) . "\n"; |
621 |
exit $? >> 8; |
exit $? >> 8; |
622 |
} |
} |
623 |
|
|
624 |
|
# Everything went ok: preserve the outputs. |
625 |
|
foreach ($tcache, $ocache) |
626 |
|
{ |
627 |
|
use File::Copy; |
628 |
|
$_ .= $req->id; |
629 |
|
move ("${_}t", "$_") |
630 |
|
or die "$me: cannot not rename ${_}t as $_: $!\n"; |
631 |
|
} |
632 |
} |
} |
633 |
|
|
634 |
|
|