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