Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 1 | Building Python using VC++ 6.0 or 5.0 |
| 2 | ------------------------------------- |
| 3 | This directory is used to build Python for Win32 platforms, e.g. Windows |
Hirokazu Yamamoto | 0255f0e | 2008-08-14 01:40:45 +0000 | [diff] [blame] | 4 | 2000 and XP. It requires Microsoft Visual C++ 6.x or 5.x and Platform |
| 5 | SDK February 2003 Edition (Core SDK). You can download this SDK from |
| 6 | http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm. |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 7 | (For other Windows platforms and compilers, see ../readme.txt.) |
| 8 | |
| 9 | All you need to do is open the workspace "pcbuild.dsw" in MSVC++, select |
| 10 | the Debug or Release setting (using Build -> Set Active Configuration...), |
| 11 | and build the projects. |
| 12 | |
| 13 | The proper order to build subprojects: |
| 14 | |
| 15 | 1) pythoncore (this builds the main Python DLL and library files, |
Christian Heimes | fd44062 | 2008-12-03 18:35:13 +0000 | [diff] [blame] | 16 | python31.{dll, lib} in Release mode) |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 17 | |
| 18 | 2) python (this builds the main Python executable, |
| 19 | python.exe in Release mode) |
| 20 | |
| 21 | 3) the other subprojects, as desired or needed (note: you probably don't |
| 22 | want to build most of the other subprojects, unless you're building an |
| 23 | entire Python distribution from scratch, or specifically making changes |
| 24 | to the subsystems they implement; see SUBPROJECTS below) |
| 25 | |
| 26 | When using the Debug setting, the output files have a _d added to |
Christian Heimes | fd44062 | 2008-12-03 18:35:13 +0000 | [diff] [blame] | 27 | their name: python31_d.dll, python_d.exe, pyexpat_d.pyd, and so on. |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 28 | |
| 29 | SUBPROJECTS |
| 30 | ----------- |
| 31 | These subprojects should build out of the box. Subprojects other than the |
| 32 | main ones (pythoncore, python, pythonw) generally build a DLL (renamed to |
| 33 | .pyd) from a specific module so that users don't have to load the code |
| 34 | supporting that module unless they import the module. |
| 35 | |
| 36 | pythoncore |
| 37 | .dll and .lib |
| 38 | python |
| 39 | .exe |
| 40 | pythonw |
| 41 | pythonw.exe, a variant of python.exe that doesn't pop up a DOS box |
Hirokazu Yamamoto | 0255f0e | 2008-08-14 01:40:45 +0000 | [diff] [blame] | 42 | _msi |
| 43 | _msi.c. You need to install Windows Installer SDK to build this module. |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 44 | _socket |
| 45 | socketmodule.c |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 46 | _testcapi |
| 47 | tests of the Python C API, run via Lib/test/test_capi.py, and |
| 48 | implemented by module Modules/_testcapimodule.c |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 49 | pyexpat |
| 50 | Python wrapper for accelerated XML parsing, which incorporates stable |
| 51 | code from the Expat project: http://sourceforge.net/projects/expat/ |
| 52 | select |
| 53 | selectmodule.c |
| 54 | unicodedata |
| 55 | large tables of Unicode data |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 56 | winsound |
| 57 | play sounds (typically .wav files) under Windows |
| 58 | |
| 59 | The following subprojects will generally NOT build out of the box. They |
| 60 | wrap code Python doesn't control, and you'll need to download the base |
| 61 | packages first and unpack them into siblings of PCbuilds's parent |
| 62 | directory; for example, if your PCbuild is .......\dist\src\PCbuild\, |
| 63 | unpack into new subdirectories of dist\. |
| 64 | |
| 65 | _tkinter |
| 66 | Python wrapper for the Tk windowing system. Requires building |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 67 | Tcl/Tk first. Following are instructions for Tcl/Tk 8.4.12. |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 68 | |
| 69 | Get source |
| 70 | ---------- |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 71 | In the dist directory, run |
| 72 | svn export http://svn.python.org/projects/external/tcl8.4.12 |
| 73 | svn export http://svn.python.org/projects/external/tk8.4.12 |
| 74 | svn export http://svn.python.org/projects/external/tix-8.4.0 |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 75 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 76 | Build Tcl first (done here w/ MSVC 6 on Win2K) |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 77 | --------------- |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 78 | cd dist\tcl8.4.12\win |
| 79 | run vcvars32.bat |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 80 | nmake -f makefile.vc |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 81 | nmake -f makefile.vc INSTALLDIR=..\..\tcltk install |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 82 | |
| 83 | XXX Should we compile with OPTS=threads? |
| 84 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 85 | Optional: run tests, via |
| 86 | nmake -f makefile.vc test |
| 87 | |
| 88 | all.tcl: Total 10835 Passed 10096 Skipped 732 Failed 7 |
| 89 | Sourced 129 Test Files. |
| 90 | Files with failing tests: exec.test expr.test io.test main.test string.test stri |
| 91 | ngObj.test |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 92 | |
| 93 | Build Tk |
| 94 | -------- |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 95 | cd dist\tk8.4.12\win |
| 96 | nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 |
| 97 | nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 98 | |
| 99 | XXX Should we compile with OPTS=threads? |
| 100 | |
| 101 | XXX I have no idea whether "nmake -f makefile.vc test" passed or |
| 102 | XXX failed. It popped up tons of little windows, and did lots of |
| 103 | XXX stuff, and nothing blew up. |
| 104 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 105 | Built Tix |
| 106 | --------- |
| 107 | cd dist\tix-8.4.0\win |
| 108 | nmake -f python.mak |
| 109 | nmake -f python.mak install |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 110 | |
| 111 | bz2 |
| 112 | Python wrapper for the libbz2 compression library. Homepage |
| 113 | http://sources.redhat.com/bzip2/ |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 114 | Download the source from the python.org copy into the dist |
| 115 | directory: |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 116 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 117 | svn export http://svn.python.org/projects/external/bzip2-1.0.3 |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 118 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 119 | And requires building bz2 first. |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 120 | |
Thomas Wouters | 89f507f | 2006-12-13 04:49:30 +0000 | [diff] [blame] | 121 | cd dist\bzip2-1.0.3 |
| 122 | nmake -f makefile.msc |
| 123 | |
| 124 | All of this managed to build bzip2-1.0.3\libbz2.lib, which the Python |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 125 | project links in. |
| 126 | |
| 127 | |
Hirokazu Yamamoto | 0255f0e | 2008-08-14 01:40:45 +0000 | [diff] [blame] | 128 | _sqlite3 |
| 129 | Python wrapper for SQLite library. |
| 130 | |
| 131 | Get the source code through |
| 132 | |
| 133 | svn export http://svn.python.org/projects/external/sqlite-source-3.3.4 |
| 134 | |
| 135 | To use the extension module in a Python build tree, copy sqlite3.dll into |
| 136 | the PC/VC6 folder. |
| 137 | |
| 138 | |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 139 | _ssl |
| 140 | Python wrapper for the secure sockets library. |
| 141 | |
| 142 | Get the latest source code for OpenSSL from |
| 143 | http://www.openssl.org |
| 144 | |
| 145 | You (probably) don't want the "engine" code. For example, get |
| 146 | openssl-0.9.6g.tar.gz |
| 147 | not |
| 148 | openssl-engine-0.9.6g.tar.gz |
| 149 | |
| 150 | Unpack into the "dist" directory, retaining the folder name from |
| 151 | the archive - for example, the latest stable OpenSSL will install as |
| 152 | dist/openssl-0.9.6g |
| 153 | |
| 154 | You can (theoretically) use any version of OpenSSL you like - the |
| 155 | build process will automatically select the latest version. |
| 156 | |
| 157 | You must also install ActivePerl from |
| 158 | http://www.activestate.com/Products/ActivePerl/ |
| 159 | as this is used by the OpenSSL build process. Complain to them <wink>. |
| 160 | |
Christian Heimes | 4c3eda3 | 2008-01-04 15:35:04 +0000 | [diff] [blame] | 161 | The MSVC project simply invokes PC/VC6/build_ssl.py to perform |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 162 | the build. This Python script locates and builds your OpenSSL |
| 163 | installation, then invokes a simple makefile to build the final .pyd. |
| 164 | |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 165 | build_ssl.py attempts to catch the most common errors (such as not |
| 166 | being able to find OpenSSL sources, or not being able to find a Perl |
| 167 | that works with OpenSSL) and give a reasonable error message. |
| 168 | If you have a problem that doesn't seem to be handled correctly |
| 169 | (eg, you know you have ActivePerl but we can't find it), please take |
| 170 | a peek at build_ssl.py and suggest patches. Note that build_ssl.py |
| 171 | should be able to be run directly from the command-line. |
| 172 | |
| 173 | build_ssl.py/MSVC isn't clever enough to clean OpenSSL - you must do |
| 174 | this by hand. |
| 175 | |
Tim Peters | ff8505d | 2004-01-03 05:45:59 +0000 | [diff] [blame] | 176 | |
| 177 | YOUR OWN EXTENSION DLLs |
| 178 | ----------------------- |
| 179 | If you want to create your own extension module DLL, there's an example |
| 180 | with easy-to-follow instructions in ../PC/example/; read the file |
| 181 | readme.txt there first. |