2 # guile-snarf-docs --- Extract the doc stuff for builtin things.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001,
5 # 2006, 2010 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation; either version 3, or (at
10 # your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this software; see the file COPYING.LESSER. If
19 # not, write to the Free Software Foundation, Inc., 51 Franklin
20 # Street, Fifth Floor, Boston, MA 02110-1301 USA
22 # Usage: guile-snarf-docs -o DOC SRC -- [CPPSNARFOPTS...]
25 filter
='./guile_filter_doc_snarfage@EXEEXT@'
27 ## Let the user override the preprocessor autoconf found.
28 test -n "${CPP+set}" || CPP
="@CPP@"
31 test -n "${AWK+set}" || AWK
="@AWK@"
35 echo 'Bad command-line' $1
39 test "x$1" = x-o || bummer
42 test "x$1" = x
&& bummer
': missing DOC'
47 test "x$1" && test -r "$1" || bummer
': missing SRC'
51 test "x$1" = x-- || bummer
54 # Before snarfing, do the function name check.
55 ${AWK} -f '@srcdir@/guile-func-name-check' "$input" ||
exit 1
57 # Snarfing takes two steps: cpp and tokenization.
58 # If cpp fails, don't bother with tokenization.
59 if ${CPP} -DSCM_MAGIC_SNARF_DOCS "$@" "$input" > "$temout" ; then
60 $filter --filter-snarfage < "$temout" > "$output"
68 # guile-snarf-docs ends here