summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na@python.org>2023-04-17 14:14:18 (GMT)
committerGitHub <noreply@github.com>2023-04-17 14:14:18 (GMT)
commit5d9762e7cf90444b03b43262be8001ff83401aac (patch)
treefcff33139fa6c70542a7e75089f1e981ddfde336 /configure
parent76933df10afc958b2db2a6bcff7509285fbf5fcf (diff)
downloadcpython-5d9762e7cf90444b03b43262be8001ff83401aac.zip
cpython-5d9762e7cf90444b03b43262be8001ff83401aac.tar.gz
cpython-5d9762e7cf90444b03b43262be8001ff83401aac.tar.bz2
gh-101525: Fix make test if the --enable-bolt enabled (gh-103574)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure108
1 files changed, 108 insertions, 0 deletions
diff --git a/configure b/configure
index 4ae8258..8133d47 100755
--- a/configure
+++ b/configure
@@ -892,6 +892,8 @@ PGO_PROF_USE_FLAG
PGO_PROF_GEN_FLAG
MERGE_FDATA
LLVM_BOLT
+ac_ct_READELF
+READELF
PREBOLT_RULE
LLVM_AR_FOUND
LLVM_AR
@@ -7916,6 +7918,112 @@ if test "$Py_BOLT" = 'true' ; then
DEF_MAKE_ALL_RULE="bolt-opt"
DEF_MAKE_RULE="build_all"
+
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in readelf
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_READELF+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$READELF"; then
+ ac_cv_prog_READELF="$READELF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_READELF="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+READELF=$ac_cv_prog_READELF
+if test -n "$READELF"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
+$as_echo "$READELF" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$READELF" && break
+ done
+fi
+if test -z "$READELF"; then
+ ac_ct_READELF=$READELF
+ for ac_prog in readelf
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_READELF+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_READELF"; then
+ ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_READELF="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
+if test -n "$ac_ct_READELF"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
+$as_echo "$ac_ct_READELF" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_READELF" && break
+done
+
+ if test "x$ac_ct_READELF" = x; then
+ READELF=""notfound""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ READELF=$ac_ct_READELF
+ fi
+fi
+
+ if test "$READELF" == "notfound"
+ then
+ as_fn_error $? "readelf is required for a --enable-bolt build but could not be found." "$LINENO" 5
+ fi
+
# -fno-reorder-blocks-and-partition is required for bolt to work.
# Possibly GCC only.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-reorder-blocks-and-partition" >&5