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 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame^] | 8 | Upstream-Status: Pending |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 9 | |
| 10 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> |
| 11 | Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 12 | |
Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 13 | Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com> |
| 14 | --- |
| 15 | m4/glibc.m4 | 6 ++---- |
| 16 | m4/ioloop.m4 | 9 +++------ |
| 17 | 2 files changed, 5 insertions(+), 10 deletions(-) |
| 18 | |
| 19 | diff --git a/m4/glibc.m4 b/m4/glibc.m4 |
| 20 | index 5d722aa..ce088d3 100644 |
| 21 | --- a/m4/glibc.m4 |
| 22 | +++ b/m4/glibc.m4 |
| 23 | @@ -17,7 +17,7 @@ AC_DEFUN([DOVECOT_GLIBC], [ |
| 24 | dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it. |
| 25 | dnl * It may also be broken in AIX. |
| 26 | AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 27 | - AC_TRY_RUN([ |
| 28 | + AC_TRY_LINK([ |
Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 29 | #define _XOPEN_SOURCE 600 |
| 30 | #include <stdio.h> |
| 31 | #include <stdlib.h> |
| 32 | @@ -26,7 +26,7 @@ AC_DEFUN([DOVECOT_GLIBC], [ |
| 33 | #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7) |
| 34 | possibly broken posix_fallocate |
| 35 | #endif |
| 36 | - int main() { |
| 37 | + ], [ |
| 38 | int fd = creat("conftest.temp", 0600); |
| 39 | int ret; |
| 40 | if (fd == -1) { |
| 41 | @@ -35,8 +35,6 @@ AC_DEFUN([DOVECOT_GLIBC], [ |
| 42 | } |
| 43 | ret = posix_fallocate(fd, 1024, 1024) < 0 ? 1 : 0; |
| 44 | unlink("conftest.temp"); |
| 45 | - return ret; |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 46 | - } |
Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 47 | ], [ |
| 48 | i_cv_posix_fallocate_works=yes |
| 49 | ], [ |
| 50 | diff --git a/m4/ioloop.m4 b/m4/ioloop.m4 |
| 51 | index 0f7dde0..f40fd62 100644 |
| 52 | --- a/m4/ioloop.m4 |
| 53 | +++ b/m4/ioloop.m4 |
| 54 | @@ -4,13 +4,10 @@ AC_DEFUN([DOVECOT_IOLOOP], [ |
| 55 | |
| 56 | if test "$ioloop" = "best" || test "$ioloop" = "epoll"; then |
| 57 | AC_CACHE_CHECK([whether we can use epoll],i_cv_epoll_works,[ |
| 58 | - AC_TRY_RUN([ |
| 59 | + AC_TRY_LINK([ |
| 60 | #include <sys/epoll.h> |
| 61 | - |
| 62 | - int main() |
| 63 | - { |
| 64 | - return epoll_create(5) < 1; |
| 65 | - } |
| 66 | + ], [ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 67 | + epoll_create(5) < 1; |
Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 68 | ], [ |
| 69 | i_cv_epoll_works=yes |
| 70 | ], [ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 71 | -- |
Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 72 | 2.25.1 |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 73 | |