Updated
[bpt/guile.git] / configure.in
index 7523590..00d8dae 100644 (file)
@@ -1,5 +1,25 @@
 dnl   configuration script for Guile
 dnl   Process this file with autoconf to produce configure.
+dnl
+dnl  Copyright (C) 1998 Free Software Foundation, Inc.
+dnl
+dnl  This file is part of GUILE
+dnl
+dnl  GUILE is free software; you can redistribute it and/or modify it
+dnl  under the terms of the GNU General Public License as published by
+dnl  the Free Software Foundation; either version 2, or (at your
+dnl  option) any later version.
+dnl
+dnl  GUILE is distributed in the hope that it will be useful, but
+dnl  WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU General Public License
+dnl  along with GUILE; see the file COPYING.  If not, write to the
+dnl  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+dnl  Boston, MA 02111-1307, USA.
+
 AC_INIT(Makefile.in)
 . $srcdir/GUILE-VERSION
 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
@@ -37,7 +57,10 @@ AC_AIX
 AC_ISC_POSIX
 AC_MINIX
 
+AM_PROG_CC_STDC
+
 AC_C_CONST
+AC_C_INLINE
 
 AC_HEADER_STDC
 AC_HEADER_DIRENT
@@ -118,11 +141,11 @@ AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gethostent gettimeofday lstat mkdir
 ### Check for a declaration of FUNCTION in HEADERFILE; if it is
 ### not there, #define MISSING_FUNCTION_DECL.
 AC_DEFUN(GUILE_FUNC_DECLARED, [
-  AC_CACHE_CHECK(for $1 declaration, ac_cv_func_$1_declared,
+  AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
     AC_EGREP_HEADER($1, $2,
-                   ac_cv_func_$1_declared=yes, 
-                   ac_cv_func_$1_declared=no))
-  if test [x$ac_cv_func_]$1[_declared] = xno; then
+                   guile_cv_func_$1_declared=yes, 
+                   guile_cv_func_$1_declared=no))
+  if test [x$guile_cv_func_]$1[_declared] = xno; then
     AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL])
   fi
 ])
@@ -132,12 +155,18 @@ GUILE_FUNC_DECLARED(bzero, string.h)
 GUILE_FUNC_DECLARED(sleep, unistd.h)
 GUILE_FUNC_DECLARED(usleep, unistd.h)
 
-# On some systems usleep has no return value
-AC_EGREP_HEADER(changequote(<, >)<void[        ][      ]*usleep>changequote([, ]),
-  /usr/include/unistd.h,
-  AC_DEFINE(USLEEP_RETURNS_VOID)
-)
-
+### On some systems usleep has no return value.  If it does have one,
+### we'd like to return it; otherwise, we'll fake it.
+AC_CACHE_CHECK([return type of usleep], guile_cv_func_usleep_return_type,
+  [AC_EGREP_HEADER(changequote(<, >)<void[     ]+usleep>changequote([, ]),
+                   /usr/include/unistd.h,
+                  [guile_cv_func_usleep_return_type=void],
+                  [guile_cv_func_usleep_return_type=int])])
+case "$guile_cv_func_usleep_return_type" in
+  "void" )
+    AC_DEFINE(USLEEP_RETURNS_VOID)
+  ;;
+esac
 
 dnl <GNU-WIN32 hacks>
 
@@ -239,10 +268,22 @@ AC_TRY_RUN(aux (l) unsigned long l;
           main () { int q; aux((unsigned long)&q); }, 
           AC_DEFINE(SCM_STACK_GROWS_UP),,AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h.in))
 
+AC_CACHE_CHECK([whether floats fit in longs], guile_cv_type_float_fits_long,
+    [AC_TRY_RUN([main () { exit (sizeof(float) > sizeof(long)); }],
+               [guile_cv_type_float_fits_long=yes],
+               [guile_cv_type_float_fits_long=no],
+               [guile_cv_type_float_fits_long=guess-yes])])
+case $guile_cv_type_float_fits_long in
+  "yes" )
+    AC_DEFINE(SCM_SINGLES)
+  ;;
+  "guess-yes" )
+    AC_DEFINE(SCM_SINGLES)
+    AC_MSG_WARN([guessing that sizeof(long) == sizeof(float)])
+    AC_MSG_WARN([see SCM_SINGLES in scmconfig.h.in])
+  ;;
+esac
 
-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,
@@ -436,7 +477,7 @@ AC_SUBST(GUILE_STAMP)
 AC_SUBST(AWK)
 AC_SUBST(LIBLOBJS)
 
-AC_OUTPUT([Makefile libguile/Makefile libguile/guile-snarf ice-9/Makefile ice-9/version.scm qt/Makefile qt/qt.h qt/md/Makefile qt/time/Makefile guile-config/Makefile doc/Makefile], [chmod +x libguile/guile-snarf])
+AC_OUTPUT([Makefile libguile/Makefile libguile/guile-snarf libguile/versiondat.h ice-9/Makefile ice-9/version.scm qt/Makefile qt/qt.h qt/md/Makefile qt/time/Makefile guile-config/Makefile doc/Makefile], [chmod +x libguile/guile-snarf])
 
 dnl Local Variables:
 dnl comment-start: "dnl "