diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-07-04 16:40:05 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-07-18 11:32:40 +0100 |
commit | 602d2b520dc5917c2353987032c881f79b34d634 (patch) | |
tree | f84b64d0e9d010a9692c35d02e5da3ef487c1179 /gdb/configure.ac | |
parent | 7e864bf71d55626dce94df26ebaf11f65b4d7b65 (diff) | |
download | gdb-602d2b520dc5917c2353987032c881f79b34d634.zip gdb-602d2b520dc5917c2353987032c881f79b34d634.tar.gz gdb-602d2b520dc5917c2353987032c881f79b34d634.tar.bz2 |
gdb/python: look for python, then python 3 at configure time
It is possible that a system might have a python3 executable, but no
python executable. For example, on my Fedora system the python2
package provides /usr/bin/python2, the python3 package provides
/usr/bin/python3, and the python-unversioned-command package provides
/usr/bin/python, which picks between python2 and python3.
It is quite possible to only have python3 available on a system.
Currently, when GDB configures, it looks for a 'python' executable.
If non is found then GDB will be built without python support. Or the
user needs to configure using --with-python=/usr/bin/python3.
This commit updates GDB's configure.ac script to first look for
'python', and then 'python3'. Now, on a system that only has a
python3 executable, GDB will automatically find, and use that in order
to provide python support, no user supplied configure arguments are
needed.
I've tested this on my local machine by removing the
python-unversioned-command package, confirming that there is no longer
a 'python' executable in my $PATH, and then rebuilding GDB from
scratch. GDB with this patch has python support.
Diffstat (limited to 'gdb/configure.ac')
-rw-r--r-- | gdb/configure.ac | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac index bf03b87..b681988 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -811,7 +811,8 @@ else case "${with_python}" in yes | auto) if test "${build}" = "${host}"; then - AC_PATH_PROG(python_prog_path, python, missing) + # Look first for 'python', then 'python3'. + AC_PATH_PROGS(python_prog_path, [python python3], missing) if test "${python_prog_path}" = missing; then python_prog=missing else |