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.

51 lines
1.7 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. diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
  17. index 6c40cafc1..63fa5bb55 100644
  18. --- a/ext/opcache/config.m4
  19. +++ b/ext/opcache/config.m4
  20. @@ -89,7 +89,10 @@ int main() {
  21. }
  22. ]])],[dnl
  23. AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
  24. - msg=yes],[msg=no],[msg=no])
  25. + msg=yes],[msg=no],[dnl
  26. + AC_CHECK_FUNC(shmget,[dnl
  27. + AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
  28. + msg=yes],[msg=no])])
  29. AC_MSG_RESULT([$msg])
  30. AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
  31. @@ -141,7 +144,10 @@ int main() {
  32. }
  33. ]])],[dnl
  34. AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
  35. - msg=yes],[msg=no],[msg=no])
  36. + msg=yes],[msg=no],[dnl
  37. + AC_CHECK_FUNC(mmap,[dnl
  38. + AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
  39. + msg=yes],[msg=no])])
  40. AC_MSG_RESULT([$msg])
  41. PHP_CHECK_FUNC_LIB(shm_open, rt)
  42. --
  43. 2.17.1