diff --git a/ChangeLog b/ChangeLog index fe25b6462..6e19b8b89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1998-04-25 Mikael Djurfeldt + + * configure.in: Define USLEEP_RETURNS_VOID on some systems. + 1998-04-20 Mikael Djurfeldt * configure.in: Check for usleep; Define DECLARE_BZERO and diff --git a/acconfig.h b/acconfig.h index 0043a27be..be39ad8c4 100644 --- a/acconfig.h +++ b/acconfig.h @@ -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 diff --git a/aclocal.m4 b/aclocal.m4 index 41774b29e..fb03a8a90 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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" diff --git a/configure b/configure index 9ab6da0ef..5dbd02ec3 100755 --- a/configure +++ b/configure @@ -2937,20 +2937,39 @@ EOF ;; esac +# On some systems usleep have no return value +cat > conftest.$ac_ext < +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 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 <&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 <&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 < 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 <&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 <&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 <&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 <&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 < 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 <&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 <&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 <&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 <&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 < #include @@ -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 < #include @@ -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 < #include @@ -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 < #include @@ -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 < #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 < #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 <&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 <= ((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 <&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 < @@ -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 < 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 < 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 < 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 < 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 < 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 < 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 < 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 < 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 < 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 < 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 diff --git a/configure.in b/configure.in index 6894177ff..a0b79c8a5 100644 --- a/configure.in +++ b/configure.in @@ -106,6 +106,13 @@ case "$host_os" in ;; esac +# On some systems usleep have no return value +AC_EGREP_HEADER(changequote(<, >)changequote([, ]), + /usr/include/unistd.h, + AC_DEFINE(USLEEP_RETURNS_VOID) +) + + dnl AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 570fac862..4ed8a8405 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +1998-04-25 Mikael Djurfeldt + + * 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 * Makefile.am (libguile_la_LDFLAGS): Removed redundant -rpath. diff --git a/libguile/coop.c b/libguile/coop.c index 8f1202dd2..e61068ecb 100644 --- a/libguile/coop.c +++ b/libguile/coop.c @@ -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 diff --git a/libguile/scmconfig.h.in b/libguile/scmconfig.h.in index 278534839..eb7e82568 100644 --- a/libguile/scmconfig.h.in +++ b/libguile/scmconfig.h.in @@ -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 diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c index 27287fcff..aea5d0aea 100644 --- a/libguile/scmsigs.c +++ b/libguile/scmsigs.c @@ -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