/PC/VC6/readme.txt

http://unladen-swallow.googlecode.com/ · Plain Text · 241 lines · 187 code · 54 blank · 0 comment · 0 complexity · 50a00818ed05a26e1efbc547f2d1ac7f MD5 · raw file

  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
  4. 2000 and XP. It requires Microsoft Visual C++ 6.x or 5.x.
  5. (For other Windows platforms and compilers, see ../readme.txt.)
  6. All you need to do is open the workspace "pcbuild.dsw" in MSVC++, select
  7. the Debug or Release setting (using Build -> Set Active Configuration...),
  8. and build the projects.
  9. The proper order to build subprojects:
  10. 1) pythoncore (this builds the main Python DLL and library files,
  11. python26.{dll, lib} in Release mode)
  12. 2) python (this builds the main Python executable,
  13. python.exe in Release mode)
  14. 3) the other subprojects, as desired or needed (note: you probably don't
  15. want to build most of the other subprojects, unless you're building an
  16. entire Python distribution from scratch, or specifically making changes
  17. to the subsystems they implement; see SUBPROJECTS below)
  18. When using the Debug setting, the output files have a _d added to
  19. their name: python26_d.dll, python_d.exe, pyexpat_d.pyd, and so on.
  20. SUBPROJECTS
  21. -----------
  22. These subprojects should build out of the box. Subprojects other than the
  23. main ones (pythoncore, python, pythonw) generally build a DLL (renamed to
  24. .pyd) from a specific module so that users don't have to load the code
  25. supporting that module unless they import the module.
  26. pythoncore
  27. .dll and .lib
  28. python
  29. .exe
  30. pythonw
  31. pythonw.exe, a variant of python.exe that doesn't pop up a DOS box
  32. _msi
  33. _msi.c. You need to install Windows Installer SDK to build this module.
  34. http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
  35. _socket
  36. socketmodule.c
  37. _testcapi
  38. tests of the Python C API, run via Lib/test/test_capi.py, and
  39. implemented by module Modules/_testcapimodule.c
  40. pyexpat
  41. Python wrapper for accelerated XML parsing, which incorporates stable
  42. code from the Expat project: http://sourceforge.net/projects/expat/
  43. select
  44. selectmodule.c
  45. unicodedata
  46. large tables of Unicode data
  47. winsound
  48. play sounds (typically .wav files) under Windows
  49. The following subprojects will generally NOT build out of the box. They
  50. wrap code Python doesn't control, and you'll need to download the base
  51. packages first and unpack them into siblings of PCbuilds's parent
  52. directory; for example, if your PCbuild is .......\dist\src\PCbuild\,
  53. unpack into new subdirectories of dist\.
  54. _tkinter
  55. Python wrapper for the Tk windowing system. Requires building
  56. Tcl/Tk first. Following are instructions for Tcl/Tk 8.5.2.
  57. Get source
  58. ----------
  59. In the dist directory, run
  60. svn export http://svn.python.org/projects/external/tcl-8.5.2.1 tcl8.5.2
  61. svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2
  62. svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3
  63. Debug Build
  64. -----------
  65. To build debug version, add DEBUG=1 to all nmake call bellow.
  66. Build Tcl first (done here w/ MSVC 6 on Win2K)
  67. ---------------
  68. If your environment doesn't have struct _stat64, you need to apply
  69. tcl852.patch in this directory to dist\tcl8.5.2\generic\tcl.h.
  70. cd dist\tcl8.5.2\win
  71. run vcvars32.bat
  72. nmake -f makefile.vc
  73. nmake -f makefile.vc INSTALLDIR=..\..\tcltk install
  74. XXX Should we compile with OPTS=threads?
  75. Optional: run tests, via
  76. nmake -f makefile.vc test
  77. all.tcl: Total 24242 Passed 23358 Skipped 877 Failed 7
  78. Sourced 137 Test Files.
  79. Files with failing tests: exec.test http.test io.test main.test string.test stri
  80. ngObj.test
  81. Build Tk
  82. --------
  83. cd dist\tk8.5.2\win
  84. nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2
  85. nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 INSTALLDIR=..\..\tcltk install
  86. XXX Should we compile with OPTS=threads?
  87. XXX I have no idea whether "nmake -f makefile.vc test" passed or
  88. XXX failed. It popped up tons of little windows, and did lots of
  89. XXX stuff, and nothing blew up.
  90. Build Tix
  91. ---------
  92. cd dist\tix8.4.3\win
  93. nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0
  94. nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 INSTALL_DIR=..\..\tcltk install
  95. bz2
  96. Python wrapper for the libbz2 compression library. Homepage
  97. http://www.bzip.org/
  98. Download the source from the python.org copy into the dist
  99. directory:
  100. svn export http://svn.python.org/projects/external/bzip2-1.0.5
  101. And requires building bz2 first.
  102. cd dist\bzip2-1.0.5
  103. nmake -f makefile.msc
  104. All of this managed to build bzip2-1.0.5\libbz2.lib, which the Python
  105. project links in.
  106. _bsddb
  107. To use the version of bsddb that Python is built with by default, invoke
  108. (in the dist directory)
  109. svn export http://svn.python.org/projects/external/db-4.7.25.0 db-4.7.25
  110. Then open db-4.7.25\build_windows\Berkeley_DB.dsw and build the
  111. "db_static" project for "Release" mode.
  112. Alternatively, if you want to start with the original sources,
  113. go to Oracle's download page:
  114. http://www.oracle.com/technology/software/products/berkeley-db/db/
  115. and download version 4.7.25.
  116. With or without strong cryptography? You can choose either with or
  117. without strong cryptography, as per the instructions below. By
  118. default, Python is built and distributed WITHOUT strong crypto.
  119. Unpack the sources; if you downloaded the non-crypto version, rename
  120. the directory from db-4.7.25.NC to db-4.7.25.
  121. Now apply any patches that apply to your version.
  122. To run extensive tests, pass "-u bsddb" to regrtest.py. test_bsddb3.py
  123. is then enabled. Running in verbose mode may be helpful.
  124. XXX The test_bsddb3 tests don't always pass, on Windows (according to
  125. XXX me) or on Linux (according to Barry). (I had much better luck
  126. XXX on Win2K than on Win98SE.) The common failure mode across platforms
  127. XXX is
  128. XXX DBAgainError: (11, 'Resource temporarily unavailable -- unable
  129. XXX to join the environment')
  130. XXX
  131. XXX and it appears timing-dependent. On Win2K I also saw this once:
  132. XXX
  133. XXX test02_SimpleLocks (bsddb.test.test_thread.HashSimpleThreaded) ...
  134. XXX Exception in thread reader 1:
  135. XXX Traceback (most recent call last):
  136. XXX File "C:\Code\python\lib\threading.py", line 411, in __bootstrap
  137. XXX self.run()
  138. XXX File "C:\Code\python\lib\threading.py", line 399, in run
  139. XXX apply(self.__target, self.__args, self.__kwargs)
  140. XXX File "C:\Code\python\lib\bsddb\test\test_thread.py", line 268, in
  141. XXX readerThread
  142. XXX rec = c.next()
  143. XXX DBLockDeadlockError: (-30996, 'DB_LOCK_DEADLOCK: Locker killed
  144. XXX to resolve a deadlock')
  145. XXX
  146. XXX I'm told that DBLockDeadlockError is expected at times. It
  147. XXX doesn't cause a test to fail when it happens (exceptions in
  148. XXX threads are invisible to unittest).
  149. _sqlite3
  150. Python wrapper for SQLite library.
  151. Get the source code through
  152. svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
  153. To use the extension module in a Python build tree, copy sqlite3.dll into
  154. the PC/VC6 folder.
  155. _ssl
  156. Python wrapper for the secure sockets library.
  157. Get the latest source code for OpenSSL from
  158. http://www.openssl.org
  159. You (probably) don't want the "engine" code. For example, get
  160. openssl-0.9.8g.tar.gz
  161. not
  162. openssl-engine-0.9.8g.tar.gz
  163. Unpack into the "dist" directory, retaining the folder name from
  164. the archive - for example, the latest stable OpenSSL will install as
  165. dist/openssl-0.9.8g
  166. You can (theoretically) use any version of OpenSSL you like - the
  167. build process will automatically select the latest version.
  168. You must also install ActivePerl from
  169. http://www.activestate.com/Products/ActivePerl/
  170. as this is used by the OpenSSL build process. Complain to them <wink>.
  171. The MSVC project simply invokes PC/VC6/build_ssl.py to perform
  172. the build. This Python script locates and builds your OpenSSL
  173. installation, then invokes a simple makefile to build the final .pyd.
  174. build_ssl.py attempts to catch the most common errors (such as not
  175. being able to find OpenSSL sources, or not being able to find a Perl
  176. that works with OpenSSL) and give a reasonable error message.
  177. If you have a problem that doesn't seem to be handled correctly
  178. (eg, you know you have ActivePerl but we can't find it), please take
  179. a peek at build_ssl.py and suggest patches. Note that build_ssl.py
  180. should be able to be run directly from the command-line.
  181. build_ssl.py/MSVC isn't clever enough to clean OpenSSL - you must do
  182. this by hand.
  183. YOUR OWN EXTENSION DLLs
  184. -----------------------
  185. If you want to create your own extension module DLL, there's an example
  186. with easy-to-follow instructions in ../PC/example/; read the file
  187. readme.txt there first.