dnl
dnl Known broken systems includes:
dnl - x86_64-unknown-netbsd5.0.
+ dnl - x86_64-unknown-netbsd5.1
dnl - sparc-sun-solaris2.8
dnl
dnl On `x86_64-unknown-freebsd8.0', thread-local storage appears to
dnl be reclaimed at the wrong time, leading to a segfault when
dnl running `threads.test'. So disable it.
case "$enable_shared--$host_os" in
- [yes--netbsd[0-5].[0-9].|yes--solaris2.8|yes--freebsd[0-8]*])
+ [yes--netbsd[0-5].[0-9]*|yes--solaris2.8|yes--freebsd[0-8]*])
ac_cv_have_thread_storage_class="no"
;;
*)
GUILE_UNISTRING_CONSTANT([iconveh_escape_sequence])
])
+dnl GUILE_CHECK_VERSION
+dnl
+dnl Ensure that $GUILE_FOR_BUILD has the same version as ourselves.
+AC_DEFUN([GUILE_CHECK_VERSION], [
+ if ! "$GUILE_FOR_BUILD" --version > /dev/null 2>&1; then
+ AC_MSG_ERROR([failed to run `$GUILE_FOR_BUILD'])
+ fi
+
+ dnl Use MAJOR.MINOR.MICRO instead of (version) so that developers can
+ dnl freely shoot themselves in the foot by using, say, 2.0.3.80 and
+ dnl 2.0.3.42.
+ AC_CACHE_CHECK([the version of $GUILE_FOR_BUILD],
+ [ac_cv_guile_for_build_version],
+ [ac_cv_guile_for_build_version="`"$GUILE_FOR_BUILD" \
+ -c '(format #t "~a.~a.~a" (major-version) (minor-version) (micro-version))'`"
+ ])
+
+ if test "$ac_cv_guile_for_build_version" != \
+ "$GUILE_MAJOR_VERSION.$GUILE_MINOR_VERSION.$GUILE_MICRO_VERSION"
+ then
+ AC_MSG_ERROR([building Guile $PACKAGE_VERSION but `$GUILE_FOR_BUILD' has version $ac_cv_guile_for_build_version"])
+ fi
+])
+
+dnl GUILE_CHECK_GUILE_FOR_BUILD
+dnl
+dnl When cross-compiling, ensure that $GUILE_FOR_BUILD is suitable.
+AC_DEFUN([GUILE_CHECK_GUILE_FOR_BUILD], [
+ if test "$cross_compiling" = "yes"; then
+ if test "x$GUILE_FOR_BUILD" = "x"; then
+ AC_PATH_PROG([GUILE_FOR_BUILD], [guile], [not-found])
+ if test "$GUILE_FOR_BUILD" = "not-found"; then
+ AC_MSG_ERROR([a native Guile $PACKAGE_VERSION is required to cross-build Guile])
+ fi
+ fi
+ AC_MSG_CHECKING([guile for build])
+ AC_MSG_RESULT([$GUILE_FOR_BUILD])
+
+ dnl Since there is currently no distinction between the run-time
+ dnl search path, %load-path, and the compiler's search path,
+ dnl $GUILE_FOR_BUILD must be a native build of the very same version.
+ GUILE_CHECK_VERSION
+ else
+ GUILE_FOR_BUILD='this-value-will-never-be-used'
+ fi
+
+ AC_ARG_VAR([GUILE_FOR_BUILD], [guile for the build system])
+ AM_SUBST_NOTMAKE([GUILE_FOR_BUILD])
+])
+
dnl Declare file $1 to be a script that needs configuring,
dnl and arrange to make it executable in the process.
AC_DEFUN([GUILE_CONFIG_SCRIPT],[AC_CONFIG_FILES([$1],[chmod +x $1])])
-
-\f
-dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME.
-# For a program named, say foo, you should add a line like the following
-# in the corresponding Makefile.am file:
-# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
-
-AC_DEFUN([gl_CLOCK_TIME],
-[
- dnl Persuade glibc and Solaris <time.h> to declare these functions.
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
- # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
-
- # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
- # programs in the package would end up linked with that potentially-shared
- # library, inducing unnecessary run-time overhead.
- LIB_CLOCK_GETTIME=
- AC_SUBST([LIB_CLOCK_GETTIME])
- gl_saved_libs=$LIBS
- AC_SEARCH_LIBS([clock_gettime], [rt posix4],
- [if test "$ac_cv_search_clock_gettime" = "none required"; then
- AC_SEARCH_LIBS([clock_getcpuclockid], [rt posix4],
- [test "$ac_cv_search_clock_getcpuclockid" = "none required" \
- || LIB_CLOCK_GETTIME=$ac_cv_search_clock_getcpuclockid],
- [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
- else
- LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
- fi])
- AC_CHECK_FUNCS([clock_gettime clock_settime clock_getcpuclockid])
- LIBS=$gl_saved_libs
-])