summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-05-17 03:40:03 +0000
committerNick Mathewson <nickm@torproject.org>2005-05-17 03:40:03 +0000
commite3691c37ca4a62c3a923b992748cc3789dcf5a7a (patch)
tree8df1bd2814d21aae7d7dec6a80ddabe89152d0b3
parent7de0b3dd3b7b790970d726c2883db1889b965f54 (diff)
downloadtor-e3691c37ca4a62c3a923b992748cc3789dcf5a7a.tar.gz
tor-e3691c37ca4a62c3a923b992748cc3789dcf5a7a.zip
Check for the ugly /usr/local/lib-not-in-ld.so.conf case even when we can link against libevent normally.
svn:r4249
-rw-r--r--configure.in24
1 files changed, 20 insertions, 4 deletions
diff --git a/configure.in b/configure.in
index 2fff297398..a813b9a759 100644
--- a/configure.in
+++ b/configure.in
@@ -60,12 +60,28 @@ AC_SEARCH_LIBS(pthread_detach, [pthread])
dnl ------------------------------------------------------
dnl Where do you live, libevent?
-AC_SEARCH_LIBS(event_loop, [event], event_found=yes, event_found=no)
-if test "$event_found" = no; then
- saved_LIBS="$LIBS"
- saved_LDFLAGS="$LDFLAGS"
+AC_CACHE_CHECK([for libevent], ac_cv_libevent_normal, [
+ saved_LIBS="$LIBS"
+ LIBS="$LIBS -levent"
+ AC_TRY_RUN([
+void *event_init(void);
+int main(void)
+{
+ if (!event_init())
+ return -1;
+ return 0;
+}], ac_cv_libevent_normal=yes, ac_cv_libevent_normal=no)
+ LIBS="$saved_LIBS"
+])
+
+
+if test "$ac_cv_libevent_normal" = no; then
+ LIBS="$LIBS -levent"
+else
AC_CACHE_CHECK([for libevent in /usr/local/lib], ac_cv_libevent_local, [
+ saved_LIBS="$LIBS"
+ saved_LDFLAGS="$LDFLAGS"
LIBS="$LIBS -levent"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
AC_TRY_LINK([], [ void *event_init(void); event_init(); ],