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