diff options
author | Alexander Færøy <ahf@torproject.org> | 2017-04-18 17:54:59 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-04-25 08:10:09 -0400 |
commit | ce1feae9d9a4366e3cd93a68416841d0c6a636c5 (patch) | |
tree | 9b6fecb4f93f3d7663a13f585ad428276f23ce4b /configure.ac | |
parent | bf1c07cb07c27ca65ab66cf41442cfaabd9bb067 (diff) | |
download | tor-ce1feae9d9a4366e3cd93a68416841d0c6a636c5.tar.gz tor-ce1feae9d9a4366e3cd93a68416841d0c6a636c5.zip |
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
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 96af8d7f42..c7960fa4ed 100644 --- a/configure.ac +++ b/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. |