1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 05:50:26 +02:00

* scmsigs.c: Declare usleep as returning void on some systems.

(scm_usleep): Return SCM_INUM0 on those systems.

* coop.c (usleep): Return void on some systems.

* configure.in: Define USLEEP_RETURNS_VOID on some systems.
This commit is contained in:
Mikael Djurfeldt 1998-04-24 23:36:04 +00:00
parent f1a5fa3c92
commit 0935d604b5
9 changed files with 152 additions and 92 deletions

View file

@ -1,3 +1,7 @@
1998-04-25 Mikael Djurfeldt <mdj@kenneth>
* configure.in: Define USLEEP_RETURNS_VOID on some systems.
1998-04-20 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
* configure.in: Check for usleep; Define DECLARE_BZERO and

View file

@ -92,3 +92,6 @@
/* Define if the operating system supplies usleep without declaring it. */
#undef DECLARE_USLEEP
/* Define if usleep doesn't return a value. */
#undef USLEEP_RETURNS_VOID

1
aclocal.m4 vendored
View file

@ -622,6 +622,7 @@ dnl
dnl Set the appropriate flags!
dnl
cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags"
cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs"
cy_cv_threads_package=$threads_package
CPPFLAGS="$saved_CPP"
LDFLAGS="$saved_LD"

200
configure vendored
View file

@ -2937,20 +2937,39 @@ EOF
;;
esac
# On some systems usleep have no return value
cat > conftest.$ac_ext <<EOF
#line 2943 "configure"
#include "confdefs.h"
#include </usr/include/unistd.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "void[ ][ ]*usleep" >/dev/null 2>&1; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define USLEEP_RETURNS_VOID 1
EOF
fi
rm -f conftest*
ac_safe=`echo "sys/un.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/un.h""... $ac_c" 1>&6
echo "configure:2944: checking for sys/un.h" >&5
echo "configure:2963: checking for sys/un.h" >&5
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 2949 "configure"
#line 2968 "configure"
#include "confdefs.h"
#include <sys/un.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2981,12 +3000,12 @@ fi
for ac_func in socketpair getgroups setpwent pause tzset
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2985: checking for $ac_func" >&5
echo "configure:3004: checking for $ac_func" >&5
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 2990 "configure"
#line 3009 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -3009,7 +3028,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:3013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -3040,12 +3059,12 @@ done
for ac_func in sethostent endhostent getnetent setnetent endnetent getprotoent endprotoent getservent endservent getnetbyaddr getnetbyname inet_lnaof inet_makeaddr inet_netof
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3044: checking for $ac_func" >&5
echo "configure:3063: checking for $ac_func" >&5
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 3049 "configure"
#line 3068 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -3068,7 +3087,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:3072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -3095,20 +3114,20 @@ done
echo $ac_n "checking for restartable system calls""... $ac_c" 1>&6
echo "configure:3099: checking for restartable system calls" >&5
echo "configure:3118: checking for restartable system calls" >&5
if eval "test \"`echo '$''{'scm_cv_restarts'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test $ac_cv_func_sigaction = yes; then
cat > conftest.$ac_ext <<EOF
#line 3105 "configure"
#line 3124 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {
int a = SA_RESTART
; return 0; }
EOF
if { (eval echo configure:3112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_restarts=yes
else
@ -3135,12 +3154,12 @@ if test "$ac_cv_header_regex_h" = yes ||
test "$ac_cv_header_rxposix_h" = yes ||
test "$ac_cv_header_rx_rxposix_h" = yes; then
echo $ac_n "checking for regcomp""... $ac_c" 1>&6
echo "configure:3139: checking for regcomp" >&5
echo "configure:3158: checking for regcomp" >&5
if eval "test \"`echo '$''{'ac_cv_func_regcomp_norx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3144 "configure"
#line 3163 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char regcomp(); below. */
@ -3163,7 +3182,7 @@ regcomp();
; return 0; }
EOF
if { (eval echo configure:3167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_regcomp_norx=yes"
else
@ -3181,7 +3200,7 @@ if eval "test \"`echo '$ac_cv_func_'regcomp'_'norx`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for main in -lrx""... $ac_c" 1>&6
echo "configure:3185: checking for main in -lrx" >&5
echo "configure:3204: checking for main in -lrx" >&5
ac_lib_var=`echo rx'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -3189,14 +3208,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrx $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3193 "configure"
#line 3212 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
if { (eval echo configure:3200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -3224,12 +3243,12 @@ else
fi
echo $ac_n "checking for regcomp""... $ac_c" 1>&6
echo "configure:3228: checking for regcomp" >&5
echo "configure:3247: checking for regcomp" >&5
if eval "test \"`echo '$''{'ac_cv_func_regcomp_rx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3233 "configure"
#line 3252 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char regcomp(); below. */
@ -3252,7 +3271,7 @@ regcomp();
; return 0; }
EOF
if { (eval echo configure:3256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_regcomp_rx=yes"
else
@ -3286,12 +3305,12 @@ fi
for ac_func in inet_aton putenv strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3290: checking for $ac_func" >&5
echo "configure:3309: checking for $ac_func" >&5
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 3295 "configure"
#line 3314 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -3314,7 +3333,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:3318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -3347,19 +3366,19 @@ done
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
echo "configure:3351: checking for working alloca.h" >&5
echo "configure:3370: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3356 "configure"
#line 3375 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:3363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@ -3380,12 +3399,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
echo "configure:3384: checking for alloca" >&5
echo "configure:3403: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3389 "configure"
#line 3408 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@ -3408,7 +3427,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
if { (eval echo configure:3412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@ -3440,12 +3459,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
echo "configure:3444: checking whether alloca needs Cray hooks" >&5
echo "configure:3463: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3449 "configure"
#line 3468 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@ -3470,12 +3489,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3474: checking for $ac_func" >&5
echo "configure:3493: checking for $ac_func" >&5
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 3479 "configure"
#line 3498 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -3498,7 +3517,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:3502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -3525,7 +3544,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
echo "configure:3529: checking stack direction for C alloca" >&5
echo "configure:3548: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -3533,7 +3552,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
#line 3537 "configure"
#line 3556 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@ -3552,7 +3571,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
if { (eval echo configure:3556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:3575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@ -3576,12 +3595,12 @@ fi
if test "$ALLOCA" = "alloca.o"; then LIBOBJS="alloca.o $LIBOBJS"; fi
echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
echo "configure:3580: checking for st_rdev in struct stat" >&5
echo "configure:3599: checking for st_rdev in struct stat" >&5
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 3585 "configure"
#line 3604 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -3589,7 +3608,7 @@ int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
if { (eval echo configure:3593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_rdev=yes
else
@ -3610,12 +3629,12 @@ EOF
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
echo "configure:3614: checking for st_blksize in struct stat" >&5
echo "configure:3633: checking for st_blksize in struct stat" >&5
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 3619 "configure"
#line 3638 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -3623,7 +3642,7 @@ int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
if { (eval echo configure:3627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
@ -3647,12 +3666,12 @@ fi
# We could use AC_STRUCT_ST_BLOCKS here, but that adds fileblocks.o to
# LIBOBJS, which we don't need. This seems more direct.
echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
echo "configure:3651: checking for st_blocks in struct stat" >&5
echo "configure:3670: checking for st_blocks in struct stat" >&5
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 3656 "configure"
#line 3675 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -3660,7 +3679,7 @@ int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
if { (eval echo configure:3664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blocks=yes
else
@ -3681,12 +3700,12 @@ EOF
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
echo "configure:3685: checking whether struct tm is in sys/time.h or time.h" >&5
echo "configure:3704: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3690 "configure"
#line 3709 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@ -3694,7 +3713,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
if { (eval echo configure:3698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@ -3715,12 +3734,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
echo "configure:3719: checking for tm_zone in struct tm" >&5
echo "configure:3738: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3724 "configure"
#line 3743 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@ -3728,7 +3747,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
if { (eval echo configure:3732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@ -3748,12 +3767,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
echo "configure:3752: checking for tzname" >&5
echo "configure:3771: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3757 "configure"
#line 3776 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@ -3763,7 +3782,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
if { (eval echo configure:3767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:3786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@ -3786,12 +3805,12 @@ fi
echo $ac_n "checking whether we need POSIX to get struct utimbuf""... $ac_c" 1>&6
echo "configure:3790: checking whether we need POSIX to get struct utimbuf" >&5
echo "configure:3809: checking whether we need POSIX to get struct utimbuf" >&5
if eval "test \"`echo '$''{'guile_cv_struct_utimbuf_needs_posix'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3795 "configure"
#line 3814 "configure"
#include "confdefs.h"
#ifdef __EMX__
@ -3803,7 +3822,7 @@ struct utime blah;
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -3836,13 +3855,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 3840 "configure"
#line 3859 "configure"
#include "confdefs.h"
aux (l) unsigned long l;
{ int x; exit (l >= ((unsigned long)&x)); }
main () { int q; aux((unsigned long)&q); }
EOF
if { (eval echo configure:3846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:3865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
cat >> confdefs.h <<\EOF
#define SCM_STACK_GROWS_UP 1
@ -3865,11 +3884,11 @@ EOF
echo "configure: warning: Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in" 1>&2
else
cat > conftest.$ac_ext <<EOF
#line 3869 "configure"
#line 3888 "configure"
#include "confdefs.h"
main () { exit (sizeof(float) != sizeof(long)); }
EOF
if { (eval echo configure:3873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:3892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
cat >> confdefs.h <<\EOF
#define SCM_SINGLES 1
@ -3884,12 +3903,12 @@ fi
echo $ac_n "checking for struct linger""... $ac_c" 1>&6
echo "configure:3888: checking for struct linger" >&5
echo "configure:3907: checking for struct linger" >&5
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 3893 "configure"
#line 3912 "configure"
#include "confdefs.h"
#include <sys/types.h>
@ -3898,7 +3917,7 @@ int main() {
struct linger lgr; lgr.l_linger = 100
; return 0; }
EOF
if { (eval echo configure:3902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_struct_linger="yes"
else
@ -3925,19 +3944,19 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking how to set a stream file descriptor""... $ac_c" 1>&6
echo "configure:3929: checking how to set a stream file descriptor" >&5
echo "configure:3948: checking how to set a stream file descriptor" >&5
if eval "test \"`echo '$''{'scm_cv_fd_setter'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3934 "configure"
#line 3953 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
stdout->_file = 1
; return 0; }
EOF
if { (eval echo configure:3941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_fd_setter="_file"
else
@ -3945,14 +3964,14 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
#line 3949 "configure"
#line 3968 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
stdout->_fileno = 1
; return 0; }
EOF
if { (eval echo configure:3956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_fd_setter="_fileno"
else
@ -3990,19 +4009,19 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking how to get buffer char count from FILE structure""... $ac_c" 1>&6
echo "configure:3994: checking how to get buffer char count from FILE structure" >&5
echo "configure:4013: checking how to get buffer char count from FILE structure" >&5
if eval "test \"`echo '$''{'scm_cv_struct_file_count'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3999 "configure"
#line 4018 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_cnt = 0
; return 0; }
EOF
if { (eval echo configure:4006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:4025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_struct_file_count="_cnt"
else
@ -4010,14 +4029,14 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
#line 4014 "configure"
#line 4033 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_r = 0
; return 0; }
EOF
if { (eval echo configure:4021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:4040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_struct_file_count="_r"
else
@ -4025,14 +4044,14 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
#line 4029 "configure"
#line 4048 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->readCount = 0
; return 0; }
EOF
if { (eval echo configure:4036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:4055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_struct_file_count="readCount"
else
@ -4059,14 +4078,14 @@ if eval "test \"`echo '$''{'scm_cv_struct_file_gptr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4063 "configure"
#line 4082 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_gptr = f->egptr;
; return 0; }
EOF
if { (eval echo configure:4070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:4089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_struct_file_gptr=1
else
@ -4089,14 +4108,14 @@ if eval "test \"`echo '$''{'scm_cv_struct_file_readptr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4093 "configure"
#line 4112 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;
; return 0; }
EOF
if { (eval echo configure:4100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:4119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
scm_cv_struct_file_readptr=1
else
@ -4126,7 +4145,7 @@ fi
echo $ac_n "checking "threads package type"""... $ac_c" 1>&6
echo "configure:4130: checking "threads package type"" >&5
echo "configure:4149: checking "threads package type"" >&5
if eval "test \"`echo '$''{'cy_cv_threads_package'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -4185,7 +4204,7 @@ if test "$use_threads" != no; then
LDFLAGS="-L$use_threads/lib"
LIBS="-lgthreads -lmalloc"
cat > conftest.$ac_ext <<EOF
#line 4189 "configure"
#line 4208 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@ -4194,7 +4213,7 @@ pthread_equal(NULL,NULL);
; return 0; }
EOF
if { (eval echo configure:4198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:4217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
threads_package=FSU
else
@ -4206,7 +4225,7 @@ rm -f conftest*
if test "$threads_package" = unknown; then
LIBS="-lpthread"
cat > conftest.$ac_ext <<EOF
#line 4210 "configure"
#line 4229 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@ -4215,7 +4234,7 @@ pthread_equal(NULL,NULL);
; return 0; }
EOF
if { (eval echo configure:4219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:4238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
threads_package=MIT
else
@ -4227,7 +4246,7 @@ rm -f conftest*
if test "$threads_package" = unknown; then
LIBS="-lpthreads"
cat > conftest.$ac_ext <<EOF
#line 4231 "configure"
#line 4250 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@ -4236,7 +4255,7 @@ pthread_equal(NULL,NULL);
; return 0; }
EOF
if { (eval echo configure:4240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:4259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
threads_package=PCthreads
else
@ -4246,6 +4265,7 @@ fi
rm -f conftest*
fi
cy_cv_threads_cflags="$CPPFLAGS $cy_cv_threads_cflags"
cy_cv_threads_libs="$LDFLAGS $LIBS $cy_cv_threads_libs"
cy_cv_threads_package=$threads_package
CPPFLAGS="$saved_CPP"
LDFLAGS="$saved_LD"
@ -4331,7 +4351,7 @@ 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:4335: checking for $ac_word" >&5
echo "configure:4355: 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

View file

@ -106,6 +106,13 @@ case "$host_os" in
;;
esac
# On some systems usleep have no return value
AC_EGREP_HEADER(changequote(<, >)<void[ ][ ]*usleep>changequote([, ]),
/usr/include/unistd.h,
AC_DEFINE(USLEEP_RETURNS_VOID)
)
dnl <GNU-WIN32 hacks>
AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1)

View file

@ -1,3 +1,10 @@
1998-04-25 Mikael Djurfeldt <mdj@kenneth>
* scmsigs.c: Declare usleep as returning void on some systems.
(scm_usleep): Return SCM_INUM0 on those systems.
* coop.c (usleep): Return void on some systems.
1998-04-20 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
* Makefile.am (libguile_la_LDFLAGS): Removed redundant -rpath.

View file

@ -40,7 +40,7 @@
* If you do not wish that, delete this exception notice. */
/* $Id: coop.c,v 1.9 1998-04-20 00:39:15 mdj Exp $ */
/* $Id: coop.c,v 1.10 1998-04-24 23:36:02 mdj Exp $ */
/* Cooperative thread library, based on QuickThreads */
@ -652,15 +652,21 @@ coop_sleephelp (sp, old, bolckq)
#ifdef GUILE_ISELECT
#ifdef USLEEP_RETURNS_VOID
void
#else
int
#endif
usleep (unsigned usec)
{
struct timeval timeout;
timeout.tv_sec = 0;
timeout.tv_usec = usec;
scm_internal_select (0, NULL, NULL, NULL, &timeout);
#ifndef USLEEP_RETURNS_VOID
return 0; /* Maybe we should calculate actual time slept,
but this is faster... :) */
#endif
}
unsigned

View file

@ -176,6 +176,9 @@
/* Define if the operating system supplies usleep without declaring it. */
#undef DECLARE_USLEEP
/* Define if usleep doesn't return a value. */
#undef USLEEP_RETURNS_VOID
/* Define if you have the bzero function. */
#undef HAVE_BZERO

View file

@ -53,8 +53,12 @@
#endif
#if defined(DECLARE_USLEEP) || (defined(GUILE_ISELECT) && !defined(HAVE_USLEEP))
#ifdef USLEEP_RETURNS_VOID
extern void usleep (unsigned);
#else
extern int usleep (unsigned);
#endif
#endif
@ -364,8 +368,13 @@ scm_usleep (i)
{
int j;
SCM_ASSERT (SCM_INUMP (i) && (SCM_INUM (i) >= 0), i, SCM_ARG1, s_usleep);
j = usleep (SCM_INUM(i));
#ifdef USLEEP_RETURNS_VOID
usleep (SCM_INUM (i));
return SCM_INUM0;
#else
j = usleep (SCM_INUM (i));
return SCM_MAKINUM (j);
#endif
}
#endif