]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
windows thread library check
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 2 Jun 2010 08:43:29 +0000 (08:43 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 2 Jun 2010 08:43:29 +0000 (08:43 +0000)
git-svn-id: file:///svn/unbound/trunk@2132 be551aaa-1e26-0410-a405-d3ace91eadb9

configure
configure.ac

index ce8221d66e14e9d63d3f870c025d31483eb32bfa..d96e047d15580d4b94357c82475b39e97f664d2f 100755 (executable)
--- a/configure
+++ b/configure
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
+# check windows threads (we use them, not pthreads, on windows).
+if test "$on_mingw" = "yes"; then
+# check windows threads
+       for ac_header in windows.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_windows_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_WINDOWS_H 1
+_ACEOF
+
+fi
+
+done
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CreateThread" >&5
+$as_echo_n "checking for CreateThread... " >&6; }
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+int
+main ()
+{
+
+       HANDLE t = CreateThread(NULL, 0, NULL, NULL, 0, NULL);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_WINDOWS_THREADS 1" >>confdefs.h
+
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+# not on mingw, check thread libraries.
+
 # check for thread library.
 # check this first, so that the pthread lib does not get linked in via
 # libssl or libpython, and thus distorts the tests, and we end up using
        fi
 fi
 
-# check windows threads
-if test x_$ub_have_pthreads = x_no -a x_$ub_have_sol_threads = x_no; then
-       for ac_header in windows.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_windows_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_WINDOWS_H 1
-_ACEOF
-
-fi
-
-done
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CreateThread" >&5
-$as_echo_n "checking for CreateThread... " >&6; }
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-int
-main ()
-{
-
-       HANDLE t = CreateThread(NULL, 0, NULL, NULL, 0, NULL);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_WINDOWS_THREADS 1" >>confdefs.h
-
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+fi # end of non-mingw check of thread libraries
 
 # Check for PyUnbound
 
index 33768a842c720cc7721a2196b8664b176c85d38d..b666a24ab837e254e0df65e0e0111e9752320c29 100644 (file)
@@ -248,6 +248,27 @@ ACX_SYS_LARGEFILE
 ACX_CHECK_NONBLOCKING_BROKEN
 ACX_MKDIR_ONE_ARG
 
+# check windows threads (we use them, not pthreads, on windows).
+if test "$on_mingw" = "yes"; then
+# check windows threads
+       AC_CHECK_HEADERS([windows.h],,, [AC_INCLUDES_DEFAULT])
+       AC_MSG_CHECKING([for CreateThread])
+       AC_TRY_COMPILE([
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+], [
+       HANDLE t = CreateThread(NULL, 0, NULL, NULL, 0, NULL);
+],
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_WINDOWS_THREADS, 1, [Using Windows threads])
+,      
+       AC_MSG_RESULT(no)
+)
+
+else
+# not on mingw, check thread libraries.
+
 # check for thread library.
 # check this first, so that the pthread lib does not get linked in via
 # libssl or libpython, and thus distorts the tests, and we end up using
@@ -288,23 +309,7 @@ if test x_$withval != x_no; then
        fi
 fi
 
-# check windows threads
-if test x_$ub_have_pthreads = x_no -a x_$ub_have_sol_threads = x_no; then
-       AC_CHECK_HEADERS([windows.h],,, [AC_INCLUDES_DEFAULT])
-       AC_MSG_CHECKING([for CreateThread])
-       AC_TRY_COMPILE([
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-], [
-       HANDLE t = CreateThread(NULL, 0, NULL, NULL, 0, NULL);
-],
-       AC_MSG_RESULT(yes)
-       AC_DEFINE(HAVE_WINDOWS_THREADS, 1, [Using Windows threads])
-,      
-       AC_MSG_RESULT(no)
-)
-fi
+fi # end of non-mingw check of thread libraries
 
 # Check for PyUnbound
 AC_ARG_WITH(pyunbound,