When python version 2 is not found, AM_PROG_PYTHON sets the output
variable PYTHON to ":" (which is intentional; see "man 1P colon").
Fix incorrect tests that compared PYTHON to an empty string.
Use the same behavior for python version 3: when it is not found,
set the output variable PYTHON3 to ":" and test that accordingly.
Pass the variables "python3" and "py3execdir" to the subconfigure
unconditionally, just like the variables "python" and "pyexecdir".
When a program named "python" exists, fix a conditional that tests
if it is python version 3.
Do not guess the name of the python-config script. Simply append
"-config" to the program name for the python interpreter.
--with-dracutbindir=DIR Use the dracut binary located in DIR
--without-avahi Do not use Avahi even if present
--with-rpm query rpm database for missing debuginfos
--with-dracutbindir=DIR Use the dracut binary located in DIR
--without-avahi Do not use Avahi even if present
--with-rpm query rpm database for missing debuginfos
- --with-python3 prefer /usr/bin/python3
+ --with-python3 prefer python version 3
--with-elfutils=DIRECTORY
find elfutils source code in DIRECTORY
--with-dyninst=DIRECTORY
--with-elfutils=DIRECTORY
find elfutils source code in DIRECTORY
--with-dyninst=DIRECTORY
#define PYTHON_BASENAME "${python_basename}"
_ACEOF
#define PYTHON_BASENAME "${python_basename}"
_ACEOF
-if test -n "$PYTHON"; then
+if test "x$PYTHON" != "x:"; then
$as_echo "#define PYTHON_EXISTS /**/" >>confdefs.h
$as_echo "#define PYTHON_EXISTS /**/" >>confdefs.h
as_fn_append ac_configure_args " python='$PYTHON' pyexecdir='$pyexecdir'"
# Now let's try to find python version 3.
as_fn_append ac_configure_args " python='$PYTHON' pyexecdir='$pyexecdir'"
# Now let's try to find python version 3.
-if test "x$PYTHON_UNKNOWN" != "xno" -a "x$python_unknown_version" = "x3"; then
+if test "x$PYTHON_UNKNOWN" != "xno" -a "x$ac_cv_python_unknown_version" = "x3"; then
# Extract the first word of "python", so it can be a program name with args.
set dummy python; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
# Extract the first word of "python", so it can be a program name with args.
set dummy python; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- for ac_prog in python3 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0
+ for ac_prog in python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
test -n "$PYTHON3" && break
done
test -n "$PYTHON3" && break
done
+test -n "$PYTHON3" || PYTHON3=":"
fi
python3_basename=$(basename "$PYTHON3")
fi
python3_basename=$(basename "$PYTHON3")
# If we found python version 3, set up the other variables for python
# version 3 that AM_PATH_PYTHON sets up for python version 2.
# If we found python version 3, set up the other variables for python
# version 3 that AM_PATH_PYTHON sets up for python version 2.
-if test -n "$PYTHON3"; then
+if test "x$PYTHON3" != "x:"; then
$as_echo "#define PYTHON3_EXISTS /**/" >>confdefs.h
$as_echo "#define PYTHON3_EXISTS /**/" >>confdefs.h
$as_echo "$ac_cv_py3execdir" >&6; }
py3execdir=$ac_cv_py3execdir
$as_echo "$ac_cv_py3execdir" >&6; }
py3execdir=$ac_cv_py3execdir
-
- # Make sure the python3 and py3execdir variables get sent down to
- # the subconfigure in the testsuite directory.
- as_fn_append ac_configure_args " python3='$PYTHON3' py3execdir='$ac_cv_py3execdir'"
+# Make sure the python3 and py3execdir variables get sent down to
+# the subconfigure in the testsuite directory.
+as_fn_append ac_configure_args " python3='$PYTHON3' py3execdir='$ac_cv_py3execdir'"
+
if test "${enable_prologues+set}" != set; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if prologue searching should be the default" >&5
$as_echo_n "checking to see if prologue searching should be the default... " >&6; }
if test "${enable_prologues+set}" != set; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if prologue searching should be the default" >&5
$as_echo_n "checking to see if prologue searching should be the default... " >&6; }
fi
if test "x$with_python3" = "xyes"; then :
fi
if test "x$with_python3" = "xyes"; then :
- if test -z "$PYTHON3"; then :
+ if test "x$PYTHON3" = "x:"; then :
as_fn_error $? "python version 3 is required" "$LINENO" 5
else
preferred_python=$PYTHON3
as_fn_error $? "python version 3 is required" "$LINENO" 5
else
preferred_python=$PYTHON3
have_python2_support=no
if test "x$with_python2_probes" != "xno"; then :
have_python2_support=no
if test "x$with_python2_probes" != "xno"; then :
- for ac_prog in python2-config python-config
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+ if test "x$PYTHON" != "x:"; then :
+ # Extract the first word of "${python_basename}-config", so it can be a program name with args.
+set dummy ${python_basename}-config; 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_path_PYTHON_CONFIG+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PYTHON_CONFIG+:} false; then :
- test -n "$PYTHON_CONFIG" && break
-done
-test -n "$PYTHON_CONFIG" || PYTHON_CONFIG="no"
-
- if test "x$PYTHON_CONFIG" != "xno"; then :
+fi
+ if test "x$PYTHON_CONFIG" != "x"; then :
PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes 2> /dev/null`
PYTHON_CPPFLAGS=$PYTHON_CPPFLAGS
PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes 2> /dev/null`
PYTHON_CPPFLAGS=$PYTHON_CPPFLAGS
have_python3_support=no
if test "x$with_python3_probes" != "xno"; then :
have_python3_support=no
if test "x$with_python3_probes" != "xno"; then :
- pathless_python3=$(basename "$PYTHON3")
- if test "x${pathless_python3}" == "x"; then
- pathless_python3="python3"
- fi
- # Extract the first word of "${pathless_python3}-config", so it can be a program name with args.
-set dummy ${pathless_python3}-config; ac_word=$2
+ if test "x$PYTHON3" != "x:" ; then :
+ # Extract the first word of "${python3_basename}-config", so it can be a program name with args.
+set dummy ${python3_basename}-config; 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_path_PYTHON3_CONFIG+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PYTHON3_CONFIG+:} false; then :
- test -z "$ac_cv_path_PYTHON3_CONFIG" && ac_cv_path_PYTHON3_CONFIG="no"
- if test "x$PYTHON3_CONFIG" != "xno"; then :
+fi
+ if test "x$PYTHON3_CONFIG" != "x"; then :
PYTHON3_CPPFLAGS=`$PYTHON3_CONFIG --includes 2> /dev/null`
PYTHON3_CPPFLAGS=$PYTHON3_CPPFLAGS
PYTHON3_CPPFLAGS=`$PYTHON3_CONFIG --includes 2> /dev/null`
PYTHON3_CPPFLAGS=$PYTHON3_CPPFLAGS
python_basename=$(basename "$PYTHON")
AC_DEFINE_UNQUOTED([PYTHON_BASENAME], "${python_basename}",
[Base name of the python2 interpreter binary.])
python_basename=$(basename "$PYTHON")
AC_DEFINE_UNQUOTED([PYTHON_BASENAME], "${python_basename}",
[Base name of the python2 interpreter binary.])
-if test -n "$PYTHON"; then
+if test "x$PYTHON" != "x:"; then
AC_DEFINE([PYTHON_EXISTS], [],
[The python2 interpreter binary exists.])
fi
AC_DEFINE([PYTHON_EXISTS], [],
[The python2 interpreter binary exists.])
fi
AS_VAR_APPEND([ac_configure_args], [" python='$PYTHON' pyexecdir='$pyexecdir'"])
# Now let's try to find python version 3.
AS_VAR_APPEND([ac_configure_args], [" python='$PYTHON' pyexecdir='$pyexecdir'"])
# Now let's try to find python version 3.
-if test "x$PYTHON_UNKNOWN" != "xno" -a "x$python_unknown_version" = "x3"; then
+if test "x$PYTHON_UNKNOWN" != "xno" -a "x$ac_cv_python_unknown_version" = "x3"; then
AC_PATH_PROG([PYTHON3], [python])
else
AC_PATH_PROGS([PYTHON3],
AC_PATH_PROG([PYTHON3], [python])
else
AC_PATH_PROGS([PYTHON3],
- [python3 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0])
+ [python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0], [:])
fi
python3_basename=$(basename "$PYTHON3")
AC_DEFINE_UNQUOTED([PYTHON3_BASENAME], "${python3_basename}",
fi
python3_basename=$(basename "$PYTHON3")
AC_DEFINE_UNQUOTED([PYTHON3_BASENAME], "${python3_basename}",
# If we found python version 3, set up the other variables for python
# version 3 that AM_PATH_PYTHON sets up for python version 2.
# If we found python version 3, set up the other variables for python
# version 3 that AM_PATH_PYTHON sets up for python version 2.
-if test -n "$PYTHON3"; then
+if test "x$PYTHON3" != "x:"; then
AC_DEFINE([PYTHON3_EXISTS], [],
[The python3 interpreter binary exists.])
AC_CACHE_CHECK([for python3 version], [ac_cv_python3_version],
AC_DEFINE([PYTHON3_EXISTS], [],
[The python3 interpreter binary exists.])
AC_CACHE_CHECK([for python3 version], [ac_cv_python3_version],
[ac_cv_py3execdir],
[ac_cv_py3execdir=`$PYTHON3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='$PYTHON3_EXEC_PREFIX'))"`])
AC_SUBST([py3execdir], [$ac_cv_py3execdir])
[ac_cv_py3execdir],
[ac_cv_py3execdir=`$PYTHON3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='$PYTHON3_EXEC_PREFIX'))"`])
AC_SUBST([py3execdir], [$ac_cv_py3execdir])
-
- # Make sure the python3 and py3execdir variables get sent down to
- # the subconfigure in the testsuite directory.
- AS_VAR_APPEND([ac_configure_args], [" python3='$PYTHON3' py3execdir='$ac_cv_py3execdir'"])
+# Make sure the python3 and py3execdir variables get sent down to
+# the subconfigure in the testsuite directory.
+AS_VAR_APPEND([ac_configure_args], [" python3='$PYTHON3' py3execdir='$ac_cv_py3execdir'"])
+
dnl Handle the prologues option.
dnl
dnl If the user didn't specify --enable-prologues/--disable-prologues
dnl Handle the prologues option.
dnl
dnl If the user didn't specify --enable-prologues/--disable-prologues
dnl Allow user to choose python3 for /usr/bin/dtrace
AC_ARG_WITH([python3],
dnl Allow user to choose python3 for /usr/bin/dtrace
AC_ARG_WITH([python3],
- AS_HELP_STRING([--with-python3],[prefer /usr/bin/python3]))
+ AS_HELP_STRING([--with-python3],[prefer python version 3]))
AS_IF([test "x$with_python3" = "xyes"],
AS_IF([test "x$with_python3" = "xyes"],
- [AS_IF([test -z "$PYTHON3"],
+ [AS_IF([test "x$PYTHON3" = "x:"],
[AC_MSG_ERROR([python version 3 is required])],
[AC_SUBST(preferred_python,[$PYTHON3])])],
[AS_IF([test "x$PYTHON" = "x:"],
[AC_MSG_ERROR([python version 3 is required])],
[AC_SUBST(preferred_python,[$PYTHON3])])],
[AS_IF([test "x$PYTHON" = "x:"],
have_python2_support=no
AS_IF([test "x$with_python2_probes" != "xno"],
[dnl First, check to make sure we have the 'python-config' script.
have_python2_support=no
AS_IF([test "x$with_python2_probes" != "xno"],
[dnl First, check to make sure we have the 'python-config' script.
- AC_PATH_PROGS([PYTHON_CONFIG], [python2-config python-config], [no])
- AS_IF([test "x$PYTHON_CONFIG" != "xno"],
+ AS_IF([test "x$PYTHON" != "x:"],
+ [AC_PATH_PROG([PYTHON_CONFIG], [${python_basename}-config])])
+ AS_IF([test "x$PYTHON_CONFIG" != "x"],
[dnl Use the 'python-config' script to find the python
dnl include directories.
PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes 2> /dev/null`
[dnl Use the 'python-config' script to find the python
dnl include directories.
PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes 2> /dev/null`
have_python3_support=no
AS_IF([test "x$with_python3_probes" != "xno"],
[dnl First, check to make sure we have the 'python3-config' script.
have_python3_support=no
AS_IF([test "x$with_python3_probes" != "xno"],
[dnl First, check to make sure we have the 'python3-config' script.
- pathless_python3=$(basename "$PYTHON3")
- if test "x${pathless_python3}" == "x"; then
- pathless_python3="python3"
- fi
- AC_PATH_PROG([PYTHON3_CONFIG], [${pathless_python3}-config], [no])
- AS_IF([test "x$PYTHON3_CONFIG" != "xno"],
+ AS_IF([test "x$PYTHON3" != "x:" ],
+ [AC_PATH_PROG([PYTHON3_CONFIG], [${python3_basename}-config])])
+ AS_IF([test "x$PYTHON3_CONFIG" != "x"],
[dnl Use the 'python3-config' script to find the python
dnl include directories.
PYTHON3_CPPFLAGS=`$PYTHON3_CONFIG --includes 2> /dev/null`
[dnl Use the 'python3-config' script to find the python
dnl include directories.
PYTHON3_CPPFLAGS=`$PYTHON3_CONFIG --includes 2> /dev/null`