[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Check for the ugly /usr/local/lib-not-in-ld.so.conf case ev...



Update of /home/or/cvsroot/tor
In directory moria.mit.edu:/tmp/cvs-serv5263

Modified Files:
	configure.in 
Log Message:
Check for the ugly /usr/local/lib-not-in-ld.so.conf case even when we can link against libevent normally.

Index: configure.in
===================================================================
RCS file: /home/or/cvsroot/tor/configure.in,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -d -r1.203 -r1.204
--- configure.in	17 May 2005 03:18:19 -0000	1.203
+++ configure.in	17 May 2005 03:40:03 -0000	1.204
@@ -60,12 +60,28 @@
 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(); ],