1 From 5593f23e8e062da108ed585535e7281b87346ee1 Mon Sep 17 00:00:00 2001
2 From: Sergei Trofimovich <slyfox@gentoo.org>
3 Date: Wed, 25 Nov 2020 09:36:25 +0000
4 Subject: [PATCH] build/apr_common.m4: avoid explicit inclusion of
7 The failure is observed on `autoconf-2.69d` (soon to be released
8 as `autoconf-2.70`). There `int64_t` detection fails as:
11 $ autoreconf && ./configure
13 checking whether int64_t and int use fmt %d... no
14 checking whether int64_t and long use fmt %ld... no
15 checking whether int64_t and long long use fmt %lld... no
16 configure: error: could not determine the string function for int64_t
19 This happens because `./configure` always stumbles on warning:
22 configure:3350: gcc -c -g -O2 -Werror conftest.c >&5
23 In file included from conftest.c:31:
24 confdefs.h:22: error: "__STDC_WANT_IEC_60559_ATTRIBS_EXT__" redefined [-Werror]
25 22 | #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
29 It's triggered by double inclusion of `"confdefs.h"` contents:
30 explicitly in `APR_TRY_COMPILE_NO_WARNING` macro and implicitly
31 via `AC_LANG_SOURCE` use.
33 To fix it and avoid having to define `main()` declaration the change
34 uses `AC_LANG_PROGRAM` instead.
36 Tested on both `autoconf-2.69` and `autoconf-2.69d`.
38 Bug: https://bugs.gentoo.org/738156
39 Bug: https://bugs.gentoo.org/750353
40 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
42 build/apr_common.m4 | 8 ++------
43 1 file changed, 2 insertions(+), 6 deletions(-)
45 diff --git a/build/apr_common.m4 b/build/apr_common.m4
46 index f4e2dfd0a7..6f5782e674 100644
47 --- a/build/apr_common.m4
48 +++ b/build/apr_common.m4
49 @@ -504,13 +504,9 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
50 CFLAGS="$CFLAGS -Werror"
54 - [#include "confdefs.h"
57 - [int main(int argc, const char *const *argv) {]
62 )], [CFLAGS=$apr_save_CFLAGS
63 $3], [CFLAGS=$apr_save_CFLAGS