From: Serhei Makarov Date: Tue, 15 Oct 2019 19:48:30 +0000 (-0400) Subject: configure.ac :: default --with-python3=auto to handle Python3-only systems X-Git-Tag: release-4.2~26 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=d32d80fb93d25f656f93d94a04978b874c5d9448;p=systemtap.git configure.ac :: default --with-python3=auto to handle Python3-only systems --- diff --git a/configure b/configure index 5cfeae6c6..4290f6627 100755 --- a/configure +++ b/configure @@ -11393,6 +11393,8 @@ LIBS=$LIBS_no_readline # 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 : @@ -11402,13 +11404,21 @@ else 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 diff --git a/configure.ac b/configure.ac index 96c5c9db7..932d40445 100644 --- a/configure.ac +++ b/configure.ac @@ -557,14 +557,20 @@ LIBS=$LIBS_no_readline 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.