diff options
author | Sam Thursfield <ssssam@gmail.com> | 2012-05-09 18:46:56 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2012-05-09 18:46:56 +0800 |
commit | 115581ae2d3e35ddb7c43c50aacfa98193be6b72 (patch) | |
tree | ec1bb79027dc407692782c118f4d8e49e9506923 /configure.in | |
parent | 066c69777207436e3517d1b930a97f0e0a8aa060 (diff) | |
download | libxml2-115581ae2d3e35ddb7c43c50aacfa98193be6b72.tar.gz |
prefer native threads on win32
For https://bugzilla.gnome.org/show_bug.cgi?id=665526
When building on Win32 configure the suport to use native Windows
threads since there is support for it unless pthreads are found
and asked for explicitely
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/configure.in b/configure.in index 5a6f5b79..e71f00a8 100644 --- a/configure.in +++ b/configure.in @@ -944,22 +944,30 @@ if test "$with_threads" = "no" ; then echo Disabling multithreaded support else echo Enabling multithreaded support - dnl Use pthread by default - if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; 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 + + dnl Default to native threads on Win32 case $host_os in - *mingw32*) if test "$THREAD_LIBS" != "-lpthread"; then + *mingw32*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then WITH_THREADS="1" THREADS_W32="Win32" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" + THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" fi ;; + esac + + dnl Use pthread by default in other cases + if test -z "$THREADS_W32"; then + if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; 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 + fi + + case $host_os in *cygwin*) THREAD_LIBS="" ;; *beos*) WITH_THREADS="1" |