1From 9d57d4353c82110c609f36f91986277343d4ee45 Mon Sep 17 00:00:00 2001
2From: "Yann E. MORIN" <yann.morin.1998@free.fr>
3Date: Wed, 8 Feb 2023 13:26:56 +0100
4Subject: [PATCH] configure: allow overriding some tests
5
6Some tests use AC_RUN_IFELSE, so they do not work for cross-compilation.
7
8Allow the user to provide these results from the environment.
9
10Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
11---
12 configure    | 6 +++---
13 configure.ac | 6 +++---
14 2 files changed, 6 insertions(+), 6 deletions(-)
15
16diff --git a/configure b/configure
17index c18dfb2..d165962 100755
18--- a/configure
19+++ b/configure
20@@ -4540,7 +4540,7 @@ fi
21 { $as_echo "$as_me:${as_lineno-$LINENO}: checking strdup macro" >&5
22 $as_echo_n "checking strdup macro... " >&6; }
23 if test "$cross_compiling" = yes; then :
24-  ac_cv_strdup_macro=no
25+  ac_cv_strdup_macro="${ac_cv_strdup_macro-no}"
26
27 else
28   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29@@ -4578,7 +4578,7 @@ $as_echo "$ac_cv_strdup_macro" >&6; }
30 { $as_echo "$as_me:${as_lineno-$LINENO}: checking strndup macro" >&5
31 $as_echo_n "checking strndup macro... " >&6; }
32 if test "$cross_compiling" = yes; then :
33-  ac_cv_strndup_macro=no
34+  ac_cv_strndup_macro="${ac_cv_strndup_macro-no}"
35
36 else
37   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38@@ -4753,7 +4753,7 @@ done
39
40 { $as_echo "$as_me:${as_lineno-$LINENO}: checking basic-block size" >&5
41 $as_echo_n "checking basic-block size... " >&6; }
42-ac_cv_page_size=0
43+ac_cv_page_size="${ac_cv_page_size-0}"
44 if test $ac_cv_page_size = 0; then
45    if test "$cross_compiling" = yes; then :
46    ac_cv_page_size=0
47diff --git a/configure.ac b/configure.ac
48index 9740fdc..51bdf4d 100644
49--- a/configure.ac
50+++ b/configure.ac
51@@ -292,7 +292,7 @@ int main() { return 1; }
52 ]])],
53 [ac_cv_strdup_macro=yes],
54 [ac_cv_strdup_macro=no],
55-[ac_cv_strdup_macro=no]
56+[ac_cv_strdup_macro="${ac_cv_strdup_macro-no}"]
57 )
58 AC_MSG_RESULT([$ac_cv_strdup_macro])
59
60@@ -316,7 +316,7 @@ int main() { return 1; }
61 ]])],
62 [ac_cv_strndup_macro=yes],
63 [ac_cv_strndup_macro=no],
64-[ac_cv_strndup_macro=no]
65+[ac_cv_strndup_macro="${ac_cv_strndup_macro-no}"]
66 )
67 AC_MSG_RESULT([$ac_cv_strndup_macro])
68
69@@ -390,7 +390,7 @@ AC_MSG_RESULT([$ac_cv_use_mmap])
70 #
71 AC_CHECK_FUNCS(getpagesize)
72 AC_MSG_CHECKING([basic-block size])
73-ac_cv_page_size=0
74+ac_cv_page_size="${ac_cv_page_size-0}"
75 if test $ac_cv_page_size = 0; then
76    AC_RUN_IFELSE([AC_LANG_SOURCE([
77 #if HAVE_UNISTD_H
78--
792.25.1
80
81