Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a6cdcc

Browse files
committed
Updated for 2.0b1
1 parent e61aca7 commit 8a6cdcc

5 files changed

Lines changed: 126 additions & 148 deletions

File tree

Mac/Demo/building.html

Lines changed: 62 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ <H1>Building Mac Python from source</H1>
77
<HR>
88

99
This document explains how to build MacPython from source. This is
10-
necessary if you want to write extension modules for 68K Python, and
11-
is also necessary if you want to make modifications to the Python core.
12-
Building Python is not something to be undertaken lightly,
13-
you need a reasonable working
14-
knowledge of the CodeWarrior development environment, a good net
10+
necessary if you want to make modifications to the Python core. Building
11+
Python is not something to be undertaken lightly, you need a reasonable
12+
working knowledge of the CodeWarrior development environment, a good net
1513
connection and probably quite some time too. <p>
1614

1715
The information density in this file is high, so you should probably
@@ -43,49 +41,42 @@ <H2>What you need.</H2>
4341
http://www.cwi.nl/~jack/macpython.html</A> (which has up-to-date links
4442
to the other packages needed too) and possibly also from the standard
4543
<A HREF="ftp://ftp.python.org/pub/python/mac">python.org ftp
46-
site</A>. Everything you need is also included in the standard Python
47-
source distribution, but the organization is different. Look in
48-
directory <code>Mac/mwerks/projects</code> for the project files and
49-
related stuff. <BR>
44+
site</A>. <BR>
5045

51-
An alternative is to check the sources straight out of the CVS
46+
A better alternative is to check the sources straight out of the CVS
5247
repository, see below. Most of the packages mentioned here are also
5348
available through CVS. Check the section on <a href="#cvs">CVS
5449
repository use</a> below.
5550

5651
<LI> You need MetroWerks CodeWarrior. The current distribution has
57-
been built with CodeWarrior Pro 4. Ordering information is
52+
been built with CodeWarrior Pro 5.2. Ordering information is
5853
available on the <A HREF="http://www.metrowerks.com/">MetroWerks
5954
homepage</A>. Building Python with MPW or Think/Symantec C is
6055
probably impossible without major surgery.
6156

62-
<LI> You need GUSI, the Grand Unified Socket Interface, by Matthias
63-
Neeracher. The original CWGUSI is
64-
obtainable from <A
65-
HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/src">
66-
ftp://sunsite.cnlab-switch.ch/software/platform/macos/src</A>.
67-
At the moment Python is built with a slightly modified version of GUSI,
68-
these modifications are available in folder <code>Python:Mac:GUSI-mods</code>. <br>
57+
<LI> You need GUSI version 2, the Grand Unified Socket Interface, by
58+
Matthias Neeracher. The original GUSI is obtainable from <A
59+
HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/src/mw_c">
60+
ftp://sunsite.cnlab-switch.ch/software/platform/macos/src/mw_c</A>. At
61+
the moment Python is built with a slightly modified version of GUSI
62+
2.1.1, so it may be better to check the <A
63+
HREF="http://www.cwi.nl/~jack/macpython.html">MacPython homepage</A>
64+
for a GUSI that is most easily used for building Python.
65+
<br>
6966

7067
The modified GUSI is also in the MacPython cvs source repository, in the
71-
directory <code>lib-src/CWGUSI</code>. However, some files contain slashes in
72-
their names, something CVS seriously frowns upon, and each slash has been
73-
replaced by <code>"_s_"</code>. There is a script
74-
<code>Mac:scripts:fixgusidir.py</code> which you should run after checking CWGUSI
75-
out
76-
68+
directory <code>lib-src/GUSI2</code>. As GUSI is moving to sourceforge
69+
this info may be outdated by the time you read it so better check the
70+
MacPython homepage, probably.
7771
</UL>
7872

7973
<A NAME="optional">The MacPython project files are configured to
8074
include a plethora of optional modules</A>, and these modules need a
8175
number of extra packages. To use the project files as-is you have to
82-
download these packages too. PPC and CFM68K Python have all such modules as
76+
download these packages too. Python has all such modules as
8377
dynamically loaded modules, so if you don't need a certain package it
84-
suffices to just refrain from builing the extension module. For static 68K
85-
Python things are a bit more complicated: you have to edit the
86-
interpreter project file to remove the reference to the module (and
87-
the libraries it uses), and edit the <code>Mac:mwerks:mwerks_nonshared_config.h</code>
88-
file to remove the <code>USE_...</code> line. Here are the locations for the various things
78+
suffices to just refrain from builing the extension module.
79+
Here are the locations for the various things
8980
you need:
9081

9182
<UL>
@@ -134,7 +125,7 @@ <H2>Setting Up</H2>
134125

135126
<PRE>
136127
Top-level-folder:
137-
CWGUSI
128+
GUSI2
138129
imglibs
139130
jpeg
140131
netpbm
@@ -159,25 +150,21 @@ <H2>Setting Up</H2>
159150
If your setup of the libraries is exactly the same as mine (which is
160151
not very likely, unless you happen to work from the same CVS
161152
repository) you can use the project <code>buildlibs.prj</code> in the
162-
<code>:Mac:build.mac</code> folder to build all needed libraries in one
153+
<code>:Mac:Build</code> folder to build all needed libraries in one
163154
fell swoop, otherwise you will have to build the libraries one by
164155
one. <p>
165156

166157
First build GUSI. If you didn't get the python-specific GUSI you have to
167-
move the files from the "CWGUSI-mods" to the right
168-
place in the CWGUSI distribution folder. Build the MSL version for your
169-
platform (ppc, 68k, cfm68k). <p>
170-
171-
<em>Note:</em> always rebuild the CWGUSI libraries, even if you have
172-
checked them out from the CVS repository. <P>
158+
massage some of the Python code (missing routines) and you'll miss the
159+
functionality of "delay console".
160+
<p>
173161

174162
Next, in
175-
<code>MoreFiles</code>, <code>libjpeg</code>, <code>pbmplus</code>,
163+
<code>libjpeg</code>, <code>pbmplus</code>,
176164
<code>zlib</code>, <code>libpng</code>, <code>gdbm</code>,
177165
and<code>libtiff</code> you build all projects. Usually the projects are in "mac"
178166
subfolders, sometimes they are in the main folder. Tcl/tk is a special
179-
case, see below. Of course, if you are only interested in one of
180-
static 68K, CFM68K or PPC you can skip building the other libraries.
167+
case, see below.
181168

182169
<H2><A NAME="tcltk">Building Tcl/Tk</H2>
183170

@@ -222,14 +209,12 @@ <H2>The organization of the Python source tree</H2>
222209
<DL>
223210
<DT> Demo
224211
<DD> Demo programs that are not Mac-specific. Some of these may not
225-
work, the file <code>README-Mac</code> has some details.
212+
work.
226213

227214
<DT> Extensions
228215
<DD> Extensions to the interpreter that are not Mac-specific. Contains
229-
the <code>img</code>, <code>Imaging</code> and <code>Numeric</code> extensions
230-
in this distribution. Nowadays, the extensions are all built in their own
231-
folders (unlike in older distributions, where img was incorporated in the main
232-
build procedure).
216+
the <code>img</code>, <code>Imaging</code> and <code>Numerical</code> extensions
217+
in this distribution.
233218

234219
<DT> Grammar
235220
<DD> The Python grammar. Included for reference only, you cannot build
@@ -243,7 +228,7 @@ <H2>The organization of the Python source tree</H2>
243228
on the Mac.
244229

245230
<DT> Objects
246-
<DD> Machine-independent code for various objects. Most of these are
231+
<DD> Machine-independent code for various object types. Most of these are
247232
not really optional: the interpreter will not function without them.
248233

249234
<DT> Parser
@@ -254,11 +239,12 @@ <H2>The organization of the Python source tree</H2>
254239
are unix-specific and not used on the Mac.
255240

256241
<DT> Tools
257-
<DD> Tools for python developers. Contains <code>modulator</code>
258-
which builds skeleton C extension modules and <code>bgen</code> which
259-
generates complete interface modules from information in C header
260-
files. There are some readme files, but more documentation is sorely
261-
needed.
242+
<DD> Tools for python developers. Contains <code>modulator</code> which
243+
builds skeleton C extension modules, <code>bgen</code> which generates
244+
complete interface modules from information in C header files and
245+
<code>freeze</code> which is used to turn Python scripts into real
246+
applications (used by MacFreeze and BuildApplication) There are some
247+
readme files, but more documentation is sorely needed.
262248

263249
</DL>
264250

@@ -271,8 +257,8 @@ <H2>The organization of the Python source tree</H2>
271257
the toplevel folder or the Mac:PlugIns folder (for plugin modules).
272258

273259
<DT> Compat
274-
<DD> Unix-compatability routines. Some of these are not used anymore,
275-
since CWGUSI provides a rather complete emulation, but you may need
260+
<DD> Unix-compatability routines. Most of these are not used anymore,
261+
since GUSI provides a rather complete emulation, but you may need
276262
these if you are trying to build a non-GUSI python.
277263

278264
<DT> Demo
@@ -339,25 +325,14 @@ <H2>The organization of the Python source tree</H2>
339325

340326
<H2>Building the 68K interpreter</H2>
341327

342-
If you have all the optional libraries mentioned <A
343-
HREF="#optional">above</A> loaded building Python for 68K macs is a
344-
breeze: in the Mac:Build folder you build the libraries with buildlibs.prj
345-
and then the interpreter with PythonStandalone.prj. <p>
346-
347-
If you were previously running another copy of this Python release,
348-
from a binary installer for instance, you should
349-
first remove the <code>Python XXX preferences</code> file from your
350-
preference folder. Next, run the interpreter, in the toplevel folder. This will
351-
create a correct initial preferences file. You are now all set, and
352-
your tree should be completely compatible with a binary-only
353-
distribution. Read the release notes
354-
(<code>Relnotes-somethingorother</code>) and
355-
<code>ReadMe</code> in the <code>Mac</code> folder. <p>
356-
357-
If something goes wrong you may end up with a garbled preferences file. Removing
358-
it from the system folder and running Python once again will re-create it.
328+
68K Python is no longer supported, and the projects are not included in the
329+
source distirbution anymore. If you really want to build Python for the 68K
330+
your best bet is to check the sources out of the CVS repository. The latest
331+
projects (in :Mac:build:) that support 68K development are tagged as such,
332+
and are dated around August 2000. If you plan on doing this announce it on
333+
the SIG, please. <p>
359334

360-
<H2>Building the PPC and CFM68K interpreter</H2>
335+
<H2>Building the PPC interpreter</H2>
361336

362337
First you optionally build the external libraries with buildlibs.prj. Next,
363338
the projects for
@@ -371,14 +346,16 @@ <H2>Building the PPC and CFM68K interpreter</H2>
371346

372347
<DL>
373348

374-
<DT> PythonCore (with subprojects PythonCorePPC and PythonCoreCFM68K)
349+
<DT> PythonCore (with subproject PythonCorePPC)
375350
<DD> The shared library that contains the bulk of the interpreter and
376351
its resources. It is a good idea to immedeately put an alias to this
377352
shared library in the <code>Extensions</code> folder of your system
378353
folder. Do exactly that: put an <em>alias</em> there, copying or
379354
moving the file will cause you grief later if you rebuild the library and
380355
forget to copy it to the extensions folder again. The InstallPython applet
381-
will also do this, along with creating the plugin aliases.
356+
will also do this, along with creating the plugin aliases. <br>
357+
Note that the subproject looks a bit silly nowadays (with no more CFM68K
358+
support) but you will have to live with that for this release.
382359

383360
<DT> PythonInterpeter
384361
<DD> The interpreter. This is basically a routine to call out to the
@@ -387,11 +364,12 @@ <H2>Building the PPC and CFM68K interpreter</H2>
387364

388365
<DT> Plugin projects
389366
<DD> Each plugin module has a separate project. The <code>Plugins.prj</code>
390-
project tries to build them all, but is known to be flakey under CW Pro 4.
367+
project tries to build them all, but is known to be flakey. See <code>fullbuild</code>
368+
below for a better way to build everything.
391369
</DL>
392370

393371
After creating the alias to <code>PythonCore</code> you remove any old
394-
<code>Python XXX Preferences</code> file from the <code>Preferences</code> folder
372+
<code>Python 2.0b1 Preferences</code> file from the <code>Preferences</code> folder
395373
(if you had python installed on your system before) and run the interpreter once
396374
to create the correct preferences file. <p>
397375

@@ -409,10 +387,10 @@ <H2>Building the PPC and CFM68K interpreter</H2>
409387
Actually, the <code>fullbuild</code> script can be used to build
410388
everything, but you need a fully-functional interpreter before you can
411389
use it (and one that isn't rebuilt in the process: you cannot rebuild
412-
a running program). You could copy the 68K interpreter to a different
413-
place and use that to run fullbuild, or use the standalone PPC python
414-
for this. I tend to keep a standalone interpreter in a safe place for
415-
this use only. <p>
390+
a running program). You could copy the interpreter to a different
391+
place and use that to run fullbuild. The <code>PythonStandSmall.prj</code>
392+
project builds an interpreter that is suited to this, and it can also come
393+
in handy if you need to debug things (which is easier in a static program). <p>
416394

417395
</BLOCKQUOTE>
418396

@@ -441,7 +419,7 @@ <H2>Rebuilding <code>.exp</code> files for PPC and CFM68K</H2>
441419

442420
<H2><a name="cvs">Using the CVS source archive</a></H2>
443421

444-
It is possible to access the Python sources through remote CVS. The
422+
It is possible (and probably best) to access the Python sources through remote CVS. The
445423
advantage of this is that you get the very latest sources, so any bug
446424
fixed or new features will be immedeately available. This is also the
447425
disadvantage, of course: as this is the same tree as is used for
@@ -461,7 +439,7 @@ <H2><a name="cvs">Using the CVS source archive</a></H2>
461439
is not a Windows bitmap file. <p>
462440

463441
The machine-independent Python sources are checked out from the main
464-
Python CVS archive, see the <a
442+
Python CVS archive on sourceforge.net, see the <a
465443
href="http://www.python.org/download/cvs.html">Source access via
466444
CVS</a> page for details. When you check the sources out you will get
467445
something like <code>Python:dist:src</code>, and under that the
@@ -503,12 +481,11 @@ <H2>Odds and ends</H2>
503481
<LI> It may be possible to use the <code>PythonCore</code> shared
504482
library to embed Python in another program, if your program can live
505483
with using GUSI for I/O. Use PythonCore in stead of your MSL C library
506-
(or, at the very least, link it before the normal C library). Let me
507-
know whether this works.
484+
(or, at the very least, link it before the normal C library).
508485

509486
<LI> It is possible to build PPC extension modules without building a
510487
complete Python. The binary distribution installer can optionally install
511-
all the needed folders. A template for a dynamic module can be found in
488+
all the needed folders (the develop option). A template for a dynamic module can be found in
512489
<code>xx.prj</code>.
513490

514491
<LI> The Python shared library architecture is a variant of the architecture

Mac/Demo/embed.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<H1>Embedding Python on the Mac</H1>
77
<HR>
88
<B>Note</B>: if you have a binary-only release of MacPython you will not
9-
have this demo installed. Go to
9+
have this demo installed. Install the developer option (in the standard installer) or go to
1010
<a href="http://www.cwi.nl/~jack/macpython.html">Jack's MacPython Page</a>
11-
to download either a source or a development release if you want to embed
11+
to download either a source release if you want to embed
1212
Python in other applications. <p>
1313

1414
Embedding Python on the mac is pretty similar to embedding it on other

Mac/Demo/freezing.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ <H2>The easy way</H2>
2323
it on the <code>BuildApplication</code> applet in the main Python folder.
2424
BuildApplication has a similar interface as BuildApplet: you drop a script on
2525
it and it will process it, along with an optional <code>.rsrc</code> file.
26-
It does ask one extra question: whether you want to build your application for
27-
PPC macs only, 68K macs or any Mac.<P>
26+
<P>
2827

2928
What BuildApplication does, however, is very different. It parses your script,
3029
recursively looking for all modules you use, bundles the compiled code for

Mac/Demo/using.html

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<HTML>
22
<HEAD>
3-
<TITLE>Using Python 1.5 on the Macintosh</TITLE>
3+
<TITLE>Using Python 2.0 on the Macintosh</TITLE>
44
</HEAD>
55
<BODY>
6-
<H1>Using Python 1.5 on the Macintosh</H1>
6+
<H1>Using Python 2.0 on the Macintosh</H1>
77
<HR>
88

99
This document is an introduction to using Python on the Apple
@@ -15,26 +15,32 @@ <H1>Using Python 1.5 on the Macintosh</H1>
1515

1616
The tutorial, along with other indispensible documentation like the
1717
library reference and such, is also available in a number of different
18-
formats at <a href="ftp://ftp.python.org/pub/python/doc">
19-
ftp://ftp.python.org/pub/python/doc</a>. The Adobe Acrobat <code>.pdf</code>
18+
formats at <a href="http://www.python.org">
19+
www.python.org</a>. The Adobe Acrobat <code>.pdf</code>
2020
files are probably a good choice for reading or printing the documents
2121
from your mac. <p>
2222

2323
There is currently no good tutorial for the mac-specific features of
2424
Python, but to whet your appetite: it has interfaces to many MacOS
2525
toolboxes (quickdraw, sound, quicktime, open scripting, etc) and
26-
various portable toolboxes are available too (Tk, stdwin, complex
26+
various portable toolboxes are available too (Tk, complex
2727
numbers, image manipulation, etc). Some <A HREF="index.html">
2828
annotated sample programs</A> are available to give you an idea of
2929
Python's power. <P>
3030

31-
<h2>Invoking the interpreter</h2>
31+
<h2>Using Python</h2>
3232

33-
The name of the interpreter may differ on different installations: it
34-
may be called <CODE>PythonFAT</CODE> (for powerpc macs and 68K macs with
35-
CFM68K installed) or <CODE>Python68K</CODE> (for 68K macs).
36-
It will always
37-
be recognizable by the "16 ton" icon, though. You start the
33+
The best way to start using Python is by using the <code>Python IDE</code>,
34+
an integrated development environment with editor, debugger, class browser, etc.
35+
Unfortunately the IDE is not yet documented here. Fortunately, however, it does not
36+
need much documentation, so your best bet is to try it. <p>
37+
38+
<h2>Invoking the bare interpreter</h2>
39+
40+
An alternative method to use Python (and the method this document unfortunately emphasizes,
41+
see the comment above) is to use the bare interpreter and an external text editor.
42+
The name of the interpreter is <CODE>PythonInterpreter</CODE> and it is
43+
recognizable by the "16 ton" icon. You start the
3844
interpreter in interactive mode by double-clicking its icon: <p>
3945

4046
<img src="html.icons/python.gif"><p>
@@ -417,7 +423,7 @@ <h2>Your five minutes are up. Next!</h2>
417423

418424
<HR>
419425
<A HREF="http://www.cwi.nl/~jack">Jack Jansen</A>,
420-
<A HREF="mailto:[email protected]">[email protected]</A>, 27-Apr-98.
426+
<A HREF="mailto:[email protected]">[email protected]</A>, 10-Sep-00.
421427

422428
</BODY>
423429
</HTML>

0 commit comments

Comments
 (0)