dnl configuration script for Guile
dnl Process this file with autoconf to produce configure.
dnl
-dnl Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
dnl
dnl This file is part of GUILE
dnl
dnl Free Software Foundation, Inc., 59 Temple Place - Suite 330,
dnl Boston, MA 02111-1307, USA.
-AC_PREREQ(2.50)
+AC_PREREQ(2.53)
AC_INIT
AC_CONFIG_SRCDIR([Makefile.in])
AM_CONDITIONAL(HTMLDOC, test x$htmldoc_enabled = xyes)
AC_ARG_ENABLE(deprecated,
- [ --disable-deprecated omit deprecated features [no]])
+ [ --disable-deprecated omit deprecated features])
AH_TEMPLATE([SCM_ENABLE_DEPRECATED],
[Define this to 1 if you want to include deprecated features.])
[ --disable-elisp omit Emacs Lisp support],,
enable_elisp=yes)
+#--------------------------------------------------------------------
+
+dnl Some more checks for Win32
+AC_CYGWIN
+AC_MINGW32
+AC_LIBTOOL_WIN32_DLL
+
+AC_LIBLTDL_INSTALLABLE
+AC_CONFIG_SUBDIRS(libltdl)
+
+AC_PROG_INSTALL
+AC_PROG_CC
+AC_PROG_CPP
+AC_LIBTOOL_DLOPEN
+
+AC_AIX
+AC_ISC_POSIX
+AC_MINIX
+
+AM_PROG_CC_STDC
+
+## Needed for building DLLs on Cygwin, before AM_PROG_LIBTOOL
+AC_LIBTOOL_WIN32_DLL
+AM_PROG_LIBTOOL
+
+AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
+AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)
+
+dnl Check for dynamic linking
+
+use_modules=yes
+AC_ARG_WITH(modules,
+[ --with-modules[=FILES] Add support for dynamic modules],
+use_modules="$withval")
+test -z "$use_modules" && use_modules=yes
+DLPREOPEN=
+if test "$use_modules" != no; then
+ AC_DEFINE(DYNAMIC_LINKING, 1,
+ [Define if you want support for dynamic linking.])
+ if test "$use_modules" = yes; then
+ DLPREOPEN="-dlpreopen force"
+ else
+ DLPREOPEN="-export-dynamic"
+ for module in $use_modules; do
+ DLPREOPEN="$DLPREOPEN -dlopen $module"
+ done
+ fi
+fi
+
dnl files which are destined for separate modules.
+if test "$use_modules" != no; then
+ AC_LIBOBJ([dynl])
+fi
+
if test "$enable_arrays" = yes; then
AC_LIBOBJ([ramap])
AC_LIBOBJ([unif])
[Define this if you want Elisp support (in addition to Scheme).])
fi
-#--------------------------------------------------------------------
-
-dnl Some more checks for Win32
-AC_CYGWIN
-AC_MINGW32
-AC_LIBTOOL_WIN32_DLL
-
-AC_LIBLTDL_INSTALLABLE
-AC_CONFIG_SUBDIRS(libltdl)
-
-AC_PROG_INSTALL
-AC_PROG_CC
-AC_PROG_CPP
-AC_LIBTOOL_DLOPEN
-
-AC_AIX
-AC_ISC_POSIX
-AC_MINIX
-
-AM_PROG_CC_STDC
-AM_PROG_LIBTOOL
-
-AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
-AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)
AC_C_CONST
AC_C_INLINE
if test $ac_cv_func_gethostbyname = no; then
AC_CHECK_LIB(nsl, gethostbyname)
fi
+
AC_CHECK_FUNCS(connect)
if test $ac_cv_func_connect = no; then
AC_CHECK_LIB(socket, connect)
fi
AC_SUBST(EXTRA_DEFS)
-dnl Check for dynamic linking
-
-use_modules=yes
-AC_ARG_WITH(modules,
-[ --with-modules[=FILES] Add support for dynamic modules],
-use_modules="$withval")
-test -z "$use_modules" && use_modules=yes
-DLPREOPEN=
-if test "$use_modules" != no; then
- AC_DEFINE(DYNAMIC_LINKING, 1,
- [Define if you want support for dynamic linking.])
- if test "$use_modules" = yes; then
- DLPREOPEN="-dlpreopen force"
- else
- DLPREOPEN="-export-dynamic"
- for module in $use_modules; do
- DLPREOPEN="$DLPREOPEN -dlopen $module"
- done
- fi
-fi
-
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
AC_SUBST(DLPREOPEN)
inet_lnaof inet_makeaddr inet_netof hstrerror 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_DEFINE(HAVE_LIBC_STACK_END, 1,
+ [Define if you have the __libc_stack_end variable.])
+fi
+
dnl Some systems do not declare this. Some systems do declare it, as a
dnl macro. With cygwin it may be in a DLL.
AC_MSG_CHECKING(for working IPv6 support)
AC_CACHE_VAL(guile_cv_have_ipv6,
-[AC_TRY_COMPILE([#include <netinet/in.h>
+[AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <netinet/in.h>
#include <sys/socket.h>],
[struct sockaddr_in6 a; a.sin6_family = AF_INET6;],
guile_cv_have_ipv6=yes, guile_cv_have_ipv6=no)])
# included in rfc2553 but not in older implementations, e.g., glibc 2.1.3.
AC_MSG_CHECKING(whether sockaddr_in6 has sin6_scope_id)
AC_CACHE_VAL(guile_cv_have_sin6_scope_id,
-[AC_TRY_COMPILE([#include <netinet/in.h>],
+[AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <netinet/in.h>],
[struct sockaddr_in6 sok; sok.sin6_scope_id = 0;],
guile_cv_have_sin6_scope_id=yes, guile_cv_have_sin6_scope_id=no)])
AC_MSG_RESULT($guile_cv_have_sin6_scope_id)
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)
+
# When testing for the presence of alloca, we need to add alloca.o
# explicitly to LIBOBJS to make sure that it is translated to
# `alloca.lo' for libtool later on. This can and should be done more cleanly.
fi
fi
+## Cross building
+if test "$cross_compiling" = "yes"; then
+ AC_MSG_CHECKING(cc for build)
+ ## /usr/bin/cc still uses wrong assembler
+ ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}"
+ CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}"
+else
+ CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
+fi
+AC_ARG_WITH(cc-for-build,
+ [ --with-cc-for-build=CC native C compiler, to be used during build])
+test -n "$with_cc_for_build" && CC_FOR_BUILD="$with_cc_for_build"
+
+## AC_MSG_CHECKING("if we are cross compiling")
+## AC_MSG_RESULT($cross_compiling)
+if test "$cross_compiling" = "yes"; then
+ AC_MSG_RESULT($CC_FOR_BUILD)
+fi
+
+## No need as yet to be more elaborate
+CCLD_FOR_BUILD="$CC_FOR_BUILD"
+
+AC_SUBST(cross_compiling)
+AC_SUBST(CC_FOR_BUILD)
+AC_SUBST(CCLD_FOR_BUILD)
+
+## libtool erroneously calls CC_FOR_BUILD HOST_CC;
+## --HOST is the platform that PACKAGE is compiled for.
+HOST_CC="$CC_FOR_BUILD"
+AC_SUBST(HOST_CC)
+
+if test "$cross_compiling" = "yes"; then
+ AC_MSG_CHECKING(guile for build)
+ GUILE_FOR_BUILD="${GUILE_FOR_BUILD-guile}"
+else
+ GUILE_FOR_BUILD='$(preinstguile)'
+fi
+AC_ARG_WITH(guile-for-build,
+ [ --with-guile-for-build=guile native guile executable, to be used during build])
+test -n "$with_guile_for_build" && GUILE_FOR_BUILD="$with_guile_for_build"
+
+## AC_MSG_CHECKING("if we are cross compiling")
+## AC_MSG_RESULT($cross_compiling)
+if test "$cross_compiling" = "yes"; then
+ AC_MSG_RESULT($GUILE_FOR_BUILD)
+fi
+AC_SUBST(GUILE_FOR_BUILD)
+
## If we're using GCC, ask for aggressive warnings.
case "$GCC" in
yes )
examples/safe/Makefile
test-suite/Makefile
check-guile
+ benchmark-suite/Makefile
+ benchmark-guile
guile-tools
pre-inst-guile])
libguile/guile-func-name-check \
libguile/guile-snarf-docs \
check-guile \
+ benchmark-guile \
guile-tools \
pre-inst-guile])