--- memcached-1.4.2.orig/configure.ac 2009-10-19 20:42:41.290837462 +0200 +++ memcached-1.4.2/configure.ac 2009-10-19 20:45:21.774604386 +0200 @@ -101,6 +101,14 @@ AC_SUBST(DTRACEFLAGS) 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])]) @@ -306,12 +314,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)