From 531a5b33ed57c226d8a4a24a6bbe1ca74814a1b3 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 26 Jun 2026 13:23:16 +0700 Subject: [PATCH 1/3] Enhance APCu include detection for in-tree builds see https://github.com/kjdev/php-ext-zstd/pull/100 --- config.m4 | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/config.m4 b/config.m4 index d46e9a4..683e5da 100644 --- a/config.m4 +++ b/config.m4 @@ -65,14 +65,22 @@ if test "$PHP_LZ4" != "no"; then PHP_ADD_INCLUDE([$ext_srcdir/lz4/lib]) fi - AC_MSG_CHECKING([for APCu includes]) - if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then - apc_inc_path="$phpincludedir" - AC_MSG_RESULT([APCu in $apc_inc_path]) - AC_DEFINE(HAVE_APCU_SUPPORT,1,[Whether to enable APCu support]) - else - AC_MSG_RESULT([not found]) - fi + dnl APCu + if test "$PHP_APCU" != "no"; then + AC_MSG_CHECKING([for APCu includes]) + if test ! -f "$phpincludedir/ext/apcu/apc_serializer.h" && test -f "$abs_srcdir/ext/apcu/apc_serializer.h"; then + phpincludedir="$abs_srcdir" + fi + if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then + apc_inc_path="$phpincludedir" + AC_MSG_RESULT([APCu in $apc_inc_path]) + AC_DEFINE(HAVE_APCU_SUPPORT, 1, [Whether to enable APCu support]) + else + if test "$PHP_APCU" != "auto"; then + AC_MSG_ERROR([apc_serializer.h header not found]) + fi + AC_MSG_RESULT([not found]) + fi fi dnl coverage From 5d3c4de14eeb91f32e3d81114eb591391c3fd197 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 26 Jun 2026 13:33:11 +0700 Subject: [PATCH 2/3] Fix conditional block in config.m4 --- config.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/config.m4 b/config.m4 index 683e5da..cc59730 100644 --- a/config.m4 +++ b/config.m4 @@ -81,6 +81,7 @@ if test "$PHP_LZ4" != "no"; then fi AC_MSG_RESULT([not found]) fi + fi fi dnl coverage From afdd345a78ee3c7b7ce6d1bbdf9e2ec69e952970 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 26 Jun 2026 13:34:52 +0700 Subject: [PATCH 3/3] Add option to enable APCu support --- config.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.m4 b/config.m4 index cc59730..1315cb5 100644 --- a/config.m4 +++ b/config.m4 @@ -27,6 +27,9 @@ PHP_ARG_ENABLE(lz4, whether to enable lz4 support, PHP_ARG_WITH(lz4-includedir, for lz4 header, [ --with-lz4-includedir=DIR lz4 header files], no, no) +PHP_ARG_ENABLE(apcu, whether to enable APCu support, +[ --enable-apcu Enable APCu support], auto, no) + if test "$PHP_LZ4" != "no"; then AC_MSG_CHECKING([searching for liblz4])