aboutsummaryrefslogtreecommitdiff
path: root/libs/apr/patches/000-055-backport-strerror-cache.patch
blob: 7a0caca6747800af946038ddd98786d62fed4fda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 5fd2568c34a8d5c8159d9a5e0f5601f9e8902166
From: Graham Leggett <minfrin@apache.org>
Date: Tue, 10 Mar 2020 22:38:59 +0000
Subject: [PATCH] APR's configure script uses AC_TRY_RUN to detect whether the
 return type of strerror_r is int. When cross-compiling this defaults to no.

This commit adds an AC_CACHE_CHECK so users who cross-compile APR may
influence the outcome with a configure variable.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1875065 13f79535-47bb-0310-9956-ffa450edef68
---
 CHANGES             |  7 +++++++ (OPENWRT REMOVED)
 build/apr_common.m4 | 11 ++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

--- a/build/apr_common.m4
+++ b/build/apr_common.m4
@@ -489,8 +489,9 @@ dnl  string.
 dnl
 dnl
 AC_DEFUN([APR_CHECK_STRERROR_R_RC], [
-AC_MSG_CHECKING(for type of return code from strerror_r)
-AC_TRY_RUN([
+AC_CACHE_CHECK([whether return code from strerror_r has type int],
+[ac_cv_strerror_r_rc_int],
+[AC_TRY_RUN([
 #include <errno.h>
 #include <string.h>
 #include <stdio.h>
@@ -506,14 +507,10 @@ main()
 }], [
     ac_cv_strerror_r_rc_int=yes ], [
     ac_cv_strerror_r_rc_int=no ], [
-    ac_cv_strerror_r_rc_int=no ] )
+    ac_cv_strerror_r_rc_int=no ] ) ] )
 if test "x$ac_cv_strerror_r_rc_int" = xyes; then
   AC_DEFINE(STRERROR_R_RC_INT, 1, [Define if strerror returns int])
-  msg="int"
-else
-  msg="pointer"
 fi
-AC_MSG_RESULT([$msg])
 ] )
 
 dnl