Changed logic in thread support configuration such that
--with-threads=no is equivalent to --with-threads=null. On platforms that are not supported by QuickThreads, we also use the null-threads. Thus, USE_THREADS is always defined now.
This commit is contained in:
parent
64e00566db
commit
585356dcbd
1 changed files with 35 additions and 41 deletions
76
configure.in
76
configure.in
|
|
@ -638,14 +638,13 @@ AC_ARG_WITH(threads, [ --with-threads thread interface],
|
||||||
|
|
||||||
### Turn $with_threads into either the name of a threads package, like
|
### Turn $with_threads into either the name of a threads package, like
|
||||||
### `qt', or `no', meaning that threads should not be supported.
|
### `qt', or `no', meaning that threads should not be supported.
|
||||||
AC_MSG_CHECKING(whether to support threads)
|
AC_MSG_CHECKING(what kind of threads to support)
|
||||||
case "$with_threads" in
|
case "$with_threads" in
|
||||||
"yes" | "qt" | "coop" | "")
|
"yes" | "qt" | "coop" | "")
|
||||||
with_threads=qt
|
with_threads=qt
|
||||||
;;
|
;;
|
||||||
"null" )
|
"no" | "null")
|
||||||
;;
|
with_threads=null
|
||||||
"no" )
|
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
|
AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
|
||||||
|
|
@ -659,7 +658,7 @@ case "${with_threads}" in
|
||||||
"qt" )
|
"qt" )
|
||||||
## This configures the QuickThreads package, and sets or clears
|
## This configures the QuickThreads package, and sets or clears
|
||||||
## the THREAD_PACKAGE variable if qthreads don't configure
|
## the THREAD_PACKAGE variable if qthreads don't configure
|
||||||
## correctly.
|
## correctly. In that case, we fall back on null-threads.
|
||||||
QTHREADS_CONFIGURE
|
QTHREADS_CONFIGURE
|
||||||
;;
|
;;
|
||||||
"null" )
|
"null" )
|
||||||
|
|
@ -667,49 +666,44 @@ case "${with_threads}" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
## We always provide the thread API now and thus, USE_THREADS is
|
||||||
|
## always defined and threads.o is always included.
|
||||||
|
|
||||||
## If we're using threads, bring in some other parts of Guile which
|
AC_DEFINE(USE_THREADS, 1, [Define if providing the thread API.])
|
||||||
## work with them.
|
AC_LIBOBJ([threads])
|
||||||
if test "${THREAD_PACKAGE}" != "" ; then
|
|
||||||
AC_DEFINE(USE_THREADS, 1, [Define if providing the thread API.])
|
|
||||||
|
|
||||||
## Include the Guile thread interface in the library...
|
case "${THREAD_PACKAGE}" in
|
||||||
AC_LIBOBJ([threads])
|
"QT" )
|
||||||
|
AC_DEFINE(USE_COOP_THREADS, 1,
|
||||||
|
[Define if using cooperative multithreading.])
|
||||||
|
|
||||||
## ... and tell it which package to talk to.
|
AC_ARG_ENABLE(linuxthreads,
|
||||||
case "${THREAD_PACKAGE}" in
|
[ --disable-linuxthreads disable linuxthreads workaround],,
|
||||||
"QT" )
|
enable_linuxthreads=yes)
|
||||||
AC_DEFINE(USE_COOP_THREADS, 1,
|
|
||||||
[Define if using cooperative multithreading.])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(linuxthreads,
|
## Workaround for linuxthreads (optionally disabled)
|
||||||
[ --disable-linuxthreads disable linuxthreads workaround],,
|
if test $host_os = linux-gnu -a "$enable_linuxthreads" = yes; then
|
||||||
enable_linuxthreads=yes)
|
AC_DEFINE(GUILE_PTHREAD_COMPAT, 1,
|
||||||
|
[Define to enable workaround for COOP-linuxthreads compatibility.])
|
||||||
|
AC_CHECK_LIB(pthread, main)
|
||||||
|
fi
|
||||||
|
|
||||||
## Workaround for linuxthreads (optionally disabled)
|
## Bring in scm_internal_select, if appropriate.
|
||||||
if test $host_os = linux-gnu -a "$enable_linuxthreads" = yes; then
|
if test $ac_cv_func_gettimeofday = yes &&
|
||||||
AC_DEFINE(GUILE_PTHREAD_COMPAT, 1,
|
test $ac_cv_func_select = yes; then
|
||||||
[Define to enable workaround for COOP-linuxthreads compatibility.])
|
AC_DEFINE(GUILE_ISELECT, 1, [Define to implement scm_internal_select.])
|
||||||
AC_CHECK_LIB(pthread, main)
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
## Bring in scm_internal_select, if appropriate.
|
;;
|
||||||
if test $ac_cv_func_gettimeofday = yes &&
|
"null" | "" )
|
||||||
test $ac_cv_func_select = yes; then
|
AC_DEFINE(USE_NULL_THREADS, 1,
|
||||||
AC_DEFINE(GUILE_ISELECT, 1, [Define to implement scm_internal_select.])
|
[Define if using one-thread 'multi'threading.])
|
||||||
fi
|
;;
|
||||||
|
* )
|
||||||
|
AC_MSG_ERROR(invalid value for THREAD_PACKAGE: ${THREAD_PACKAGE})
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
;;
|
|
||||||
"null" )
|
|
||||||
AC_DEFINE(USE_NULL_THREADS, 1,
|
|
||||||
[Define if using one-thread 'multi'threading.])
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
AC_MSG_ERROR(invalid value for THREAD_PACKAGE: ${THREAD_PACKAGE})
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Cross building
|
## Cross building
|
||||||
if test "$cross_compiling" = "yes"; then
|
if test "$cross_compiling" = "yes"; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue