Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | From 07150f3a27681e034f18ab2ed2b68914c1e10af6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Li xin <lixin.fnst@cn.fujitsu.com> |
| 3 | Date: Sat, 18 Jul 2015 05:03:57 +0900 |
| 4 | Subject: [PATCH] configure.ac: convert AC_TRY_RUN to AC_TRY_LINK statements |
| 5 | |
| 6 | This is not completely safe, but it's the least invasive fix. |
| 7 | |
| 8 | Upstream-Status: pending |
| 9 | |
| 10 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> |
| 11 | Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> |
| 12 | --- |
| 13 | configure.ac | 15 +++++---------- |
| 14 | 1 file changed, 5 insertions(+), 10 deletions(-) |
| 15 | |
| 16 | diff --git a/configure.ac b/configure.ac |
| 17 | index 3b32614..94ec002 100644 |
| 18 | --- a/configure.ac |
| 19 | +++ b/configure.ac |
| 20 | @@ -519,13 +519,10 @@ have_ioloop=no |
| 21 | |
| 22 | if test "$ioloop" = "best" || test "$ioloop" = "epoll"; then |
| 23 | AC_CACHE_CHECK([whether we can use epoll],i_cv_epoll_works,[ |
| 24 | - AC_TRY_RUN([ |
| 25 | + AC_TRY_LINK([ |
| 26 | #include <sys/epoll.h> |
| 27 | - |
| 28 | - int main() |
| 29 | - { |
| 30 | - return epoll_create(5) < 1; |
| 31 | - } |
| 32 | + ], [ |
| 33 | + epoll_create(5) < 1; |
| 34 | ], [ |
| 35 | i_cv_epoll_works=yes |
| 36 | ], [ |
| 37 | @@ -653,7 +650,7 @@ fi |
| 38 | dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it. |
| 39 | dnl * It may also be broken in AIX. |
| 40 | AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ |
| 41 | - AC_TRY_RUN([ |
| 42 | + AC_TRY_LINK([ |
| 43 | #define _XOPEN_SOURCE 600 |
| 44 | #include <stdio.h> |
| 45 | #include <stdlib.h> |
| 46 | @@ -662,7 +659,7 @@ AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ |
| 47 | #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7) |
| 48 | possibly broken posix_fallocate |
| 49 | #endif |
| 50 | - int main() { |
| 51 | + ], [ |
| 52 | int fd = creat("conftest.temp", 0600); |
| 53 | int ret; |
| 54 | if (fd == -1) { |
| 55 | @@ -671,8 +668,6 @@ AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ |
| 56 | } |
| 57 | ret = posix_fallocate(fd, 1024, 1024) < 0 ? 1 : 0; |
| 58 | unlink("conftest.temp"); |
| 59 | - return ret; |
| 60 | - } |
| 61 | ], [ |
| 62 | i_cv_posix_fallocate_works=yes |
| 63 | ], [ |
| 64 | -- |
| 65 | 1.8.4.2 |
| 66 | |