blob: 06cf3990d2515b3eb9edb768af2ec0df69850375 [file] [log] [blame]
Jack Jansen8f2d8021996-08-05 15:34:45 +00001<HTML>
2<HEAD>
Jack Jansen3e828722003-01-08 16:27:44 +00003<TITLE>Building MacPython-OS9 from source</TITLE>
Jack Jansen8f2d8021996-08-05 15:34:45 +00004</HEAD>
5<BODY>
Jack Jansen3e828722003-01-08 16:27:44 +00006<H1>Building MacPython-OS9 from source</H1>
Jack Jansen8f2d8021996-08-05 15:34:45 +00007<HR>
Jack Jansen8f2d8021996-08-05 15:34:45 +00008
Jack Jansen3e828722003-01-08 16:27:44 +00009This document explains how to build MacPython-OS9 from source. This is
Jack Jansen8a6cdcc2000-09-10 12:02:28 +000010necessary if you want to make modifications to the Python core. Building
11Python is not something to be undertaken lightly, you need a reasonable
12working knowledge of the CodeWarrior development environment, a good net
Jack Jansen4c1e56c1996-08-06 16:16:20 +000013connection and probably quite some time too. <p>
Jack Jansen8f2d8021996-08-05 15:34:45 +000014
Jack Jansene0b1e6a2002-01-08 23:03:45 +000015Note that if you only want to build new extension modules you don't need to
16build Python from source, see the <a href="#extending">note on extending Python</a>.<p>
17
Jack Jansen4c1e56c1996-08-06 16:16:20 +000018The information density in this file is high, so you should probably
19print it and read it at your leasure. Most things are explained only
20once (and probably in the wrong place:-). <p>
21
Jack Jansen90cf4912000-02-11 23:14:46 +000022<blockquote>
23First a warning: this information may become outdated if a new CodeWarrior is
24released after MacPython. The
25<a href="http://www.cwi.nl/~jack/macpython.html">MacPython homepage</a> will
Jack Jansen3e828722003-01-08 16:27:44 +000026hopefully have updated instructions in that case. These instructions are for CW7,
27it is rumoured you may encounter some problems with newer versions of CodeWarrior.
Jack Jansen90cf4912000-02-11 23:14:46 +000028</blockquote>
29
Jack Jansen3e828722003-01-08 16:27:44 +000030I am interested in feedback on this document, send your
Jack Jansen4c1e56c1996-08-06 16:16:20 +000031comments to the <A
32HREF="http://www.python.org/sigs/pythonmac-sig/">Mac Python Special
33Interest Group</A>.
Jack Jansen8f2d8021996-08-05 15:34:45 +000034
35<H2>What you need.</H2>
36
37The following things you definitely need:
38
39<UL>
Jack Jansen8f2d8021996-08-05 15:34:45 +000040
Jack Jansen4c1e56c1996-08-06 16:16:20 +000041<LI> You need a MacPython source distribution, of course. You can
Jack Jansen16904092001-08-16 14:10:56 +000042obtain one via <A HREF="http://www.cwi.nl/~jack/macpython.html">
43http://www.cwi.nl/~jack/macpython.html</A> (which has up-to-date links
Jack Jansen95375861999-03-10 15:51:56 +000044to the other packages needed too) and possibly also from the standard
45<A HREF="ftp://ftp.python.org/pub/python/mac">python.org ftp
Jack Jansen8a6cdcc2000-09-10 12:02:28 +000046site</A>. <BR>
Jack Jansenc256ece1999-02-03 13:09:27 +000047
Jack Jansen8a6cdcc2000-09-10 12:02:28 +000048A better alternative is to check the sources straight out of the CVS
Jack Jansen95375861999-03-10 15:51:56 +000049repository, see below. Most of the packages mentioned here are also
50available through CVS. Check the section on <a href="#cvs">CVS
51repository use</a> below.
Jack Jansen8f2d8021996-08-05 15:34:45 +000052
Jack Jansen4c1e56c1996-08-06 16:16:20 +000053<LI> You need MetroWerks CodeWarrior. The current distribution has
Jack Jansene0b1e6a2002-01-08 23:03:45 +000054been built with CodeWarrior Pro 7.1. Ordering information is
Jack Jansen4c1e56c1996-08-06 16:16:20 +000055available on the <A HREF="http://www.metrowerks.com/">MetroWerks
Jack Jansen16904092001-08-16 14:10:56 +000056homepage</A>. Building Python with MPW, Think/Symantec C or the OSX
57developer tools is impossible without major surgery.
Jack Jansen4c1e56c1996-08-06 16:16:20 +000058
Jack Jansen8a6cdcc2000-09-10 12:02:28 +000059<LI> You need GUSI version 2, the Grand Unified Socket Interface, by
60Matthias Neeracher. The original GUSI is obtainable from <A
Jack Jansen5f884c02000-12-12 22:14:14 +000061HREF="ftp://gusi.sourceforge.net/pub/gusi/">
62ftp://gusi.sourceforge.net/pub/gusi/</A>. At
Jack Jansene0b1e6a2002-01-08 23:03:45 +000063the moment Python is built with a modified version of GUSI
64with Carbon adaptations, so it may be better to check the <A
Jack Jansen8a6cdcc2000-09-10 12:02:28 +000065HREF="http://www.cwi.nl/~jack/macpython.html">MacPython homepage</A>
66for a GUSI that is most easily used for building Python.
Jack Jansena598bc41999-02-10 23:08:24 +000067
Jack Jansen8f2d8021996-08-05 15:34:45 +000068</UL>
69
Jack Jansen4c1e56c1996-08-06 16:16:20 +000070<A NAME="optional">The MacPython project files are configured to
71include a plethora of optional modules</A>, and these modules need a
Jack Jansena2139fe1998-02-25 15:40:35 +000072number of extra packages. To use the project files as-is you have to
Jack Jansen8a6cdcc2000-09-10 12:02:28 +000073download these packages too. Python has all such modules as
Jack Jansen4c1e56c1996-08-06 16:16:20 +000074dynamically loaded modules, so if you don't need a certain package it
Jack Jansen8a6cdcc2000-09-10 12:02:28 +000075suffices to just refrain from builing the extension module.
76Here are the locations for the various things
Jack Jansen4c1e56c1996-08-06 16:16:20 +000077you need:
Jack Jansen8f2d8021996-08-05 15:34:45 +000078
79<UL>
Jack Jansen8f2d8021996-08-05 15:34:45 +000080
Jack Jansen4c1e56c1996-08-06 16:16:20 +000081<LI> Waste, a TextEdit replacement written by Marco Piovanelli, <A
82HREF="mailto:piovanel@kagi.com">&lt;piovanel@kagi.com&gt;</A>. Python
Jack Jansenc1218bc2001-04-25 22:11:24 +000083was built using version 2.0, which is included in the CodeWarrior
84package. You can also obtain it from <A
Jack Jansen16904092001-08-16 14:10:56 +000085HREF="http://www.merzwaren.com/waste">&lt;http://www.merzwaren.com/waste&gt;</A>
Jack Jansen4c1e56c1996-08-06 16:16:20 +000086and various other places.
Jack Jansen8f2d8021996-08-05 15:34:45 +000087
Jack Jansen1473af71997-05-07 15:43:38 +000088<LI> Gdbm library for the Mac. Available from Jack's Mac software page at
89<A HREF="http://www.cwi.nl/~jack/macsoftware.html">
90http://www.cwi.nl/~jack/macsoftware.html</A> and <A HREF="ftp://ftp.cwi.nl/pub/jack/mac">
Jack Jansen16904092001-08-16 14:10:56 +000091ftp://ftp.cwi.nl/pub/jack/mac</A>.
Jack Jansen1473af71997-05-07 15:43:38 +000092
93<LI> JPEG library by the Independent JPEG Group. A version including
94Mac projects can be found at Jack's page mentioned above.
95The most recent JPEG library can always be obtained from <A
Jack Jansen16904092001-08-16 14:10:56 +000096HREF="ftp://ftp.uu.net/graphics/jpeg/">ftp://ftp.uu.net/graphics/jpeg/</A>.
Jack Jansen4c1e56c1996-08-06 16:16:20 +000097
Jack Jansen1473af71997-05-07 15:43:38 +000098<LI> The netpbm/pbmplus, libtiff, zlib and png libraries. The netpbm distribution
Jack Jansen4c1e56c1996-08-06 16:16:20 +000099(which includes libtiff) is generally available on Internet ftp
100servers. For Python pbmplus, an older incarnation of netpbm, is
101functionally identical to netpbm, since Python only uses the library
102and not the complete applications. A distribution with correct
Jack Jansen1473af71997-05-07 15:43:38 +0000103projects and library source only is available from, you guessed it, Jack's Mac software
Jack Jansen16904092001-08-16 14:10:56 +0000104page mentioned above.
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000105
Jack Jansen8f2d8021996-08-05 15:34:45 +0000106</UL>
107
108<H2>Setting Up</H2>
109
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000110Now that you have collected everything you should start with building
Jack Jansen1473af71997-05-07 15:43:38 +0000111the various parts. If you don't want to fix
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000112access paths try to set things up as follows:
113
Jack Jansen8f2d8021996-08-05 15:34:45 +0000114<PRE>
115Top-level-folder:
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000116 GUSI2
Jack Jansen8f2d8021996-08-05 15:34:45 +0000117 imglibs
Jack Jansende570301998-08-27 13:39:01 +0000118 jpeg
119 netpbm
120 libtiff
Jack Jansen1473af71997-05-07 15:43:38 +0000121 zlib
Jack Jansende570301998-08-27 13:39:01 +0000122 png
Jack Jansen1473af71997-05-07 15:43:38 +0000123 gdbm
Jack Jansen8f2d8021996-08-05 15:34:45 +0000124 Python
Jack Jansen90cf4912000-02-11 23:14:46 +0000125 Modules
126 ...
127 Mac
128 Modules
129 Build
130 ...
Jack Jansen8f2d8021996-08-05 15:34:45 +0000131</PRE>
132
Jack Jansende570301998-08-27 13:39:01 +0000133If your setup of the libraries is exactly the same as mine (which is
134not very likely, unless you happen to work from the same CVS
135repository) you can use the project <code>buildlibs.prj</code> in the
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000136<code>:Mac:Build</code> folder to build all needed libraries in one
Jack Jansende570301998-08-27 13:39:01 +0000137fell swoop, otherwise you will have to build the libraries one by
138one. <p>
139
Jack Jansen3e828722003-01-08 16:27:44 +0000140First build GUSI, the Carbon variant.
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000141 <p>
Jack Jansen95375861999-03-10 15:51:56 +0000142
Jack Jansen16e99c01996-09-07 17:11:26 +0000143Next, in
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000144<code>libjpeg</code>, <code>pbmplus</code>,
Jack Jansen1473af71997-05-07 15:43:38 +0000145<code>zlib</code>, <code>libpng</code>, <code>gdbm</code>,
Jack Jansena2139fe1998-02-25 15:40:35 +0000146and<code>libtiff</code> you build all projects. Usually the projects are in "mac"
Jack Jansen1473af71997-05-07 15:43:38 +0000147subfolders, sometimes they are in the main folder. Tcl/tk is a special
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000148case, see below.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000149
Jack Jansen8f2d8021996-08-05 15:34:45 +0000150<H2>The organization of the Python source tree</H2>
151
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000152Time for a short break, while we have a look at the organization of
153the Python source tree. At the top level, we find the following
154folders:
Jack Jansen8f2d8021996-08-05 15:34:45 +0000155
156<DL>
Jack Jansen8f2d8021996-08-05 15:34:45 +0000157<DT> Demo
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000158<DD> Demo programs that are not Mac-specific. Some of these may not
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000159work.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000160
161<DT> Extensions
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000162<DD> Extensions to the interpreter that are not Mac-specific. Contains
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000163the <code>img</code>, <code>Imaging</code> and <code>Numerical</code> extensions
164in this distribution.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000165
166<DT> Grammar
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000167<DD> The Python grammar. Included for reference only, you cannot build
168the parser on a Mac.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000169
170<DT> Include
171<DD> Machine-independent header files.
172
173<DT> Modules
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000174<DD> Machine-independent optional modules. Not all of these will work
175on the Mac.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000176
Jack Jansene0b1e6a2002-01-08 23:03:45 +0000177<DT> Lib
178<DD> Machine-independent modules in Python.
179
180<DT> Lib:lib-dynload
Jack Jansen3e828722003-01-08 16:27:44 +0000181<DD> This is where the dynamically-loaded plugin modules live.
182
183<DT> Lib:plat-mac
184<DD> This is where most of the Mac-specific modules live. The modules here
185are available both in MacPython-OS9 and MacPython-OSX.
Jack Jansene0b1e6a2002-01-08 23:03:45 +0000186
Jack Jansen8f2d8021996-08-05 15:34:45 +0000187<DT> Objects
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000188<DD> Machine-independent code for various object types. Most of these are
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000189not really optional: the interpreter will not function without them.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000190
191<DT> Parser
192<DD> The Python parser (machine-independent).
193
Jack Jansen8f2d8021996-08-05 15:34:45 +0000194<DT> Python
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000195<DD> The core interpreter. Most files are machine-independent, some
196are unix-specific and not used on the Mac.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000197
198<DT> Tools
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000199<DD> Tools for python developers. Contains <code>modulator</code> which
200builds skeleton C extension modules, <code>bgen</code> which generates
201complete interface modules from information in C header files and
202<code>freeze</code> which is used to turn Python scripts into real
203applications (used by MacFreeze and BuildApplication) There are some
204readme files, but more documentation is sorely needed.
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000205
Jack Jansen8f2d8021996-08-05 15:34:45 +0000206</DL>
207
Jack Jansen3e828722003-01-08 16:27:44 +0000208The mac-specific stuff lives in the <code>Mac</code> folder:
Jack Jansen8f2d8021996-08-05 15:34:45 +0000209<DL>
Jack Jansenc256ece1999-02-03 13:09:27 +0000210<DT> Build
211<DD> This is where the project files live and where you build the
212libraries, shared libraries, executables and plugin modules. All the
213resulting binaries, except for intermedeate results, are deposited in
Jack Jansen3e828722003-01-08 16:27:44 +0000214the toplevel folder or the :Lib:lib-dynload folder (for plugin modules).
Jack Jansen8f2d8021996-08-05 15:34:45 +0000215
216<DT> Compat
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000217<DD> Unix-compatability routines. Most of these are not used anymore,
218since GUSI provides a rather complete emulation, but you may need
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000219these if you are trying to build a non-GUSI python.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000220
221<DT> Demo
222<DD> Mac-specific demo programs, some of them annotated.
223
224<DT> Include
225<DD> Mac-specific but compiler-independent include files.
226
227<DT> Lib
Jack Jansen3e828722003-01-08 16:27:44 +0000228<DD> MacPython-OS9 specific standard modules which are not shared with
229MacPython-OSX.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000230
231<DT> Modules
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000232<DD> Mac-specific builtin modules. Theoretically these are all
233optional, but some are rather essential (like
Jack Jansen16904092001-08-16 14:10:56 +0000234<code>macosmodule</code>). A lot of these modules are generated with
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000235<code>bgen</code>, in which case the bgen input files are included so
236you can attempt to regenerate them or extend them.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000237
238<DT> MPW
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000239<DD> MPW-specific files. These have not been used or kept up-to-date
240for a long time, so use at your own risk.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000241
242<DT> mwerks
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000243<DD> Mwerks-specific sources and headers. Contains glue code for
244Pythons shared-library architecture, a replacement for
245<code>malloc</code> and a directory with various projects for building
246variations on the Python interpreter. The <code>mwerks_*.h</code>
247files here are the option-setting files for the various interpreters
248and such, comparable to the unix command-line <code>-D</code> options
249to the compiler. Each project uses the correct option file as its
250"prefix file" in the "C/C++ language" settings. Disabling optional
251modules (for the 68K interpreter), building non-GUSI interpreters and
252various other things are accomplished by modifying these files (and
253possibly changing the list of files included in the project window, of
254course).
Jack Jansen8f2d8021996-08-05 15:34:45 +0000255
Jack Jansene0b1e6a2002-01-08 23:03:45 +0000256<DT> OSX
Jack Jansen3e828722003-01-08 16:27:44 +0000257<DD> Specific to MacPython-OSX, not used by MacPython-OS9.
Jack Jansene0b1e6a2002-01-08 23:03:45 +0000258
259<DT> OSXResources
Jack Jansen3e828722003-01-08 16:27:44 +0000260<DD> Specific to MacPython-OSX, not used by MacPython-OS9.
Jack Jansenc256ece1999-02-03 13:09:27 +0000261
Jack Jansen8f2d8021996-08-05 15:34:45 +0000262<DT> Python
263<DD> Mac-specific parts of the core interpreter.
264
265<DT> Resources
266<DD> Resource files needed to build the interpreter.
267
268<DT> Scripts
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000269<DD> A collection of various mac-specific Python scripts. Some are
270essential, some are useful but few are documented, so you will have to
271use your imagination to work them out.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000272
Jack Jansenc256ece1999-02-03 13:09:27 +0000273<DT> Tools
274<DD> A collection of tools, usually bigger than those in the scripts
275folder. The important ones here are the IDE and macfreeze. The IDE is built
276with the buildIDE.py script, which puts the resulting applet in the toplevel
277folder. Macfreeze is usually invoked through the BuildApplication script,
278but for more control over the freezing process you can run the main script here.
279
280
Jack Jansen8f2d8021996-08-05 15:34:45 +0000281<DT> Unsupported
282<DD> Modules that are not supported any longer but may still work with a little effort.
283</DL>
284
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000285<H2>Building the PPC interpreter</H2>
Jack Jansen16904092001-08-16 14:10:56 +0000286
Jack Jansen3e828722003-01-08 16:27:44 +0000287First you optionally build the external libraries with buildlibs.prj. <p>
288
289Then, the <code>fullbuild</code> script can be used to build
290everything, but you need a fully-functional interpreter before you can
291use it (and one that isn't rebuilt in the process: you cannot rebuild
292a running program). You could copy the interpreter to a different
293place and use that to run fullbuild. The <code>PythonStandSmall.prj</code>
294project builds an interpreter that is suited to this, and it can also come
295in handy if you need to debug things (which is easier in a static program). <p>
296
297In case you want to build by hand, or in case the <code>fullbuild</code>
298script does not work, here is a breakdown of the various projects. <p>
299
300The projects for interpreter and core library are linked together, so
301building the PythonInterpreter target
Jack Jansen16904092001-08-16 14:10:56 +0000302in <code>PythonInterpreter.prj</code>
Jack Jansen3e828722003-01-08 16:27:44 +0000303will result in the whole core being built, but not the extension modules. <p>
Jack Jansenc256ece1999-02-03 13:09:27 +0000304
Jack Jansenc7dd34b2002-01-30 10:42:59 +0000305You will get about 100 warnings on "missing prototype" for the various module init
306routines, ignore these. You will also get numerous warnings on functions from GUSI which
307override functions from MSL, ignore these too. <p>
308
Jack Jansen3e828722003-01-08 16:27:44 +0000309Here is a breakdown of the projects:
Jack Jansen8f2d8021996-08-05 15:34:45 +0000310
311<DL>
Jack Jansen8f2d8021996-08-05 15:34:45 +0000312
Jack Jansen16904092001-08-16 14:10:56 +0000313<DT> PythonCore
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000314<DD> The shared library that contains the bulk of the interpreter and
Jack Jansen3e828722003-01-08 16:27:44 +0000315its resources.
Jack Jansen16904092001-08-16 14:10:56 +0000316It is a good idea to immedeately put an alias to this
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000317shared library in the <code>Extensions</code> folder of your system
318folder. Do exactly that: put an <em>alias</em> there, copying or
Jack Jansen3412c5d1997-08-27 14:08:22 +0000319moving the file will cause you grief later if you rebuild the library and
Jack Jansen16904092001-08-16 14:10:56 +0000320forget to copy it to the extensions folder again. The ConfigurePythonXXX applets
321will also do this. <br>
Jack Jansen8f2d8021996-08-05 15:34:45 +0000322
Jack Jansen3b805261999-02-14 23:12:06 +0000323<DT> PythonInterpeter
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000324<DD> The interpreter. This is basically a routine to call out to the
Jack Jansen3e828722003-01-08 16:27:44 +0000325shared library. <p>
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000326
Jack Jansenc256ece1999-02-03 13:09:27 +0000327<DT> Plugin projects
Jack Jansen16904092001-08-16 14:10:56 +0000328<DD> Each plugin module has a separate project, and these can be rebuilt on
329the fly. Fullbuild (or actually it's little helper genpluginprojects) takes
330care of this.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000331</DL>
332
Jack Jansen3412c5d1997-08-27 14:08:22 +0000333After creating the alias to <code>PythonCore</code> you remove any old
Jack Jansen16904092001-08-16 14:10:56 +0000334<code>Python XXXX Preferences</code> file from the <code>Preferences</code> folder
Jack Jansen061ac501996-10-22 15:27:56 +0000335(if you had python installed on your system before) and run the interpreter once
Jack Jansen3412c5d1997-08-27 14:08:22 +0000336to create the correct preferences file. <p>
Jack Jansen8f2d8021996-08-05 15:34:45 +0000337
Jack Jansenc256ece1999-02-03 13:09:27 +0000338Next, you have to build the extension modules.
Jack Jansen16904092001-08-16 14:10:56 +0000339If you don't use fullbuild simply open each project and build it.
Jack Jansena598bc41999-02-10 23:08:24 +0000340<p>
Jack Jansen8f2d8021996-08-05 15:34:45 +0000341
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000342Finally, you must build the standard applets:
Jack Jansen16904092001-08-16 14:10:56 +0000343<code>EditPythonPrefs</code>, <code>BuildApplet</code>, etc. For the N-th time:
344fullbuild does this for you, but you can also manually drag/drop them onto
345BuildApplet. <p>
Jack Jansen8f2d8021996-08-05 15:34:45 +0000346
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000347You are all set now, and should read the release notes and
Jack Jansen3412c5d1997-08-27 14:08:22 +0000348<code>ReadMe</code> file from the <code>Mac</code> folder.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000349
Jack Jansene0b1e6a2002-01-08 23:03:45 +0000350Rebuilding .exp files is no longer needed since CodeWarrior 7.
Jack Jansen27b10ec1996-08-23 15:44:18 +0000351
Jack Jansen95375861999-03-10 15:51:56 +0000352<H2><a name="cvs">Using the CVS source archive</a></H2>
Jack Jansenc256ece1999-02-03 13:09:27 +0000353
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000354It is possible (and probably best) to access the Python sources through remote CVS. The
Jack Jansen65f685b1999-04-12 09:25:23 +0000355advantage of this is that you get the very latest sources, so any bug
356fixed or new features will be immedeately available. This is also the
357disadvantage, of course: as this is the same tree as is used for
358development it may sometimes be a little less stable. <p>
Jack Jansenc256ece1999-02-03 13:09:27 +0000359
360The CVS client of choice is Alexandre Parenteau's MacCVS. It can be
Jack Jansen65f685b1999-04-12 09:25:23 +0000361obtained through the <a href="http://www.wincvs.org">WinCVS
362homepage</a>. MacCVS uses Internet Config to set file types correctly
363based on the filename extension. In the maccvs preferences you should
364also set (in the "binary files" section) "use mac encoding:
365applesingle" and (in the "text files" section) "use ISO latin 1
Jack Jansenc256ece1999-02-03 13:09:27 +0000366conversion". <p>
367
Jack Jansen3e828722003-01-08 16:27:44 +0000368It is a good idea to disable Quicktime Exchange in the Quicktime control
369panel if you are on OS9 or before. Quicktime Exchange will magically map
370some extensions to filetypes, and this can seriously hinder you if, for
371instance, <code>.bmp</code> is not a Windows bitmap file. <p>
Jack Jansen8b41d532000-05-07 22:08:42 +0000372
Jack Jansen16904092001-08-16 14:10:56 +0000373The Python sources are checked out from the main
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000374Python CVS archive on sourceforge.net, see the <a
Jack Jansen65f685b1999-04-12 09:25:23 +0000375href="http://www.python.org/download/cvs.html">Source access via
376CVS</a> page for details. When you check the sources out you will get
Jack Jansen95375861999-03-10 15:51:56 +0000377something like <code>Python:dist:src</code>, and under that the
Jack Jansen16904092001-08-16 14:10:56 +0000378<code>Modules</code>, <code>Lib</code>, <code>Mac</code> etc hierarchy. The
379<code>src</code> folder can be renamed to <code>Python</code>, and
Jack Jansen95375861999-03-10 15:51:56 +0000380is what this document refers to as the "toplevel Python folder". <P>
Jack Jansenc256ece1999-02-03 13:09:27 +0000381
Jack Jansen16904092001-08-16 14:10:56 +0000382The CVS repository does not contain all the projects for the plugin modules,
383these are built with <code>fullbuild.py</code> normally. For this reason
384it is probably a good idea to first build <code>PythonStandSmall.prj</code>,
385which builds a fairly minimal interpreter, and then follow the
Jack Jansen3e828722003-01-08 16:27:44 +0000386fullbuild instructions</a>.
Jack Jansendae108c2000-02-11 23:17:14 +0000387
Jack Jansen8f2d8021996-08-05 15:34:45 +0000388<H2>Odds and ends</H2>
389
390Some remarks that I could not fit in elsewhere:
391
392<UL>
Jack Jansen8f2d8021996-08-05 15:34:45 +0000393
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000394<LI> It may be possible to use the <code>PythonCore</code> shared
395library to embed Python in another program, if your program can live
Jack Jansen1473af71997-05-07 15:43:38 +0000396with using GUSI for I/O. Use PythonCore in stead of your MSL C library
Jack Jansen3e828722003-01-08 16:27:44 +0000397(or, at the very least, link it before the normal C library). Ask for help
398on PythonMac-SIG if you have problems with this.
Jack Jansen4c1e56c1996-08-06 16:16:20 +0000399
Jack Jansene0b1e6a2002-01-08 23:03:45 +0000400<LI> <a name="extending"></a>It is possible to build PPC extension
401modules without building a complete Python. The binary distribution
402installer can optionally install all the needed folders (the develop
403option). A template for a dynamic module can be found in
Jack Jansen3412c5d1997-08-27 14:08:22 +0000404<code>xx.prj</code>.
Jack Jansen27b10ec1996-08-23 15:44:18 +0000405
406<LI> The Python shared library architecture is a variant of the architecture
407described as "application with shared libraries and dropins" in the MetroWerks
408"Targeting MacOS" documentation. The Python Application and applet-template use
Jack Jansen1473af71997-05-07 15:43:38 +0000409the <code>MSL AppRuntime.Lib</code> runtime library (with properly set CFM
410initialization and termination routines). PythonCore uses <code>MSL Runtime.Lib</code>,
411which is really intended for standalone programs but which we fool into working by
412providing a dummy main program.
Jack Jansen27b10ec1996-08-23 15:44:18 +0000413It is linked statically into PythonCore (and exported to the applications and plugins)
414so we do not have to distribute yet another shared library. Plugin modules use
Jack Jansen1473af71997-05-07 15:43:38 +0000415<code>MSL ShlibRuntime.Lib</code> (not the dropin runtime: modules are never unloaded)
416and obtain the rest from PythonCore. PythonCore uses a
Jack Jansen27b10ec1996-08-23 15:44:18 +0000417non-standard initialization entry point, <code>__initialize_with_resources</code>, to
Jack Jansen1473af71997-05-07 15:43:38 +0000418be able to obtain resources from the library file later on. Plugins can do the same
419(_tkinter does) or use the standard <code>__initialize</code> entry point.
Jack Jansen8f2d8021996-08-05 15:34:45 +0000420
421
Jack Jansen6ad8d131997-01-15 16:53:37 +0000422</UL>
Jack Jansen8f2d8021996-08-05 15:34:45 +0000423</BODY>
424</HTML>