diff options
author | Jean-Paul Calderone <exarkun@divmod.com> | 2009-11-11 10:10:57 -0500 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@divmod.com> | 2009-11-11 10:10:57 -0500 |
commit | bcd4545f70a2439c6f5d54938b057cf00734e8ab (patch) | |
tree | 8142c0ab289f839d36712858f630200fa3e5f337 /INSTALL | |
parent | 2953db8a56fa9c2ffc4fe2994efa83498ca24ae5 (diff) | |
download | pyopenssl-bcd4545f70a2439c6f5d54938b057cf00734e8ab.tar.gz |
Some changes to setup.py
Diffstat (limited to 'INSTALL')
-rw-r--r-- | INSTALL | 84 |
1 files changed, 65 insertions, 19 deletions
@@ -38,31 +38,77 @@ to find out more about how to use the script. -- Building the Module on a Windows System -- -pyOpenSSL is known to build with mingw32 for Python 2.3 through Python 2.5. -For Python 2.6, the official Windows installer of which is built with -Microsoft Visual Studio 2008 (version 9.0), Microsoft Visual Studio 2008 -(version 9.0) is required. You can specify that mingw32 be used by passing -the --compiler argument to build_ext. You will also need to specify the -location of the OpenSSL headers and libraries: - - C:\pyOpenSSL-X.Y> setup.py build_ext -c mingw32 -I C:\OpenSSL\include ^ - -L C:\OpenSSL bdist_msi - -The correct header and library paths depend on how you have OpenSSL -installed. The above paths are correct for the default installation of -(<http://www.slproweb.com/products/Win32OpenSSL.html>). +First you should get OpenSSL linked with the same runtime library that Python +uses. If you are using Python 2.6 you can use the installer at: + + http://www.slproweb.com/products/Win32OpenSSL.html + +The binaries in the installer are built with Visual Studio 2008 at the +time of this writing, which is the same compiler used for building the +official Python 2.6 installers. + +If you want to build PyOpenSSL for an older Python version, it is preferred +to build OpenSSL yourself, either with the Visual Studio 2003 compiler or +with the MinGW compiler. This way you avoid all potential incompatibilities +between different versions of runtime library (msvcrt.dll). To build OpenSSL +folow the instructions in its source distribution and make sure that you build +a shared library, not a static one. PyOpenSSL fails some of its tests when +linked with the static OpenSSL libraries. Use the same compiler for OpenSSL +that you will use for PyOpenSSL later. Make sure that OpenSSL is properly +installed before continuing. To install OpenSSL when building with MinGW, use +the folowing script: + +set OPENSSL_INSTALL_DIR=%1 +mkdir %OPENSSL_INSTALL_DIR% +mkdir %OPENSSL_INSTALL_DIR%\bin +mkdir %OPENSSL_INSTALL_DIR%\include +mkdir %OPENSSL_INSTALL_DIR%\include\openssl +mkdir %OPENSSL_INSTALL_DIR%\lib +copy /b .\*.dll %OPENSSL_INSTALL_DIR%\bin +copy /b .\out\openssl.exe %OPENSSL_INSTALL_DIR%\bin +copy /b .\outinc\openssl\* %OPENSSL_INSTALL_DIR%\include\openssl +copy /b .\out\*.a %OPENSSL_INSTALL_DIR%\lib + +Ensure that OpenSSL's openssl.exe executable can be found on PATH before +running PyOpenSSL's setup script. The setup script finds OpenSSL's include dir +and lib dir based on the location of openssl.exe, and the test suite requires +openssl.exe for output comparison. Alternatively, you can specify the +--with-openssl option to setup.py's build_ext command with the path to the +OpenSSL installation dir: + + > python setup.py build_ext --with-openssl=C:\path\to\openssl build + +PyOpenSSL is known to build with mingw32 for Python 2.3 through Python 2.5. +Before using the mingw32 compiler for Python 2.3, you will have to create +a Python library that MinGW understands. Find and download the pexports +program, put it and MinGW's bin directory on path, then run from Python's +install dir: + +> pexports python23.dll > libs\python23.def +> dlltool --dllname python23.dll --def libs\python23.def \ + --output-lib libs\libpython23.a + +For Python 2.4 and 2.5, no special preparation is needed, just make sure that +MinGW's gcc is on PATH. You can specify that mingw32 be used by passing +the --compiler argument to build_ext: + + C:\pyOpenSSL-X.Y> setup.py build_ext -c mingw32 bdist_msi The bdist_msi command will build an MSI installer. It can be substituted -with another bdist command if another kind of installer is desired. +with another bdist command if another kind of installer is desired or with +the install command if you want to install directly. + +For Python 2.4 and 2.5 you can use Visual Studio 2003 in addition to MinGW. +For Python 2.6, the official Windows installer of which is built with +Microsoft Visual Studio 2008 (version 9.0), Microsoft Visual Studio 2008 +(version 9.0) is required. -To build with MSVC instead, omit the -c option and pass a slightly different -library directory: +To build with MSVC, just omit the compiler specific option: - C:\pyOpenSSL-X.Y> setup.py build_ext -I C:\OpenSSL\include ^ - -L C:\OpenSSL\lib bdist_msi + C:\pyOpenSSL-X.Y> setup.py bdist_msi The resulting binary distribution will be placed in the dist directory. To -install it, dDepending on what kind of distribution you create, run it, +install it, depending on what kind of distribution you create, run it, unzip it, or copy it to Python installation's site-packages. And similarily, you can do |