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