1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-19 19:20:23 +02:00

* ioext.c (scm_setfileno): throw a runtime error if SET_FILE_FD_FIELD

wan't defined.  Don't include fd.h.

* Previously fd.h was regenerated whenever configure was run,
forcing a couple of files to be recompiled.

* fd.h.in: deleted, SET_FILE_FD_FIELD moved to ioext.c.
* configure.in: AC_DEFINE FD_SETTER instead of HAVE_FD_SETTER.
Check for _fileno as well as _file.
Don't output fd.h.
* ioext.c: don't fd.h.
* acconfig.h: remove duplicate HAVE_FD_SETTER and change the
other to FD_SETTER.

* Change the stratigy for getting information about errno
(and now signal number) values, e.g., ENOSYS, SIGKILL.  Instead of
generating lists of symbols during the build process, which will
not always work, include comprehensive lists in the distribution.
To help keep the lists up to date, the "check_signals" and
"check_errnos" make targets can be used.

* configure.in: don't check for a command to extract errno codes.
* Makefile.am: update file lists, remove errnos.list and errnos.c
targets, add cpp_err_symbols.c, cpp_sig_symbols.c, check_signals,
check_errnos targets.
(CLEANFILES): remove errnos.c and errnos.list, add
cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new
cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new
* errnos.default: deleted.
* cpp_signal.c: new file.
* cpp_errno.c: renamed from errnos_get.c.
* cpp_err_symbols, cpp_sig_symbols: new files.
* cpp_cnvt.awk: renamed from errnos_cnvt_awk.
* error.c (scm_init_error): #include cpp_err_symbols instead of
errnos.c.
* posix.c (scm_init_posix): don't intern signal symbols.  #include
cpp_sig_symbols.c.
* strop.c (scm_i_index): allow the lower bound to be equal to the
length of the string, so a null string doesn't always give an error.

* posix.h: new prototypes.
* posix.c (scm_status_exit_val, scm_status_term_sig,
scm_status_stop_sig): new functions, as in scsh.  They break down
process status values as returned by waitpid.
This commit is contained in:
Gary Houston 1997-03-29 18:42:43 +00:00
parent 9337637f9a
commit 67ec36676e
18 changed files with 359 additions and 393 deletions

View file

@ -123,34 +123,23 @@ fi
#
#--------------------------------------------------------------------
FD_SETTER=""
AC_MSG_CHECKING(how to set a stream file descriptor)
AC_CACHE_VAL(scm_cv_fd_setter,
AC_TRY_COMPILE([#include <stdio.h>],
[stdout->_file = 1],
scm_cv_fd_setter="_file",
AC_TRY_COMPILE([#include <stdio.h>],
[stdout->_fileno = 1],
scm_cv_fd_setter="_fileno",
scm_cv_fd_setter="")))
if test "x$FD_SETTER" = x; then
AC_TRY_COMPILE(#include <stdio.h>
, stdout->_file = 1,
FD_SETTER="((F)->_file = (D))")
if test "$scm_cv_fd_setter"; then
AC_MSG_RESULT($scm_cv_fd_setter)
AC_DEFINE_UNQUOTED(FD_SETTER, $scm_cv_fd_setter)
else
AC_MSG_RESULT(we couldn't do it!)
fi
if test "x$FD_SETTER" = x; then
AC_TRY_COMPILE(#include <stdio.h>
, stdout->_fileno,
FD_SETTER="((F)->_fileno = (D))")
fi
dnl
dnl Add FD_SETTER tests for other systems here. Your test should
dnl try a particular style of assigning to the descriptor
dnl field(s) of a FILE* and define FD_SETTER accordingly.
dnl
dnl The value of FD_SETTER is used as a macro body, as in:
dnl
dnl #define SET_FILE_FD_FIELD(F,D) @FD_SETTER@
dnl
dnl F is a FILE* and D a descriptor (int).
dnl
test "x$FD_SETTER" != x && AC_DEFINE(HAVE_FD_SETTER)
#--------------------------------------------------------------------
# How to find out whether a FILE structure contains buffered data.
# From Tk we have the following list:
@ -195,6 +184,8 @@ AC_CACHE_VAL(scm_cv_struct_file_readptr,
if test "$scm_cv_struct_file_readptr"; then
AC_MSG_RESULT(read_ptr)
AC_DEFINE_UNQUOTED(FILE_CNT_READPTR, $scm_cv_struct_file_readptr)
else
AC_MSG_RESULT(we couldn't do it!)
fi
fi
fi
@ -234,14 +225,6 @@ case "$GCC" in
esac
AC_PROG_AWK
AC_MSG_CHECKING(whether errno codes can be extracted from errno.h)
if test "$GCC" = yes ; then
AC_MSG_RESULT(yes)
ERRNO_EXTRACT="${CC-cc} -undef -dM -E $srcdir/errnos_get.c | egrep ' E.+' | cut -f2 -d' ' > errnos.list"
else
ERRNO_EXTRACT="cp $srcdir/errnos.default errnos.list"
AC_MSG_RESULT([no, using default])
fi
## If we're creating a shared library (using libtool!), then we'll
## need to generate a list of .lo files corresponding to the .o files
@ -253,10 +236,8 @@ AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, "$GUILE_MINOR_VERSION")
AC_DEFINE_UNQUOTED(GUILE_VERSION, "$GUILE_VERSION")
AC_SUBST(AWK)
AC_SUBST(FD_SETTER)
AC_SUBST(ERRNO_EXTRACT)
AC_SUBST(LIBLOBJS)
AC_OUTPUT([Makefile fd.h guile-snarf PLUGIN/guile.libs], [chmod +x guile-snarf])
AC_OUTPUT([Makefile guile-snarf PLUGIN/guile.libs], [chmod +x guile-snarf])
dnl Local Variables:
dnl comment-start: "dnl "