Skip to content

Fail in ./configure when no opcache shm backends exist #5615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions ext/opcache/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ int main() {
}
]])],[dnl
AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
msg=yes],[msg=no],[msg=no])
AC_MSG_RESULT([$msg])
have_shm_ipc=yes],[have_shm_ipc=no],[have_shm_ipc=no])
AC_MSG_RESULT([$have_shm_ipc])

AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
AC_RUN_IFELSE([AC_LANG_SOURCE([[
Expand Down Expand Up @@ -219,8 +219,8 @@ int main() {
}
]])],[dnl
AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
msg=yes],[msg=no],[msg=no])
AC_MSG_RESULT([$msg])
have_shm_mmap_anon=yes],[have_shm_mmap_anon=no],[have_shm_mmap_anon=no])
AC_MSG_RESULT([$have_shm_mmap_anon=yes])

PHP_CHECK_FUNC_LIB(shm_open, rt)
AC_MSG_CHECKING(for mmap() using shm_open() shared memory support)
Expand Down Expand Up @@ -290,6 +290,7 @@ int main() {
]])],[dnl
AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support])
AC_MSG_RESULT([yes])
have_shm_mmap_posix=yes
PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)])
],[
AC_MSG_RESULT([no])
Expand Down Expand Up @@ -338,6 +339,10 @@ int main() {
PHP_ADD_BUILD_DIR([$ext_builddir/Optimizer], 1)
PHP_ADD_EXTENSION_DEP(opcache, pcre)

if test "$have_shm_ipc" != "yes" && test "$have_shm_mmap_posix" != "yes" && test "$have_shm_mmap_anon" != "yes"; then
AC_MSG_ERROR([No supported shared memory caching support was found when configuring opcache. Check config.log for any errors or missing dependencies.])
fi

if test "$PHP_OPCACHE_JIT" = "yes"; then
PHP_ADD_BUILD_DIR([$ext_builddir/jit], 1)
PHP_ADD_MAKEFILE_FRAGMENT($ext_srcdir/jit/Makefile.frag)
Expand Down