diff --git a/config.m4 b/config.m4 index a962ee2..87a5a13 100644 --- a/config.m4 +++ b/config.m4 @@ -105,20 +105,23 @@ if test "$PHP_ZSTD" != "no"; then ], [ PHP_ADD_MAKEFILE_FRAGMENT ]) -fi -dnl APCu -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]) + 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 - AC_MSG_RESULT([not found]) fi fi