Skip to content

Commit b6c5551

Browse files
[3.14] GH-132983: Restore libzstd fallback detection (GH-133565) (#133757)
GH-132983: Restore libzstd fallback detection (GH-133565) (cherry picked from commit 2c7cac4) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 2df021d commit b6c5551

File tree

3 files changed

+323
-1
lines changed

3 files changed

+323
-1
lines changed

configure

Lines changed: 290 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: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5387,7 +5387,33 @@ PKG_CHECK_MODULES([LIBLZMA], [liblzma], [have_liblzma=yes], [
53875387
])
53885388

53895389
dnl zstd 1.4.5 stabilised ZDICT_finalizeDictionary
5390-
PKG_CHECK_MODULES([LIBZSTD], [libzstd >= 1.4.5], [have_libzstd=yes], [have_libzstd=no])
5390+
PKG_CHECK_MODULES([LIBZSTD], [libzstd >= 1.4.5], [have_libzstd=yes], [
5391+
WITH_SAVE_ENV([
5392+
CPPFLAGS="$CPPFLAGS $LIBZSTD_CFLAGS"
5393+
CFLAGS="$CFLAGS $LIBZSTD_CFLAGS"
5394+
LIBS="$LIBS $LIBZSTD_LIBS"
5395+
AC_SEARCH_LIBS([ZDICT_finalizeDictionary], [zstd], [
5396+
AC_MSG_CHECKING([ZSTD_VERSION_NUMBER >= 1.4.5])
5397+
AC_COMPILE_IFELSE([
5398+
AC_LANG_PROGRAM([@%:@include "zstd.h"], [
5399+
#if ZSTD_VERSION_NUMBER < 10405
5400+
# error "zstd version is too old"
5401+
#endif
5402+
])
5403+
], [
5404+
AC_MSG_RESULT([yes])
5405+
AC_CHECK_HEADERS([zstd.h zdict.h], [have_libzstd=yes], [have_libzstd=no])
5406+
], [
5407+
AC_MSG_RESULT([no])
5408+
have_libzstd=no
5409+
])
5410+
], [have_libzstd=no])
5411+
AS_VAR_IF([have_libzstd], [yes], [
5412+
LIBZSTD_CFLAGS=${LIBZSTD_CFLAGS-""}
5413+
LIBZSTD_LIBS=${LIBZSTD_LIBS-"-lzstd"}
5414+
])
5415+
])
5416+
])
53915417

53925418
dnl PY_CHECK_NETDB_FUNC(FUNCTION)
53935419
AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [@%:@include <netdb.h>])])

pyconfig.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,12 +1630,18 @@
16301630
/* Define to 1 if you have the 'writev' function. */
16311631
#undef HAVE_WRITEV
16321632

1633+
/* Define to 1 if you have the <zdict.h> header file. */
1634+
#undef HAVE_ZDICT_H
1635+
16331636
/* Define if the zlib library has inflateCopy */
16341637
#undef HAVE_ZLIB_COPY
16351638

16361639
/* Define to 1 if you have the <zlib.h> header file. */
16371640
#undef HAVE_ZLIB_H
16381641

1642+
/* Define to 1 if you have the <zstd.h> header file. */
1643+
#undef HAVE_ZSTD_H
1644+
16391645
/* Define to 1 if you have the '_getpty' function. */
16401646
#undef HAVE__GETPTY
16411647

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy