Commit | Line | Data |
---|---|---|
3dc81fba GB |
1 | #!/bin/sh |
2 | # Extract the initialization actions for builtin things. | |
d6a35f3f MV |
3 | # |
4 | # Copyright (C) 1999, 2000 Free Software Foundation, Inc. | |
5 | # | |
6 | # This program is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2, or (at your option) | |
9 | # any later version. | |
10 | # | |
11 | # This program is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with this software; see the file COPYING. If not, write to | |
18 | # the Free Software Foundation, Inc., 59 Temple Place, Suite 330, | |
19 | # Boston, MA 02111-1307 USA | |
3dc81fba | 20 | |
dd3c73d2 | 21 | fullfilename=$1; shift |
3dc81fba | 22 | |
aff882a8 | 23 | # strip path to source directory |
dd3c73d2 | 24 | filename=`basename $fullfilename` |
aff882a8 | 25 | |
3dc81fba GB |
26 | # we need to be sure that the .x file exists |
27 | # since the .c/.cc file may include it | |
28 | # (the old guile-snarf did not have this problem | |
29 | # because the makefile redirects output to the .x file | |
30 | # which creates the file before the inclusion occurs) | |
31 | # --12/12/99 gjb | |
a1bfef7f | 32 | no_ext=`echo $filename | sed 's/\.[^.]*$//g'` |
11a5232f | 33 | dot_doc=${no_ext}.doc |
3dc81fba GB |
34 | |
35 | temp="/tmp/snarf.$$" | |
36 | trap "rm -f $temp" 0 1 2 15 | |
37 | ||
11a5232f | 38 | ## Let the user override the preprocessor & awk autoconf found. |
3dc81fba | 39 | test -n "${CPP+set}" || CPP="@CPP@" |
11a5232f | 40 | test -n "${AWK+set}" || AWK="@AWK@" |
3dc81fba | 41 | |
0f981281 | 42 | ## Must run guile-func-name-check on the unpreprocessed source |
fa787a58 | 43 | ${AWK} -f guile-func-name-check "$fullfilename" |
0f981281 | 44 | |
3dc81fba GB |
45 | ## We must use a temporary file here, instead of a pipe, because we |
46 | ## need to know if CPP exits with a non-zero status. | |
adb2c53b | 47 | ${CPP} -DSCM_MAGIC_SNARFER "$@" > ${temp} || exit $? |
7f40b48a | 48 | cut -c1-1023 ${temp} | ${AWK} -f `dirname $0`/guile-snarf.awk ${dot_doc} |