GNOME Bugzilla – Bug 607273
configure script can't detect Python installation correctly in MSys
Last modified: 2010-11-04 14:48:01 UTC
Created attachment 151645 [details] Python detection for Windows/MSys configure script is 100% *nix-oriented: 1) Thinks that python executable lives in */bin 2) Thinks that python keeps includes in */include/python${PYTHON_VERSION} 3) Thinks that python keeps import libraries in */lib 4) Expects all Python-related paths to have slashes ('/') All are false on Windows: 1) Python executable is in */ (for example - C:/Python26/python.exe , not C:/Python26/bin/python.exe) 2) Python keeps includes in */include (without python${PYTHON_VERSION} component) 3) Python keeps its import libraries (the ones for embedding) in */libs 4) Python itself always provides paths with backslashes. How to fix: 1) Check for */python in addition to */bin/python . Also don't rely on "test -x" to fail when file is not executable, it doesn't on MSys! 2) Check for include files in */include 3) Check for import libraries in */libs 4) This might be partially fixable by user providing correct Python prefix with slashes via --with-python (such as --with-python=C:/Python26). For that to work, python executable check that does test -x $with_python must come AFTER check that does test -x $with_python/python.exe , because test -x $with_python will always succeed, even though $with_python is a directory (and is not executable). Patch for configure.in and python/Makefile.am is attached. P.S. don't forget --with-threads=native
Created attachment 159983 [details] [review] Python decetion for Windows/MSys Updated the patch, made it against current git HEAD.
Okay, patch looks fine, still applies and doesn't seemd to break anything for me at least, so I applied it and pushed to git, thanks a lot ! Daniel