33 |
# If there are errors during processing, delete OUTFILE and exit with |
# If there are errors during processing, delete OUTFILE and exit with |
34 |
# non-zero status. |
# non-zero status. |
35 |
# |
# |
36 |
# During snarfing, the pre-processor macro @code{SCM_MAGIC_SNARFER} is |
# During snarfing, the pre-processor macro SCM_MAGIC_SNARFER is |
37 |
# defined. |
# defined. |
38 |
# |
# |
39 |
# If env var CPP is set, use its value instead of the C pre-processor |
# If env var CPP is set, use its value instead of the C pre-processor |
74 |
temp="/tmp/snarf.$$" |
temp="/tmp/snarf.$$" |
75 |
if [ x"$CPP" = x ] ; then cpp="@CPP@" ; else cpp="$CPP" ; fi |
if [ x"$CPP" = x ] ; then cpp="@CPP@" ; else cpp="$CPP" ; fi |
76 |
|
|
77 |
trap "rm -f $temp $clean_infile" 0 1 2 15 |
trap "rm -f $temp" 0 1 2 15 |
78 |
|
|
79 |
if [ ! "$outfile" = "-" ] ; then |
if [ ! "$outfile" = "-" ] ; then |
80 |
self_blind_regexp='^#include ".*'`basename $outfile`'"' |
self_blind_regexp='^#include ".*'`basename $outfile`'"' |
83 |
# (e.g., see libguile/eval.c). |
# (e.g., see libguile/eval.c). |
84 |
# use .c to satisfy cpp heuristics. |
# use .c to satisfy cpp heuristics. |
85 |
# clean input file |
# clean input file |
86 |
|
trap "rm -f $cleanfile" 0 1 2 15 |
87 |
grep -v "$self_blind_regexp" $infile > $clean_infile |
grep -v "$self_blind_regexp" $infile > $clean_infile |
88 |
modern_snarf "$@" $clean_infile > $outfile |
modern_snarf "$@" $clean_infile > $outfile |
89 |
else |
else |