Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 1 | Welcome to the "PC" subdirectory of the Python distribution! |
Guido van Rossum | e982ee3 | 1996-09-06 21:46:10 +0000 | [diff] [blame^] | 2 | ************************************************************ |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 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" |
| 10 | subdirectory. |
| 11 | |
| 12 | Be sure to read the documentation in the Python distribution. You |
| 13 | must set the environment variable PYTHONPATH to point to your Python |
| 14 | library directory. This is "../Lib", but you must use an absolute path, |
| 15 | and perhaps copy it somewhere else. Be sure to include the Windows |
| 16 | specific directory "win" too. If you use a DOS FAT file system and |
| 17 | either a DOS or Windows 3.1x Python version, you should also put |
| 18 | ../Lib/dos_8x3 on your PYTHONPATH too, since it has DOS 8x3 names |
| 19 | for the standard Python library names. So your autoexec.bat should have: |
| 20 | set PYTHONPATH=.;c:\python\lib;c:\python\lib\win |
| 21 | for Windows NT or |
| 22 | set PYTHONPATH=.;c:\python\lib;c:\python\lib\win;c:\python\lib\dos_8x3 |
| 23 | for DOS or Windows 3.1x (change the path to the correct path). |
| 24 | |
| 25 | There are several add-in modules to build Python programs which use |
| 26 | the native Windows operating environment. The ports here just make |
| 27 | "QuickWin" and DOS Python versions which support a character-mode |
| 28 | (console) environment. Look in www.python.org for Tkinter, PythonWin, |
| 29 | WPY and wxPython. |
| 30 | |
| 31 | To make a Python port, start the Integrated Development Environment |
| 32 | (IDE) of your compiler, and read in the native "project file" |
| 33 | (or makefile) provided. This will enable you to change any source |
| 34 | files or build settings so you can make custom builds. |
| 35 | |
| 36 | config.h An important configuration file specific to PC's. |
| 37 | |
| 38 | config.c The list of C modules to include in the Python PC |
| 39 | version. Manually edit this file to add or |
| 40 | remove Python modules. |
| 41 | |
| 42 | testpy.py A Python test program. Run this to test your |
| 43 | Python port. It should say "all tests OK". |
| 44 | |
| 45 | src A subdirectory used only for VC++ version 1.5 Python |
| 46 | source files. See below. The other compilers do not |
| 47 | use it. They reference the actual distribution |
| 48 | directories instead. |
| 49 | |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 50 | |
| 51 | Microsoft Visual C++ Version 4.0 (32-bit Windows) |
| 52 | ================================================= |
| 53 | |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame] | 54 | The distributed Makefile is vc40.mak. This file is distributed with |
| 55 | CRLF line separators, otherwise Developer Studio won't like it. It |
| 56 | will NOT work from this PC directory. To use it, first copy it to the |
| 57 | Python distribution directory, e.g. with this command: |
| 58 | copy vc40.mak .. |
| 59 | To convert the Makefile into a project file, start Developer Studio, |
| 60 | choose Open Workspace, change the file name pattern to *.mak, find and |
| 61 | select the file vc40.mak, and click OK. Developer Studio will create |
| 62 | additional project files vc40.ncb and vc40.mdp when you use the |
Guido van Rossum | e982ee3 | 1996-09-06 21:46:10 +0000 | [diff] [blame^] | 63 | project. The project contains six targets, which should be built in |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame] | 64 | this order: |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 65 | |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame] | 66 | python14 The Python core as a DLL, named python14.dll. |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 67 | |
Guido van Rossum | e982ee3 | 1996-09-06 21:46:10 +0000 | [diff] [blame^] | 68 | python The Python main program, named python.exe. This should |
| 69 | work as a console program under Windows 95 or NT, as well |
| 70 | as under Windows 3.1(1) when using win32s. It uses |
| 71 | python14.dll. |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 72 | |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame] | 73 | _tkinter The optional _tkinter extension, _tkinter.dll; see below. |
| 74 | |
Guido van Rossum | e982ee3 | 1996-09-06 21:46:10 +0000 | [diff] [blame^] | 75 | NumPy, multiarray, fast_umath |
| 76 | Optional projects to build Numerical Python. |
Guido van Rossum | cbc6676 | 1996-08-23 15:48:14 +0000 | [diff] [blame] | 77 | |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame] | 78 | ALl end products of the compilation are placed in the subdirectory |
| 79 | vc40 (which Developer Studio creates); object files are placed in |
| 80 | vc40/tmp. There are no separate Release and Debug project variants. |
| 81 | Note that the python and _tkinter projects require that the |
| 82 | python14.lib file exists in the vc40 subdirectory before they can be |
| 83 | built. |
| 84 | |
| 85 | *** How to build the _tkinter extension *** |
| 86 | |
Guido van Rossum | 983c552 | 1996-09-05 03:15:22 +0000 | [diff] [blame] | 87 | This assumes that you have installed the Tcl/Tk binary distribution for |
| 88 | Windows 95/NT with version numbers 7.5p1/4.1p1, in the default |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame] | 89 | installation location (C:\tcl). (Ftp to ftp.sunlabs.com in /pub/tcl, |
Guido van Rossum | 983c552 | 1996-09-05 03:15:22 +0000 | [diff] [blame] | 90 | file win41p1.exe.) You must also fetch and unpack the zip file |
| 91 | vclibs41.zip which contains the files tcl75.lib and tk41.lib, and place |
| 92 | those files in the PC subdirectory. In order to use _tkinter, the |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame] | 93 | Tkinter.py module must be on PYTHONPATH. It is found in the |
| 94 | Lib\tkinter subdirectory. |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 95 | |
Guido van Rossum | cbc6676 | 1996-08-23 15:48:14 +0000 | [diff] [blame] | 96 | *** How to build Numerical Python *** |
| 97 | |
| 98 | This has been tested only with NumPy 1.0alpha2. Unpack the NumPy |
| 99 | tarfile so that it creates a NumPy subdirectory in the Python |
| 100 | distribution directory. You need to create exports files |
| 101 | NumPy/multiarray.def and NumPy/fast_umath.def (see PC/_tkinter.def for |
| 102 | an example). Then build the targets NumPy, multiarray and fast_umath, |
| 103 | in that order. To use Numerical Python you have to append NumPy/Lib |
| 104 | to sys.path. |
| 105 | |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 106 | |
Guido van Rossum | e982ee3 | 1996-09-06 21:46:10 +0000 | [diff] [blame^] | 107 | Additional files and subdirectories for 32-bit Windows |
| 108 | ====================================================== |
| 109 | |
| 110 | python_nt.def Exports definition file for python14.dll. |
| 111 | |
| 112 | python_nt.rc Resource compiler input for python14.dll. |
| 113 | |
| 114 | dl_nt.c, getpath_nt.c, import_nt.c |
| 115 | Additional sources used for 32-bit Windows features. |
| 116 | |
| 117 | main_nt.c Source for python.exe. |
| 118 | |
| 119 | dllbase_nt.txt A (manually maintained) list of base addresses for |
| 120 | various DLLs, to avoid run-time relocation. |
| 121 | |
| 122 | _tkinter.def The export definitions file for _tkinter.dll. |
| 123 | |
| 124 | make_nt.in Include file for nmake-based builds (unsupported). |
| 125 | |
| 126 | example_nt A subdirectory showing how to build an extension as a |
| 127 | DLL. |
| 128 | |
| 129 | setup_nt A subdirectory containing an experimental installer |
| 130 | using Python only. |
| 131 | |
| 132 | |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 133 | Microsoft Visual C++ Version 1.5 (16-bit Windows) |
| 134 | ================================================= |
| 135 | |
| 136 | Since VC++1.5 does not handle long file names, it is necessary |
| 137 | to run the "makesrc.exe" program in this directory to copy |
| 138 | Python files from the distribution to the directory "src" |
| 139 | with shortened names. Included file names are shortened too. |
| 140 | Do this before you attempt to build Python. |
| 141 | |
| 142 | The "makesrc.exe" program is a native NT program, and you must |
| 143 | have NT, Windows 95 or Win32s to run it. Otherwise you will need |
| 144 | to copy distribution files to src yourself. |
| 145 | |
| 146 | The makefiles are named *.mak and are located in directories |
| 147 | starting with "vc15_". NOTE: When dependencies are scanned |
| 148 | VC++ will create dependencies for directories which are not |
| 149 | used because it fails to evaluate "#define" properly. You |
| 150 | must manaully edit makefiles (*.mak) to remove references to |
| 151 | "sys/" and other bad directories. |
| 152 | |
| 153 | vc15_lib A static Python library. Create this first because is |
| 154 | is required for vc15_w31. |
| 155 | |
| 156 | vc15_w31 A Windows 3.1x Python QuickWin (console-mode) |
| 157 | Python including sockets. Requires vc15_lib. |
Guido van Rossum | e982ee3 | 1996-09-06 21:46:10 +0000 | [diff] [blame^] | 158 | |
| 159 | |
| 160 | Watcom C++ Version 10.6 |
| 161 | ======================= |
| 162 | |
| 163 | The project file for the Watcom compiler is ./python.wpj. |
| 164 | It will build Watcom versions in the directories wat_*. |
| 165 | |
| 166 | wat_dos A 32-bit extended DOS Python (console-mode) using the |
| 167 | dos4gw DOS extender. Sockets are not included. |
| 168 | |
| 169 | wat_os2 A 32-bit OS/2 Python (console-mode). |
| 170 | Sockets are not included. |