summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorLRN <lrn1986@google.com>2009-08-07 21:47:25 +0200
committerDaniel Veillard <veillard@redhat.com>2009-08-07 21:47:25 +0200
commit203fd2e6c72984711e8904557046aca0c8ee920c (patch)
tree36456add864efef68abe713e3ffdbcf01388a846 /configure.in
parent99f7ac7f66dd8e484209c22b6e10e05befffbd0f (diff)
downloadlibxml2-203fd2e6c72984711e8904557046aca0c8ee920c.tar.gz
Allow to select the threading system on Windows
* configure.in: changes to enable either pthreads or win32-threads
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in26
1 files changed, 15 insertions, 11 deletions
diff --git a/configure.in b/configure.in
index 9d64dfda..6c0e1398 100644
--- a/configure.in
+++ b/configure.in
@@ -870,17 +870,21 @@ if test "$with_threads" = "no" ; then
echo Disabling multithreaded support
else
echo Enabling multithreaded support
-
- AC_CHECK_HEADER(pthread.h,
- AC_CHECK_LIB(pthread, pthread_join,[
- THREAD_LIBS="-lpthread"
- AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
- AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
- WITH_THREADS="1"]))
+ dnl Use pthread by default
+ if test "$with_threads" = "pthread" | test "$with_threads" = "" ; then
+ AC_CHECK_HEADER(pthread.h,
+ AC_CHECK_LIB(pthread, pthread_join,[
+ THREAD_LIBS="-lpthread"
+ AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
+ AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
+ WITH_THREADS="1"]))
+ fi
case $host_os in
- *mingw32*) WITH_THREADS="1"
- THREADS_W32="Win32"
- THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
+ *mingw32*) if test "$THREAD_LIBS" != "-lpthread"; then
+ WITH_THREADS="1"
+ THREADS_W32="Win32"
+ THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
+ fi
;;
*cygwin*) THREAD_LIBS=""
;;
@@ -898,7 +902,7 @@ else
THREAD_LIBS=""
BASE_THREAD_LIBS="-lpthread"
else
- if expr ${GCC_MAJOR} \> 3 > /dev/null
+ if expr ${GCC_MAJOR} \> 3 > /dev/null
then
THREAD_LIBS=""
BASE_THREAD_LIBS="-lpthread"