summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-02-14 15:41:04 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-02-14 15:41:04 +0100
commit442fa64e416a798b94b33dfa95e0031648864e1a (patch)
treed39bedd0e423d7ecafcc35c3d05079a0e3d05585 /configure.ac
parentf01c22704826d1587fb8d91b253752b13c6713ba (diff)
parent5347f0f731359807c6aa186d04cd57ae47c6dd62 (diff)
downloadlibtiff-git-442fa64e416a798b94b33dfa95e0031648864e1a.tar.gz
Merge branch 'zstd'
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac55
1 files changed, 55 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e35be778..5d9e25d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -812,6 +812,60 @@ fi
AM_CONDITIONAL(HAVE_LZMA, test "$HAVE_LZMA" = 'yes')
dnl ---------------------------------------------------------------------------
+dnl Check for libzstd.
+dnl ---------------------------------------------------------------------------
+
+HAVE_ZSTD=no
+
+AC_ARG_ENABLE(zstd,
+ AS_HELP_STRING([--disable-zstd],
+ [disable libzstd usage (required for zstd compression, enabled by default)]),,)
+AC_ARG_WITH(zstd-include-dir,
+ AS_HELP_STRING([--with-zstd-include-dir=DIR],
+ [location of libzstd headers]),,)
+AC_ARG_WITH(zstd-lib-dir,
+ AS_HELP_STRING([--with-zstd-lib-dir=DIR],
+ [location of libzstd library binary]),,)
+
+if test "x$enable_zstd" != "xno" ; then
+
+ if test "x$with_zstd_lib_dir" != "x" ; then
+ LDFLAGS="-L$with_zstd_lib_dir $LDFLAGS"
+ fi
+
+ AC_CHECK_LIB(zstd, ZSTD_decompressStream, [zstd_lib=yes], [zstd_lib=no],)
+ if test "$zstd_lib" = "no" -a "x$with_zstd_lib_dir" != "x"; then
+ AC_MSG_ERROR([zstd library not found at $with_zstd_lib_dir])
+ fi
+
+ if test "x$with_zstd_include_dir" != "x" ; then
+ CPPFLAGS="-I$with_zstd_include_dir $CPPFLAGS"
+ fi
+ AC_CHECK_HEADER(zstd.h, [zstd_h=yes], [zstd_h=no])
+ if test "$zstd_h" = "no" -a "x$with_zstd_include_dir" != "x" ; then
+ AC_MSG_ERROR([Libzstd headers not found at $with_zstd_include_dir])
+ fi
+
+ if test "$zstd_lib" = "yes" -a "$zstd_h" = "yes" ; then
+ HAVE_ZSTD=yes
+ fi
+
+fi
+
+if test "$HAVE_ZSTD" = "yes" ; then
+ AC_DEFINE(ZSTD_SUPPORT,1,[Support zstd compression])
+ LIBS="-lzstd $LIBS"
+ tiff_libs_private="-lzstd ${tiff_libs_private}"
+
+ if test "$HAVE_RPATH" = "yes" -a "x$with_zstd_lib_dir" != "x" ; then
+ LIBDIR="-R $with_zstd_lib_dir $LIBDIR"
+ fi
+
+fi
+
+AM_CONDITIONAL(HAVE_ZSTD, test "$HAVE_ZSTD" = 'yes')
+
+dnl ---------------------------------------------------------------------------
dnl Should 8/12 bit jpeg mode be enabled?
dnl ---------------------------------------------------------------------------
@@ -1088,6 +1142,7 @@ LOC_MSG([ Old JPEG support: ${HAVE_OJPEG}])
LOC_MSG([ JPEG 8/12 bit dual mode: ${HAVE_JPEG12}])
LOC_MSG([ ISO JBIG support: ${HAVE_JBIG}])
LOC_MSG([ LZMA2 support: ${HAVE_LZMA}])
+LOC_MSG([ ZSTD support: ${HAVE_ZSTD}])
LOC_MSG()
LOC_MSG([ C++ support: ${HAVE_CXX}])
LOC_MSG()