summaryrefslogtreecommitdiff
path: root/dev-libs/apr/files/apr-1.7.0-dev-zero.patch
blob: be6433dd46bc9c7c18689222e691146c2b965503 (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
APR (ab)uses AC_TRY_RUN to determine if:

* We have /dev/zero
* We can mmap /dev/zero

The APR ebuild sets ac_cv_file__dev_zero=yes when cross compiling
to fill in an answer for the first question, but the configure script
immediately defeats that when answering the second.

AC_TRY_FUN takes four arguments: the test, and what happens on success,
failure, and cross-compiling. The APR script uses this as a "gate" to
clear ac_cv_file__dev_zero when /dev/zero exists but it turns out not
to be useable. They take a pessimistic approach: if you can't "prove"
it is mmap-able, clear the flag.

This patch changes that to leave the flag alone while cross compiling;
just assume /dev/zero is mmap-able. It relies on ac_cv_file__dev_zero
to be correctly set for the target. The fourth parameter is changed to
[:] and not [] because [] engages autoconf's default cross-compiling
behavior, which raises an error.

Signed-off-by: Alexandra Parker <alex.iris.parker@gmail.com>

--- a/configure.in	2022-01-09 00:31:05.552582255 -0800
+++ b/configure.in	2022-01-09 00:31:19.824582533 -0800
@@ -1203,7 +1203,7 @@
             return 3;
         }
         return 0;
-    }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])
+    }], [], [ac_cv_file__dev_zero=no], [:])
 
     AC_MSG_RESULT($ac_cv_file__dev_zero)
 fi