summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure62
1 files changed, 60 insertions, 2 deletions
diff --git a/configure b/configure
index 5cf3230b56..10b0fb7069 100755
--- a/configure
+++ b/configure
@@ -639,6 +639,8 @@ CXX_CMATH_HEADER
CXX_CSTDLIB_HEADER
CXX_SYSINCLUDES
SYSINCLUDES
+PYTHON
+PYTHON_PROG
AUTOCONF
NM
AWK
@@ -5086,17 +5088,73 @@ else
AUTOCONF=no
fi
+# Check for python3 if available, or else python.
+for ac_prog in python3 python
+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_PYTHON_PROG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PYTHON_PROG"; then
+ ac_cv_prog_PYTHON_PROG="$PYTHON_PROG" # 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_PYTHON_PROG="$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
+PYTHON_PROG=$ac_cv_prog_PYTHON_PROG
+if test -n "$PYTHON_PROG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_PROG" >&5
+$as_echo "$PYTHON_PROG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$PYTHON_PROG" && break
+done
+test -n "$PYTHON_PROG" || PYTHON_PROG="no"
+
+case "x$PYTHON_PROG" in
+xno|x|x:) PYTHON_PROG=no ;;
+*) ;;
+esac
+
+if test "x$PYTHON_PROG" = xno; then
+ aux_missing="$aux_missing python"
+else
+ PYTHON="$PYTHON_PROG -B"
+
+fi
+
test -n "$critic_missing" && as_fn_error $? "
*** These critical programs are missing or too old:$critic_missing
*** Check the INSTALL file for required versions." "$LINENO" 5
test -n "$aux_missing" && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
*** These auxiliary programs are missing or incompatible versions:$aux_missing
-*** some features will be disabled.
+*** some features or tests will be disabled.
*** Check the INSTALL file for required versions." >&5
$as_echo "$as_me: WARNING:
*** These auxiliary programs are missing or incompatible versions:$aux_missing
-*** some features will be disabled.
+*** some features or tests will be disabled.
*** Check the INSTALL file for required versions." >&2;}
# if using special system headers, find out the compiler's sekrit