From: Charles Kerr Date: Wed, 3 Jun 2009 16:31:43 +0000 (+0000) Subject: (trunk) if libevent exists on the system, use it. otherwise, use our own copy. X-Git-Tag: 1.70~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ccee6c2d3c7ccff01c2963532adc5464dbfd76e;p=transmission (trunk) if libevent exists on the system, use it. otherwise, use our own copy. --- diff --git a/configure.ac b/configure.ac index c732de254..ddada3861 100644 --- a/configure.ac +++ b/configure.ac @@ -166,21 +166,19 @@ AC_TRY_LINK([#include ], [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} " diff --git a/third-party/Makefile.am b/third-party/Makefile.am index b87708f57..7a1d395d0 100644 --- a/third-party/Makefile.am +++ b/third-party/Makefile.am @@ -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 \