diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-05-17 10:50:22 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-05-17 10:55:34 +0200 |
commit | 66e63950907b6ce1683243a165d89c560a8bef6c (patch) | |
tree | 96916b150261b55b04dbd99eb2a8dbab744b6f8b /m4/zstd.m4 | |
parent | 91d628c5cf067432bc78b728a0bf4f56aee3e407 (diff) |
Add Automake conditional for zstd stream compression support
In addition to the preprocessor define, use an Automake conditional
for optional compilation of the zstd stream tests.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'm4/zstd.m4')
-rw-r--r-- | m4/zstd.m4 | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,11 +1,17 @@ AC_DEFUN([AC_TEST_ZSTD_STREAM], [ AC_MSG_CHECKING([whether zstd supports stream compression]) AC_LANG_PUSH([C]) + ac_zstd_have_stream="no" ac_zstd_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $ZSTD_CFLAGS" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <zstd.h>], [ZSTD_EndDirective op = ZSTD_e_end; ZSTD_compressStream2(NULL, NULL, NULL, op);])], - AC_DEFINE(HAVE_ZSTD_STREAM, 1, [Does zstd support stream compression?]) + ac_zstd_have_stream="yes" AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])) + + AS_IF([test "x$ac_zstd_have_stream" = "xyes"], + [AC_DEFINE(HAVE_ZSTD_STREAM, 1, [Does zstd support stream compression?])]) + + AM_CONDITIONAL([HAVE_ZSTD_STREAM], [test "x$ac_zstd_have_stream" = "xyes"]) CFLAGS=$ac_zstd_save_CFLAGS AC_LANG_POP([C]) ]) |