summaryrefslogtreecommitdiff
path: root/libguile/guile-snarf.in
blob: ead21ef4b365d3d2e0a327ab84b6a4100bd7b60e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# Extract the initialization actions for builtin things.

temp="/tmp/snarf.$$"
trap "rm -f $temp" 0 1 2 15

## Let the user override the preprocessor autoconf found.
test -n "${CPP+set}" || CPP="@CPP@"

## We must use a temporary file here, instead of a pipe, because we
## need to know if CPP exits with a non-zero status.
${CPP} -DSCM_MAGIC_SNARFER "$@" > ${temp} || exit $?
< ${temp} grep "^ *% *% *%" | sed -e "s/^ *% *% *%//" -e 's/\$\$\$.*$//g'

## Apparently, AIX's preprocessor is unhappy if you try to #include an
## empty file.
echo