From 10538ab07d3ffceaa736c18ffd5302ddbb41ea17 Mon Sep 17 00:00:00 2001 From: Paavo-Einari Kaipila Date: Mon, 8 Jun 2026 12:04:41 +0300 Subject: [PATCH] config.m4: explicit on and off options for APCu --- config.m4 | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/config.m4 b/config.m4 index 304eccd..a962ee2 100644 --- a/config.m4 +++ b/config.m4 @@ -27,6 +27,9 @@ PHP_ARG_ENABLE(zstd, whether to enable zstd support, PHP_ARG_WITH(libzstd, whether to use system zstd library, [ --with-libzstd Use system zstd library], no, no) +PHP_ARG_ENABLE(apcu, whether to enable APCu support, +[ --enable-apcu Enable APCu support], auto, no) + if test "$PHP_ZSTD" != "no"; then LIBZSTD_MIN_VERSION=1.4.0 @@ -105,13 +108,18 @@ if test "$PHP_ZSTD" != "no"; then fi dnl APCu -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]) +if test "$PHP_APCU" != "no"; then + 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 + 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