### What thread package has the user asked for?
AC_ARG_WITH(threads, [ --with-threads thread interface],
- , with_threads=no)
+ , with_threads=yes)
-### Turn $with_threads into either the name of a threads package, like
-### `qt', or `no', meaning that threads should not be supported.
-AC_MSG_CHECKING(what kind of threads to support)
case "$with_threads" in
- "yes" | "qt" | "coop" | "")
- with_threads=qt
- ;;
- "no" | "null")
- with_threads=null
- ;;
- "coop-pthreads" | "copt" )
- with_threads="coop-pthreads"
- ;;
- * )
- AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
+ "yes" | "pthread" | "pthreads" | "pthread-threads" | "")
+ AC_CHECK_LIB(pthread, main,
+ LIBS="-lpthread $LIBS"
+ AC_DEFINE(USE_PTHREAD_THREADS, 1,
+ [Define if using pthread multithreading.])
+ with_threads="pthreads",
+ with_threads="null")
+
+ if test $GCC = yes; then
+ AC_DEFINE(_THREAD_SAFE, 1,
+ [Use thread safe versions of GNU Libc functions.])
+ fi
+
+ AC_MSG_CHECKING(if pthread_mutexattr_settype is declared)
+ AC_CACHE_VAL(guile_cv_mutexattr_settype_declared,
+ [AC_TRY_COMPILE([#include <pthread.h>],
+ [int pthread_mutexattr_settype (int, int);],
+ guile_cv_mutexattr_settype_declared=no,
+ guile_cv_mutexattr_settype_declared=yes)])
+ AC_MSG_RESULT($guile_cv_mutexattr_settype_declared)
+ if test $guile_cv_mutexattr_settype_declared = yes; then
+ AC_DEFINE(SCM_MUTEXATTR_SETTYPE_DECLARED, 1,
+ [Define if pthread.h declares pthread_mutexattr_settype.])
+ fi
+
+ AC_MSG_CHECKING(how to get a fast mutex)
+ AC_CACHE_VAL(guile_cv_have_mutex_fast,
+ [AC_TRY_COMPILE([#include <pthread.h>],
+ [int a = PTHREAD_MUTEX_ADAPTIVE_NP;],
+ guile_cv_have_mutex_fast=PTHREAD_MUTEX_ADAPTIVE_NP,
+ guile_cv_have_mutex_fast=none)])
+ AC_MSG_RESULT($guile_cv_have_mutex_fast)
+ if test ! $guile_cv_have_mutex_fast = none; then
+ AC_DEFINE_UNQUOTED(SCM_MUTEX_FAST, $guile_cv_have_mutex_fast,
+ [The mutex kind enum for fast mutexes.])
+ fi
+
+ AC_MSG_CHECKING(how to get a recursive mutex)
+ AC_CACHE_VAL(guile_cv_have_mutex_recursive,
+ [AC_TRY_COMPILE([#include <pthread.h>],
+ [int a = PTHREAD_MUTEX_RECURSIVE_NP;],
+ guile_cv_have_mutex_recursive=PTHREAD_MUTEX_RECURSIVE_NP)
+ if test -z "$guile_cv_have_mutex_recursive"; then
+ AC_TRY_COMPILE([#include <pthread.h>],
+ [int a = PTHREAD_MUTEX_RECURSIVE;],
+ guile_cv_have_mutex_recursive=PTHREAD_MUTEX_RECURSIVE,
+ guile_cv_have_mutex_recursive=none)
+ fi])
+ AC_MSG_RESULT($guile_cv_have_mutex_recursive)
+ if test ! $guile_cv_have_mutex_recursive = none; then
+ AC_DEFINE_UNQUOTED(SCM_MUTEX_RECURSIVE, $guile_cv_have_mutex_recursive,
+ [The mutex kind enum for recursive mutexes.])
+ fi
;;
esac
-AC_MSG_RESULT($with_threads)
-
-## Make sure the threads package we've chosen is actually supported on
-## the present platform.
-case "${with_threads}" in
- "qt" )
- ## This configures the QuickThreads package, and sets or clears
- ## the THREAD_PACKAGE variable if qthreads don't configure
- ## correctly. In that case, we fall back on null-threads.
- QTHREADS_CONFIGURE
- ;;
- * )
- THREAD_PACKAGE="${with_threads}"
- ;;
-esac
-
-case "${THREAD_PACKAGE}" in
- "QT" )
- AC_DEFINE(USE_COOP_THREADS, 1,
- [Define if using cooperative multithreading.])
-
- AC_ARG_ENABLE(linuxthreads,
- [ --disable-linuxthreads disable linuxthreads workaround],,
- enable_linuxthreads=yes)
-
- ## Workaround for linuxthreads (optionally disabled)
- if test $host_os = linux-gnu -a "$enable_linuxthreads" = yes; then
- AC_DEFINE(GUILE_PTHREAD_COMPAT, 1,
- [Define to enable workaround for COOP-linuxthreads compatibility.])
- AC_CHECK_LIB(pthread, main)
- fi
+case "$with_threads" in
+ "pthreads")
;;
- "null" | "" )
+ "no" | "null")
AC_DEFINE(USE_NULL_THREADS, 1,
[Define if using one-thread 'multi'threading.])
- ;;
- "coop-pthreads" )
- AC_DEFINE(USE_COPT_THREADS, 1,
- [Define if using coop-pthread multithreading.])
- AC_CHECK_LIB(pthread, main)
+ with_threads="null-threads"
;;
* )
- AC_MSG_ERROR(invalid value for THREAD_PACKAGE: ${THREAD_PACKAGE})
+ AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
;;
esac
+AC_MSG_CHECKING(what kind of threads to support)
+AC_MSG_RESULT($with_threads)
## Cross building
if test "$cross_compiling" = "yes"; then
AC_SUBST(GUILE_MAJOR_VERSION)
AC_SUBST(GUILE_MINOR_VERSION)
AC_SUBST(GUILE_MICRO_VERSION)
+AC_SUBST(GUILE_EFFECTIVE_VERSION)
AC_SUBST(GUILE_VERSION)
#######################################################################
AC_SUBST(LIBGUILE_INTERFACE_AGE)
AC_SUBST(LIBGUILE_INTERFACE)
+AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_CURRENT)
+AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_REVISION)
+AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_AGE)
+AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE)
+
AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT)
AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION)
AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE)
dnl See also top_builddir in info node: (libtool)AC_PROG_LIBTOOL
top_builddir_absolute=`pwd`
AC_SUBST(top_builddir_absolute)
-top_srcdir_absolute=`(cd $srcdir ; pwd)`
+top_srcdir_absolute=`(cd $srcdir && pwd)`
AC_SUBST(top_srcdir_absolute)
AC_CONFIG_FILES([
Makefile
am/Makefile
- libguile/Makefile
- libguile/guile-snarf
- libguile/guile-doc-snarf
- libguile/guile-func-name-check
- libguile/guile-snarf-docs
- libguile/version.h
- libguile-ltdl/Makefile
- libguile-ltdl/upstream/Makefile
+ benchmark-suite/Makefile
+ doc/Makefile
+ doc/goops/Makefile
+ doc/r5rs/Makefile
+ doc/ref/Makefile
+ doc/tutorial/Makefile
+ examples/Makefile
+ examples/box-dynamic-module/Makefile
+ examples/box-dynamic/Makefile
+ examples/box-module/Makefile
+ examples/box/Makefile
+ examples/modules/Makefile
+ examples/safe/Makefile
+ examples/scripts/Makefile
+ guile-config/Makefile
ice-9/Makefile
ice-9/debugger/Makefile
ice-9/debugger/breakpoints/Makefile
lang/elisp/Makefile
lang/elisp/internals/Makefile
lang/elisp/primitives/Makefile
+ libguile-ltdl/Makefile
+ libguile-ltdl/upstream/Makefile
+ libguile/Makefile
oop/Makefile
oop/goops/Makefile
scripts/Makefile
srfi/Makefile
- qt/Makefile
- qt/qt.h
- qt/md/Makefile
- qt/time/Makefile
- guile-config/Makefile
- doc/Makefile
- doc/ref/Makefile
- doc/tutorial/Makefile
- doc/goops/Makefile
- doc/r5rs/Makefile
- examples/Makefile
- examples/scripts/Makefile
- examples/box/Makefile
- examples/box-module/Makefile
- examples/box-dynamic/Makefile
- examples/box-dynamic-module/Makefile
- examples/modules/Makefile
- examples/safe/Makefile
- test-suite/Makefile
- check-guile
- benchmark-suite/Makefile
- benchmark-guile
- guile-tools
- pre-inst-guile])
-
-AC_CONFIG_COMMANDS(default,
- [ chmod +x libguile/guile-snarf \
- libguile/guile-doc-snarf \
- libguile/guile-func-name-check \
- libguile/guile-snarf-docs \
- check-guile \
- benchmark-guile \
- guile-tools \
- pre-inst-guile])
+ test-suite/Makefile])
+
+AC_CONFIG_FILES([check-guile], [chmod +x check-guile])
+AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile])
+AC_CONFIG_FILES([guile-tools], [chmod +x guile-tools])
+AC_CONFIG_FILES([pre-inst-guile], [chmod +x pre-inst-guile])
+AC_CONFIG_FILES([libguile/guile-snarf],
+ [chmod +x libguile/guile-snarf])
+AC_CONFIG_FILES([libguile/guile-doc-snarf],
+ [chmod +x libguile/guile-doc-snarf])
+AC_CONFIG_FILES([libguile/guile-func-name-check],
+ [chmod +x libguile/guile-func-name-check])
+AC_CONFIG_FILES([libguile/guile-snarf-docs],
+ [chmod +x libguile/guile-snarf-docs])
AC_OUTPUT