diff --git a/libguile/ChangeLog b/libguile/ChangeLog index ef8dce813..417f97290 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,18 @@ +Mon Jan 13 03:47:04 1997 Gary Houston + + * Makefile.am (EXTRA_DIST): add errnos_cnvt.awk, errnos.default, + errnos_get.c. + Add a rule to generate errnos.c from errnos. + * error.c (scm_init_error): include errnos.c. + * errnos_cnvt.awk: new file, converts the list of errno codes to + C expressions. + * errnos_get.c: new file. + * errnos.default: new file, contains errnos to try if they can't + be extracted from errno.h. + * configure.in: if using GCC, try and extract errno codes from + errno.h. + Added AC_PROG_AWK. + Sat Jan 11 14:47:00 1997 Marius Vollmer * configure.in: Replaced AC_PROG_RANLIB with AM_PROG_LIBTOOL. @@ -58,7 +73,7 @@ Tue Jan 7 15:04:06 1997 Mikael Djurfeldt Mon Jan 6 20:39:08 1997 Gary Houston * socket.c (scm_recvfrom): allow buff_or_size to be a list containing - the buffer and start and end positions for SCSH networking + the buffer and start and end positions for scsh networking implementation. Sun Jan 5 13:53:53 1997 Jim Blandy diff --git a/libguile/Makefile.am b/libguile/Makefile.am index e4252bb9a..f65f503ba 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -44,7 +44,8 @@ modinclude_DATA = scmconfig.h bin_SCRIPTS = guile-snarf EXTRA_DIST = gscm.c gscm.h ChangeLog-scm dynl-dl.c dynl-dld.c dynl-shl.c \ -dynl-vms.c DYNAMIC-LINKING PLUGIN/REQ PLUGIN/guile.config PLUGIN/guile.libs.in +dynl-vms.c DYNAMIC-LINKING PLUGIN/REQ PLUGIN/guile.config \ +PLUGIN/guile.libs.in errnos_cnvt.awk errnos.default errnos_get.c ## FIXME: shouldn't directly generate file; instead generate temp file ## and "mv". Consider using timestamp file as well, to avoid @@ -66,3 +67,9 @@ dynl.o dynl.lo: dynl.x ## Add -MG to make the .x magic work with auto-dep code. MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) + +errnos.c: errnos.list + $(AWK) -f $(srcdir)/errnos_cnvt.awk < errnos.list > errnos.c + +CLEANFILES=errnos.c +DISTCLEANFILES=errnos.list diff --git a/libguile/Makefile.in b/libguile/Makefile.in index f158d37c1..5d6991be9 100644 --- a/libguile/Makefile.in +++ b/libguile/Makefile.in @@ -88,11 +88,15 @@ modinclude_DATA = scmconfig.h bin_SCRIPTS = guile-snarf EXTRA_DIST = gscm.c gscm.h ChangeLog-scm dynl-dl.c dynl-dld.c dynl-shl.c \ -dynl-vms.c DYNAMIC-LINKING PLUGIN/REQ PLUGIN/guile.config PLUGIN/guile.libs.in +dynl-vms.c DYNAMIC-LINKING PLUGIN/REQ PLUGIN/guile.config \ +PLUGIN/guile.libs.in errnos_cnvt.awk errnos.default errnos_get.c SUFFIXES = .x MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) + +CLEANFILES=errnos.c +DISTCLEANFILES=errnos.list ACLOCAL = $(top_srcdir)/aclocal.m4 CONFIG_HEADER_IN = scmconfig.h.in mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -489,6 +493,9 @@ libpath.h: Makefile dynl.o dynl.lo: dynl.x +errnos.c: errnos.list + $(AWK) -f $(srcdir)/errnos_cnvt.awk < errnos.list > errnos.c + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/libguile/configure b/libguile/configure index f200d575f..5c6512b77 100755 --- a/libguile/configure +++ b/libguile/configure @@ -2748,6 +2748,53 @@ case "$GCC" in yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;; esac +for ac_prog in mawk gawk nawk awk +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2757: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AWK="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AWK="$ac_cv_prog_AWK" +if test -n "$AWK"; then + echo "$ac_t""$AWK" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$AWK" && break +done + +echo $ac_n "checking whether errno codes can be extracted from errno.h""... $ac_c" 1>&6 +echo "configure:2786: checking whether errno codes can be extracted from errno.h" >&5 +goterrnos=0 +if test "$GCC" = yes ; then + ${CC-cc} -undef -dM -E $srcdir/errnos_get.c | egrep ' E.+' | cut -f2 -d' ' > errnos.list + egrep '^E.+' errnos.list > /dev/null 2>&1 && goterrnos=1 +fi +if test $goterrnos = 1 ; then + echo "$ac_t""yes" 1>&6 +else + cp $srcdir/errnos.default errnos.list + echo "$ac_t""no, using default" 1>&6 +fi + cat >> confdefs.h < errnos.list + egrep '^E.+' errnos.list > /dev/null 2>&1 && goterrnos=1 +fi +if test $goterrnos = 1 ; then + AC_MSG_RESULT(yes) +else + cp $srcdir/errnos.default errnos.list + AC_MSG_RESULT([no, using default]) +fi + AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, "$GUILE_MAJOR_VERSION") AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, "$GUILE_MINOR_VERSION") AC_DEFINE_UNQUOTED(GUILE_VERSION, "$GUILE_VERSION") diff --git a/libguile/error.c b/libguile/error.c index 68f24a985..93ec9debf 100644 --- a/libguile/error.c +++ b/libguile/error.c @@ -323,6 +323,7 @@ scm_wta (arg, pos, s_subr) void scm_init_error () { +#include "errnos.c" #include "error.x" }