| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | How to build Python from a source distribution. | 
					
						
							|  |  |  |  | ----------------------------------------------- | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | You will need a Python source distribution in tar form. So, the | 
					
						
							|  |  |  |  | first thing you need is a tar program for the mac. Suntar is | 
					
						
							|  |  |  |  | reasonable and can be found at the info-mac sites. Edit the | 
					
						
							|  |  |  |  | preferences to make it extract C sources with creator CWIE | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | and .py files as text files with creator Pyth, this will save | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | you work later. | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | You will also need CodeWarrior 8. If you have another development | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | environment you are on your own, basically. | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | You may also need the img distribution and the stdwin distribution. | 
					
						
							|  |  |  |  | If you don't want them you may have to edit some of the projects | 
					
						
							|  |  |  |  | to remove references to them. | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | When you've extracted everything you may have to unpack the | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | .hqx files in Mac:Resources and Mac:mwerks:Projects (but suntar | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | may have done this for you already). | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | You have to remove Modules:fmmodule.c, the SGI fm module, which has a | 
					
						
							|  |  |  |  | name conflict with the Mac Fmmodule.c. | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | Next, create your build directories. I use the following naming | 
					
						
							|  |  |  |  | convention: | 
					
						
							|  |  |  |  | build.macppc.shared		PowerPC shared-library | 
					
						
							|  |  |  |  | build.mac68k.stand		68K non-shared | 
					
						
							|  |  |  |  | and there are also projects for ppc standalone and some others, they | 
					
						
							|  |  |  |  | may be useful at times. The project files expect the build directories | 
					
						
							|  |  |  |  | to be located right in the main python folder, if you put them elsewhere | 
					
						
							|  |  |  |  | you will have to edit the access paths. | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | Move MWCPythonCoreRuntime.<2E>, PythonCore.<2E>, PythonPPC.<2E> and | 
					
						
							|  |  |  |  | PythonApplet.<2E> (from the Mac:mwerks:projects folder) to | 
					
						
							|  |  |  |  | build.macppc.shared, move Python68K.<2E> to build.mac68k.stand. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | Build the projects. For the PPC projects, keep the order given above. | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | Do *not* run the python interpreter yet. First, move the interpreter | 
					
						
							|  |  |  |  | to the main python folder. For PPC, also move PythonCore to the main | 
					
						
							|  |  |  |  | python folder. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | Now try your python interpreter, this will create an initial | 
					
						
							|  |  |  |  | preferences file. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | For 68K python you are now done. | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | For PPC Python, don't try complicated scripts yet, you first have to | 
					
						
							|  |  |  |  | create the dynamically loadable modules. Create a folder PlugIns (in | 
					
						
							|  |  |  |  | the toplevel python folder) and move all the projects that have | 
					
						
							|  |  |  |  | "module" or "modules" in their name there. Build these projects. This | 
					
						
							|  |  |  |  | will create a number of ".exp" files, edit these files to contain only | 
					
						
							|  |  |  |  | all the "init" modules, and build the projects again. This latter step | 
					
						
							|  |  |  |  | isn't really essential, so feel free to skip it. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | The next step is to create aliases for the various modules that "live | 
					
						
							|  |  |  |  | together" in one shared library. For this, take MkPluginAliases.py and | 
					
						
							|  |  |  |  | MkPluginAliases.rsrc from the Mac:scripts folder and move or copy them | 
					
						
							|  |  |  |  | to the python home folder.  Run the script from there. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | If you haven't created all plugins you'll get some errors about files | 
					
						
							|  |  |  |  | not existing, don't worry. Don't forget to move the scripts back. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | Next, make an alias of PythonCore (also named PythonCore) and put it | 
					
						
							|  |  |  |  | in System Folder:Extensions. This will ensure that you can run python | 
					
						
							|  |  |  |  | anywhere, not just from the folder where PythonCore lives. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | Most of your environment is now setup. You can try it by running | 
					
						
							|  |  |  |  | EditPythonPrefs.py (in Mac:scripts), it should now work from there. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | Lastly, you should setup some stuff needed for applet creation. First, | 
					
						
							|  |  |  |  | you should put PythonApplet (or an alias to it) in the python home | 
					
						
							|  |  |  |  | folder. Next, you should turn mkapplet.py (from mac:scripts) into an | 
					
						
							|  |  |  |  | applet itself: double-click it and give it itself as input in the | 
					
						
							|  |  |  |  | input file dialog. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | Now that you have created mkapplet you can use this as a droplet: | 
					
						
							|  |  |  |  | drag-and-drop python sources onto it (EditPythonPrefs.py and | 
					
						
							|  |  |  |  | RunLibScript.py come to mind) and the applets will be created. | 
					
						
							| 
									
										
										
										
											1995-12-21 15:40:26 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-03-20 16:27:30 +00:00
										 |  |  |  | 			Jack Jansen, CWI, 18 March 1996.  |