blob: d6cd8fd600c51c6b1a393a97003819b02500c4a8 [file] [log] [blame]
Guido van Rossum082d2891997-05-16 16:24:09 +00001Welcome to the "PC" subdirectory of the Python distribution!
2************************************************************
3
4
5This "PC" subdirectory contains complete project files to make
6several PC ports of Python, as well as all the PC-specific
7Python source files. It should be located in the root of the
8Python distribution, and there should be directories "Modules",
9"Objects", "Python", etc. in the parent directory of this "PC"
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000010subdirectory. Be sure to read the documentation in the Python
11distribution.
Guido van Rossum082d2891997-05-16 16:24:09 +000012
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000013Python requires library files such as string.py to be available in
14one or more library directories. The search path of libraries is
15set up when Python starts. To see the current Python library search
16path, start Python and enter "import sys" and "print sys.path".
17
Guido van Rossum831c2581997-08-14 22:57:33 +000018All PC ports use this scheme to try to set up a module search path:
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000019
Guido van Rossum831c2581997-08-14 22:57:33 +000020 1) The script location; the current directory without script.
21 2) The PYTHONPATH variable, if set.
22 3) For Win32 platforms (NT/95), paths specified in the Registry.
23 4) Default directories lib, lib/win, lib/test, lib/tkinter;
24 these are searched relative to the environment variable
25 PYTHONHOME, if set, or relative to the executable and its
26 ancestors, if a landmark file (Lib/string.py) is found ,
27 or the current directory (not useful).
28 5) The directory containing the executable.
29
30The best installation strategy is to put the Python executable (and
31DLL, for Win32 platforms) in some convenient directory such as
32C:/python, and copy all library files and subdirectories (using XCOPY)
33to C:/python/lib. Then you don't need to set PYTHONPATH. Otherwise,
34set the environment variable PYTHONPATH to your Python search path.
35For example,
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000036 set PYTHONPATH=.;d:\python\lib;d:\python\lib\win;d:\python\lib\dos_8x3
37
Guido van Rossum082d2891997-05-16 16:24:09 +000038There are several add-in modules to build Python programs which use
39the native Windows operating environment. The ports here just make
40"QuickWin" and DOS Python versions which support a character-mode
41(console) environment. Look in www.python.org for Tkinter, PythonWin,
42WPY and wxPython.
43
44To make a Python port, start the Integrated Development Environment
45(IDE) of your compiler, and read in the native "project file"
46(or makefile) provided. This will enable you to change any source
47files or build settings so you can make custom builds.
48
49config.h An important configuration file specific to PC's.
50
51config.c The list of C modules to include in the Python PC
52 version. Manually edit this file to add or
53 remove Python modules.
54
55testpy.py A Python test program. Run this to test your
Guido van Rossum831c2581997-08-14 22:57:33 +000056 Python port. It should produce copious output,
57 ending in a report on how many tests were OK, how many
58 failed, and how many were skipped. Don't worry about
59 skipped tests (these test unavailable optional features).
Guido van Rossum082d2891997-05-16 16:24:09 +000060
61src A subdirectory used only for VC++ version 1.5 Python
62 source files. See below. The other compilers do not
63 use it. They reference the actual distribution
64 directories instead.
65
66
Guido van Rossume34b7de1997-05-19 20:01:57 +000067Microsoft Visual C++ Version 4.x (32-bit Windows)
Guido van Rossum082d2891997-05-16 16:24:09 +000068=================================================
69
Guido van Rossume34b7de1997-05-19 20:01:57 +000070(For historic reasons this uses the filename "vc40"; it has been tested
Guido van Rossum831c2581997-08-14 22:57:33 +000071most recently with VC 4.2. See below for VC 5.x.)
Guido van Rossum082d2891997-05-16 16:24:09 +000072
73The distributed Makefile is vc40.mak. This file is distributed with
74CRLF line separators, otherwise Developer Studio won't like it. It
75will NOT work from this PC directory. To use it, first copy it to the
76Python distribution directory, e.g. with this command:
77 copy vc40.mak ..
78To convert the Makefile into a project file, start Developer Studio,
79choose Open Workspace, change the file name pattern to *.mak, find and
80select the file vc40.mak, and click OK. Developer Studio will create
81additional project files vc40.ncb and vc40.mdp when you use the
82project. The project contains six targets, which should be built in
83this order:
84
Guido van Rossume34b7de1997-05-19 20:01:57 +000085python15 The Python core as a DLL, named python15.dll.
Guido van Rossum082d2891997-05-16 16:24:09 +000086
87python The Python main program, named python.exe. This should
88 work as a console program under Windows 95 or NT, as well
89 as under Windows 3.1(1) when using win32s. It uses
Guido van Rossume34b7de1997-05-19 20:01:57 +000090 python15.dll.
Guido van Rossum082d2891997-05-16 16:24:09 +000091
92_tkinter The optional _tkinter extension, _tkinter.dll; see below.
93
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000094All end products of the compilation are placed in the subdirectory
Guido van Rossum082d2891997-05-16 16:24:09 +000095vc40 (which Developer Studio creates); object files are placed in
96vc40/tmp. There are no separate Release and Debug project variants.
97Note that the python and _tkinter projects require that the
Guido van Rossume34b7de1997-05-19 20:01:57 +000098python15.lib file exists in the vc40 subdirectory before they can be
Guido van Rossum082d2891997-05-16 16:24:09 +000099built.
100
101*** How to build the _tkinter extension ***
102
103This assumes that you have installed the Tcl/Tk binary distribution for
104Windows 95/NT with version numbers 7.5p1/4.1p1, in the default
105installation location (C:\tcl). (Ftp to ftp.sunlabs.com in /pub/tcl,
106file win41p1.exe.) You must also fetch and unpack the zip file
107vclibs41.zip which contains the files tcl75.lib and tk41.lib, and place
108those files in the PC subdirectory. In order to use _tkinter, the
109Tkinter.py module must be on PYTHONPATH. It is found in the
110Lib\tkinter subdirectory.
111
Guido van Rossum831c2581997-08-14 22:57:33 +0000112Microsoft Visual C++ Version 5.x (Developer Studio)
113===================================================
114
115For Visual C++ 5.x (Developer Studio) the instructions are somewhat
116different again. Three project files (*.dsp) and a workspace file
117(pcbuild.dsw) are provided in the subdirectory vc5x. (These are the
118same three subprojects as discussed for VC++ 4.x.)
119
Guido van Rossumfd910561997-09-03 16:11:19 +0000120To use these, copy the files from vc5x to the toplevel PCbuild
121directory. Then open the pcbuild.dsw workspace file with Developer
122Studio. Select the Debug configuration (use Set Active
123Configuration... in the Build menu) and build the python15 and python
124projects (in that order). If you have Tcl/Tk 8.0 installed you can
125also try building the _tkinter project. If you plan to use the parser
126module, also build that project.
Guido van Rossum831c2581997-08-14 22:57:33 +0000127
Guido van Rossum082d2891997-05-16 16:24:09 +0000128
129Additional files and subdirectories for 32-bit Windows
130======================================================
131
Guido van Rossume34b7de1997-05-19 20:01:57 +0000132python_nt.def Exports definition file for python15.dll.
Guido van Rossum082d2891997-05-16 16:24:09 +0000133
Guido van Rossume34b7de1997-05-19 20:01:57 +0000134python_nt.rc Resource compiler input for python15.dll.
Guido van Rossum082d2891997-05-16 16:24:09 +0000135
Guido van Rossum831c2581997-08-14 22:57:33 +0000136dl_nt.c, import_nt.c
Guido van Rossum082d2891997-05-16 16:24:09 +0000137 Additional sources used for 32-bit Windows features.
138
Guido van Rossum831c2581997-08-14 22:57:33 +0000139getpathp.c Default sys.path calculations (for all PC platforms).
Guido van Rossum082d2891997-05-16 16:24:09 +0000140
141dllbase_nt.txt A (manually maintained) list of base addresses for
142 various DLLs, to avoid run-time relocation.
143
144_tkinter.def The export definitions file for _tkinter.dll.
Guido van Rossum831c2581997-08-14 22:57:33 +0000145 (No longer needed; the /export:init_tkinter takes care
146 of this.)
Guido van Rossum082d2891997-05-16 16:24:09 +0000147
148make_nt.in Include file for nmake-based builds (unsupported).
149
150example_nt A subdirectory showing how to build an extension as a
151 DLL.
152
153setup_nt A subdirectory containing an experimental installer
154 using Python only.
155
156
157Microsoft Visual C++ Version 1.5 (16-bit Windows)
158=================================================
159
160Since VC++1.5 does not handle long file names, it is necessary
161to run the "makesrc.exe" program in this directory to copy
162Python files from the distribution to the directory "src"
163with shortened names. Included file names are shortened too.
164Do this before you attempt to build Python.
165
166The "makesrc.exe" program is a native NT program, and you must
167have NT, Windows 95 or Win32s to run it. Otherwise you will need
168to copy distribution files to src yourself.
169
170The makefiles are named *.mak and are located in directories
171starting with "vc15_". NOTE: When dependencies are scanned
172VC++ will create dependencies for directories which are not
173used because it fails to evaluate "#define" properly. You
174must manaully edit makefiles (*.mak) to remove references to
175"sys/" and other bad directories.
176
177vc15_lib A static Python library. Create this first because is
178 is required for vc15_w31.
179
180vc15_w31 A Windows 3.1x Python QuickWin (console-mode)
181 Python including sockets. Requires vc15_lib.
182
183
184Watcom C++ Version 10.6
185=======================
186
187The project file for the Watcom compiler is ./python.wpj.
188It will build Watcom versions in the directories wat_*.
189
190wat_dos A 32-bit extended DOS Python (console-mode) using the
191 dos4gw DOS extender. Sockets are not included.
192
193wat_os2 A 32-bit OS/2 Python (console-mode).
194 Sockets are not included.