]> granicus.if.org Git - transmission/commitdiff
(trunk) if libevent exists on the system, use it. otherwise, use our own copy.
authorCharles Kerr <charles@transmissionbt.com>
Wed, 3 Jun 2009 16:31:43 +0000 (16:31 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Wed, 3 Jun 2009 16:31:43 +0000 (16:31 +0000)
configure.ac
third-party/Makefile.am

index c732de254bbbacf42693eebdcbf12c9f74615f94..ddada38616a7e798ebc7d8c4816a9833f85a00b7 100644 (file)
@@ -166,21 +166,19 @@ AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
 ])
 
 
-dnl let's try using the system's libevent now
-dnl
-dnl ----------------------------------------------------------------------------
-dnl
-dnl  libevent fun
-dnl
-dnl  we have to add the builddir into the include path because event-config.h
-dnl  is generated when libevent is build
-dnl 
-dnl AC_CONFIG_SUBDIRS([third-party/libevent])
-dnl AC_MSG_NOTICE([invoking libevent's configure script])
-dnl LIBEVENT_CPPFLAGS="-I\$(top_srcdir)/third-party/libevent -I\$(top_builddir)/third-party/libevent"
-dnl AC_SUBST(LIBEVENT_CPPFLAGS)
-
-LIBEVENT_LIBS="-levent"
+AC_CHECK_HEADER([event-config.h],
+                [libevent_source=system
+                 LIBEVENT_CPPFLAGS=""
+                 LIBEVENT_LIBS="-levent"],
+                [libevent_source=bundled
+                 AC_CONFIG_SUBDIRS([third-party/libevent])
+                 AC_MSG_NOTICE([libevent not found on system, so we'll build our own from third-party/libevent/.])
+                 AC_MSG_NOTICE([if you are cross-compiling this is probably not what you want.])
+                 LIBEVENT_CPPFLAGS="-I\$(top_srcdir)/third-party/libevent -I\$(top_builddir)/third-party/libevent"
+                 LIBEVENT_LIBS="\$(top_builddir)/third-party/libevent/.libs/libevent.a"
+                 AC_SUBST(LIBEVENT_CPPFLAGS)])
+AM_CONDITIONAL([BUILD_LIBEVENT], [test x$libevent_source = xbundled])
+AC_SUBST(LIBEVENT_CPPFLAGS)
 AC_SUBST(LIBEVENT_LIBS)
 
 
@@ -377,14 +375,16 @@ echo "
 
 Configuration:
 
-        Source code location:       ${srcdir}
-        Compiler:                   ${CXX}
-        Build Command-Line client:  ${build_cli}
-        Build Daemon:               ${build_daemon}
-        Build GTK+ client:          ${build_gtk}
-          ... gio support:          ${use_gio}
-          ... dbus-glib support:    ${use_dbus_glib}
-          ... libnotify support:    ${use_libnotify}
-        Build OS X client:          ${build_mac}
+        Source code location:          ${srcdir}
+        Compiler:                      ${CXX}
+        System or bundled libevent:    ${libevent_source}
+
+        Build OS X client:             ${build_mac}
+        Build GTK+ client:             ${build_gtk}
+          ... with gio support:        ${use_gio}
+          ... with dbus-glib support:  ${use_dbus_glib}
+          ... with libnotify support:  ${use_libnotify}
+        Build Command-Line client:     ${build_cli}
+        Build Daemon:                  ${build_daemon}
 
 "
index b87708f570401b7b9d6ba7aea3713ca0bc4957bb..7a1d395d0e672c8b56658e39b3003062db10f34b 100644 (file)
@@ -1,7 +1,11 @@
-SUBDIRS = \
-    libnatpmp \
-    miniupnp \
-    dht
+
+if BUILD_LIBEVENT
+  LIBEVENT_DIR = libevent
+else
+  LIBEVENT_DIR =
+endif
+
+SUBDIRS = libnatpmp miniupnp dht $(LIBEVENT_DIR)
 
 EXTRA_DIST = \
     libevent \