summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTrond Norbye <trond.norbye@gmail.com>2011-08-08 16:39:24 +0200
committerTrond Norbye <trond.norbye@gmail.com>2011-08-08 16:39:24 +0200
commit56d95469a4385bc0aa1d1f67085ed91e67f28e23 (patch)
tree52141ac1d5cc93fb83993683b9e91e937cfe75fa /configure.ac
parentf5111cc6d3f1c60ca72d5d43ed48581c77226597 (diff)
downloadmemcached-56d95469a4385bc0aa1d1f67085ed91e67f28e23.tar.gz
Issue 214: Search for network libraries before searching for libevent
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 6 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 4c89cfa..066d06c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,6 +190,10 @@ fi
# Issue 213: Search for clock_gettime to help people linking
# with a static version of libevent
AC_SEARCH_LIBS(clock_gettime, rt)
+# Issue 214: Search for the network libraries _before_ searching
+# for libevent (to help people linking with static libevent)
+AC_SEARCH_LIBS(socket, socket)
+AC_SEARCH_LIBS(gethostbyname, nsl)
trylibeventdir=""
AC_ARG_WITH(libevent,
@@ -213,7 +217,7 @@ AC_CACHE_CHECK([for libevent directory], ac_cv_libevent_dir, [
le_found=no
for ledir in $trylibeventdir "" $prefix /usr/local ; do
LDFLAGS="$saved_LDFLAGS"
- LIBS="$saved_LIBS -levent"
+ LIBS="-levent $saved_LIBS"
# Skip the directory if it isn't there.
if test ! -z "$ledir" -a ! -d "$ledir" ; then
@@ -261,7 +265,7 @@ AC_CACHE_CHECK([for libevent directory], ac_cv_libevent_dir, [
])
fi
])
-LIBS="$LIBS -levent"
+LIBS="-levent $LIBS"
if test $ac_cv_libevent_dir != "(system)"; then
if test -d "$ac_cv_libevent_dir/lib" ; then
LDFLAGS="-L$ac_cv_libevent_dir/lib $LDFLAGS"
@@ -279,8 +283,6 @@ fi
dnl ----------------------------------------------------------------------------
-AC_SEARCH_LIBS(socket, socket)
-AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(umem_cache_create, umem)
AC_SEARCH_LIBS(gethugepagesizes, hugetlbfs)