Skip to content

Commit f3dd7f7

Browse files
committed
Support finding libzstd not in pkg-config
GH-133479 removed the logic to check for libzstd outside of pkg-config. This commit adds that logic back with a check for the version so that users can provide their own libzstd. This is to bring parity with lzma, bz2, and zlib detection.
1 parent 3dfed23 commit f3dd7f7

File tree

3 files changed

+291
-3
lines changed

3 files changed

+291
-3
lines changed

configure

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

configure.ac

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5387,7 +5387,27 @@ 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_CHECK_HEADERS([zstd.h zdict.h], [
5396+
PY_CHECK_LIB([zstd], [ZDICT_finalizeDictionary], [
5397+
AC_RUN_IFELSE([AC_LANG_PROGRAM([@%:@include "zstd.h"], [
5398+
#if ZSTD_VERSION_NUMBER < 10405
5399+
exit(1);
5400+
#endif
5401+
])
5402+
], [have_libzstd=yes], [have_libzstd=no])
5403+
], [have_libzstd=no])
5404+
], [have_libzstd=no])
5405+
AS_VAR_IF([have_libzstd], [yes], [
5406+
LIBZSTD_CFLAGS=${LIBZSTD_CFLAGS-""}
5407+
LIBZSTD_LIBS=${LIBZSTD_LIBS-"-lzstd"}
5408+
])
5409+
])
5410+
])
53915411

53925412
dnl PY_CHECK_NETDB_FUNC(FUNCTION)
53935413
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