I'm trying to build the latest gdb 10.1 from source.
[My reason for wanting to do it is that I'm trying to debug a program that links to a custom build of Python 2.7.18, and my system gdb was linked to the build of Python 2.7.5 in my /lib64 directory and doesn't work with the newer version].
Having read through the README file, I have configured using:
../gdb-10.1/configure --with-python=<path to my 2.7.18 installation> --prefix=<path to where I want the new gdb to go>
...and then run
make all install
...per the instructions. However, every attempt to build then fails in a slew of error messages of the form:
python/py-arch.o: In function `gdbarch_to_arch_object(gdbarch*)':
.../build/gdb/../../../gdb-10.1/gdb/python/py-arch.c:86: undefined reference to `_Py_RefTotal'
python/py-arch.o: In function `gdbpy_ref_policy<_object>::decref(_object*)':
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_NegativeRefcount'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_Dealloc'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_NegativeRefcount'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_Dealloc'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_Dealloc'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_NegativeRefcount'
On inspecting the output of the configure step, and the Makefile itself, I can find no reference at all to the Python installation that I specified at configure time (and which I've also placed at the head of my LD_LIBRARY_PATH to ensure that the compiler and linker can find it when building).
What am I missing here?