Unable to install GDB with python support


The thing is, I want to have python support in my GDB installation. When I ran

./configure --with-python



in the GDB source file directory, however, the "make" exited with the following information:

checking whether to use python... yes
checking for python... (cached) /home/tools/tools/../bin/64//python
checking for python2.7... no
configure: error: python is missing or unusable"

Note that the returned information possible indicates that the "make" program is trying to find a python intallation in "/home/tools/tools/../bin/64//python" directory, which, however is not the default python installation of my account. I've set the $PATH variable to make the "python" command pointing to a python installation of my own, which resides under home directory.

Why is this? Can anyone help? A thousand thanks.

PS. There's one thing I'm not sure, since I only want to have some script automatically run in the ".gdbinit" file, which seems like some python script. Does supporting this script equal to making GDB able to debug python script??

I had this same problem. I am using Python 2.7.10 - Anaconda 2.3.0 (installed in a non-standard location), and GDB-7.11. It turns out that within gdb-7.11/ there are multiple autoconfigs. When I inspected gdb-7.11/gdb/config.cache, there was an error because it could not find python2.7 library. So the solution is to export LDFLAGS, when running the top level autoconfig in gdb-7.11 otherwise the autoconfig in gdb-7.11/gdb will not know where to find the python2.7 library.


 make distclean
 cd gdb/
 make distclean
 cd ../
 export LDFLAGS=-L/path/to/nonstandard/python/lib/; ./configure --prefix=/path/to/home/directory/gdb-7.11/ --with-python

NOTE : In this situation, it is best to clean both the top level and the gdb configures. Cleaning the top level configure will not clean the gdb/ configure. This gave me some grief.