aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac32
-rw-r--r--src/or/include.am6
-rw-r--r--src/test/fuzz/include.am3
-rw-r--r--src/test/include.am16
5 files changed, 49 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am
index aeac0b85c4..0f59ebee4c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,7 +16,7 @@ noinst_PROGRAMS=
DISTCLEANFILES=
bin_SCRIPTS=
AM_CPPFLAGS=
-AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@
+AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@ @TOR_LZMA_CFLAGS@
SHELL=@SHELL@
if COVERAGE_ENABLED
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.
diff --git a/src/or/include.am b/src/or/include.am
index 1841bbfe9d..d4dc6a90ce 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -120,7 +120,8 @@ src_or_tor_LDADD = src/or/libtor.a src/common/libor.a src/common/libor-ctime.a \
src/common/libor-crypto.a $(LIBKECCAK_TINY) $(LIBDONNA) \
src/common/libor-event.a src/trunnel/libor-trunnel.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
- @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@
+ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@ \
+ @TOR_LZMA_LIBS@
if COVERAGE_ENABLED
src_or_tor_cov_SOURCES = src/or/tor_main.c
@@ -132,7 +133,8 @@ src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \
src/common/libor-crypto-testing.a $(LIBKECCAK_TINY) $(LIBDONNA) \
src/common/libor-event-testing.a src/trunnel/libor-trunnel-testing.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
- @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@
+ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@ \
+ @TOR_LZMA_LIBS@
endif
ORHEADERS = \
diff --git a/src/test/fuzz/include.am b/src/test/fuzz/include.am
index 1b608c6885..abffcad602 100644
--- a/src/test/fuzz/include.am
+++ b/src/test/fuzz/include.am
@@ -18,7 +18,8 @@ FUZZING_LIBS = \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
@TOR_LIBEVENT_LIBS@ \
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
- @TOR_SYSTEMD_LIBS@
+ @TOR_SYSTEMD_LIBS@ \
+ @TOR_LZMA_LIBS@
oss-fuzz-prereqs: \
src/or/libtor-testing.a \
diff --git a/src/test/include.am b/src/test/include.am
index c92eab13c9..9b5eb146fc 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -179,7 +179,8 @@ src_test_test_switch_id_LDFLAGS = @TOR_LDFLAGS_zlib@
src_test_test_switch_id_LDADD = \
src/common/libor-testing.a \
src/common/libor-ctime-testing.a \
- @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@
+ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
+ @TOR_LZMA_LIBS@
src_test_test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
@TOR_LDFLAGS_libevent@
@@ -193,7 +194,7 @@ src_test_test_LDADD = src/or/libtor-testing.a \
src/trunnel/libor-trunnel-testing.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
- @TOR_SYSTEMD_LIBS@
+ @TOR_SYSTEMD_LIBS@ @TOR_LZMA_LIBS@
src_test_test_slow_CPPFLAGS = $(src_test_test_CPPFLAGS)
src_test_test_slow_CFLAGS = $(src_test_test_CFLAGS)
@@ -216,7 +217,7 @@ src_test_bench_LDADD = src/or/libtor.a src/common/libor.a \
src/common/libor-event.a src/trunnel/libor-trunnel.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
- @TOR_SYSTEMD_LIBS@
+ @TOR_SYSTEMD_LIBS@ @TOR_LZMA_LIBS@
src_test_test_workqueue_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
@TOR_LDFLAGS_libevent@
@@ -226,7 +227,8 @@ src_test_test_workqueue_LDADD = src/or/libtor-testing.a \
src/common/libor-crypto-testing.a $(LIBKECCAK_TINY) $(LIBDONNA) \
src/common/libor-event-testing.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
- @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
+ @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
+ @TOR_LZMA_LIBS@
src_test_test_timers_CPPFLAGS = $(src_test_test_CPPFLAGS)
src_test_test_timers_CFLAGS = $(src_test_test_CFLAGS)
@@ -236,7 +238,8 @@ src_test_test_timers_LDADD = \
src/common/libor-event-testing.a \
src/common/libor-crypto-testing.a $(LIBKECCAK_TINY) $(LIBDONNA) \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
- @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
+ @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
+ @TOR_LZMA_LIBS@
src_test_test_timers_LDFLAGS = $(src_test_test_LDFLAGS)
noinst_HEADERS+= \
@@ -261,7 +264,8 @@ src_test_test_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \
src/common/libor-ctime.a \
src/common/libor-crypto.a $(LIBKECCAK_TINY) $(LIBDONNA) \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
- @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
+ @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
+ @TOR_LZMA_LIBS@
src_test_test_ntor_cl_AM_CPPFLAGS = \
-I"$(top_srcdir)/src/or"