# Check whether --with-python3 was given.
if test "${with_python3+set}" = set; then :
withval=$with_python3;
+else
+ with_python3="auto"
fi
if test "x$with_python3" = "xyes"; then :
preferred_python=$PYTHON3
fi
-else
+elif test "x$with_python3" = "xno"; then :
if test "x$PYTHON" = "x:"; then :
as_fn_error $? "python version 2 is required" "$LINENO" 5
else
preferred_python=$PYTHON
fi
+elif test "x$PYTHON3" != "x:"; then :
+ preferred_python=$PYTHON3
+
+elif test "x$PYTHON" != "x:"; then :
+ preferred_python=$PYTHON
+
+else
+ as_fn_error $? "neither python version 2 nor 3 found" "$LINENO" 5
fi
build_elfutils=no
dnl Allow user to choose python3 for /usr/bin/dtrace
AC_ARG_WITH([python3],
- AS_HELP_STRING([--with-python3],[prefer python version 3]))
+ AS_HELP_STRING([--with-python3],[prefer python version 3]), [], [with_python3="auto"])
AS_IF([test "x$with_python3" = "xyes"],
[AS_IF([test "x$PYTHON3" = "x:"],
[AC_MSG_ERROR([python version 3 is required])],
[AC_SUBST(preferred_python,[$PYTHON3])])],
+ [test "x$with_python3" = "xno"],
[AS_IF([test "x$PYTHON" = "x:"],
[AC_MSG_ERROR([python version 2 is required])],
- [AC_SUBST(preferred_python,[$PYTHON])])])
+ [AC_SUBST(preferred_python,[$PYTHON])])],
+ [test "x$PYTHON3" != "x:"],
+ [AC_SUBST(preferred_python,[$PYTHON3])],
+ [test "x$PYTHON" != "x:"],
+ [AC_SUBST(preferred_python,[$PYTHON])],
+ [AC_MSG_ERROR([neither python version 2 nor 3 found])])
dnl Handle elfutils. If '--with-elfutils=DIR' wasn't specified, used
dnl the system's elfutils.