[Buildroot] [git commit] package/apr: fix build with autoconf >= 2.70

Arnout Vandecappelle (Essensium/Mind) arnout at mind.be
Wed Oct 13 18:14:55 UTC 2021


commit: https://git.buildroot.net/buildroot/commit/?id=1868145c55345b5bc923f027abc7c8bb985e2a14
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fix the following build failure raised since bump of autoconf to version
2.71 in commit ecd54b65c1f998a7ccd91f7c523e4ff38c4781da:

configure: error: could not determine the string function for int64_t

Fixes:
 - http://autobuild.buildroot.org/results/640bbe5b19d6e046cebd5208b37293e03714cd21

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
---
 package/apr/0003-Merge-r1887279-from-trunk.patch | 69 ++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/package/apr/0003-Merge-r1887279-from-trunk.patch b/package/apr/0003-Merge-r1887279-from-trunk.patch
new file mode 100644
index 0000000000..444b9d2b06
--- /dev/null
+++ b/package/apr/0003-Merge-r1887279-from-trunk.patch
@@ -0,0 +1,69 @@
+From a15958a37a06f71c42c690278f9c958b93b7ee20 Mon Sep 17 00:00:00 2001
+From: Yann Ylavic <ylavic at apache.org>
+Date: Thu, 11 Mar 2021 14:10:21 +0000
+Subject: [PATCH] Merge r1887279 from trunk:
+
+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/branches/1.7.x@1887485 13f79535-47bb-0310-9956-ffa450edef68
+
+[Retrieved from:
+https://github.com/apache/apr/commit/0a763c5e500f4304b7c534fae0fad430d64982e8]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+---
+ build/apr_common.m4 | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/build/apr_common.m4 b/build/apr_common.m4
+index 297dd32cf75..b67a8608abe 100644
+--- a/build/apr_common.m4
++++ b/build/apr_common.m4
+@@ -467,13 +467,9 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
+    CFLAGS="$CFLAGS -Werror"
+  fi
+  AC_COMPILE_IFELSE(
+-  [AC_LANG_SOURCE(
+-   [#include "confdefs.h"
+-   ]
+-   [[$1]]
+-   [int main(int argc, const char *const *argv) {]
++  [AC_LANG_PROGRAM(
++   [[$1]],
+    [[$2]]
+-   [   return 0; }]
+   )], [CFLAGS=$apr_save_CFLAGS
+ $3],  [CFLAGS=$apr_save_CFLAGS
+ $4])


More information about the buildroot mailing list