Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 1 | Welcome to the "PC" subdirectory of the Python distribution! |
| 2 | |
| 3 | |
| 4 | This "PC" subdirectory contains complete project files to make |
| 5 | several PC ports of Python, as well as all the PC-specific |
| 6 | Python source files. It should be located in the root of the |
| 7 | Python distribution, and there should be directories "Modules", |
| 8 | "Objects", "Python", etc. in the parent directory of this "PC" |
| 9 | subdirectory. |
| 10 | |
| 11 | Be sure to read the documentation in the Python distribution. You |
| 12 | must set the environment variable PYTHONPATH to point to your Python |
| 13 | library directory. This is "../Lib", but you must use an absolute path, |
| 14 | and perhaps copy it somewhere else. Be sure to include the Windows |
| 15 | specific directory "win" too. If you use a DOS FAT file system and |
| 16 | either a DOS or Windows 3.1x Python version, you should also put |
| 17 | ../Lib/dos_8x3 on your PYTHONPATH too, since it has DOS 8x3 names |
| 18 | for the standard Python library names. So your autoexec.bat should have: |
| 19 | set PYTHONPATH=.;c:\python\lib;c:\python\lib\win |
| 20 | for Windows NT or |
| 21 | set PYTHONPATH=.;c:\python\lib;c:\python\lib\win;c:\python\lib\dos_8x3 |
| 22 | for DOS or Windows 3.1x (change the path to the correct path). |
| 23 | |
| 24 | There are several add-in modules to build Python programs which use |
| 25 | the native Windows operating environment. The ports here just make |
| 26 | "QuickWin" and DOS Python versions which support a character-mode |
| 27 | (console) environment. Look in www.python.org for Tkinter, PythonWin, |
| 28 | WPY and wxPython. |
| 29 | |
| 30 | To make a Python port, start the Integrated Development Environment |
| 31 | (IDE) of your compiler, and read in the native "project file" |
| 32 | (or makefile) provided. This will enable you to change any source |
| 33 | files or build settings so you can make custom builds. |
| 34 | |
| 35 | config.h An important configuration file specific to PC's. |
| 36 | |
| 37 | config.c The list of C modules to include in the Python PC |
| 38 | version. Manually edit this file to add or |
| 39 | remove Python modules. |
| 40 | |
| 41 | testpy.py A Python test program. Run this to test your |
| 42 | Python port. It should say "all tests OK". |
| 43 | |
| 44 | src A subdirectory used only for VC++ version 1.5 Python |
| 45 | source files. See below. The other compilers do not |
| 46 | use it. They reference the actual distribution |
| 47 | directories instead. |
| 48 | |
| 49 | Watcom C++ Version 10.6 |
| 50 | ======================= |
| 51 | |
| 52 | The project file for the Watcom compiler is ./python.wpj. |
| 53 | It will build Watcom versions in the directories wat_*. |
| 54 | |
| 55 | wat_dos A 32-bit extended DOS Python (console-mode) using the |
| 56 | dos4gw DOS extender. Sockets are not included. |
| 57 | |
| 58 | wat_os2 A 32-bit OS/2 Python (console-mode). |
| 59 | Sockets are not included. |
| 60 | |
| 61 | |
| 62 | Microsoft Visual C++ Version 4.0 (32-bit Windows) |
| 63 | ================================================= |
| 64 | |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame^] | 65 | The distributed Makefile is vc40.mak. This file is distributed with |
| 66 | CRLF line separators, otherwise Developer Studio won't like it. It |
| 67 | will NOT work from this PC directory. To use it, first copy it to the |
| 68 | Python distribution directory, e.g. with this command: |
| 69 | copy vc40.mak .. |
| 70 | To convert the Makefile into a project file, start Developer Studio, |
| 71 | choose Open Workspace, change the file name pattern to *.mak, find and |
| 72 | select the file vc40.mak, and click OK. Developer Studio will create |
| 73 | additional project files vc40.ncb and vc40.mdp when you use the |
| 74 | project. The project contains three targets, which should be built in |
| 75 | this order: |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 76 | |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame^] | 77 | python14 The Python core as a DLL, named python14.dll. |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 78 | |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame^] | 79 | python The Python main program, named python.exe. This should |
| 80 | work as a console program under Windows 95 or NT, as well |
| 81 | as under Windows 3.1(1) when using win32s. It uses |
| 82 | python14.dll. |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 83 | |
Guido van Rossum | 331a897 | 1996-08-22 00:28:34 +0000 | [diff] [blame^] | 84 | _tkinter The optional _tkinter extension, _tkinter.dll; see below. |
| 85 | |
| 86 | ALl end products of the compilation are placed in the subdirectory |
| 87 | vc40 (which Developer Studio creates); object files are placed in |
| 88 | vc40/tmp. There are no separate Release and Debug project variants. |
| 89 | Note that the python and _tkinter projects require that the |
| 90 | python14.lib file exists in the vc40 subdirectory before they can be |
| 91 | built. |
| 92 | |
| 93 | *** How to build the _tkinter extension *** |
| 94 | |
| 95 | This assumes that you have installed the Tcl/Tk binary distribution |
| 96 | for Windows 95/NT with version numbers 7.5p1/4.1p1, in the default |
| 97 | installation location (C:\tcl). (Ftp to ftp.sunlabs.com in /pub/tcl, |
| 98 | file win41p1.exe.) You must also have fetched and unpacked the zip |
| 99 | file vclibs41.zip which contains the files tcl75.lib and tk41.lib, and |
| 100 | placed those files in C:\tcl\bin. In order to use _tkinter, the |
| 101 | Tkinter.py module must be on PYTHONPATH. It is found in the |
| 102 | Lib\tkinter subdirectory. |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 103 | |
| 104 | |
| 105 | Microsoft Visual C++ Version 1.5 (16-bit Windows) |
| 106 | ================================================= |
| 107 | |
| 108 | Since VC++1.5 does not handle long file names, it is necessary |
| 109 | to run the "makesrc.exe" program in this directory to copy |
| 110 | Python files from the distribution to the directory "src" |
| 111 | with shortened names. Included file names are shortened too. |
| 112 | Do this before you attempt to build Python. |
| 113 | |
| 114 | The "makesrc.exe" program is a native NT program, and you must |
| 115 | have NT, Windows 95 or Win32s to run it. Otherwise you will need |
| 116 | to copy distribution files to src yourself. |
| 117 | |
| 118 | The makefiles are named *.mak and are located in directories |
| 119 | starting with "vc15_". NOTE: When dependencies are scanned |
| 120 | VC++ will create dependencies for directories which are not |
| 121 | used because it fails to evaluate "#define" properly. You |
| 122 | must manaully edit makefiles (*.mak) to remove references to |
| 123 | "sys/" and other bad directories. |
| 124 | |
| 125 | vc15_lib A static Python library. Create this first because is |
| 126 | is required for vc15_w31. |
| 127 | |
| 128 | vc15_w31 A Windows 3.1x Python QuickWin (console-mode) |
| 129 | Python including sockets. Requires vc15_lib. |