gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 17/205: configure: fix for --enable-pthreads


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 17/205: configure: fix for --enable-pthreads
Date: Thu, 20 Apr 2017 16:19:17 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.54.0
in repository gnurl.

commit 5f139d6b6f1de89ed8449a327ed743f5461ac2ec
Author: Jay Satiro <address@hidden>
AuthorDate: Wed Mar 1 03:11:36 2017 -0500

    configure: fix for --enable-pthreads
    
    Better handle options conflicts that can occur if --enable-pthreads.
    
    Bug: https://github.com/curl/curl/pull/1295
    Reported-by: Marc-Antoine Perennou
---
 configure.ac        | 45 ++++++++++++++++++++++++++++++++-------------
 m4/curl-confopts.m4 |  4 ----
 2 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1e76c4918..5c77b0f4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3427,8 +3427,28 @@ AC_HELP_STRING([--disable-pthreads],[Disable POSIX 
threads]),
        want_pthreads=auto
        ]
 )
-if test "$want_thres" = "yes" && test "$dontwant_rt" = "no" && \
-   test "$want_pthreads" != "no"; then
+
+dnl turn off pthreads if rt is disabled
+if test "$want_pthreads" != "no"; then
+  if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
+    AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually 
exclusive])
+  fi
+  if test "$dontwant_rt" != "no"; then
+    dnl if --enable-pthreads was explicit then warn it's being ignored
+    if test "$want_pthreads" = "yes"; then
+      AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
+    fi
+    want_pthreads=no
+  fi
+fi
+
+dnl turn off pthreads if no threaded resolver
+if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
+  want_pthreads=no
+fi
+
+dnl detect pthreads
+if test "$want_pthreads" != "no"; then
   AC_CHECK_HEADER(pthread.h,
     [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
       save_CFLAGS="$CFLAGS"
@@ -3452,23 +3472,22 @@ if test "$want_thres" = "yes" && test "$dontwant_rt" = 
"no" && \
       fi
   ])
 fi
-if test "x$USE_THREADS_POSIX" != "x1"; then
+
+dnl threaded resolver check
+if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
   if test "$want_pthreads" = "yes"; then
     AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
   fi
-  if test "$want_thres" = "yes"; then
-    dnl If native Windows fallback on Win32 threads since no POSIX threads
-    if test "$curl_cv_native_windows" = "yes"; then
-      USE_THREADS_WIN32=1
-      AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
-      curl_res_msg="Win32 threaded"
-    else
-      AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
-    fi
+  dnl If native Windows fallback on Win32 threads since no POSIX threads
+  if test "$curl_cv_native_windows" = "yes"; then
+    USE_THREADS_WIN32=1
+    AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
+    curl_res_msg="Win32 threaded"
+  else
+    AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
   fi
 fi
 
-
 dnl ************************************************************
 dnl disable verbose text strings
 dnl
diff --git a/m4/curl-confopts.m4 b/m4/curl-confopts.m4
index 69b9a1431..b86e0fc4f 100644
--- a/m4/curl-confopts.m4
+++ b/m4/curl-confopts.m4
@@ -346,10 +346,6 @@ AC_DEFUN([CURL_CHECK_OPTION_RT], [
       AC_MSG_RESULT([no])
       ;;
   esac
-  dnl TODO: may require mutual exclusion
-  if test "$dontwant_rt" = "yes" && test "$want_thres" = "yes" ; then
-    AC_MSG_ERROR([options --disable-rt and --enable-thread-resolver are 
mutually exclusive, at most one can be selected.])
-  fi
 ])
  
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]