Skip to content

Commit 77af732

Browse files
committed
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.
1 parent b863b9c commit 77af732

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Allow override of ac_cv_cxx_thread so that cross compiled python can set
2+
-pthread for CXX.

configure

+8-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+5-5
Original file line numberDiff line numberDiff line change
@@ -2664,11 +2664,10 @@ fi
26642664

26652665
# If we have set a CC compiler flag for thread support then
26662666
# check if it works for CXX, too.
2667-
ac_cv_cxx_thread=no
26682667
if test ! -z "$CXX"
26692668
then
2670-
AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
2671-
ac_save_cxx="$CXX"
2669+
AC_CACHE_CHECK([whether $CXX also accepts flags for thread support], [ac_cv_cxx_thread],
2670+
[ac_save_cxx="$CXX"
26722671
26732672
if test "$ac_cv_kpthread" = "yes"
26742673
then
@@ -2697,9 +2696,10 @@ then
26972696
fi
26982697
rm -fr conftest*
26992698
fi
2700-
AC_MSG_RESULT($ac_cv_cxx_thread)
2699+
CXX="$ac_save_cxx"])
2700+
else
2701+
ac_cv_cxx_thread=no
27012702
fi
2702-
CXX="$ac_save_cxx"
27032703

27042704
dnl # check for ANSI or K&R ("traditional") preprocessor
27052705
dnl AC_MSG_CHECKING(for C preprocessor type)

0 commit comments

Comments
 (0)