-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy path0001-bpo-41916-allow-cross-compiled-python-to-have-pthrea.patch
More file actions
85 lines (75 loc) · 2.21 KB
/
0001-bpo-41916-allow-cross-compiled-python-to-have-pthrea.patch
File metadata and controls
85 lines (75 loc) · 2.21 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From 0bca228707c3f69cb8e6b4bc59b2ecf54f1f7c76 Mon Sep 17 00:00:00 2001
From: Dustin Spicuzza <dustin@virtualroadside.com>
Date: Sat, 3 Oct 2020 12:31:44 -0400
Subject: [PATCH] bpo-41916: allow cross-compiled python to have -pthread set
for CXX
When cross-compiling, the compile/run test for -pthread always fails so -pthread
will never be automatically set without an override from the cache. ac_cv_pthread
can already be overridden, so do the same thing for ac_cv_cxx_thread.
---
configure | 12 +++++++++---
configure.ac | 8 +++++---
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/configure b/configure
index 0914e24704..119d720500 100755
--- a/configure
+++ b/configure
@@ -7710,12 +7710,14 @@ fi
# If we have set a CC compiler flag for thread support then
# check if it works for CXX, too.
-ac_cv_cxx_thread=no
if test ! -z "$CXX"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX also accepts flags for thread support" >&5
$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; }
-ac_save_cxx="$CXX"
+if ${ac_cv_cxx_thread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_cxx="$CXX"
if test "$ac_cv_kpthread" = "yes"
then
@@ -7744,10 +7746,14 @@ then
fi
rm -fr conftest*
fi
+CXX="$ac_save_cxx"
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_thread" >&5
$as_echo "$ac_cv_cxx_thread" >&6; }
+else
+ ac_cv_cxx_thread=no
fi
-CXX="$ac_save_cxx"
# checks for header files
diff --git a/configure.ac b/configure.ac
index 7051dc109a..6259c0290c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2080,11 +2080,11 @@ fi
# If we have set a CC compiler flag for thread support then
# check if it works for CXX, too.
-ac_cv_cxx_thread=no
if test ! -z "$CXX"
then
AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
-ac_save_cxx="$CXX"
+AC_CACHE_VAL(ac_cv_cxx_thread,
+[ac_save_cxx="$CXX"
if test "$ac_cv_kpthread" = "yes"
then
@@ -2113,9 +2113,11 @@ then
fi
rm -fr conftest*
fi
+CXX="$ac_save_cxx"])
AC_MSG_RESULT($ac_cv_cxx_thread)
+else
+ ac_cv_cxx_thread=no
fi
-CXX="$ac_save_cxx"
dnl # check for ANSI or K&R ("traditional") preprocessor
dnl AC_MSG_CHECKING(for C preprocessor type)
--
2.26.2