638 |
|
|
639 |
### Turn $with_threads into either the name of a threads package, like |
### Turn $with_threads into either the name of a threads package, like |
640 |
### `qt', or `no', meaning that threads should not be supported. |
### `qt', or `no', meaning that threads should not be supported. |
641 |
AC_MSG_CHECKING(whether to support threads) |
AC_MSG_CHECKING(what kind of threads to support) |
642 |
case "$with_threads" in |
case "$with_threads" in |
643 |
"yes" | "qt" | "coop" | "") |
"yes" | "qt" | "coop" | "") |
644 |
with_threads=qt |
with_threads=qt |
645 |
;; |
;; |
646 |
"null" ) |
"no" | "null") |
647 |
;; |
with_threads=null |
|
"no" ) |
|
648 |
;; |
;; |
649 |
* ) |
* ) |
650 |
AC_MSG_ERROR(invalid value for --with-threads: $with_threads) |
AC_MSG_ERROR(invalid value for --with-threads: $with_threads) |
658 |
"qt" ) |
"qt" ) |
659 |
## This configures the QuickThreads package, and sets or clears |
## This configures the QuickThreads package, and sets or clears |
660 |
## the THREAD_PACKAGE variable if qthreads don't configure |
## the THREAD_PACKAGE variable if qthreads don't configure |
661 |
## correctly. |
## correctly. In that case, we fall back on null-threads. |
662 |
QTHREADS_CONFIGURE |
QTHREADS_CONFIGURE |
663 |
;; |
;; |
664 |
"null" ) |
"null" ) |
666 |
;; |
;; |
667 |
esac |
esac |
668 |
|
|
669 |
|
## We always provide the thread API now and thus, USE_THREADS is |
670 |
|
## always defined and threads.o is always included. |
671 |
|
|
672 |
|
AC_DEFINE(USE_THREADS, 1, [Define if providing the thread API.]) |
673 |
|
AC_LIBOBJ([threads]) |
674 |
|
|
675 |
## If we're using threads, bring in some other parts of Guile which |
case "${THREAD_PACKAGE}" in |
676 |
## work with them. |
"QT" ) |
677 |
if test "${THREAD_PACKAGE}" != "" ; then |
AC_DEFINE(USE_COOP_THREADS, 1, |
678 |
AC_DEFINE(USE_THREADS, 1, [Define if providing the thread API.]) |
[Define if using cooperative multithreading.]) |
679 |
|
|
680 |
## Include the Guile thread interface in the library... |
AC_ARG_ENABLE(linuxthreads, |
681 |
AC_LIBOBJ([threads]) |
[ --disable-linuxthreads disable linuxthreads workaround],, |
682 |
|
enable_linuxthreads=yes) |
683 |
## ... and tell it which package to talk to. |
|
684 |
case "${THREAD_PACKAGE}" in |
## Workaround for linuxthreads (optionally disabled) |
685 |
"QT" ) |
if test $host_os = linux-gnu -a "$enable_linuxthreads" = yes; then |
686 |
AC_DEFINE(USE_COOP_THREADS, 1, |
AC_DEFINE(GUILE_PTHREAD_COMPAT, 1, |
687 |
[Define if using cooperative multithreading.]) |
[Define to enable workaround for COOP-linuxthreads compatibility.]) |
688 |
|
AC_CHECK_LIB(pthread, main) |
689 |
AC_ARG_ENABLE(linuxthreads, |
fi |
690 |
[ --disable-linuxthreads disable linuxthreads workaround],, |
|
691 |
enable_linuxthreads=yes) |
## Bring in scm_internal_select, if appropriate. |
692 |
|
if test $ac_cv_func_gettimeofday = yes && |
693 |
## Workaround for linuxthreads (optionally disabled) |
test $ac_cv_func_select = yes; then |
694 |
if test $host_os = linux-gnu -a "$enable_linuxthreads" = yes; then |
AC_DEFINE(GUILE_ISELECT, 1, [Define to implement scm_internal_select.]) |
695 |
AC_DEFINE(GUILE_PTHREAD_COMPAT, 1, |
fi |
696 |
[Define to enable workaround for COOP-linuxthreads compatibility.]) |
|
697 |
AC_CHECK_LIB(pthread, main) |
;; |
698 |
fi |
"null" | "" ) |
699 |
|
AC_DEFINE(USE_NULL_THREADS, 1, |
700 |
## Bring in scm_internal_select, if appropriate. |
[Define if using one-thread 'multi'threading.]) |
701 |
if test $ac_cv_func_gettimeofday = yes && |
;; |
702 |
test $ac_cv_func_select = yes; then |
* ) |
703 |
AC_DEFINE(GUILE_ISELECT, 1, [Define to implement scm_internal_select.]) |
AC_MSG_ERROR(invalid value for THREAD_PACKAGE: ${THREAD_PACKAGE}) |
704 |
fi |
;; |
705 |
|
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 |
|
706 |
|
|
|
fi |
|
707 |
|
|
708 |
## Cross building |
## Cross building |
709 |
if test "$cross_compiling" = "yes"; then |
if test "$cross_compiling" = "yes"; then |