After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 607273 - configure script can't detect Python installation correctly in MSys
configure script can't detect Python installation correctly in MSys
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.30
Other Windows
: Normal minor
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-18 01:08 UTC by LRN
Modified: 2010-11-04 14:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Python detection for Windows/MSys (2.95 KB, application/octet-stream)
2010-01-18 01:08 UTC, LRN
  Details
Python decetion for Windows/MSys (3.91 KB, patch)
2010-04-30 15:11 UTC, LRN
none Details | Review

Description LRN 2010-01-18 01:08:09 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
Comment 1 LRN 2010-04-30 15:11:37 UTC
Created attachment 159983 [details] [review]
Python decetion for Windows/MSys

Updated the patch, made it against current git HEAD.
Comment 2 Daniel Veillard 2010-11-04 14:48:01 UTC
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