1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

let fdsocket.c compile if struct linger is missing

This commit is contained in:
Gary Houston 1996-08-03 03:12:33 +00:00
parent 02b754d3a6
commit 2e18892a89
5 changed files with 104 additions and 43 deletions

View file

@ -1,3 +1,11 @@
Sat Aug 3 01:27:14 1996 Gary Houston <ghouston@actrix.gen.nz>
* fdsocket.c: getsockopt, setsockopt: use HAVE_STRUCT_LINGER.
* scmconfig.h.in: add HAVE_STRUCT_LINGER.
* configure.in: check for struct linger, set HAVE_STRUCT_LINGER.
Thu Aug 1 02:58:39 1996 Jim Blandy <jimb@totoro.cyclic.com>
* filesys.c, posix.c: #include <sys/types.h> before <sys/stat.h>.

121
libguile/configure vendored
View file

@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.9
# Generated automatically using autoconf version 2.10
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@ -330,7 +330,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.9"
echo "configure generated by autoconf version 2.10"
exit 0 ;;
-with-* | --with-*)
@ -1057,7 +1057,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for -ldir""... $ac_c" 1>&6
ac_lib_var=`echo dir_opendir | tr '.-/+' '___p'`
ac_lib_var=`echo dir'_'opendir | tr './+\055' '__p_'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1067,6 +1067,8 @@ cat > conftest.$ac_ext <<EOF
#line 1068 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char opendir();
int main() { return 0; }
@ -1074,7 +1076,7 @@ int t() {
opendir()
; return 0; }
EOF
if { (eval echo configure:1078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:1080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1094,16 +1096,18 @@ fi
else
echo $ac_n "checking for -lx""... $ac_c" 1>&6
ac_lib_var=`echo x_opendir | tr '.-/+' '___p'`
ac_lib_var=`echo x'_'opendir | tr './+\055' '__p_'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1105 "configure"
#line 1107 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char opendir();
int main() { return 0; }
@ -1111,7 +1115,7 @@ int t() {
opendir()
; return 0; }
EOF
if { (eval echo configure:1115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:1119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1136,7 +1140,7 @@ if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1140 "configure"
#line 1144 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@ -1146,7 +1150,7 @@ int t() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:1150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@ -1170,7 +1174,7 @@ if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1174 "configure"
#line 1178 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@ -1187,7 +1191,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
if { (eval echo configure:1191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@ -1214,12 +1218,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1218 "configure"
#line 1222 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1249,7 +1253,7 @@ if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1253 "configure"
#line 1257 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@ -1285,7 +1289,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
#line 1289 "configure"
#line 1293 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@ -1310,7 +1314,7 @@ main()
}
EOF
{ (eval echo configure:1314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
{ (eval echo configure:1318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_type_getgroups=gid_t
else
@ -1320,7 +1324,7 @@ fi
rm -fr conftest*
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
#line 1324 "configure"
#line 1328 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@ -1348,7 +1352,7 @@ if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1352 "configure"
#line 1356 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@ -1366,7 +1370,7 @@ int t() {
int i;
; return 0; }
EOF
if { (eval echo configure:1370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@ -1384,19 +1388,21 @@ EOF
for ac_func in ftime times geteuid select uname mkdir rmdir getcwd rename putenv setlocale strftime strptime mknod nice lstat readlink symlink sync
for ac_func in ftime times geteuid seteuid setegid select uname mkdir rmdir getcwd rename putenv setlocale strftime strptime mknod nice lstat readlink symlink sync
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1395 "configure"
#line 1399 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() { return 0; }
@ -1413,7 +1419,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:1423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -1443,12 +1449,14 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1447 "configure"
#line 1453 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() { return 0; }
@ -1465,7 +1473,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:1477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -1491,7 +1499,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1495 "configure"
#line 1503 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -1500,7 +1508,7 @@ int t() {
struct stat s; s.st_rdev;
; return 0; }
EOF
if { (eval echo configure:1504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_rdev=yes
else
@ -1524,7 +1532,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1528 "configure"
#line 1536 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -1533,7 +1541,7 @@ int t() {
struct stat s; s.st_blksize;
; return 0; }
EOF
if { (eval echo configure:1537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
@ -1557,7 +1565,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1561 "configure"
#line 1569 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -1566,7 +1574,7 @@ int t() {
struct stat s; s.st_blocks;
; return 0; }
EOF
if { (eval echo configure:1570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blocks=yes
else
@ -1598,13 +1606,13 @@ if test "$cross_compiling" = yes; then
echo "configure: warning: Guessing that stack grows down -- see scmconfig.h.in" 1>&2
else
cat > conftest.$ac_ext <<EOF
#line 1602 "configure"
#line 1610 "configure"
#include "confdefs.h"
aux (l) unsigned long l;
{ int x; exit (l >= ((unsigned long)&x)); }
main () { int q; aux((unsigned long)&q); }
EOF
{ (eval echo configure:1608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
{ (eval echo configure:1616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
if test -s conftest && (./conftest; exit) 2>/dev/null; then
cat >> confdefs.h <<\EOF
#define SCM_STACK_GROWS_UP 1
@ -1623,11 +1631,11 @@ EOF
echo "configure: warning: Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in" 1>&2
else
cat > conftest.$ac_ext <<EOF
#line 1627 "configure"
#line 1635 "configure"
#include "confdefs.h"
main () { exit (sizeof(float) != sizeof(long)); }
EOF
{ (eval echo configure:1631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
{ (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
if test -s conftest && (./conftest; exit) 2>/dev/null; then
cat >> confdefs.h <<\EOF
#define SCM_SINGLES 1
@ -1637,8 +1645,37 @@ fi
fi
rm -fr conftest*
echo $ac_n "checking for struct linger""... $ac_c" 1>&6
if eval "test \"`echo '$''{'scm_cv_struct_linger'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1654 "configure"
#include "confdefs.h"
#include <sys/socket.h>
int main() { return 0; }
int t() {
struct linger lgr; lgr.l_linger = 100
; return 0; }
EOF
if { (eval echo configure:1662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_struct_linger="yes"
else
rm -rf conftest*
scm_cv_struct_linger="no"
fi
rm -f conftest*
fi
echo "$ac_t""$scm_cv_struct_linger" 1>&6
if test $scm_cv_struct_linger = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_LINGER 1
EOF
fi
#--------------------------------------------------------------------
#
@ -1650,7 +1687,7 @@ FD_SETTER=""
if test "x$FD_SETTER" = x; then
cat > conftest.$ac_ext <<EOF
#line 1654 "configure"
#line 1691 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -1659,7 +1696,7 @@ int t() {
stdout->_file = 1
; return 0; }
EOF
if { (eval echo configure:1663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
FD_SETTER="((F)->_file = (D))"
fi
@ -1669,7 +1706,7 @@ fi
if test "x$FD_SETTER" = x; then
cat > conftest.$ac_ext <<EOF
#line 1673 "configure"
#line 1710 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -1678,7 +1715,7 @@ int t() {
stdout->_fileno
; return 0; }
EOF
if { (eval echo configure:1682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
FD_SETTER="((F)->_fileno = (D))"
fi
@ -1780,7 +1817,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.9"
echo "$CONFIG_STATUS generated by autoconf version 2.10"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@ -1978,6 +2015,12 @@ cat >> $CONFIG_STATUS <<\EOF
echo "$ac_file is unchanged"
rm -f conftest.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
mv conftest.h $ac_file
fi

View file

@ -49,8 +49,16 @@ AC_TRY_RUN(main () { exit (sizeof(float) != sizeof(long)); },
AC_DEFINE(SCM_SINGLES),,AC_DEFINE(SCM_SINGLES)
AC_MSG_WARN(Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in))
AC_MSG_CHECKING(for struct linger)
AC_CACHE_VAL(scm_cv_struct_linger,
AC_TRY_COMPILE([#include <sys/socket.h>],
[struct linger lgr; lgr.l_linger = 100],
scm_cv_struct_linger="yes",
scm_cv_struct_linger="no"))
AC_MSG_RESULT($scm_cv_struct_linger)
if test $scm_cv_struct_linger = yes; then
AC_DEFINE(HAVE_STRUCT_LINGER)
fi
#--------------------------------------------------------------------
#

View file

@ -157,3 +157,5 @@
#undef SCM_STACK_GROWS_UP
/* Define if you have struct linger. */
#undef HAVE_STRUCT_LINGER

View file

@ -34,7 +34,7 @@ scm_sys_inet_aton (address)
#endif
{
struct in_addr soka;
int rv;
SCM_ASSERT (SCM_NIMP (address) && SCM_ROSTRINGP (address), address, SCM_ARG1, s_sys_inet_aton);
if (SCM_SUBSTRP (address))
address = scm_makfromstr (SCM_ROCHARS (address), SCM_ROLENGTH (address), 0);