[PATCH 1/1] Fix --disable-threads not to _enable_ them.

Tomash Brechko tomash.brechko at gmail.com
Thu Dec 6 12:43:41 UTC 2007


Also do not link with libpthread when threads are disabled.
---
 trunk/server/configure.ac |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/trunk/server/configure.ac b/trunk/server/configure.ac
index 9bd37d7..474ed25 100644
--- a/trunk/server/configure.ac
+++ b/trunk/server/configure.ac
@@ -95,7 +95,6 @@ dnl ----------------------------------------------------------------------------
 AC_SEARCH_LIBS(socket, socket)
 AC_SEARCH_LIBS(gethostbyname, nsl)
 AC_SEARCH_LIBS(mallinfo, malloc)
-AC_SEARCH_LIBS(pthread_create, pthread)
 
 AC_CHECK_FUNC(daemon,AC_DEFINE([HAVE_DAEMON],,[Define this if you have daemon()]),[AC_LIBOBJ(daemon)])
 
@@ -160,12 +159,15 @@ AC_C_ENDIAN
 
 dnl Check whether the user wants threads or not
 AC_ARG_ENABLE(threads,
-  [AS_HELP_STRING([--enable-threads],[support multithreaded execution])],
-  [if test "$ac_cv_search_pthread_create" != "no"; then
+  [AS_HELP_STRING([--enable-threads],[support multithreaded execution])])
+if test "x$enable_threads" == "xyes"; then
+  AC_SEARCH_LIBS(pthread_create, pthread)
+  if test "x$ac_cv_search_pthread_create" != "xno"; then
     AC_DEFINE([USE_THREADS],,[Define this if you want to use pthreads])
-   else
+  else
     AC_MSG_ERROR([Can't enable threads without the POSIX thread library.])
-   fi])
+  fi
+fi
 
 AC_CHECK_FUNCS(mlockall)
 
-- 
1.5.3.6.961.gecf4


More information about the memcached mailing list