aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-01-31 04:42:08 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-01-31 04:42:08 +0000
commit9c4ea6c5a9607f76721259469ca229957bca2e0b (patch)
treeb94d3786942244a783752a7c0c9080026dcf1feb /gdb/configure
parentac534cba292dd37e6c0e2a6e30e455a92018cf66 (diff)
downloadgdb-9c4ea6c5a9607f76721259469ca229957bca2e0b.zip
gdb-9c4ea6c5a9607f76721259469ca229957bca2e0b.tar.gz
gdb-9c4ea6c5a9607f76721259469ca229957bca2e0b.tar.bz2
allow building GDB with Python support on MinGW
This makes several adjustements to the configure python-config.py scripts to deal with the differences between a Unix install of Python and a Windows install of Python (as downloaded from the Python website). Differences: - The Python executable is directly in the python prefix directory as opposed to inside the bin/ subdirectory. - The name of the python library is does not have a dot in the version number: On Unix, we have libpython2.7, while on Windows, it's libpython27. So the regexp extracting the python version from the Python lib filename had to be adjusted slightly. Also, the tests checking the name of the libpython had to be adjusted to allow for that. - There are no link options following the -lpython<version> switch on Windows, but the regexp extracting the python version was using it as a delimiter. It had to be removed. - python-config.py does not work on Windows, mostly because some sysconfig variables are missing. They are not necessary so the script was adapted to skip them if not defined. - The paths returned by python-config.py follow the Windows filename convention in terms of the directory separator, and this is causing trouble when the build environment is cygwin (while the compiler and Python are MinGW). We could have fixed that in the configure script, but it felt simpler to do so in python-config.py gdb/ChangeLog: * configure.ac: Add handling of Python distribution on Windows. * python-config.py: If the LIBS, SYSLIBS, LIBPL and/or LINKFORSHARED sysconfig variables are not defined, then do not use them. On Windows, if LIBPL is not defined, then use prefix + '/libs' instead. On Windows, return all paths using forward-slashes rather than backslashes.
Diffstat (limited to 'gdb/configure')
-rwxr-xr-xgdb/configure17
1 files changed, 12 insertions, 5 deletions
diff --git a/gdb/configure b/gdb/configure
index 2540f8b..5a6d0be 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -10478,6 +10478,13 @@ else
# Assume the python binary is ${with_python}/bin/python.
python_prog="${with_python}/bin/python"
python_prefix=
+ # If python does not exit ${with_python}/bin, then try in
+ # ${with_python}. On Windows/MinGW, this is where the Python
+ # executable is.
+ if test ! -x "${python_prog}"; then
+ python_prog="${with_python}/python"
+ python_prefix=
+ fi
if test ! -x "${python_prog}"; then
# Fall back to gdb 7.0/7.1 behaviour.
python_prog=missing
@@ -10652,7 +10659,7 @@ fi
have_libpython=no
if test "${have_python_config}" = yes; then
python_version=`echo " ${python_libs} " \
- | sed -e 's,^.* -l\(python[0-9]*[.][0-9]*\) .*$,\1,'`
+ | sed -e 's,^.* -l\(python[0-9]*[.]\?[0-9]*\).*$,\1,'`
case "${python_version}" in
python*)
@@ -10850,19 +10857,19 @@ $as_echo "${found_usable_python}" >&6; }
fi
fi
- if test "${have_libpython}" = python2.7; then
+ if test "${have_libpython}" = python2.7 -o "${have_libpython}" = python27; then
$as_echo "#define HAVE_LIBPYTHON2_7 1" >>confdefs.h
- elif test "${have_libpython}" = python2.6; then
+ elif test "${have_libpython}" = python2.6 -o "${have_libpython}" = python26; then
$as_echo "#define HAVE_LIBPYTHON2_6 1" >>confdefs.h
- elif test "${have_libpython}" = python2.5; then
+ elif test "${have_libpython}" = python2.5 -o "${have_libpython}" = python25; then
$as_echo "#define HAVE_LIBPYTHON2_5 1" >>confdefs.h
- elif test "${have_libpython}" = python2.4; then
+ elif test "${have_libpython}" = python2.4 -o "${have_libpython}" = python24; then
$as_echo "#define HAVE_LIBPYTHON2_4 1" >>confdefs.h