gh-86082: bpo-41916: allow cross-compiled python to have -pthread set for CXX (#22525)
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.
This commit is contained in:
parent
1ae619c911
commit
cc8748712e
@ -0,0 +1,2 @@
|
|||||||
|
Allow override of ac_cv_cxx_thread so that cross compiled python can set
|
||||||
|
-pthread for CXX.
|
13
configure
generated
vendored
13
configure
generated
vendored
@ -9395,12 +9395,14 @@ fi
|
|||||||
|
|
||||||
# If we have set a CC compiler flag for thread support then
|
# If we have set a CC compiler flag for thread support then
|
||||||
# check if it works for CXX, too.
|
# check if it works for CXX, too.
|
||||||
ac_cv_cxx_thread=no
|
|
||||||
if test ! -z "$CXX"
|
if test ! -z "$CXX"
|
||||||
then
|
then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX also accepts flags for thread support" >&5
|
{ $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; }
|
$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"
|
if test "$ac_cv_kpthread" = "yes"
|
||||||
then
|
then
|
||||||
@ -9414,6 +9416,8 @@ elif test "$ac_cv_pthread" = "yes"
|
|||||||
then
|
then
|
||||||
CXX="$CXX -pthread"
|
CXX="$CXX -pthread"
|
||||||
ac_cv_cxx_thread=yes
|
ac_cv_cxx_thread=yes
|
||||||
|
else
|
||||||
|
ac_cv_cxx_thread=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test $ac_cv_cxx_thread = yes
|
if test $ac_cv_cxx_thread = yes
|
||||||
@ -9429,10 +9433,13 @@ then
|
|||||||
fi
|
fi
|
||||||
rm -fr conftest*
|
rm -fr conftest*
|
||||||
fi
|
fi
|
||||||
|
CXX="$ac_save_cxx"
|
||||||
|
fi
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_thread" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_thread" >&5
|
||||||
$as_echo "$ac_cv_cxx_thread" >&6; }
|
$as_echo "$ac_cv_cxx_thread" >&6; }
|
||||||
|
else
|
||||||
|
ac_cv_cxx_thread=no
|
||||||
fi
|
fi
|
||||||
CXX="$ac_save_cxx"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
12
configure.ac
12
configure.ac
@ -2653,11 +2653,10 @@ fi
|
|||||||
|
|
||||||
# If we have set a CC compiler flag for thread support then
|
# If we have set a CC compiler flag for thread support then
|
||||||
# check if it works for CXX, too.
|
# check if it works for CXX, too.
|
||||||
ac_cv_cxx_thread=no
|
|
||||||
if test ! -z "$CXX"
|
if test ! -z "$CXX"
|
||||||
then
|
then
|
||||||
AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
|
AC_CACHE_CHECK([whether $CXX also accepts flags for thread support], [ac_cv_cxx_thread],
|
||||||
ac_save_cxx="$CXX"
|
[ac_save_cxx="$CXX"
|
||||||
|
|
||||||
if test "$ac_cv_kpthread" = "yes"
|
if test "$ac_cv_kpthread" = "yes"
|
||||||
then
|
then
|
||||||
@ -2671,6 +2670,8 @@ elif test "$ac_cv_pthread" = "yes"
|
|||||||
then
|
then
|
||||||
CXX="$CXX -pthread"
|
CXX="$CXX -pthread"
|
||||||
ac_cv_cxx_thread=yes
|
ac_cv_cxx_thread=yes
|
||||||
|
else
|
||||||
|
ac_cv_cxx_thread=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test $ac_cv_cxx_thread = yes
|
if test $ac_cv_cxx_thread = yes
|
||||||
@ -2686,9 +2687,10 @@ then
|
|||||||
fi
|
fi
|
||||||
rm -fr conftest*
|
rm -fr conftest*
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($ac_cv_cxx_thread)
|
CXX="$ac_save_cxx"])
|
||||||
|
else
|
||||||
|
ac_cv_cxx_thread=no
|
||||||
fi
|
fi
|
||||||
CXX="$ac_save_cxx"
|
|
||||||
|
|
||||||
dnl # check for ANSI or K&R ("traditional") preprocessor
|
dnl # check for ANSI or K&R ("traditional") preprocessor
|
||||||
dnl AC_MSG_CHECKING(for C preprocessor type)
|
dnl AC_MSG_CHECKING(for C preprocessor type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user