I get this error while attempting to cross-compile GDB (using the --with-python
flag):
checking for python: /usr/bin/python
checking for python2.7: no
configure: error: python is missing or unusable
I made sure I had python2.7 installed in /usr/bin
. I even removed the package and installed it again. I tried using --with-python=/usr/bin
and --with-python=/usr/local
, but no luck. I know for sure though that 2.7 is installed though. Any idea on what to do?
I had the same problem on Debian 6.0 when compiling GDB 7.4.1
The solution was to install python headers
sudo apt-get install python2.6-dev
and then configure with the right flag
./configure --with-python
I had the same problem with gdb 7.4 and finally made it worked after spending some time debugging.
By checking the file <gdb-source-path>/gdb/config.log
, you will notice one line:
configure:11031: gcc -o conftest -g -O2 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 conftest.c -lncurses -lz -lm -L/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 -u _PyMac_Error Python.framework/Versions/2.7/Python >&5
Seems that the script python/python-config.py
returned some invalid flags that caused the gcc
command to fail.
The solution is to open <gdb-source-directory>/gdb/python/python-config.py
and comment out these two lines:
# if getvar('LINKFORSHARED') is not None:
# libs.extend(getvar('LINKFORSHARED').split())
I just came across a similar issue building gdb 7.8.1 using Continuum's Python 2.7, which, in my case, was installed in a non-standard location.
In this case, the solution was to provide an additional piece of configuration before running 'configure':
export LDFLAGS="-Wl,-rpath,<non-standard-Python-lib-location> -L<non-standard-Python-lib-location>"
configure --with-python=<non-standard-Python-executable-location>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With