Skip to content

Commit 5eb0216

Browse files
committed
Add python3 check
1 parent 96f4788 commit 5eb0216

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

configure

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ with_gssapi
744744
with_pythonsrc_ext
745745
PIP3
746746
CURL
747+
PYTHON3
747748
with_python
748749
with_perl
749750
with_tcl
@@ -9896,6 +9897,50 @@ $as_echo "$with_pythonsrc_ext" >&6; }
98969897

98979898
# Check for required dependencies when pythonsrc-ext is enabled
98989899
if test "$with_pythonsrc_ext" = yes; then
9900+
# Extract the first word of "python3", so it can be a program name with args.
9901+
set dummy python3; ac_word=$2
9902+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9903+
$as_echo_n "checking for $ac_word... " >&6; }
9904+
if ${ac_cv_path_PYTHON3+:} false; then :
9905+
$as_echo_n "(cached) " >&6
9906+
else
9907+
case $PYTHON3 in
9908+
[\\/]* | ?:[\\/]*)
9909+
ac_cv_path_PYTHON3="$PYTHON3" # Let the user override the test with a path.
9910+
;;
9911+
*)
9912+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9913+
for as_dir in $PATH
9914+
do
9915+
IFS=$as_save_IFS
9916+
test -z "$as_dir" && as_dir=.
9917+
for ac_exec_ext in '' $ac_executable_extensions; do
9918+
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9919+
ac_cv_path_PYTHON3="$as_dir/$ac_word$ac_exec_ext"
9920+
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9921+
break 2
9922+
fi
9923+
done
9924+
done
9925+
IFS=$as_save_IFS
9926+
9927+
;;
9928+
esac
9929+
fi
9930+
PYTHON3=$ac_cv_path_PYTHON3
9931+
if test -n "$PYTHON3"; then
9932+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3" >&5
9933+
$as_echo "$PYTHON3" >&6; }
9934+
else
9935+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9936+
$as_echo "no" >&6; }
9937+
fi
9938+
9939+
9940+
if test -z "$PYTHON3"; then
9941+
as_fn_error $? "python3 is required for --with-pythonsrc-ext but was not found" "$LINENO" 5
9942+
fi
9943+
98999944
# Extract the first word of "curl", so it can be a program name with args.
99009945
set dummy curl; ac_word=$2
99019946
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,11 @@ AC_MSG_RESULT([$with_pythonsrc_ext])
10801080

10811081
# Check for required dependencies when pythonsrc-ext is enabled
10821082
if test "$with_pythonsrc_ext" = yes; then
1083+
AC_PATH_PROG([PYTHON3], [python3])
1084+
if test -z "$PYTHON3"; then
1085+
AC_MSG_ERROR([python3 is required for --with-pythonsrc-ext but was not found])
1086+
fi
1087+
10831088
AC_PATH_PROG([CURL], [curl])
10841089
if test -z "$CURL"; then
10851090
AC_MSG_ERROR([curl is required for --with-pythonsrc-ext but was not found])

0 commit comments

Comments
 (0)