FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-132983: Use a standard autoconf version check for zstd by AA-Turner · Pull Request #133479 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ac  (1) No extension  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
161 changes: 22 additions & 139 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 5 additions & 23 deletions configure.ac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -5386,32 +5386,14 @@ PKG_CHECK_MODULES([LIBLZMA], [liblzma], [have_liblzma=yes], [
])
])

have_libzstd=no
AC_DEFUN([TEST_ZSTD_VERSION],[
AC_MSG_CHECKING([if libzstd is new enough])

dnl TODO(emmatyping): check if we can set a C define for the minimum version
dnl to re-use here and in the header compile check

dnl This is checked when both a package is found and we do fallback searches
dnl If you update the minimum version here, you should update the compile
dnl check in Modules/_zstd/_zstdmodule.h
AC_RUN_IFELSE([AC_LANG_PROGRAM([@%:@include "zstd.h"], [
#if ZSTD_VERSION_NUMBER < 10405
exit(1);
#endif
])], [py__zstd_too_old=no], [py__zstd_too_old=yes])
dnl Important to record that we have libzstd
have_libzstd=yes
])

PKG_CHECK_MODULES([LIBZSTD], [libzstd], [TEST_ZSTD_VERSION()], [
dnl zstd 1.4.5 added ZDICT_finalizeDictionary
PKG_CHECK_MODULES([LIBZSTD], [libzstd >= 1.4.5], [have_libzstd=yes], [
WITH_SAVE_ENV([
CPPFLAGS="$CPPFLAGS $LIBZSTD_CFLAGS"
LIBS="$LIBS $LIBZSTD_LIBS"
AC_CHECK_HEADERS([zstd.h zdict.h], [
AC_CHECK_LIB([zstd], [ZDICT_finalizeDictionary],
[TEST_ZSTD_VERSION()], [have_libzstd=no])
PY_CHECK_LIB([zstd], [ZDICT_finalizeDictionary],
[have_libzstd=yes], [have_libzstd=no])
], [have_libzstd=no])
AS_VAR_IF([have_libzstd], [yes], [
LIBZSTD_CFLAGS=${LIBZSTD_CFLAGS-""}
Expand Down Expand Up @@ -8072,7 +8054,7 @@ PY_STDLIB_MOD([_bz2], [], [test "$have_bzip2" = yes],
[$BZIP2_CFLAGS], [$BZIP2_LIBS])
PY_STDLIB_MOD([_lzma], [], [test "$have_liblzma" = yes],
[$LIBLZMA_CFLAGS], [$LIBLZMA_LIBS])
PY_STDLIB_MOD([_zstd], [test "$py__zstd_too_old" = no], [test "$have_libzstd" = yes],
PY_STDLIB_MOD([_zstd], [], [test "$have_libzstd" = yes],
[$LIBZSTD_CFLAGS], [$LIBZSTD_LIBS])

dnl OpenSSL bindings
Expand Down

Back | FazBrowse Home | New Git URL