Skip to content

Commit 0a763c5

Browse files
committed
build/apr_common.m4: avoid explicit inclusion of "confdefs.h"
The failure is observed on `autoconf-2.69d` (soon to be released as `autoconf-2.70`). There `int64_t` detection fails as: $ autoreconf && ./configure checking whether int64_t and int use fmt %d... no checking whether int64_t and long use fmt %ld... no checking whether int64_t and long long use fmt %lld... no configure: error: could not determine the string function for int64_t ``` This happens because `./configure` always stumbles on warning: configure:3350: gcc -c -g -O2 -Werror conftest.c >&5 In file included from conftest.c:31: confdefs.h:22: error: "__STDC_WANT_IEC_60559_ATTRIBS_EXT__" redefined [-Werror] 22 | #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1 | It's triggered by double inclusion of `"confdefs.h"` contents: explicitly in `APR_TRY_COMPILE_NO_WARNING` macro and implicitly via `AC_LANG_SOURCE` use. To fix it and avoid having to define `main()` declaration the change uses `AC_LANG_PROGRAM` instead. Tested on both `autoconf-2.69` and `autoconf-2.69d`. Github: closes #25 Submitted by: Sergei Trofimovich <slyfox gentoo.org> Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1887279 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8cd01f3 commit 0a763c5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

build/apr_common.m4

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,13 +467,9 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
467467
CFLAGS="$CFLAGS -Werror"
468468
fi
469469
AC_COMPILE_IFELSE(
470-
[AC_LANG_SOURCE(
471-
[#include "confdefs.h"
472-
]
473-
[[$1]]
474-
[int main(int argc, const char *const *argv) {]
470+
[AC_LANG_PROGRAM(
471+
[[$1]],
475472
[[$2]]
476-
[ return 0; }]
477473
)], [CFLAGS=$apr_save_CFLAGS
478474
$3], [CFLAGS=$apr_save_CFLAGS
479475
$4])

0 commit comments

Comments
 (0)