diff options
Diffstat (limited to 'pr1.patch')
-rw-r--r-- | pr1.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/pr1.patch b/pr1.patch new file mode 100644 index 0000000..b574d78 --- /dev/null +++ b/pr1.patch @@ -0,0 +1,75 @@ +From be78be9c43fc87bc2bc936f60b3091e72cf5492a Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 9 Jul 2021 15:28:51 +0200 +Subject: [PATCH 1/2] fix lib test + +--- + config.m4 | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/config.m4 b/config.m4 +index 02dd4b7..ec0c30f 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -12,12 +12,9 @@ if test "$PHP_XZ" != "no"; then + + PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, + [ +- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $XZ_DIR/lib, XZ_SHARED_LIBADD) +- AC_DEFINE(HAVE_XZLIB,1,[ ]) ++ PHP_ADD_LIBRARY($LIBNAME, 1, XZ_SHARED_LIBADD) + ],[ + AC_MSG_ERROR([wrong xz lib version or lib not found]) +- ],[ +- -L$XZ_DIR/lib -lm + ]) + PHP_SUBST(XZ_SHARED_LIBADD) + + +From 3ef5b4ade5bb94358fba1bcba9bc8538749d3479 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 9 Jul 2021 15:50:54 +0200 +Subject: [PATCH 2/2] rely on pkg-config + +--- + config.m4 | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +diff --git a/config.m4 b/config.m4 +index ec0c30f..e6c03ef 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -10,12 +10,27 @@ if test "$PHP_XZ" != "no"; then + LIBNAME=lzma # you may want to change this + LIBSYMBOL=lzma_stream_encoder # you most likely want to change this + +- PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, +- [ +- PHP_ADD_LIBRARY($LIBNAME, 1, XZ_SHARED_LIBADD) +- ],[ +- AC_MSG_ERROR([wrong xz lib version or lib not found]) +- ]) ++ AC_PATH_PROG(PKG_CONFIG, pkg-config, no) ++ ++ AC_MSG_CHECKING(for liblzma) ++ if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists liblzma; then ++ LIBLZMA_INCLINE=`$PKG_CONFIG liblzma --cflags` ++ LIBLZMA_LIBLINE=`$PKG_CONFIG liblzma --libs` ++ LIBLZMA_VERSION=`$PKG_CONFIG liblzma --modversion` ++ AC_MSG_RESULT(from pkg-config: version $LIBLZMA_VERSION) ++ PHP_EVAL_LIBLINE($LIBLZMA_LIBLINE, XZ_SHARED_LIBADD) ++ PHP_EVAL_INCLINE($LIBLZMA_INCLINE) ++ else ++ AC_MSG_WARN([not found using pkg-config, fallback to system directory]) ++ ++ PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, ++ [ ++ PHP_ADD_LIBRARY($LIBNAME, 1, XZ_SHARED_LIBADD) ++ ],[ ++ AC_MSG_ERROR([wrong xz lib version or lib not found]) ++ ]) ++ fi ++ + PHP_SUBST(XZ_SHARED_LIBADD) + + PHP_NEW_EXTENSION(xz, xz.c xz_fopen_wrapper.c utils.c, $ext_shared, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) |