aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-04-18 13:56:02 +0200
committerNick Mathewson <nickm@torproject.org>2017-04-25 08:06:02 -0400
commit157af1d26e3cdfc3159c1085f35e5ddcda7ccd21 (patch)
treece2a95e5012ed28837018c05ea26fff73a4b3868 /configure.ac
parentc171af048731cc00d77e17a1ff0be5c641024f8a (diff)
downloadtor-157af1d26e3cdfc3159c1085f35e5ddcda7ccd21.tar.gz
tor-157af1d26e3cdfc3159c1085f35e5ddcda7ccd21.zip
Add --enable-lzma to our configure script.
This patch adds support for enabling support for LZMA to our configure script. By default, the --enable-lzma option is set to "auto" which means if liblzma is available we'll build Tor with LZMA support. See: https://bugs.torproject.org/21662
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 32 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0d4fa9838b..96af8d7f42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -732,6 +732,38 @@ else
fi
AC_SUBST(TOR_ZLIB_LIBS)
+dnl ------------------------------------------------------
+dnl Where we do we find lzma?
+
+AC_ARG_ENABLE(lzma,
+ AS_HELP_STRING(--enable-lzma, [enable support for the Zstandard compression scheme.]),
+ [case "${enableval}" in
+ "yes") lzma=true ;;
+ "no") lzma=false ;;
+ * ) AC_MSG_ERROR(bad value for --enable-lzma) ;;
+ esac], [lzma=auto])
+
+if test "x$enable_lzma" = "xno"; then
+ have_lzma=no;
+else
+ PKG_CHECK_MODULES([LZMA],
+ [liblzma],
+ have_lzma=yes,
+ have_lzma=no)
+
+ if test "x$have_lzma" = "xno" ; then
+ AC_MSG_WARN([Unable to find liblzma.])
+ fi
+fi
+
+if test "x$have_lzma" = "xyes"; then
+ AC_DEFINE(HAVE_LZMA,1,[Have LZMA])
+ TOR_LZMA_CFLAGS="${LZMA_CFLAGS}"
+ TOR_LZMA_LIBS="${LZMA_LIBS}"
+fi
+AC_SUBST(TOR_LZMA_CFLAGS)
+AC_SUBST(TOR_LZMA_LIBS)
+
dnl ----------------------------------------------------------------------
dnl Check if libcap is available for capabilities.