[libxml2] Allow to select the threading system on Windows
- From: Daniel Veillard <veillard src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libxml2] Allow to select the threading system on Windows
- Date: Fri, 7 Aug 2009 19:49:31 +0000 (UTC)
commit 203fd2e6c72984711e8904557046aca0c8ee920c
Author: LRN <lrn1986 google com>
Date: Fri Aug 7 21:47:25 2009 +0200
Allow to select the threading system on Windows
* configure.in: changes to enable either pthreads or win32-threads
configure.in | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/configure.in b/configure.in
index 9d64dfd..6c0e139 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"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]