[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r36805 - libmicrohttpd
From: |
gnunet |
Subject: |
[GNUnet-SVN] r36805 - libmicrohttpd |
Date: |
Mon, 11 Jan 2016 21:15:15 +0100 |
Author: Karlson2k
Date: 2016-01-11 21:15:15 +0100 (Mon, 11 Jan 2016)
New Revision: 36805
Modified:
libmicrohttpd/configure.ac
Log:
configure.ac: cleaned up and refactored threading lib selection for clarity
Modified: libmicrohttpd/configure.ac
===================================================================
--- libmicrohttpd/configure.ac 2016-01-11 19:48:15 UTC (rev 36804)
+++ libmicrohttpd/configure.ac 2016-01-11 20:15:15 UTC (rev 36805)
@@ -86,32 +86,6 @@
MHD_REQ_PRIVATE=''
MHD_LIBDEPS_PKGCFG=''
-AC_ARG_WITH([threads],
- [AS_HELP_STRING([--with-threads=LIB],[choose threading library (posix, w32,
auto) [auto]])],
- [], [with_threads='auto'])
-test "x$with_threads" = "xwin32" && with_threads='w32'
-test "x$with_threads" = "xpthreads" && with_threads='posix'
-
-# Check for posix threads support
-AX_PTHREAD([HAVE_POSIX_THREADS='yes'],[HAVE_POSIX_THREADS='no'])
-AM_CONDITIONAL([HAVE_POSIX_THREADS],[test "x$HAVE_POSIX_THREADS" = "xyes"])
-# Simple check for W32 threads support
-AC_CHECK_HEADER([windows.h],
- [
- AC_MSG_CHECKING([for CreateThread()])
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([#include <windows.h>], [ HANDLE h = CreateThread(NULL,
0, NULL, NULL, 0, NULL);])],
- [
- AC_MSG_RESULT([yes])
- HAVE_W32_THREADS='yes'
- ],
- [
- AC_MSG_RESULT([no])
- HAVE_W32_THREADS='no'
- ])
- ],
- [HAVE_W32_THREADS='no'])
-
# Check system type
AC_MSG_CHECKING([[for target host OS]])
case "$host_os" in
@@ -205,45 +179,52 @@
;;
esac
-if test "x$with_threads" = "xposix"; then
-# forced posix threads
- if test "x$HAVE_POSIX_THREADS" = "xyes"; then
- USE_THREADS='posix'
- else
- if test "x$HAVE_W32_THREADS" = "xyes"; then
- AC_MSG_ERROR([[Posix threads are not available. Try to configure
--with-threads=auto]])
- else
- AC_MSG_ERROR([[Posix threads are not available]])
- fi
- fi
-elif test "x$with_threads" = "xw32"; then
-# forced w32 threads
- if test "x$HAVE_W32_THREADS" = "xyes"; then
- USE_THREADS='w32'
- else
- if test "x$HAVE_POSIX_THREADS" = "xyes"; then
- AC_MSG_ERROR([[W32 threads are not available. Try to configure
--with-threads=auto]])
- else
- AC_MSG_ERROR([[W32 threads are not available]])
- fi
- fi
-else
-# automatic threads lib selection
- if test "x$HAVE_POSIX_THREADS" = "xyes" && test "x$HAVE_W32_THREADS" =
"xyes"; then
- if test "x$os_is_native_w32" = "xyes"; then
- USE_THREADS='w32'
- else
- USE_THREADS='posix'
- fi
- elif test "x$HAVE_POSIX_THREADS" = "xyes"; then
- USE_THREADS='posix'
- elif test "x$HAVE_W32_THREADS" = "xyes"; then
- USE_THREADS='w32'
- else
- AC_MSG_ERROR([[No threading lib is available. Cosider installing
pthreads]])
- fi
-fi
+AC_ARG_WITH([threads],
+ [AS_HELP_STRING([--with-threads=LIB],[choose threading library (posix, w32,
auto) [auto]])],
+ [], [with_threads='auto'])
+test "x$with_threads" = "xwin32" && with_threads='w32'
+test "x$with_threads" = "xpthreads" && with_threads='posix'
+# Check for posix threads support, regardless of configure parameters as
+# posix threads are used in some tests even on W32.
+AX_PTHREAD([HAVE_POSIX_THREADS='yes'],[HAVE_POSIX_THREADS='no'])
+AM_CONDITIONAL([HAVE_POSIX_THREADS],[test "x$HAVE_POSIX_THREADS" = "xyes"])
+
+HAVE_W32_THREADS='no'
+AS_IF([[test "x$os_is_windows" = "xyes"]],
+ [
+ AC_MSG_CHECKING([[for W32 threads]])
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <windows.h>], [ HANDLE h = CreateThread(NULL,
0, NULL, NULL, 0, NULL);])]
+ , [[HAVE_W32_THREADS='yes']], [[HAVE_W32_THREADS='no']]
+ )
+ AC_MSG_RESULT([[$HAVE_W32_THREADS]])
+ ])
+
+AC_MSG_CHECKING([[for threading lib to use with libmicrohttpd]])
+AS_IF([[test "x$with_threads" = "xposix"]],
+ [ # forced posix threads
+ AS_IF([[test "x$HAVE_POSIX_THREADS" = "xyes"]], [[ USE_THREADS='posix' ]],
+ [ AS_IF([[test "x$os_is_windows" = "xyes"]] ,
+ [ AC_MSG_ERROR([[Posix threads are not available. Try to configure
--with-threads=auto]])],
+ [ AC_MSG_ERROR([[No threading lib is available. Consider installing
pthreads]])] )
+ ])
+ ] ,
+ [[ test "x$with_threads" = "xw32" ]] ,
+ [ # forced w32 threads
+ AS_IF([[test "x$HAVE_W32_THREADS" = "xyes"]],
+ [[ USE_THREADS='w32' ]],
+ [ AC_MSG_ERROR([[W32 threads are not available. Try to configure
--with-threads=auto]])])
+ ] ,
+ [ # automatic threads lib selection
+ AS_IF([[test "x$os_is_native_w32" = "xyes" && test "x$HAVE_W32_THREADS"
= "xyes"]] ,
+ [[ USE_THREADS='w32' ]] ,
+ [[ test "x$HAVE_POSIX_THREADS" = "xyes" ]], [[ USE_THREADS='posix' ]],
+ [[ test "x$HAVE_W32_THREADS" = "xyes" ]], [[ USE_THREADS='w32' ]],
+ [ AC_MSG_ERROR([[No threading lib is available. Consider installing
pthreads]]) ]
+ )
+ ]
+ )
if test "x$USE_THREADS" = "xposix"; then
CC="$PTHREAD_CC"
AC_DEFINE([MHD_USE_POSIX_THREADS],[1],[define to use pthreads])
@@ -255,6 +236,7 @@
fi
AM_CONDITIONAL([USE_POSIX_THREADS], [test "x$USE_THREADS" = "xposix"])
AM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"])
+AC_MSG_RESULT([[$USE_THREADS]])
AM_CONDITIONAL(HAVE_W32, [test "x$os_is_native_w32" = "xyes"])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r36805 - libmicrohttpd,
gnunet <=