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)
AC_ISC_POSIX
AC_MINIX
+AM_PROG_CC_STDC
+
AC_C_CONST
+AC_C_INLINE
AC_HEADER_STDC
AC_HEADER_DIRENT
fi
AC_CHECK_LIB(termcap, tgoto)
AC_CHECK_LIB(readline, readline)
-AC_CHECK_FUNCS(rl_getc_function rl_clear_signals rl_cleanup_after_signal)
-if test $ac_cv_lib_readline_readline = yes -a $ac_cv_func_rl_getc_function = no; then
+AC_CHECK_FUNCS(rl_clear_signals rl_cleanup_after_signal)
+
+AC_CACHE_CHECK([for rl_getc_function pointer in readline],
+ ac_cv_var_rl_getc_function,
+ [AC_TRY_LINK([
+#include <stdio.h>
+#include <readline/readline.h>],
+ [rl_getc_function;],
+ [ac_cv_var_rl_getc_function=yes],
+ [ac_cv_var_rl_getc_function=no])])
+if test "$ac_cv_var_rl_getc_function" = "yes"; then
+ AC_DEFINE(HAVE_RL_GETC_FUNCTION)
+fi
+
+if test $ac_cv_lib_readline_readline = yes -a $ac_cv_var_rl_getc_function = no; then
echo 'Warning: libreadline is too old on your system. Need >= 2.1.'
fi
### 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
])
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>
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,
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], [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 "