Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 1 | Welcome to the "PC" subdirectory of the Python distribution!
|
| 2 | ************************************************************
|
| 3 |
|
| 4 |
|
| 5 | This "PC" subdirectory contains complete project files to make
|
| 6 | several PC ports of Python, as well as all the PC-specific
|
| 7 | Python source files. It should be located in the root of the
|
| 8 | Python distribution, and there should be directories "Modules",
|
| 9 | "Objects", "Python", etc. in the parent directory of this "PC"
|
Guido van Rossum | 1aa7e3a | 1997-05-19 14:16:21 +0000 | [diff] [blame] | 10 | subdirectory. Be sure to read the documentation in the Python
|
| 11 | distribution.
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 12 |
|
Guido van Rossum | 1aa7e3a | 1997-05-19 14:16:21 +0000 | [diff] [blame] | 13 | Python requires library files such as string.py to be available in
|
| 14 | one or more library directories. The search path of libraries is
|
| 15 | set up when Python starts. To see the current Python library search
|
| 16 | path, start Python and enter "import sys" and "print sys.path".
|
| 17 |
|
| 18 | All PC ports except Windows 95/NT use this scheme to try to set up
|
| 19 | a search path:
|
| 20 | 1) If the Python executable (for example, py_dos.exe) is located
|
| 21 | in a subdirectory of the Python root (..), then those library
|
| 22 | files are used (../Lib) to generate the path.
|
| 23 | 2) Otherwise the environment variable PYTHONPATH is the search path.
|
| 24 | 3) Otherwise the directory "lib" in the directory of the executable
|
| 25 | file is used to generate the path.
|
| 26 | 4) Otherwise, the current directory is used (not useful).
|
| 27 |
|
| 28 | The best installation strategy (except NT) is to put the Python
|
| 29 | executable in some convenient directory such as C:/python, and
|
| 30 | copy all library files and subdirectories (using XCOPY) to C:/python/lib.
|
| 31 | Then you don't need to set PYTHONPATH. Otherwise, set the environment
|
| 32 | variable PYTHONPATH to your Python search path. For example,
|
| 33 | set PYTHONPATH=.;d:\python\lib;d:\python\lib\win;d:\python\lib\dos_8x3
|
| 34 |
|
| 35 | Python for Windows 95/NT uses the same PYTHONPATH environment variable, plus
|
| 36 | the Python path recorded in the registry.
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 37 |
|
| 38 | There are several add-in modules to build Python programs which use
|
| 39 | the 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,
|
| 42 | WPY and wxPython.
|
| 43 |
|
| 44 | To 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
|
| 47 | files or build settings so you can make custom builds.
|
| 48 |
|
| 49 | config.h An important configuration file specific to PC's.
|
| 50 |
|
| 51 | config.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 |
|
| 55 | testpy.py A Python test program. Run this to test your
|
| 56 | Python port. It should say "all tests OK".
|
| 57 |
|
| 58 | src A subdirectory used only for VC++ version 1.5 Python
|
| 59 | source files. See below. The other compilers do not
|
| 60 | use it. They reference the actual distribution
|
| 61 | directories instead.
|
| 62 |
|
| 63 |
|
Guido van Rossum | e34b7de | 1997-05-19 20:01:57 +0000 | [diff] [blame] | 64 | Microsoft Visual C++ Version 4.x (32-bit Windows)
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 65 | =================================================
|
| 66 |
|
Guido van Rossum | e34b7de | 1997-05-19 20:01:57 +0000 | [diff] [blame] | 67 | (For historic reasons this uses the filename "vc40"; it has been tested
|
| 68 | most recently with VC 4.2. VC 5.x should be able to convert it.)
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 69 |
|
| 70 | The distributed Makefile is vc40.mak. This file is distributed with
|
| 71 | CRLF line separators, otherwise Developer Studio won't like it. It
|
| 72 | will NOT work from this PC directory. To use it, first copy it to the
|
| 73 | Python distribution directory, e.g. with this command:
|
| 74 | copy vc40.mak ..
|
| 75 | To convert the Makefile into a project file, start Developer Studio,
|
| 76 | choose Open Workspace, change the file name pattern to *.mak, find and
|
| 77 | select the file vc40.mak, and click OK. Developer Studio will create
|
| 78 | additional project files vc40.ncb and vc40.mdp when you use the
|
| 79 | project. The project contains six targets, which should be built in
|
| 80 | this order:
|
| 81 |
|
Guido van Rossum | e34b7de | 1997-05-19 20:01:57 +0000 | [diff] [blame] | 82 | python15 The Python core as a DLL, named python15.dll.
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 83 |
|
| 84 | python The Python main program, named python.exe. This should
|
| 85 | work as a console program under Windows 95 or NT, as well
|
| 86 | as under Windows 3.1(1) when using win32s. It uses
|
Guido van Rossum | e34b7de | 1997-05-19 20:01:57 +0000 | [diff] [blame] | 87 | python15.dll.
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 88 |
|
| 89 | _tkinter The optional _tkinter extension, _tkinter.dll; see below.
|
| 90 |
|
Guido van Rossum | 1aa7e3a | 1997-05-19 14:16:21 +0000 | [diff] [blame] | 91 | All end products of the compilation are placed in the subdirectory
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 92 | vc40 (which Developer Studio creates); object files are placed in
|
| 93 | vc40/tmp. There are no separate Release and Debug project variants.
|
| 94 | Note that the python and _tkinter projects require that the
|
Guido van Rossum | e34b7de | 1997-05-19 20:01:57 +0000 | [diff] [blame] | 95 | python15.lib file exists in the vc40 subdirectory before they can be
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 96 | built.
|
| 97 |
|
| 98 | *** How to build the _tkinter extension ***
|
| 99 |
|
| 100 | This assumes that you have installed the Tcl/Tk binary distribution for
|
| 101 | Windows 95/NT with version numbers 7.5p1/4.1p1, in the default
|
| 102 | installation location (C:\tcl). (Ftp to ftp.sunlabs.com in /pub/tcl,
|
| 103 | file win41p1.exe.) You must also fetch and unpack the zip file
|
| 104 | vclibs41.zip which contains the files tcl75.lib and tk41.lib, and place
|
| 105 | those files in the PC subdirectory. In order to use _tkinter, the
|
| 106 | Tkinter.py module must be on PYTHONPATH. It is found in the
|
| 107 | Lib\tkinter subdirectory.
|
| 108 |
|
| 109 |
|
| 110 | Additional files and subdirectories for 32-bit Windows
|
| 111 | ======================================================
|
| 112 |
|
Guido van Rossum | e34b7de | 1997-05-19 20:01:57 +0000 | [diff] [blame] | 113 | python_nt.def Exports definition file for python15.dll.
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 114 |
|
Guido van Rossum | e34b7de | 1997-05-19 20:01:57 +0000 | [diff] [blame] | 115 | python_nt.rc Resource compiler input for python15.dll.
|
Guido van Rossum | 082d289 | 1997-05-16 16:24:09 +0000 | [diff] [blame] | 116 |
|
| 117 | dl_nt.c, getpath_nt.c, import_nt.c
|
| 118 | Additional sources used for 32-bit Windows features.
|
| 119 |
|
| 120 | main_nt.c Source for python.exe.
|
| 121 |
|
| 122 | dllbase_nt.txt A (manually maintained) list of base addresses for
|
| 123 | various DLLs, to avoid run-time relocation.
|
| 124 |
|
| 125 | _tkinter.def The export definitions file for _tkinter.dll.
|
| 126 |
|
| 127 | make_nt.in Include file for nmake-based builds (unsupported).
|
| 128 |
|
| 129 | example_nt A subdirectory showing how to build an extension as a
|
| 130 | DLL.
|
| 131 |
|
| 132 | setup_nt A subdirectory containing an experimental installer
|
| 133 | using Python only.
|
| 134 |
|
| 135 |
|
| 136 | Microsoft Visual C++ Version 1.5 (16-bit Windows)
|
| 137 | =================================================
|
| 138 |
|
| 139 | Since VC++1.5 does not handle long file names, it is necessary
|
| 140 | to run the "makesrc.exe" program in this directory to copy
|
| 141 | Python files from the distribution to the directory "src"
|
| 142 | with shortened names. Included file names are shortened too.
|
| 143 | Do this before you attempt to build Python.
|
| 144 |
|
| 145 | The "makesrc.exe" program is a native NT program, and you must
|
| 146 | have NT, Windows 95 or Win32s to run it. Otherwise you will need
|
| 147 | to copy distribution files to src yourself.
|
| 148 |
|
| 149 | The makefiles are named *.mak and are located in directories
|
| 150 | starting with "vc15_". NOTE: When dependencies are scanned
|
| 151 | VC++ will create dependencies for directories which are not
|
| 152 | used because it fails to evaluate "#define" properly. You
|
| 153 | must manaully edit makefiles (*.mak) to remove references to
|
| 154 | "sys/" and other bad directories.
|
| 155 |
|
| 156 | vc15_lib A static Python library. Create this first because is
|
| 157 | is required for vc15_w31.
|
| 158 |
|
| 159 | vc15_w31 A Windows 3.1x Python QuickWin (console-mode)
|
| 160 | Python including sockets. Requires vc15_lib.
|
| 161 |
|
| 162 |
|
| 163 | Watcom C++ Version 10.6
|
| 164 | =======================
|
| 165 |
|
| 166 | The project file for the Watcom compiler is ./python.wpj.
|
| 167 | It will build Watcom versions in the directories wat_*.
|
| 168 |
|
| 169 | wat_dos A 32-bit extended DOS Python (console-mode) using the
|
| 170 | dos4gw DOS extender. Sockets are not included.
|
| 171 |
|
| 172 | wat_os2 A 32-bit OS/2 Python (console-mode).
|
| 173 | Sockets are not included.
|