> From: Keith Marshall <keith****@users*****> > Date: Thu, 23 Jul 2020 07:20:20 +0100 > > > The Python tree is "relocatable", i.e. if GDB discovers at run time > > that its installation is some place different from the configured > > exec-prefix, it will "rewrite" the beginning of the root of the Python > > installation to be in sync with the actual GDB installation directory. > > So, for example, if GDB was configured for exec-prefix = x:/usr, and > > you give --with-python=x:/usr/Python27, then GDB invoked from > > C:/foo/bar/bin will look for Python in C:/foo/bar/Python27. > > So, in theory, if I configure with "--prefix=C:/MinGW", (or maybe just > with "--exec-prefix=C:/MinGW"), and I've arranged it such that testing > for Python yields an effective "python_prefix=C:/Python27", (which does > not seem to be achieved with "--with-python=C:/Python27" ... it needs a > program reference, such as "--with-python=mingw32-python-config", which > is assigned to python_prog, and will return the effective prefix when > that program is invoked as > > ${python_prog} ${srcdir}/python/python-config.py --exec-prefix > > with the result assigned to python_prefix), then, at least, if the user > installs GDB to "x:/MinGW", then that installation should expect to find > Python in "x:/Python27"? Yes, I'd expect it to work. > That seems reasonable, but wait ... this is truly weird! For reasons I > explained previously, I need to specify "--with-mpfr=/mingw", (and also > "--with-gmp=/mingw", except that's broken anyway), so that the build > process can find MPFR headers and libraries. As long as I configure > with "--prefix=/mingw", (and leave exec-prefix unspecified), and kludge > around the broken handling of "--with-gmp=/mingw", MPFR detection works > correctly, but if I use "--prefix=C:/MinGW", or even if I simply do no > more than add "--exec-prefix=C:/MinGW", then MPFR detection fails! > > Likewise for "--with-expat=/mingw": works fine as long as configuration > of "--prefix=/mingw" is consistent, but breaks with "--prefix=C:/MinGW", > or with "--exec-prefix=C:/MinGW". So maybe you could use --prefix=/mingw instead of C:/MinGW, and it would still work, provided that one stays on the same drive... > It isn't really that complex, but GDB's (and GCC's) horrendously complex > configuration process just doesn't always play nicely with cross > compilation, especially when we want Windows style paths to be recorded > in the generated executable program files. Yes, it sounds like that.