blob: 3e901841be9f81f9a68c86dd27486ca3fa4e3c50 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From 3bfcc7fdd22261eaed10949714de0a90d31e10ab Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Thu, 20 Aug 2015 16:29:35 +0800
4Subject: [PATCH] [PATCH] config.m4: change AC_TRY_RUN to AC_TRY_LINK
5
6Upstream-Status: Pending
7
8AC_TRY_RUN is not suitable for cross-compile
9
10Signed-off-by: Roy Li <rongqing.li@windriver.com>
11
12%% original patch: change-AC_TRY_RUN-to-AC_TRY_LINK.patch
13---
14 ext/fileinfo/config.m4 | 31 ++++++-------------------------
15 1 file changed, 6 insertions(+), 25 deletions(-)
16
17diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4
18index 523b4fd..0aaa4c8 100644
19--- a/ext/fileinfo/config.m4
20+++ b/ext/fileinfo/config.m4
21@@ -14,31 +14,12 @@ if test "$PHP_FILEINFO" != "no"; then
22 libmagic/readcdf.c libmagic/softmagic.c libmagic/der.c"
23
24 AC_MSG_CHECKING([for strcasestr])
25- AC_TRY_RUN([
26-#include <string.h>
27-#include <strings.h>
28-#include <stdlib.h>
29-
30-int main(void)
31-{
32- char *s0, *s1, *ret;
33-
34- s0 = (char *) malloc(42);
35- s1 = (char *) malloc(8);
36-
37- memset(s0, 'X', 42);
38- s0[24] = 'Y';
39- s0[26] = 'Z';
40- s0[41] = '\0';
41- memset(s1, 'x', 8);
42- s1[0] = 'y';
43- s1[2] = 'Z';
44- s1[7] = '\0';
45-
46- ret = strcasestr(s0, s1);
47-
48- return !(NULL != ret);
49-}
50+ AC_TRY_COMPILE([
51+ #include <string.h>
52+ #include <strings.h>
53+ #include <stdlib.h>
54+ ],[
55+ strcasestr(NULL, NULL);
56 ],[
57 dnl using the platform implementation
58 AC_MSG_RESULT(yes)
59--
602.7.4
61