blob: 4fcfa48b993d4987aaaa73ab0f570e335c4cb63c [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From 07150f3a27681e034f18ab2ed2b68914c1e10af6 Mon Sep 17 00:00:00 2001
2From: Li xin <lixin.fnst@cn.fujitsu.com>
3Date: Sat, 18 Jul 2015 05:03:57 +0900
4Subject: [PATCH] configure.ac: convert AC_TRY_RUN to AC_TRY_LINK statements
5
6This is not completely safe, but it's the least invasive fix.
7
Andrew Geissler6aa7eec2023-03-03 12:41:14 -06008Upstream-Status: Pending
Patrick Williamsb48b7b42016-08-17 15:04:38 -05009
10Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
11Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
Patrick Williamsb48b7b42016-08-17 15:04:38 -050012
Andrew Geisslereef63862021-01-29 15:58:13 -060013Signed-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
19diff --git a/m4/glibc.m4 b/m4/glibc.m4
20index 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 Williamsb48b7b42016-08-17 15:04:38 -050027- AC_TRY_RUN([
28+ AC_TRY_LINK([
Andrew Geisslereef63862021-01-29 15:58:13 -060029 #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 Williamsb48b7b42016-08-17 15:04:38 -050046- }
Andrew Geisslereef63862021-01-29 15:58:13 -060047 ], [
48 i_cv_posix_fallocate_works=yes
49 ], [
50diff --git a/m4/ioloop.m4 b/m4/ioloop.m4
51index 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 Williamsb48b7b42016-08-17 15:04:38 -050067+ epoll_create(5) < 1;
Andrew Geisslereef63862021-01-29 15:58:13 -060068 ], [
69 i_cv_epoll_works=yes
70 ], [
Patrick Williamsb48b7b42016-08-17 15:04:38 -050071--
Andrew Geisslereef63862021-01-29 15:58:13 -0600722.25.1
Patrick Williamsb48b7b42016-08-17 15:04:38 -050073