| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 1 | How to build Python from a source distribution. | 
 | 2 | ----------------------------------------------- | 
 | 3 |  | 
 | 4 | You will need a Python source distribution in tar form. So, the | 
 | 5 | first thing you need is a tar program for the mac. Suntar is | 
 | 6 | reasonable and can be found at the info-mac sites. Edit the | 
 | 7 | preferences to make it extract C sources with creator CWIE | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 8 | and .py files as text files with creator Pyth, this will save | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 9 | you work later. | 
 | 10 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 11 | You will also need CodeWarrior 8. If you have another development | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 12 | environment you are on your own, basically. | 
 | 13 |  | 
 | 14 | You may also need the img distribution and the stdwin distribution. | 
 | 15 | If you don't want them you may have to edit some of the projects | 
 | 16 | to remove references to them. | 
 | 17 |  | 
 | 18 | When you've extracted everything you may have to unpack the | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 19 | .hqx files in Mac:Resources and Mac:mwerks:Projects (but suntar | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 20 | may have done this for you already). | 
 | 21 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 22 | You have to remove Modules:fmmodule.c, the SGI fm module, which has a | 
 | 23 | name conflict with the Mac Fmmodule.c. | 
 | 24 |  | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 25 | Next, create your build directories. I use the following naming | 
 | 26 | convention: | 
 | 27 | build.macppc.shared		PowerPC shared-library | 
 | 28 | build.mac68k.stand		68K non-shared | 
 | 29 | and there are also projects for ppc standalone and some others, they | 
 | 30 | may be useful at times. The project files expect the build directories | 
 | 31 | to be located right in the main python folder, if you put them elsewhere | 
 | 32 | you will have to edit the access paths. | 
 | 33 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 34 | Move MWCPythonCoreRuntime.µ, PythonCore.µ, PythonPPC.µ and | 
 | 35 | PythonApplet.µ (from the Mac:mwerks:projects folder) to | 
 | 36 | build.macppc.shared, move Python68K.µ to build.mac68k.stand. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 37 |  | 
 | 38 | Build the projects. For the PPC projects, keep the order given above. | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 39 | Do *not* run the python interpreter yet. First, move the interpreter | 
 | 40 | to the main python folder. For PPC, also move PythonCore to the main | 
 | 41 | python folder. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 42 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 43 | Now try your python interpreter, this will create an initial | 
 | 44 | preferences file. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 45 |  | 
 | 46 | For 68K python you are now done. | 
 | 47 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 48 | For PPC Python, don't try complicated scripts yet, you first have to | 
 | 49 | create the dynamically loadable modules. Create a folder PlugIns (in | 
 | 50 | the toplevel python folder) and move all the projects that have | 
 | 51 | "module" or "modules" in their name there. Build these projects. This | 
 | 52 | will create a number of ".exp" files, edit these files to contain only | 
 | 53 | all the "init" modules, and build the projects again. This latter step | 
 | 54 | isn't really essential, so feel free to skip it. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 55 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 56 | The next step is to create aliases for the various modules that "live | 
 | 57 | together" in one shared library. For this, take MkPluginAliases.py and | 
 | 58 | MkPluginAliases.rsrc from the Mac:scripts folder and move or copy them | 
 | 59 | to the python home folder.  Run the script from there. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 60 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 61 | If you haven't created all plugins you'll get some errors about files | 
 | 62 | not existing, don't worry. Don't forget to move the scripts back. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 63 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 64 | Next, make an alias of PythonCore (also named PythonCore) and put it | 
 | 65 | in System Folder:Extensions. This will ensure that you can run python | 
 | 66 | anywhere, not just from the folder where PythonCore lives. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 67 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 68 | Most of your environment is now setup. You can try it by running | 
 | 69 | EditPythonPrefs.py (in Mac:scripts), it should now work from there. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 70 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 71 | Lastly, you should setup some stuff needed for applet creation. First, | 
 | 72 | you should put PythonApplet (or an alias to it) in the python home | 
 | 73 | folder. Next, you should turn mkapplet.py (from mac:scripts) into an | 
 | 74 | applet itself: double-click it and give it itself as input in the | 
 | 75 | input file dialog. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 76 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 77 | Now that you have created mkapplet you can use this as a droplet: | 
 | 78 | drag-and-drop python sources onto it (EditPythonPrefs.py and | 
 | 79 | RunLibScript.py come to mind) and the applets will be created. | 
| Jack Jansen | b678975 | 1995-12-21 15:40:26 +0000 | [diff] [blame] | 80 |  | 
| Jack Jansen | 857e88e | 1996-03-20 16:27:30 +0000 | [diff] [blame] | 81 | 			Jack Jansen, CWI, 18 March 1996.  |