Re: GDB 7.4 --with-python doesn't like d:/foo/bar

Joel Brobecker
2012-01-27T05:25:43Z

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

Hi Doug,

> GDB 7.4 cannot be configured using --with-python-d:/foo/bar on
> MS-Windows. The gdb/configure script aborts with an error message:
>
> checking whether to use python... d:/usr/python26
> configure: error: invalid value for --with-python
>
> The culprit is this snippet from gdb/configure.ac:
>
> if test "${with_python}" = no; then
> AC_MSG_WARN([python support disabled; some features may be unavailable.])
> have_libpython=no
> else
> case "${with_python}" in
> /*) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> if test -d ${with_python}; then
> # Assume the python binary is ${with_python}/bin/python.
[...]
> As can be clearly seen, it only accepts absolute file names that begin
> with a forward slash.
>
> I don't have Autoconf installed on the Windows/MinGW machine where I
> did this (thus no patch), so I manually edited gdb/configure to
> replace the line marked above with
>
> [\\/]* | [A-Za-z]:[\\/]*)
>
> Then the configure and build steps ran successfully to completion.
>
> Since (AFAIK) [] is a quote sequence in Autoconf, could someone please
> make the appropriate change in configure.ac to fix this?

I can make the change for Eli sometime this weekend. Would it be OK
with you?

To me, the change would not be completely correct on Unix hosts,
but I think that the chances of someone calling a local directory
a single-letter followed by a colon are very small. So I think
it's OK.

I changed the expressions a bit replacing "[\\/]*" back into just "/"
as originally used. Eli, would that still work for you?

gdb/ChangeLog:

* configure.ac (--with-python): Directory names starting
with a letter followed by a colon are treated as non-relative.

Not tested yet (that part will have to wait for the weekend).

--
Joel

[-- Attachment #2: config-python-windows.diff --]
[-- Type: text/x-diff, Size: 413 bytes --]

diff --git a/gdb/configure.ac b/gdb/configure.ac
index 6f9a42c..2154574 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -734,7 +734,7 @@ if test "${with_python}" = no; then
have_libpython=no
else
case "${with_python}" in
- /*)
+ /* | [A-Za-z]:/* )