*** empty log message ***
[bpt/guile.git] / configure.in
index ad1bfa8..72d834b 100644 (file)
@@ -242,6 +242,8 @@ AC_CHECK_SIZEOF(unsigned long)
 AC_CHECK_SIZEOF(size_t)
 AC_CHECK_SIZEOF(long long)
 AC_CHECK_SIZEOF(unsigned long long)
+AC_CHECK_SIZEOF(__int64)
+AC_CHECK_SIZEOF(unsigned __int64)
 AC_CHECK_SIZEOF(void *)
 AC_CHECK_SIZEOF(intptr_t)
 AC_CHECK_SIZEOF(uintptr_t)
@@ -419,7 +421,7 @@ fi
 AC_SUBST([SCM_I_GSC_T_UINT32])
 
 ### Optional type scm_t_int64 (ANSI C says int, short, or long might work)
-### Also try long long if we have it.
+### Also try 'long long' and '__int64' if we have it.
 SCM_I_GSC_T_INT64=0
 if test "$ac_cv_sizeof_int" -eq 8; then
   SCM_I_GSC_T_INT64='"int"'
@@ -429,6 +431,8 @@ elif test "$ac_cv_sizeof_short" -eq 8; then
   SCM_I_GSC_T_INT64='"short"'
 elif test "$ac_cv_sizeof_long_long" -eq 8; then
   SCM_I_GSC_T_INT64='"long long"'
+elif test "$ac_cv_sizeof___int64" -eq 8; then
+  SCM_I_GSC_T_INT64='"__int64"'
 elif test "$scm_stdint_has_int64"; then
   SCM_I_GSC_T_INT64='"int64_t"'
   SCM_I_GSC_NEEDS_STDINT_H=1
@@ -441,7 +445,7 @@ fi
 AC_SUBST([SCM_I_GSC_T_INT64])
 
 ### Optional type scm_t_uint64 (ANSI C says int, short, or long might work)
-### Also try long long if we have it.
+### Also try 'long long' and '__int64' if we have it.
 SCM_I_GSC_T_UINT64=0
 if test "$ac_cv_sizeof_unsigned_int" -eq 8; then
   SCM_I_GSC_T_UINT64='"unsigned int"'
@@ -451,6 +455,8 @@ elif test "$ac_cv_sizeof_unsigned_short" -eq 8; then
   SCM_I_GSC_T_UINT64='"unsigned short"'
 elif test "$ac_cv_sizeof_unsigned_long_long" -eq 8; then
   SCM_I_GSC_T_UINT64='"unsigned long long"'
+elif test "$ac_cv_sizeof_unsigned___int64" -eq 8; then
+  SCM_I_GSC_T_UINT64='"unsigned __int64"'
 elif test "$scm_stdint_has_uint64"; then
   SCM_I_GSC_T_UINT64='"uint64_t"'
   SCM_I_GSC_NEEDS_STDINT_H=1
@@ -483,7 +489,9 @@ AC_TYPE_GETGROUPS
 AC_TYPE_SIGNAL
 AC_TYPE_MODE_T
 
-AC_CHECK_LIB(m, main)
+if test $MINGW32 = no; then
+       AC_CHECK_LIB(m, main)
+fi
 AC_CHECK_FUNCS(gethostbyname)
 if test $ac_cv_func_gethostbyname = no; then
     AC_CHECK_LIB(nsl, gethostbyname)
@@ -526,7 +534,7 @@ AC_SUBST(DLPREOPEN)
 
 AC_CHECK_HEADERS([assert.h])
 
-AC_CHECK_FUNCS([ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex])
+AC_CHECK_FUNCS([ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex unsetenv])
 
 AC_CHECK_HEADERS(crypt.h sys/resource.h sys/file.h)
 AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
@@ -583,7 +591,7 @@ if test -n "$have_sys_un_h" ; then
     [Define if the system supports Unix-domain (file-domain) sockets.])
 fi
 
-AC_CHECK_FUNCS(socketpair getgroups setpwent pause tzset)
+AC_CHECK_FUNCS(socketpair getgroups setgroups setpwent pause tzset)
 
 AC_CHECK_FUNCS(sethostent   gethostent   endhostent   dnl
                setnetent    getnetent    endnetent    dnl
@@ -594,13 +602,15 @@ AC_CHECK_FUNCS(sethostent   gethostent   endhostent   dnl
               inet_pton inet_ntop)
 
 AC_MSG_CHECKING(for __libc_stack_end)
-AC_TRY_LINK([extern char *__libc_stack_end;],
-            [char *p = __libc_stack_end;],
-            have_libc_stack_end=yes,
-            have_libc_stack_end=no)
-AC_MSG_RESULT($have_libc_stack_end)
-
-if test $have_libc_stack_end = yes; then
+AC_CACHE_VAL(guile_cv_have_libc_stack_end,
+[AC_TRY_LINK([#include <stdio.h>
+extern char *__libc_stack_end;],
+             [printf("%p", (char*) __libc_stack_end);],
+             guile_cv_have_libc_stack_end=yes,
+             guile_cv_have_libc_stack_end=no)])
+AC_MSG_RESULT($guile_cv_have_libc_stack_end)
+
+if test $guile_cv_have_libc_stack_end = yes; then
   AC_DEFINE(HAVE_LIBC_STACK_END, 1,
            [Define if you have the __libc_stack_end variable.])
 fi
@@ -750,7 +760,12 @@ AC_REPLACE_FUNCS(inet_aton putenv strerror memmove mkstemp)
 
 AC_CHECK_HEADERS(floatingpoint.h ieeefp.h nan.h)
 
-AC_CHECK_FUNCS(finite isinf isnan copysign)
+# Reasons for testing:
+#   asinh, acosh, atanh, trunc - C99 standard, generally not available on
+#                                older systems
+#   sincos - GLIBC extension
+#
+AC_CHECK_FUNCS(asinh acosh atanh copysign finite isinf isnan sincos trunc)
 
 # When testing for the presence of alloca, we need to add alloca.o
 # explicitly to LIBOBJS to make sure that it is translated to
@@ -897,6 +912,10 @@ case "$with_threads" in
       AC_DEFINE_UNQUOTED(SCM_MUTEX_RECURSIVE, $guile_cv_have_mutex_recursive,
         [The mutex kind enum for recursive mutexes.])
     fi
+    
+    # On Solaris, sched_yield lives in -lrt.
+    AC_SEARCH_LIBS(sched_yield, rt)
+    
   ;;
 esac
 
@@ -960,15 +979,6 @@ if test "$cross_compiling" = "yes"; then
 fi
 AC_SUBST(GUILE_FOR_BUILD)
                        
-# Do this here so we don't screw up any of the tests above that might
-# not be "warning free"
-
-if test "${GUILE_ERROR_ON_WARNING}" = yes
-then
-  CFLAGS="${CFLAGS} -Werror"
-  enable_compile_warnings=no
-fi
-
 ## If we're using GCC, ask for aggressive warnings.
 case "$GCC" in
   yes )
@@ -977,7 +987,15 @@ case "$GCC" in
     ## less than exasperating.
     ## -Wpointer-arith was here too, but something changed in gcc/glibc
     ## and it became equally exasperating (gcc 2.95 and/or glibc 2.1.2).
-    CFLAGS="$CFLAGS -Wall -Wmissing-prototypes" ;;
+    CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
+    # Do this here so we don't screw up any of the tests above that might
+    # not be "warning free"
+    if test "${GUILE_ERROR_ON_WARNING}" = yes
+    then
+       CFLAGS="${CFLAGS} -Werror"
+       enable_compile_warnings=no
+    fi
+    ;;
 esac
 
 ## NOTE the code below sets LIBOBJS directly and so is now forbidden