From ca8ecf3d0697da36835cb360b8acb59e63796fad Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sun, 28 Dec 2014 00:14:46 +0000 Subject: [PATCH] #5809: Allow building against system dht library (patch by jbeich) --- configure.ac | 14 ++++++++++++++ third-party/Makefile.am | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fee10fbc0..dd70d3ba4 100644 --- a/configure.ac +++ b/configure.ac @@ -197,6 +197,20 @@ dnl dht DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht" DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a" DHT_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/dht/libdht.a" +build_bundled_dht="yes" +AC_ARG_ENABLE([external-dht], + AS_HELP_STRING([--enable-external-dht],[Use system external-dht]), + [want_external_dht=${enableval}], + [want_external_dht=no]) +if test "x$want_external_dht" != "xno" ; then + dnl Would be lovely if it had pkgconfig + DHT_CFLAGS="" + DHT_LIBS="-ldht" + DHT_LIBS_QT="-ldht" + build_bundled_dht="no" +fi + +AM_CONDITIONAL([BUILD_DHT],[test "x$build_bundled_dht" = "xyes"]) AC_SUBST(DHT_CFLAGS) AC_SUBST(DHT_LIBS) AC_SUBST(DHT_LIBS_QT) diff --git a/third-party/Makefile.am b/third-party/Makefile.am index 3c8698053..774948d6b 100644 --- a/third-party/Makefile.am +++ b/third-party/Makefile.am @@ -1,3 +1,6 @@ +if BUILD_DHT + DHT_DIR = dht +endif if BUILD_UTP UTP_DIR = libutp endif @@ -9,7 +12,7 @@ if BUILD_NATPMP endif SUBDIRS = \ - dht \ + $(DHT_DIR) \ $(NATPMP_DIR) \ $(MINIUPNP_DIR) \ $(UTP_DIR) -- 2.40.0