1996-08-05 12:34:45 -03:00
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
2003-01-08 12:27:44 -04:00
|
|
|
<TITLE>Building MacPython-OS9 from source</TITLE>
|
1996-08-05 12:34:45 -03:00
|
|
|
</HEAD>
|
|
|
|
<BODY>
|
2003-01-08 12:27:44 -04:00
|
|
|
<H1>Building MacPython-OS9 from source</H1>
|
1996-08-05 12:34:45 -03:00
|
|
|
<HR>
|
|
|
|
|
2003-01-08 12:27:44 -04:00
|
|
|
This document explains how to build MacPython-OS9 from source. This is
|
2000-09-10 09:02:28 -03:00
|
|
|
necessary if you want to make modifications to the Python core. Building
|
|
|
|
Python is not something to be undertaken lightly, you need a reasonable
|
|
|
|
working knowledge of the CodeWarrior development environment, a good net
|
1996-08-06 13:16:20 -03:00
|
|
|
connection and probably quite some time too. <p>
|
1996-08-05 12:34:45 -03:00
|
|
|
|
2002-01-08 19:03:45 -04:00
|
|
|
Note that if you only want to build new extension modules you don't need to
|
|
|
|
build Python from source, see the <a href="#extending">note on extending Python</a>.<p>
|
|
|
|
|
1996-08-06 13:16:20 -03:00
|
|
|
The information density in this file is high, so you should probably
|
|
|
|
print it and read it at your leasure. Most things are explained only
|
|
|
|
once (and probably in the wrong place:-). <p>
|
|
|
|
|
2000-02-11 19:14:46 -04:00
|
|
|
<blockquote>
|
|
|
|
First a warning: this information may become outdated if a new CodeWarrior is
|
|
|
|
released after MacPython. The
|
|
|
|
<a href="http://www.cwi.nl/~jack/macpython.html">MacPython homepage</a> will
|
2003-01-08 12:27:44 -04:00
|
|
|
hopefully have updated instructions in that case. These instructions are for CW7,
|
|
|
|
it is rumoured you may encounter some problems with newer versions of CodeWarrior.
|
2000-02-11 19:14:46 -04:00
|
|
|
</blockquote>
|
|
|
|
|
2003-01-08 12:27:44 -04:00
|
|
|
I am interested in feedback on this document, send your
|
1996-08-06 13:16:20 -03:00
|
|
|
comments to the <A
|
|
|
|
HREF="http://www.python.org/sigs/pythonmac-sig/">Mac Python Special
|
|
|
|
Interest Group</A>.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<H2>What you need.</H2>
|
|
|
|
|
|
|
|
The following things you definitely need:
|
|
|
|
|
|
|
|
<UL>
|
1996-08-06 13:16:20 -03:00
|
|
|
|
|
|
|
<LI> You need a MacPython source distribution, of course. You can
|
2001-08-16 11:10:56 -03:00
|
|
|
obtain one via <A HREF="http://www.cwi.nl/~jack/macpython.html">
|
|
|
|
http://www.cwi.nl/~jack/macpython.html</A> (which has up-to-date links
|
1999-03-10 11:51:56 -04:00
|
|
|
to the other packages needed too) and possibly also from the standard
|
|
|
|
<A HREF="ftp://ftp.python.org/pub/python/mac">python.org ftp
|
2000-09-10 09:02:28 -03:00
|
|
|
site</A>. <BR>
|
1999-02-03 09:09:27 -04:00
|
|
|
|
2000-09-10 09:02:28 -03:00
|
|
|
A better alternative is to check the sources straight out of the CVS
|
1999-03-10 11:51:56 -04:00
|
|
|
repository, see below. Most of the packages mentioned here are also
|
|
|
|
available through CVS. Check the section on <a href="#cvs">CVS
|
|
|
|
repository use</a> below.
|
1996-08-06 13:16:20 -03:00
|
|
|
|
|
|
|
<LI> You need MetroWerks CodeWarrior. The current distribution has
|
2002-01-08 19:03:45 -04:00
|
|
|
been built with CodeWarrior Pro 7.1. Ordering information is
|
1996-08-06 13:16:20 -03:00
|
|
|
available on the <A HREF="http://www.metrowerks.com/">MetroWerks
|
2001-08-16 11:10:56 -03:00
|
|
|
homepage</A>. Building Python with MPW, Think/Symantec C or the OSX
|
|
|
|
developer tools is impossible without major surgery.
|
1996-08-06 13:16:20 -03:00
|
|
|
|
2000-09-10 09:02:28 -03:00
|
|
|
<LI> You need GUSI version 2, the Grand Unified Socket Interface, by
|
|
|
|
Matthias Neeracher. The original GUSI is obtainable from <A
|
2000-12-12 18:14:14 -04:00
|
|
|
HREF="ftp://gusi.sourceforge.net/pub/gusi/">
|
|
|
|
ftp://gusi.sourceforge.net/pub/gusi/</A>. At
|
2002-01-08 19:03:45 -04:00
|
|
|
the moment Python is built with a modified version of GUSI
|
|
|
|
with Carbon adaptations, so it may be better to check the <A
|
2000-09-10 09:02:28 -03:00
|
|
|
HREF="http://www.cwi.nl/~jack/macpython.html">MacPython homepage</A>
|
|
|
|
for a GUSI that is most easily used for building Python.
|
1999-02-10 19:08:24 -04:00
|
|
|
|
1996-08-05 12:34:45 -03:00
|
|
|
</UL>
|
|
|
|
|
1996-08-06 13:16:20 -03:00
|
|
|
<A NAME="optional">The MacPython project files are configured to
|
|
|
|
include a plethora of optional modules</A>, and these modules need a
|
1998-02-25 11:40:35 -04:00
|
|
|
number of extra packages. To use the project files as-is you have to
|
2000-09-10 09:02:28 -03:00
|
|
|
download these packages too. Python has all such modules as
|
1996-08-06 13:16:20 -03:00
|
|
|
dynamically loaded modules, so if you don't need a certain package it
|
2000-09-10 09:02:28 -03:00
|
|
|
suffices to just refrain from builing the extension module.
|
|
|
|
Here are the locations for the various things
|
1996-08-06 13:16:20 -03:00
|
|
|
you need:
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<UL>
|
1996-08-06 13:16:20 -03:00
|
|
|
|
|
|
|
<LI> Waste, a TextEdit replacement written by Marco Piovanelli, <A
|
|
|
|
HREF="mailto:piovanel@kagi.com"><piovanel@kagi.com></A>. Python
|
2001-04-25 19:11:24 -03:00
|
|
|
was built using version 2.0, which is included in the CodeWarrior
|
|
|
|
package. You can also obtain it from <A
|
2001-08-16 11:10:56 -03:00
|
|
|
HREF="http://www.merzwaren.com/waste"><http://www.merzwaren.com/waste></A>
|
1996-08-06 13:16:20 -03:00
|
|
|
and various other places.
|
|
|
|
|
1997-05-07 12:43:38 -03:00
|
|
|
<LI> Gdbm library for the Mac. Available from Jack's Mac software page at
|
|
|
|
<A HREF="http://www.cwi.nl/~jack/macsoftware.html">
|
|
|
|
http://www.cwi.nl/~jack/macsoftware.html</A> and <A HREF="ftp://ftp.cwi.nl/pub/jack/mac">
|
2001-08-16 11:10:56 -03:00
|
|
|
ftp://ftp.cwi.nl/pub/jack/mac</A>.
|
1997-05-07 12:43:38 -03:00
|
|
|
|
|
|
|
<LI> JPEG library by the Independent JPEG Group. A version including
|
|
|
|
Mac projects can be found at Jack's page mentioned above.
|
|
|
|
The most recent JPEG library can always be obtained from <A
|
2001-08-16 11:10:56 -03:00
|
|
|
HREF="ftp://ftp.uu.net/graphics/jpeg/">ftp://ftp.uu.net/graphics/jpeg/</A>.
|
1996-08-06 13:16:20 -03:00
|
|
|
|
1997-05-07 12:43:38 -03:00
|
|
|
<LI> The netpbm/pbmplus, libtiff, zlib and png libraries. The netpbm distribution
|
1996-08-06 13:16:20 -03:00
|
|
|
(which includes libtiff) is generally available on Internet ftp
|
|
|
|
servers. For Python pbmplus, an older incarnation of netpbm, is
|
|
|
|
functionally identical to netpbm, since Python only uses the library
|
|
|
|
and not the complete applications. A distribution with correct
|
1997-05-07 12:43:38 -03:00
|
|
|
projects and library source only is available from, you guessed it, Jack's Mac software
|
2001-08-16 11:10:56 -03:00
|
|
|
page mentioned above.
|
1996-08-06 13:16:20 -03:00
|
|
|
|
1996-08-05 12:34:45 -03:00
|
|
|
</UL>
|
|
|
|
|
|
|
|
<H2>Setting Up</H2>
|
|
|
|
|
1996-08-06 13:16:20 -03:00
|
|
|
Now that you have collected everything you should start with building
|
1997-05-07 12:43:38 -03:00
|
|
|
the various parts. If you don't want to fix
|
1996-08-06 13:16:20 -03:00
|
|
|
access paths try to set things up as follows:
|
|
|
|
|
1996-08-05 12:34:45 -03:00
|
|
|
<PRE>
|
|
|
|
Top-level-folder:
|
2000-09-10 09:02:28 -03:00
|
|
|
GUSI2
|
1996-08-05 12:34:45 -03:00
|
|
|
imglibs
|
1998-08-27 10:39:01 -03:00
|
|
|
jpeg
|
|
|
|
netpbm
|
|
|
|
libtiff
|
1997-05-07 12:43:38 -03:00
|
|
|
zlib
|
1998-08-27 10:39:01 -03:00
|
|
|
png
|
1997-05-07 12:43:38 -03:00
|
|
|
gdbm
|
1996-08-05 12:34:45 -03:00
|
|
|
Python
|
2000-02-11 19:14:46 -04:00
|
|
|
Modules
|
|
|
|
...
|
|
|
|
Mac
|
|
|
|
Modules
|
|
|
|
Build
|
|
|
|
...
|
1996-08-05 12:34:45 -03:00
|
|
|
</PRE>
|
|
|
|
|
1998-08-27 10:39:01 -03:00
|
|
|
If your setup of the libraries is exactly the same as mine (which is
|
|
|
|
not very likely, unless you happen to work from the same CVS
|
|
|
|
repository) you can use the project <code>buildlibs.prj</code> in the
|
2000-09-10 09:02:28 -03:00
|
|
|
<code>:Mac:Build</code> folder to build all needed libraries in one
|
1998-08-27 10:39:01 -03:00
|
|
|
fell swoop, otherwise you will have to build the libraries one by
|
|
|
|
one. <p>
|
|
|
|
|
2003-01-08 12:27:44 -04:00
|
|
|
First build GUSI, the Carbon variant.
|
2000-09-10 09:02:28 -03:00
|
|
|
<p>
|
1999-03-10 11:51:56 -04:00
|
|
|
|
1996-09-07 14:11:26 -03:00
|
|
|
Next, in
|
2000-09-10 09:02:28 -03:00
|
|
|
<code>libjpeg</code>, <code>pbmplus</code>,
|
1997-05-07 12:43:38 -03:00
|
|
|
<code>zlib</code>, <code>libpng</code>, <code>gdbm</code>,
|
1998-02-25 11:40:35 -04:00
|
|
|
and<code>libtiff</code> you build all projects. Usually the projects are in "mac"
|
1997-05-07 12:43:38 -03:00
|
|
|
subfolders, sometimes they are in the main folder. Tcl/tk is a special
|
2000-09-10 09:02:28 -03:00
|
|
|
case, see below.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<H2>The organization of the Python source tree</H2>
|
|
|
|
|
1996-08-06 13:16:20 -03:00
|
|
|
Time for a short break, while we have a look at the organization of
|
|
|
|
the Python source tree. At the top level, we find the following
|
|
|
|
folders:
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DL>
|
|
|
|
<DT> Demo
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> Demo programs that are not Mac-specific. Some of these may not
|
2000-09-10 09:02:28 -03:00
|
|
|
work.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> Extensions
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> Extensions to the interpreter that are not Mac-specific. Contains
|
2000-09-10 09:02:28 -03:00
|
|
|
the <code>img</code>, <code>Imaging</code> and <code>Numerical</code> extensions
|
|
|
|
in this distribution.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> Grammar
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> The Python grammar. Included for reference only, you cannot build
|
|
|
|
the parser on a Mac.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> Include
|
|
|
|
<DD> Machine-independent header files.
|
|
|
|
|
|
|
|
<DT> Modules
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> Machine-independent optional modules. Not all of these will work
|
|
|
|
on the Mac.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
2002-01-08 19:03:45 -04:00
|
|
|
<DT> Lib
|
|
|
|
<DD> Machine-independent modules in Python.
|
|
|
|
|
|
|
|
<DT> Lib:lib-dynload
|
2003-01-08 12:27:44 -04:00
|
|
|
<DD> This is where the dynamically-loaded plugin modules live.
|
|
|
|
|
|
|
|
<DT> Lib:plat-mac
|
|
|
|
<DD> This is where most of the Mac-specific modules live. The modules here
|
|
|
|
are available both in MacPython-OS9 and MacPython-OSX.
|
2002-01-08 19:03:45 -04:00
|
|
|
|
1996-08-05 12:34:45 -03:00
|
|
|
<DT> Objects
|
2000-09-10 09:02:28 -03:00
|
|
|
<DD> Machine-independent code for various object types. Most of these are
|
1996-08-06 13:16:20 -03:00
|
|
|
not really optional: the interpreter will not function without them.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> Parser
|
|
|
|
<DD> The Python parser (machine-independent).
|
|
|
|
|
|
|
|
<DT> Python
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> The core interpreter. Most files are machine-independent, some
|
|
|
|
are unix-specific and not used on the Mac.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> Tools
|
2000-09-10 09:02:28 -03:00
|
|
|
<DD> Tools for python developers. Contains <code>modulator</code> which
|
|
|
|
builds skeleton C extension modules, <code>bgen</code> which generates
|
|
|
|
complete interface modules from information in C header files and
|
|
|
|
<code>freeze</code> which is used to turn Python scripts into real
|
|
|
|
applications (used by MacFreeze and BuildApplication) There are some
|
|
|
|
readme files, but more documentation is sorely needed.
|
1996-08-06 13:16:20 -03:00
|
|
|
|
1996-08-05 12:34:45 -03:00
|
|
|
</DL>
|
|
|
|
|
2003-01-08 12:27:44 -04:00
|
|
|
The mac-specific stuff lives in the <code>Mac</code> folder:
|
1996-08-05 12:34:45 -03:00
|
|
|
<DL>
|
1999-02-03 09:09:27 -04:00
|
|
|
<DT> Build
|
|
|
|
<DD> This is where the project files live and where you build the
|
|
|
|
libraries, shared libraries, executables and plugin modules. All the
|
|
|
|
resulting binaries, except for intermedeate results, are deposited in
|
2003-01-08 12:27:44 -04:00
|
|
|
the toplevel folder or the :Lib:lib-dynload folder (for plugin modules).
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> Compat
|
2000-09-10 09:02:28 -03:00
|
|
|
<DD> Unix-compatability routines. Most of these are not used anymore,
|
|
|
|
since GUSI provides a rather complete emulation, but you may need
|
1996-08-06 13:16:20 -03:00
|
|
|
these if you are trying to build a non-GUSI python.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> Demo
|
|
|
|
<DD> Mac-specific demo programs, some of them annotated.
|
|
|
|
|
|
|
|
<DT> Include
|
|
|
|
<DD> Mac-specific but compiler-independent include files.
|
|
|
|
|
|
|
|
<DT> Lib
|
2003-01-08 12:27:44 -04:00
|
|
|
<DD> MacPython-OS9 specific standard modules which are not shared with
|
|
|
|
MacPython-OSX.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> Modules
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> Mac-specific builtin modules. Theoretically these are all
|
|
|
|
optional, but some are rather essential (like
|
2001-08-16 11:10:56 -03:00
|
|
|
<code>macosmodule</code>). A lot of these modules are generated with
|
1996-08-06 13:16:20 -03:00
|
|
|
<code>bgen</code>, in which case the bgen input files are included so
|
|
|
|
you can attempt to regenerate them or extend them.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> MPW
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> MPW-specific files. These have not been used or kept up-to-date
|
|
|
|
for a long time, so use at your own risk.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DT> mwerks
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> Mwerks-specific sources and headers. Contains glue code for
|
|
|
|
Pythons shared-library architecture, a replacement for
|
|
|
|
<code>malloc</code> and a directory with various projects for building
|
|
|
|
variations on the Python interpreter. The <code>mwerks_*.h</code>
|
|
|
|
files here are the option-setting files for the various interpreters
|
|
|
|
and such, comparable to the unix command-line <code>-D</code> options
|
|
|
|
to the compiler. Each project uses the correct option file as its
|
|
|
|
"prefix file" in the "C/C++ language" settings. Disabling optional
|
|
|
|
modules (for the 68K interpreter), building non-GUSI interpreters and
|
|
|
|
various other things are accomplished by modifying these files (and
|
|
|
|
possibly changing the list of files included in the project window, of
|
|
|
|
course).
|
1996-08-05 12:34:45 -03:00
|
|
|
|
2002-01-08 19:03:45 -04:00
|
|
|
<DT> OSX
|
2003-01-08 12:27:44 -04:00
|
|
|
<DD> Specific to MacPython-OSX, not used by MacPython-OS9.
|
2002-01-08 19:03:45 -04:00
|
|
|
|
|
|
|
<DT> OSXResources
|
2003-01-08 12:27:44 -04:00
|
|
|
<DD> Specific to MacPython-OSX, not used by MacPython-OS9.
|
1999-02-03 09:09:27 -04:00
|
|
|
|
1996-08-05 12:34:45 -03:00
|
|
|
<DT> Python
|
|
|
|
<DD> Mac-specific parts of the core interpreter.
|
|
|
|
|
|
|
|
<DT> Resources
|
|
|
|
<DD> Resource files needed to build the interpreter.
|
|
|
|
|
|
|
|
<DT> Scripts
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> A collection of various mac-specific Python scripts. Some are
|
|
|
|
essential, some are useful but few are documented, so you will have to
|
|
|
|
use your imagination to work them out.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
1999-02-03 09:09:27 -04:00
|
|
|
<DT> Tools
|
|
|
|
<DD> A collection of tools, usually bigger than those in the scripts
|
|
|
|
folder. The important ones here are the IDE and macfreeze. The IDE is built
|
|
|
|
with the buildIDE.py script, which puts the resulting applet in the toplevel
|
|
|
|
folder. Macfreeze is usually invoked through the BuildApplication script,
|
|
|
|
but for more control over the freezing process you can run the main script here.
|
|
|
|
|
|
|
|
|
1996-08-05 12:34:45 -03:00
|
|
|
<DT> Unsupported
|
|
|
|
<DD> Modules that are not supported any longer but may still work with a little effort.
|
|
|
|
</DL>
|
|
|
|
|
2000-09-10 09:02:28 -03:00
|
|
|
<H2>Building the PPC interpreter</H2>
|
2001-08-16 11:10:56 -03:00
|
|
|
|
2003-01-08 12:27:44 -04:00
|
|
|
First you optionally build the external libraries with buildlibs.prj. <p>
|
|
|
|
|
|
|
|
Then, the <code>fullbuild</code> script can be used to build
|
|
|
|
everything, but you need a fully-functional interpreter before you can
|
|
|
|
use it (and one that isn't rebuilt in the process: you cannot rebuild
|
|
|
|
a running program). You could copy the interpreter to a different
|
|
|
|
place and use that to run fullbuild. The <code>PythonStandSmall.prj</code>
|
|
|
|
project builds an interpreter that is suited to this, and it can also come
|
|
|
|
in handy if you need to debug things (which is easier in a static program). <p>
|
2001-08-16 11:10:56 -03:00
|
|
|
|
2003-01-08 12:27:44 -04:00
|
|
|
In case you want to build by hand, or in case the <code>fullbuild</code>
|
|
|
|
script does not work, here is a breakdown of the various projects. <p>
|
|
|
|
|
|
|
|
The projects for interpreter and core library are linked together, so
|
|
|
|
building the PythonInterpreter target
|
|
|
|
in <code>PythonInterpreter.prj</code>
|
|
|
|
will result in the whole core being built, but not the extension modules. <p>
|
1999-02-03 09:09:27 -04:00
|
|
|
|
2002-01-30 06:42:59 -04:00
|
|
|
You will get about 100 warnings on "missing prototype" for the various module init
|
|
|
|
routines, ignore these. You will also get numerous warnings on functions from GUSI which
|
|
|
|
override functions from MSL, ignore these too. <p>
|
|
|
|
|
2003-01-08 12:27:44 -04:00
|
|
|
Here is a breakdown of the projects:
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
<DL>
|
|
|
|
|
2001-08-16 11:10:56 -03:00
|
|
|
<DT> PythonCore
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> The shared library that contains the bulk of the interpreter and
|
2003-01-08 12:27:44 -04:00
|
|
|
its resources.
|
2001-08-16 11:10:56 -03:00
|
|
|
It is a good idea to immedeately put an alias to this
|
1996-08-06 13:16:20 -03:00
|
|
|
shared library in the <code>Extensions</code> folder of your system
|
|
|
|
folder. Do exactly that: put an <em>alias</em> there, copying or
|
1997-08-27 11:08:22 -03:00
|
|
|
moving the file will cause you grief later if you rebuild the library and
|
2001-08-16 11:10:56 -03:00
|
|
|
forget to copy it to the extensions folder again. The ConfigurePythonXXX applets
|
|
|
|
will also do this. <br>
|
1996-08-05 12:34:45 -03:00
|
|
|
|
1999-02-14 19:12:06 -04:00
|
|
|
<DT> PythonInterpeter
|
1996-08-06 13:16:20 -03:00
|
|
|
<DD> The interpreter. This is basically a routine to call out to the
|
2003-01-08 12:27:44 -04:00
|
|
|
shared library. <p>
|
1996-08-05 12:34:45 -03:00
|
|
|
|
1999-02-03 09:09:27 -04:00
|
|
|
<DT> Plugin projects
|
2001-08-16 11:10:56 -03:00
|
|
|
<DD> Each plugin module has a separate project, and these can be rebuilt on
|
|
|
|
the fly. Fullbuild (or actually it's little helper genpluginprojects) takes
|
|
|
|
care of this.
|
1996-08-06 13:16:20 -03:00
|
|
|
</DL>
|
1996-08-05 12:34:45 -03:00
|
|
|
|
1997-08-27 11:08:22 -03:00
|
|
|
After creating the alias to <code>PythonCore</code> you remove any old
|
2001-08-16 11:10:56 -03:00
|
|
|
<code>Python XXXX Preferences</code> file from the <code>Preferences</code> folder
|
1996-10-22 12:27:56 -03:00
|
|
|
(if you had python installed on your system before) and run the interpreter once
|
1997-08-27 11:08:22 -03:00
|
|
|
to create the correct preferences file. <p>
|
1996-08-06 13:16:20 -03:00
|
|
|
|
1999-02-03 09:09:27 -04:00
|
|
|
Next, you have to build the extension modules.
|
2001-08-16 11:10:56 -03:00
|
|
|
If you don't use fullbuild simply open each project and build it.
|
1999-02-10 19:08:24 -04:00
|
|
|
<p>
|
1996-08-06 13:16:20 -03:00
|
|
|
|
|
|
|
Finally, you must build the standard applets:
|
2001-08-16 11:10:56 -03:00
|
|
|
<code>EditPythonPrefs</code>, <code>BuildApplet</code>, etc. For the N-th time:
|
|
|
|
fullbuild does this for you, but you can also manually drag/drop them onto
|
|
|
|
BuildApplet. <p>
|
1996-08-05 12:34:45 -03:00
|
|
|
|
1996-08-06 13:16:20 -03:00
|
|
|
You are all set now, and should read the release notes and
|
1997-08-27 11:08:22 -03:00
|
|
|
<code>ReadMe</code> file from the <code>Mac</code> folder.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
2002-01-08 19:03:45 -04:00
|
|
|
Rebuilding .exp files is no longer needed since CodeWarrior 7.
|
1996-08-23 12:44:18 -03:00
|
|
|
|
1999-03-10 11:51:56 -04:00
|
|
|
<H2><a name="cvs">Using the CVS source archive</a></H2>
|
1999-02-03 09:09:27 -04:00
|
|
|
|
2000-09-10 09:02:28 -03:00
|
|
|
It is possible (and probably best) to access the Python sources through remote CVS. The
|
1999-04-12 06:25:23 -03:00
|
|
|
advantage of this is that you get the very latest sources, so any bug
|
|
|
|
fixed or new features will be immedeately available. This is also the
|
|
|
|
disadvantage, of course: as this is the same tree as is used for
|
|
|
|
development it may sometimes be a little less stable. <p>
|
1999-02-03 09:09:27 -04:00
|
|
|
|
|
|
|
The CVS client of choice is Alexandre Parenteau's MacCVS. It can be
|
1999-04-12 06:25:23 -03:00
|
|
|
obtained through the <a href="http://www.wincvs.org">WinCVS
|
|
|
|
homepage</a>. MacCVS uses Internet Config to set file types correctly
|
|
|
|
based on the filename extension. In the maccvs preferences you should
|
|
|
|
also set (in the "binary files" section) "use mac encoding:
|
|
|
|
applesingle" and (in the "text files" section) "use ISO latin 1
|
1999-02-03 09:09:27 -04:00
|
|
|
conversion". <p>
|
|
|
|
|
2003-01-08 12:27:44 -04:00
|
|
|
It is a good idea to disable Quicktime Exchange in the Quicktime control
|
|
|
|
panel if you are on OS9 or before. Quicktime Exchange will magically map
|
|
|
|
some extensions to filetypes, and this can seriously hinder you if, for
|
|
|
|
instance, <code>.bmp</code> is not a Windows bitmap file. <p>
|
2000-05-07 19:08:42 -03:00
|
|
|
|
2001-08-16 11:10:56 -03:00
|
|
|
The Python sources are checked out from the main
|
2000-09-10 09:02:28 -03:00
|
|
|
Python CVS archive on sourceforge.net, see the <a
|
1999-04-12 06:25:23 -03:00
|
|
|
href="http://www.python.org/download/cvs.html">Source access via
|
|
|
|
CVS</a> page for details. When you check the sources out you will get
|
1999-03-10 11:51:56 -04:00
|
|
|
something like <code>Python:dist:src</code>, and under that the
|
2001-08-16 11:10:56 -03:00
|
|
|
<code>Modules</code>, <code>Lib</code>, <code>Mac</code> etc hierarchy. The
|
|
|
|
<code>src</code> folder can be renamed to <code>Python</code>, and
|
1999-03-10 11:51:56 -04:00
|
|
|
is what this document refers to as the "toplevel Python folder". <P>
|
|
|
|
|
2001-08-16 11:10:56 -03:00
|
|
|
The CVS repository does not contain all the projects for the plugin modules,
|
|
|
|
these are built with <code>fullbuild.py</code> normally. For this reason
|
|
|
|
it is probably a good idea to first build <code>PythonStandSmall.prj</code>,
|
|
|
|
which builds a fairly minimal interpreter, and then follow the
|
2003-01-08 12:27:44 -04:00
|
|
|
fullbuild instructions</a>.
|
2000-02-11 19:17:14 -04:00
|
|
|
|
1996-08-05 12:34:45 -03:00
|
|
|
<H2>Odds and ends</H2>
|
|
|
|
|
|
|
|
Some remarks that I could not fit in elsewhere:
|
|
|
|
|
|
|
|
<UL>
|
1996-08-06 13:16:20 -03:00
|
|
|
|
|
|
|
<LI> It may be possible to use the <code>PythonCore</code> shared
|
|
|
|
library to embed Python in another program, if your program can live
|
1997-05-07 12:43:38 -03:00
|
|
|
with using GUSI for I/O. Use PythonCore in stead of your MSL C library
|
2003-01-08 12:27:44 -04:00
|
|
|
(or, at the very least, link it before the normal C library). Ask for help
|
|
|
|
on PythonMac-SIG if you have problems with this.
|
1996-08-06 13:16:20 -03:00
|
|
|
|
2002-01-08 19:03:45 -04:00
|
|
|
<LI> <a name="extending"></a>It is possible to build PPC extension
|
|
|
|
modules without building a complete Python. The binary distribution
|
|
|
|
installer can optionally install all the needed folders (the develop
|
|
|
|
option). A template for a dynamic module can be found in
|
1997-08-27 11:08:22 -03:00
|
|
|
<code>xx.prj</code>.
|
1996-08-23 12:44:18 -03:00
|
|
|
|
|
|
|
<LI> The Python shared library architecture is a variant of the architecture
|
|
|
|
described as "application with shared libraries and dropins" in the MetroWerks
|
|
|
|
"Targeting MacOS" documentation. The Python Application and applet-template use
|
1997-05-07 12:43:38 -03:00
|
|
|
the <code>MSL AppRuntime.Lib</code> runtime library (with properly set CFM
|
|
|
|
initialization and termination routines). PythonCore uses <code>MSL Runtime.Lib</code>,
|
|
|
|
which is really intended for standalone programs but which we fool into working by
|
|
|
|
providing a dummy main program.
|
1996-08-23 12:44:18 -03:00
|
|
|
It is linked statically into PythonCore (and exported to the applications and plugins)
|
|
|
|
so we do not have to distribute yet another shared library. Plugin modules use
|
1997-05-07 12:43:38 -03:00
|
|
|
<code>MSL ShlibRuntime.Lib</code> (not the dropin runtime: modules are never unloaded)
|
|
|
|
and obtain the rest from PythonCore. PythonCore uses a
|
1996-08-23 12:44:18 -03:00
|
|
|
non-standard initialization entry point, <code>__initialize_with_resources</code>, to
|
1997-05-07 12:43:38 -03:00
|
|
|
be able to obtain resources from the library file later on. Plugins can do the same
|
|
|
|
(_tkinter does) or use the standard <code>__initialize</code> entry point.
|
1996-08-05 12:34:45 -03:00
|
|
|
|
|
|
|
|
1997-01-15 12:53:37 -04:00
|
|
|
</UL>
|
1996-08-05 12:34:45 -03:00
|
|
|
</BODY>
|
|
|
|
</HTML>
|