Skip to content

Commit a5ea379

Browse files
committed
Properly check version in configure
1 parent d149b2c commit a5ea379

File tree

3 files changed

+71
-3
lines changed

3 files changed

+71
-3
lines changed

Modules/_zstd/_zstdmodule.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ Python module.
1212
#include "zdict.h"
1313

1414

15-
#define PYTHON_MINIMUM_SUPPORTED_ZSTD_VERSION 10400
15+
// if you update the minimum version, you should update the compile
16+
// check in configure.ac
17+
#define PYTHON_MINIMUM_SUPPORTED_ZSTD_VERSION 10405
1618

1719
#if ZSTD_VERSION_NUMBER < PYTHON_MINIMUM_SUPPORTED_ZSTD_VERSION
18-
#error "_zstd module requires zstd v1.4.0+"
20+
#error "_zstd module requires zstd v1.4.5+"
1921
#endif
2022

2123
/* Forward declaration of module state */

configure

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5420,7 +5420,17 @@ PKG_CHECK_MODULES([LIBZSTD], [libzstd], [have_libzstd=yes], [
54205420
CPPFLAGS="$CPPFLAGS $LIBZSTD_CFLAGS"
54215421
LIBS="$LIBS $LIBZSTD_LIBS"
54225422
AC_CHECK_HEADERS([zstd.h zdict.h], [
5423-
AC_CHECK_LIB([zstd], [ZDICT_finalizeDictionary], [have_libzstd=yes], [have_libzstd=no])
5423+
AC_CHECK_LIB([zstd], [ZDICT_finalizeDictionary], [
5424+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
5425+
#include "zstd.h"
5426+
], [
5427+
// if you update the minimum version, you should update the compile
5428+
// check in Modules/_zstd/_zstdmodule.h
5429+
#if ZSTD_VERSION_NUMBER < 10405
5430+
#error "_zstd module requires zstd v1.4.5+"
5431+
#endif
5432+
])], [have_libzstd=yes], [have_libzstd=no])
5433+
], [have_libzstd=no])
54245434
], [have_libzstd=no])
54255435
AS_VAR_IF([have_libzstd], [yes], [
54265436
LIBZSTD_CFLAGS=${LIBZSTD_CFLAGS-""}

0 commit comments

Comments
 (0)