xref: /OK3568_Linux_fs/buildroot/package/apr/0003-Merge-r1887279-from-trunk.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunFrom a15958a37a06f71c42c690278f9c958b93b7ee20 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Yann Ylavic <ylavic@apache.org>
3*4882a593SmuzhiyunDate: Thu, 11 Mar 2021 14:10:21 +0000
4*4882a593SmuzhiyunSubject: [PATCH] Merge r1887279 from trunk:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyunbuild/apr_common.m4: avoid explicit inclusion of "confdefs.h"
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunThe failure is observed on `autoconf-2.69d` (soon to be released
9*4882a593Smuzhiyunas `autoconf-2.70`). There `int64_t` detection fails as:
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun$ autoreconf && ./configure
12*4882a593Smuzhiyunchecking whether int64_t and int use fmt %d... no
13*4882a593Smuzhiyunchecking whether int64_t and long use fmt %ld... no
14*4882a593Smuzhiyunchecking whether int64_t and long long use fmt %lld... no
15*4882a593Smuzhiyunconfigure: error: could not determine the string function for int64_t
16*4882a593Smuzhiyun```
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunThis happens because `./configure` always stumbles on warning:
19*4882a593Smuzhiyun
20*4882a593Smuzhiyunconfigure:3350: gcc -c -g -O2 -Werror  conftest.c >&5
21*4882a593SmuzhiyunIn file included from conftest.c:31:
22*4882a593Smuzhiyunconfdefs.h:22: error: "__STDC_WANT_IEC_60559_ATTRIBS_EXT__" redefined [-Werror]
23*4882a593Smuzhiyun   22 | #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
24*4882a593Smuzhiyun      |
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunIt's triggered by double inclusion of `"confdefs.h"` contents:
27*4882a593Smuzhiyunexplicitly in `APR_TRY_COMPILE_NO_WARNING` macro and implicitly
28*4882a593Smuzhiyunvia `AC_LANG_SOURCE` use.
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunTo fix it and avoid having to define `main()` declaration the change
31*4882a593Smuzhiyunuses `AC_LANG_PROGRAM` instead.
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunTested on both `autoconf-2.69` and `autoconf-2.69d`.
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunGithub: closes #25
37*4882a593SmuzhiyunSubmitted by: Sergei Trofimovich <slyfox gentoo.org>
38*4882a593SmuzhiyunReviewed by: ylavic
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun
41*4882a593Smuzhiyungit-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1887485 13f79535-47bb-0310-9956-ffa450edef68
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun[Retrieved from:
44*4882a593Smuzhiyunhttps://github.com/apache/apr/commit/0a763c5e500f4304b7c534fae0fad430d64982e8]
45*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
46*4882a593Smuzhiyun---
47*4882a593Smuzhiyun build/apr_common.m4 | 8 ++------
48*4882a593Smuzhiyun 1 file changed, 2 insertions(+), 6 deletions(-)
49*4882a593Smuzhiyun
50*4882a593Smuzhiyundiff --git a/build/apr_common.m4 b/build/apr_common.m4
51*4882a593Smuzhiyunindex 297dd32cf75..b67a8608abe 100644
52*4882a593Smuzhiyun--- a/build/apr_common.m4
53*4882a593Smuzhiyun+++ b/build/apr_common.m4
54*4882a593Smuzhiyun@@ -467,13 +467,9 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
55*4882a593Smuzhiyun    CFLAGS="$CFLAGS -Werror"
56*4882a593Smuzhiyun  fi
57*4882a593Smuzhiyun  AC_COMPILE_IFELSE(
58*4882a593Smuzhiyun-  [AC_LANG_SOURCE(
59*4882a593Smuzhiyun-   [#include "confdefs.h"
60*4882a593Smuzhiyun-   ]
61*4882a593Smuzhiyun-   [[$1]]
62*4882a593Smuzhiyun-   [int main(int argc, const char *const *argv) {]
63*4882a593Smuzhiyun+  [AC_LANG_PROGRAM(
64*4882a593Smuzhiyun+   [[$1]],
65*4882a593Smuzhiyun    [[$2]]
66*4882a593Smuzhiyun-   [   return 0; }]
67*4882a593Smuzhiyun   )], [CFLAGS=$apr_save_CFLAGS
68*4882a593Smuzhiyun $3],  [CFLAGS=$apr_save_CFLAGS
69*4882a593Smuzhiyun $4])
70