[Gdal-dev] patch for ngpython on windows using mingw

Rob McMullen rob.mcmullen at gmail.com
Mon Mar 26 21:48:10 EDT 2007

I was able to build gdal on windows for the windows native Python 2.5
using the MinGW compiler toolchain.  It seems that Python 2.5 has the
necessary .lib files to be linked with the MinGW gcc right out of the
box, so you don't have to do the pexports or dlltool tricks to
generate the libpython25.a file.

I'm actually doing this from cygwin, but a mingw bash shell should be
similar.  You need to pass compiler options to configure from cygwin:

CXX='g++ -mno-cygwin' CC='gcc -mno-cygwin' ./configure
--with-libz=internal --without-python --with-ngpython

and then the swig/python setup.py needs a small patch to force the
mingw compiler to use the regular unix build process instead of msvc.
I couldn't figure out how to get distutils to report which compiler it
was using, so I had to assume that if you're on windows and the
GDALmake.opt file exists, then you're really using the mingw compiler.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup.py.patch
Type: application/octet-stream
Size: 782 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070326/3bf717c3/setup.py.obj

More information about the Gdal-dev mailing list