This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: GNUism in Guile
- To: Bernard URBAN <Bernard dot Urban at meteo dot fr>
- Subject: Re: GNUism in Guile
- From: Michael Livshin <mlivshin at bigfoot dot com>
- Date: 21 Dec 1999 11:54:40 +0200
- Cc: guile at sourceware dot cygnus dot com
- Organization: who? me?
- References: <9912210820.AA09087@min.meteo.fr>
Bernard URBAN <Bernard.Urban@meteo.fr> writes:
> Hello!
>
> In current CVS code, I found that libguile/guile-doc-snarf.in contains
> a reference to the GNU 'touch'. In addition, this script requires ksh,
> because of the line:
> dot_x=${filename%.*}.x
[ does anyone know whether the <bug-guile@gnu.org> list is archived
somewhere? ]
apply this patch:
1999-12-19 Michael Livshin <mlivshin@bigfoot.com>
* scm_validate.h (SCM_VALIDATE_BOOL_COPY): fix typo, so now build
works when passed --enable-debug-freelist.
* guile-doc-snarf.in: purged the bashisms. call the awk that
configure found, but let user override it (because the Solaris awk
is worthless, but nawk comes standard). call the awk snarfer with
the appropriate parameter. don't call touch at all, it isn't needed.
* guile-snarf.awk.in: changed the calling interface, so that the
only parameter is the basename of the doc file. also: set ARGC
to 0, so that nawk doesn't get confused.
Index: libguile/guile-doc-snarf.in
===================================================================
RCS file: /cvs/guile/guile/guile-core/libguile/guile-doc-snarf.in,v
retrieving revision 1.6
diff -u -b -r1.6 guile-doc-snarf.in
--- guile-doc-snarf.in 1999/12/18 18:21:39 1.6
+++ guile-doc-snarf.in 1999/12/19 10:48:23
@@ -12,16 +12,17 @@
# because the makefile redirects output to the .x file
# which creates the file before the inclusion occurs)
# --12/12/99 gjb
-dot_x=${filename%.*}.x
-touch --date=01/01/70 $dot_x
+no_ext=`echo $filename | /bin/sed 's/\.[^.]*$//g'`
+dot_doc=${no_ext}.doc
temp="/tmp/snarf.$$"
trap "rm -f $temp" 0 1 2 15
-## Let the user override the preprocessor autoconf found.
+## Let the user override the preprocessor & awk autoconf found.
test -n "${CPP+set}" || CPP="@CPP@"
+test -n "${AWK+set}" || AWK="@AWK@"
## 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} awk -f `dirname $0`/guile-snarf.awk $filename
+< ${temp} ${AWK} -f `dirname $0`/guile-snarf.awk `basename ${dot_doc}`
Index: libguile/guile-snarf.awk.in
===================================================================
RCS file: /cvs/guile/guile/guile-core/libguile/guile-snarf.awk.in,v
retrieving revision 1.1
diff -u -b -r1.1 guile-snarf.awk.in
--- guile-snarf.awk.in 1999/12/14 17:41:59 1.1
+++ guile-snarf.awk.in 1999/12/19 10:48:23
@@ -1,12 +1,10 @@
-#!/usr/bin/awk -f
# Written by Greg J. Badros, <gjb@cs.washington.edu>
# 12-Dec-1999
BEGIN { FS="|";
- filename = ARGV[1]; ARGV[1] = "";
- dot_x_file = filename; dot_doc_file = filename;
- sub(/\..*$/,".x",dot_x_file);
- sub(/\..*$/,".doc",dot_doc_file);
+ dot_doc_file = ARGV[1]; ARGV[1] = "";
+ ARGC = 0;
+ std_err = "/dev/stderr";
# be sure to put something in the files to help make out
print "";
printf "" > dot_doc_file;
@@ -38,8 +36,8 @@
gsub(/[ \t]*\|.*$/,"",copy);
sub(/ \)/,")",copy);
if (numargs != numactuals && !registering)
- { print location ":*** `" copy "' is improperly registered as having " numactuals " arguments" > /dev/stderr; }
- print "\n" copy (registering?")":"") > dot_doc_file ; }
+ { print location, ":*** \`", copy, "\' is improperly registered as having ", numactuals, " arguments" > std_err; }
+ print "\n", copy, (registering?")":"") > dot_doc_file ; }
/@@@/,/@!!!.*$/ { copy = $0;
gsub(/.*@@@/,"",copy);
@@ -48,5 +46,6 @@
gsub(/\\\"/,"\"",copy);
gsub(/[ \t]*$/,"", copy);
if (copy != "") { print copy > dot_doc_file } }
-/@!!![ \t]/ { print "[" location "]" >> dot_doc_file; }
+
+/@!!![ \t]/ { print "[", location, "]" >> dot_doc_file; }
Index: libguile/scm_validate.h
===================================================================
RCS file: /cvs/guile/guile/guile-core/libguile/scm_validate.h,v
retrieving revision 1.8
diff -u -b -r1.8 scm_validate.h
--- scm_validate.h 1999/12/19 01:04:36 1.8
+++ scm_validate.h 1999/12/19 10:48:23
@@ -95,7 +95,7 @@
#define SCM_VALIDATE_BOOL(pos,flag) SCM_MAKE_VALIDATE(pos,flag,BOOLP)
#define SCM_VALIDATE_BOOL_COPY(pos,flag,cvar) \
- do { SCM_ASSERT(SCM_BOOLP(flags), flag, pos, FUNC_NAME); \
+ do { SCM_ASSERT(SCM_BOOLP(flag), flag, pos, FUNC_NAME); \
cvar = (SCM_BOOL_T == flag)? 1: 0; } while (0)
#define SCM_VALIDATE_CHAR(pos,scm) SCM_MAKE_VALIDATE(pos,scm,ICHRP)