1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00

Allow to select the threading system on Windows

* configure.in: changes to enable either pthreads or win32-threads
This commit is contained in:
LRN 2009-08-07 21:47:25 +02:00 committed by Daniel Veillard
parent 99f7ac7f66
commit 203fd2e6c7

View File

@ -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"