mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 13:53:31 +01:00
Add --enable-zstd to our configure script.
This patch adds support for enabling support for Zstandard to our configure script. By default, the --enable-zstd option is set to "auto" which means if libzstd is available we'll build Tor with Zstandard support. See: https://bugs.torproject.org/21662
This commit is contained in:
parent
bf1c07cb07
commit
ce1feae9d9
@ -16,7 +16,7 @@ noinst_PROGRAMS=
|
||||
DISTCLEANFILES=
|
||||
bin_SCRIPTS=
|
||||
AM_CPPFLAGS=
|
||||
AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@ @TOR_LZMA_CFLAGS@
|
||||
AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@ @TOR_LZMA_CFLAGS@ @TOR_ZSTD_CFLAGS@
|
||||
SHELL=@SHELL@
|
||||
|
||||
if COVERAGE_ENABLED
|
||||
|
32
configure.ac
32
configure.ac
@ -764,6 +764,38 @@ fi
|
||||
AC_SUBST(TOR_LZMA_CFLAGS)
|
||||
AC_SUBST(TOR_LZMA_LIBS)
|
||||
|
||||
dnl ------------------------------------------------------
|
||||
dnl Where we do we find zstd?
|
||||
|
||||
AC_ARG_ENABLE(zstd,
|
||||
AS_HELP_STRING(--enable-zstd, [enable support for the Zstandard compression scheme.]),
|
||||
[case "${enableval}" in
|
||||
"yes") zstd=true ;;
|
||||
"no") zstd=false ;;
|
||||
* ) AC_MSG_ERROR(bad value for --enable-zstd) ;;
|
||||
esac], [zstd=auto])
|
||||
|
||||
if test "x$enable_zstd" = "xno"; then
|
||||
have_zstd=no;
|
||||
else
|
||||
PKG_CHECK_MODULES([ZSTD],
|
||||
[libzstd],
|
||||
have_zstd=yes,
|
||||
have_zstd=no)
|
||||
|
||||
if test "x$have_zstd" = "xno" ; then
|
||||
AC_MSG_WARN([Unable to find libzstd.])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$have_zstd" = "xyes"; then
|
||||
AC_DEFINE(HAVE_ZSTD,1,[Have Zstd])
|
||||
TOR_ZSTD_CFLAGS="${ZSTD_CFLAGS}"
|
||||
TOR_ZSTD_LIBS="${ZSTD_LIBS}"
|
||||
fi
|
||||
AC_SUBST(TOR_ZSTD_CFLAGS)
|
||||
AC_SUBST(TOR_ZSTD_LIBS)
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check if libcap is available for capabilities.
|
||||
|
||||
|
@ -121,7 +121,7 @@ src_or_tor_LDADD = src/or/libtor.a src/common/libor.a src/common/libor-ctime.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_LZMA_LIBS@
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
|
||||
if COVERAGE_ENABLED
|
||||
src_or_tor_cov_SOURCES = src/or/tor_main.c
|
||||
@ -134,7 +134,7 @@ src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \
|
||||
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_LZMA_LIBS@
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
endif
|
||||
|
||||
ORHEADERS = \
|
||||
|
@ -19,7 +19,8 @@ FUZZING_LIBS = \
|
||||
@TOR_LIBEVENT_LIBS@ \
|
||||
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
|
||||
@TOR_SYSTEMD_LIBS@ \
|
||||
@TOR_LZMA_LIBS@
|
||||
@TOR_LZMA_LIBS@ \
|
||||
@TOR_ZSTD_LIBS@
|
||||
|
||||
oss-fuzz-prereqs: \
|
||||
src/or/libtor-testing.a \
|
||||
|
@ -180,7 +180,7 @@ src_test_test_switch_id_LDADD = \
|
||||
src/common/libor-testing.a \
|
||||
src/common/libor-ctime-testing.a \
|
||||
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
|
||||
@TOR_LZMA_LIBS@
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
|
||||
src_test_test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
|
||||
@TOR_LDFLAGS_libevent@
|
||||
@ -194,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_LZMA_LIBS@
|
||||
@TOR_SYSTEMD_LIBS@ @TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
|
||||
src_test_test_slow_CPPFLAGS = $(src_test_test_CPPFLAGS)
|
||||
src_test_test_slow_CFLAGS = $(src_test_test_CFLAGS)
|
||||
@ -217,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_LZMA_LIBS@
|
||||
@TOR_SYSTEMD_LIBS@ @TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
|
||||
src_test_test_workqueue_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
|
||||
@TOR_LDFLAGS_libevent@
|
||||
@ -228,7 +228,7 @@ src_test_test_workqueue_LDADD = src/or/libtor-testing.a \
|
||||
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_LZMA_LIBS@
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
|
||||
src_test_test_timers_CPPFLAGS = $(src_test_test_CPPFLAGS)
|
||||
src_test_test_timers_CFLAGS = $(src_test_test_CFLAGS)
|
||||
|
Loading…
Reference in New Issue
Block a user