1
0

1003-Fix-dl-cross-compiling-issue.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --- a/configure.in
  2. +++ b/configure.in
  3. @@ -453,7 +453,10 @@ PHP_CHECK_FUNC(gethostname, nsl)
  4. PHP_CHECK_FUNC(gethostbyaddr, nsl)
  5. PHP_CHECK_FUNC(yp_get_default_domain, nsl)
  6. -PHP_CHECK_FUNC(dlopen, dl)
  7. +PHP_ADD_LIBRARY(dl)
  8. +PHP_DEF_HAVE(dlopen)
  9. +PHP_DEF_HAVE(libdl)
  10. +ac_cv_func_dlopen=yes
  11. if test "$ac_cv_func_dlopen" = "yes"; then
  12. AC_DEFINE(HAVE_LIBDL, 1, [ ])
  13. fi
  14. --- a/ext/fileinfo/config.m4
  15. +++ b/ext/fileinfo/config.m4
  16. @@ -46,6 +46,10 @@ int main(void)
  17. AC_MSG_RESULT(no)
  18. AC_MSG_NOTICE(using libmagic strcasestr implementation)
  19. libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
  20. + ],[
  21. + dnl cross-compiling; assume not present
  22. + AC_MSG_NOTICE(using libmagic strcasestr implementation)
  23. + libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
  24. ])
  25. PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
  26. --- a/ext/opcache/config.m4
  27. +++ b/ext/opcache/config.m4
  28. @@ -227,7 +227,14 @@ AC_TRY_RUN([
  29. flock_type=linux
  30. AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
  31. AC_MSG_RESULT("yes")
  32. -], AC_MSG_RESULT("no") )
  33. +], [
  34. + AC_MSG_RESULT("no")
  35. +], [
  36. + dnl cross-compiling; assume Linux
  37. + flock_type=linux
  38. + AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
  39. + AC_MSG_RESULT("yes")
  40. +])
  41. AC_MSG_CHECKING("whether flock struct is BSD ordered")
  42. AC_TRY_RUN([
  43. @@ -243,7 +250,12 @@ AC_TRY_RUN([
  44. flock_type=bsd
  45. AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
  46. AC_MSG_RESULT("yes")
  47. -], AC_MSG_RESULT("no") )
  48. +], [
  49. + AC_MSG_RESULT("no")
  50. +], [
  51. + dnl cross-compiling; assume Linux
  52. + AC_MSG_RESULT("no")
  53. +])
  54. if test "$flock_type" == "unknown"; then
  55. AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])