Comment 7 for bug 364185

Revision history for this message
Ziga Seilnacht (zseil) wrote :

Here is a patch for the setup script that further automates the build on Windows, and works around the bug in MinGW.

With it, you can use the following combinations for building PyOpenSSL:

 - OpenSSL from binary installer and MinGW or MSVC as the compiler
 - OpenSSL built with MSVC and MSVC
 - OpenSSL built with MinGW and MinGW

There are some other improvements in the patch, OpenSSL's path is not hardcoded anymore and OpenSSL's shared libraries get packaged even on Python 2.3. It also tries to guess if OpenSSL was linked with zlib, but that part can easily be thrown out.

I tested the patch on Windows XP, in the following combinations:

Python 2.3: OpenSSL(installer) + MinGW, OpenSSL(MinGW) + MinGW
Python 2.4: OpenSSL(installer) + MSVC + `from setuptools import setup`
Python 2.5: OpenSSL(installer) + MinGW, OpenSSL(MinGW) + MinGW
            OpenSSL(installer) + MSVC, OpenSSL(MSVC) + MSVC

The builds finished without problems and all tests passed. The patch could probably use some cleanups, but it seems to work.