summaryrefslogtreecommitdiff
path: root/net-misc/memcached/files/memcached-1.4.4-as-needed.patch
blob: f6e5cde11057f4f58f42e52476300bd2442d49f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff -Nuar memcached-1.4.4.orig/configure.ac memcached-1.4.4/configure.ac
--- memcached-1.4.4.orig/configure.ac	2009-11-24 16:40:29.000000000 -0800
+++ memcached-1.4.4/configure.ac	2009-11-27 15:20:38.000000000 -0800
@@ -115,6 +115,14 @@
 AC_SUBST(ENABLE_SASL)
 AC_SUBST(PROFILER_LDFLAGS)
 
+dnl Check whether the user's system supports pthread before adding -pthread to CFLAGS
+dnl otherwise we won't get -l{threads} in LIBS
+dnl AFAIK -pthread should be added to LDFLAGS on BSD systems
+AC_SEARCH_LIBS(pthread_create, [pthread pthreads thread threads] )
+if test "x$ac_cv_search_pthread_create" == "xno"; then
+  AC_MSG_ERROR([Can't enable threads without the POSIX thread library.])
+fi
+
 AC_ARG_ENABLE(coverage,
   [AS_HELP_STRING([--disable-coverage],[Disable code coverage])])
 
@@ -376,12 +384,6 @@
 
 AC_C_HTONLL
 
-dnl Check whether the user's system supports pthread
-AC_SEARCH_LIBS(pthread_create, pthread)
-if test "x$ac_cv_search_pthread_create" = "xno"; then
-  AC_MSG_ERROR([Can't enable threads without the POSIX thread library.])
-fi
-
 AC_CHECK_FUNCS(mlockall)
 AC_CHECK_FUNCS(getpagesizes)
 AC_CHECK_FUNCS(memcntl)