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