You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.6 KiB

  1. From dd6ee0fb6715881b204fb4cb124db9134c1a6c7d Mon Sep 17 00:00:00 2001
  2. From: Michael Heimpold <mhei@heimpold.de>
  3. Date: Mon, 2 Dec 2019 22:42:28 +0100
  4. Subject: [PATCH] ext/opcache: fix detection of shm/mmap
  5. The detection of sysvipc and mmap doesn't work well when cross-compiling,
  6. so I decided to only check for the availability of the functions involved.
  7. This is not a clean solution, but works for now(tm) :-)
  8. It should be discussed with upstream to find a better solution.
  9. This solves the issue reported at
  10. https://github.com/openwrt/packages/issues/1010
  11. and makes opcache usable on OpenWrt.
  12. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
  13. ---
  14. ext/opcache/config.m4 | 10 ++++++++--
  15. 1 file changed, 8 insertions(+), 2 deletions(-)
  16. --- a/ext/opcache/config.m4
  17. +++ b/ext/opcache/config.m4
  18. @@ -89,7 +89,10 @@ int main() {
  19. }
  20. ]])],[dnl
  21. AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
  22. - msg=yes],[msg=no],[msg=no])
  23. + msg=yes],[msg=no],[dnl
  24. + AC_CHECK_FUNC(shmget,[dnl
  25. + AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
  26. + msg=yes],[msg=no])])
  27. AC_MSG_RESULT([$msg])
  28. AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
  29. @@ -141,7 +144,10 @@ int main() {
  30. }
  31. ]])],[dnl
  32. AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
  33. - msg=yes],[msg=no],[msg=no])
  34. + msg=yes],[msg=no],[dnl
  35. + AC_CHECK_FUNC(mmap,[dnl
  36. + AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
  37. + msg=yes],[msg=no])])
  38. AC_MSG_RESULT([$msg])
  39. PHP_CHECK_FUNC_LIB(shm_open, rt)