1999-12-12 23:37:40 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
# Extract the initialization actions for builtin things.
|
|
|
|
|
|
2000-01-12 02:25:40 +00:00
|
|
|
fullfilename=$1; shift
|
1999-12-12 23:37:40 +00:00
|
|
|
|
1999-12-18 18:21:39 +00:00
|
|
|
# strip path to source directory
|
2000-01-12 02:25:40 +00:00
|
|
|
filename=`basename $fullfilename`
|
1999-12-18 18:21:39 +00:00
|
|
|
|
1999-12-12 23:37:40 +00:00
|
|
|
# we need to be sure that the .x file exists
|
|
|
|
|
# since the .c/.cc file may include it
|
|
|
|
|
# (the old guile-snarf did not have this problem
|
|
|
|
|
# because the makefile redirects output to the .x file
|
|
|
|
|
# which creates the file before the inclusion occurs)
|
|
|
|
|
# --12/12/99 gjb
|
2000-03-13 11:04:41 +00:00
|
|
|
no_ext=`echo $filename | sed 's/\.[^.]*$//g'`
|
2000-02-10 19:45:10 +00:00
|
|
|
dot_doc=${no_ext}.doc
|
1999-12-12 23:37:40 +00:00
|
|
|
|
|
|
|
|
temp="/tmp/snarf.$$"
|
|
|
|
|
trap "rm -f $temp" 0 1 2 15
|
|
|
|
|
|
2000-02-10 19:45:10 +00:00
|
|
|
## Let the user override the preprocessor & awk autoconf found.
|
1999-12-12 23:37:40 +00:00
|
|
|
test -n "${CPP+set}" || CPP="@CPP@"
|
2000-02-10 19:45:10 +00:00
|
|
|
test -n "${AWK+set}" || AWK="@AWK@"
|
1999-12-12 23:37:40 +00:00
|
|
|
|
2000-01-11 21:47:57 +00:00
|
|
|
## Must run guile-func-name-check on the unpreprocessed source
|
2000-02-13 17:41:10 +00:00
|
|
|
${AWK} -f guile-func-name-check "$fullfilename"
|
2000-01-11 21:47:57 +00:00
|
|
|
|
1999-12-12 23:37:40 +00:00
|
|
|
## We must use a temporary file here, instead of a pipe, because we
|
|
|
|
|
## need to know if CPP exits with a non-zero status.
|
2000-06-10 13:24:28 +00:00
|
|
|
${CPP} -DSCM_MAGIC_SNARFER "$@" > ${temp} || exit $?
|
2000-06-21 15:14:00 +00:00
|
|
|
cut -c1-1023 ${temp} | ${AWK} -f `dirname $0`/guile-snarf.awk ${dot_doc}
|