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

Skip to content

Commit 1473af7

Browse files
committed
Updated for building with MSL libraries
1 parent 2fe3a37 commit 1473af7

1 file changed

Lines changed: 50 additions & 41 deletions

File tree

Mac/Demo/building.html

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ <H2>What you need.</H2>
3232

3333
<LI> You need a MacPython source distribution, of course. You can
3434
obtain one from <A
35-
HREF="ftp://ftp.cwi.nl/pub/jack/python/mac">ftp://ftp.cwi.nl/pub/jack/python/mac</A>,
35+
HREF="ftp://ftp.cwi.nl/pub/jack/python/mac">ftp://ftp.cwi.nl/pub/jack/python/mac</A>
36+
or from the companion webpage at <A HREF="http://www.cwi.nl/~jack/macpython.html">
37+
http://www.cwi.nl/~jack/macpython.html</A> (which has up-to-date links to the other
38+
packages needed too)
3639
and possibly also from the standard <A
3740
HREF="ftp://ftp.python.org/pub/python/mac">python.org ftp
3841
site</A>. Everything you need is also included in the standard Python
@@ -41,18 +44,19 @@ <H2>What you need.</H2>
4144
related stuff.
4245

4346
<LI> You need MetroWerks CodeWarrior. The current distribution has
44-
been built with version 10 of CodeWarrior. Ordering information is
47+
been built with version 11 of CodeWarrior. Ordering information is
4548
available on the <A HREF="http://www.metrowerks.com/">MetroWerks
4649
homepage</A>. You might still be able to build Python with MPW or
4750
Think/Symantec C but you are basically on your own.
4851

4952
<LI> You need GUSI, the Grand Unified Socket Interface, by Matthias
50-
Neeracher. The current distribution has been built with a modified version of
51-
CWGUSI 1.8.0. CWGUSI is
53+
Neeracher. The original CWGUSI is
5254
obtainable from <A
5355
HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/src">
54-
ftp://sunsite.cnlab-switch.ch/software/platform/macos/src</A>.
55-
It is possible to build a non-GUSI Python, see below.
56+
ftp://sunsite.cnlab-switch.ch/software/platform/macos/src</A>,
57+
but at the moment Python is built with a rather hacked-up version of GUSI,
58+
available from Jack's Python webpage and ftp-directory referenced above.
59+
It is also possible to build a non-GUSI Python, see below.
5660

5761
</UL>
5862

@@ -82,30 +86,30 @@ <H2>What you need.</H2>
8286
HREF="ftp://rhino.harvard.edu/pub/dan/WASTE">&lt;ftp://rhino.harvard.edu/pub/dan/WASTE&gt;</A>
8387
and various other places.
8488

85-
<LI> JPEG library by the Independent JPEG Group. Python is still built
86-
using an archaic version of the library, version 4. It can be obtained
87-
from the <A HREF="ftp://ftp.cwi.nl/pub/jack/python/mac">
88-
ftp://ftp.cwi.nl/pub/jack/python/mac</A> directory, complete with CW8
89-
projects. If someone manages to build Python with the version 6
90-
library I would be grateful if they sent me the changes needed. The
91-
most recent JPEG library can always be obtained from <A
89+
<LI> Gdbm library for the Mac. Available from Jack's Mac software page at
90+
<A HREF="http://www.cwi.nl/~jack/macsoftware.html">
91+
http://www.cwi.nl/~jack/macsoftware.html</A> and <A HREF="ftp://ftp.cwi.nl/pub/jack/mac">
92+
ftp://ftp.cwi.nl/pub/jack/mac</A>.
93+
94+
<LI> JPEG library by the Independent JPEG Group. A version including
95+
Mac projects can be found at Jack's page mentioned above.
96+
The most recent JPEG library can always be obtained from <A
9297
HREF="ftp://ftp.uu.net/graphics/jpeg/">ftp://ftp.uu.net/graphics/jpeg/</A>.
9398

94-
<LI> The netpbm/pbmplus and libtiff libraries. The netpbm distribution
99+
<LI> The netpbm/pbmplus, libtiff, zlib and png libraries. The netpbm distribution
95100
(which includes libtiff) is generally available on Internet ftp
96101
servers. For Python pbmplus, an older incarnation of netpbm, is
97102
functionally identical to netpbm, since Python only uses the library
98103
and not the complete applications. A distribution with correct
99-
projects and library source only is available from, you guessed it, <A
100-
HREF="ftp://ftp.cwi.nl/pub/jack/python/mac">ftp://ftp.cwi.nl/pub/jack/python/mac</A>.
104+
projects and library source only is available from, you guessed it, Jack's Mac software
105+
page mentioned above.
101106

102107
</UL>
103108

104109
<H2>Setting Up</H2>
105110

106111
Now that you have collected everything you should start with building
107-
the various parts. Everything is independent, with the single
108-
exception that Tcl and Tk depend on CWGUSI. If you don't want to fix
112+
the various parts. If you don't want to fix
109113
access paths try to set things up as follows:
110114

111115
<PRE>
@@ -114,15 +118,19 @@ <H2>Setting Up</H2>
114118
imglibs
115119
libjpeg
116120
pbmplus
117-
libtiff
121+
libtiff
122+
zlib
123+
libpng
124+
gdbm
118125
MoreFiles 1.4.3 (not needed by Python, only by tcl/tk)
119126
Python
120127
Tcl 7.6
121128
Tk 4.2
122129
Waste 1.2 distribution (if you want waste)
123130
</PRE>
124131

125-
First build GUSI. Move the files from the "CWGUSI-mods" to the right
132+
First build GUSI. If you didn't get the python-specific GUSI you have to
133+
move the files from the "CWGUSI-mods" to the right
126134
place in the CWGUSI distribution folder, and build the
127135
projects <code>GUSI.68K.µ</code>, <code>GUSI.CFM68K.µ</code> and
128136
<code>GUSI.PPC.µ</code>.
@@ -141,8 +149,10 @@ <H2>Setting Up</H2>
141149
"Delay Sioux window" preferences in Python.
142150

143151
Next, in
144-
<code>MoreFiles</code>, <code>libjpeg</code>, <code>pbmplus</code>
145-
and<code>libtiff</code> you build all projects. Tcl/tk is a special
152+
<code>MoreFiles</code>, <code>libjpeg</code>, <code>pbmplus</code>,
153+
<code>zlib</code>, <code>libpng</code>, <code>gdbm</code>,
154+
and<code>libtiff</code> you build all projects. Sometimes the projects are in "mac"
155+
subfolders, sometimes they are in the main folder. Tcl/tk is a special
146156
case, see below. Of course, if you are only interested in one of
147157
static 68K, CFM68K or PPC you can skip building the other libraries.
148158

@@ -187,6 +197,8 @@ <H2><A NAME="tcltk">Building Tcl/Tk</H2>
187197
the <code>_tkinter</code> module to work without an installed Tk/Tcl on your
188198
machine.
189199

200+
<LI> You have to adapt the projects to use the MSL libraries. This is important.
201+
190202
</UL>
191203

192204
Build first the Tcl library, then
@@ -215,7 +227,7 @@ <H2>The organization of the Python source tree</H2>
215227

216228
<DL>
217229
<DT> build.mac68k.stand
218-
<DD> This is where you will build static 68K interpreters.
230+
<DD> This is where you build static 68K interpreters.
219231

220232
<DT> build.mac68k.shared
221233
<DD> This is where you build the CFM68K shared library, interpreter
@@ -363,10 +375,6 @@ <H2>Building the PPC interpreter</H2>
363375
the following:
364376

365377
<DL>
366-
<DT> MWRuntimeStaticLib
367-
<DD> A modified version of the MetroWerks runtime library that is
368-
suitable for Pythons' shared library architecture. The sources all
369-
come from the MW distribution.
370378

371379
<DT> PythonCorePPC
372380
<DD> The shared library that contains the bulk of the interpreter and
@@ -377,11 +385,10 @@ <H2>Building the PPC interpreter</H2>
377385

378386
<DT> PythonPPC
379387
<DD> The interpreter. This is basically a routine to call out to the
380-
shared library. Because of the organization of GUSI it also contains
381-
the Gusi settings resource (together with a ResEdit template, so you
382-
can change the gusi settings should you feel like doing so). Do
388+
shared library. Do
383389
<em>not</em> run it yet, this will possibly result in a garbled
384-
preferences file. <p>
390+
preferences file. See the section below on rebuilding .exp files if you
391+
get funny linker errors. <p>
385392

386393
<DT> PythonAppletPPC
387394
<DD> The applet skeleton application. Very similar to
@@ -440,7 +447,9 @@ <H2>Rebuilding <code>.exp</code> files for PPC and CFM68K</H2>
440447
reference to it in the project (in the "config" section). Next, build PythonCore.
441448
This will create a new .exp file. Edit this file to remove the references to
442449
the symbols <code>__initialize</code>, <code>__terminate</code>, <code>setjmp</code>,
443-
<code>longjmp</code> and <code>__ptmf_null</code>. Next, add the .exp file to the project
450+
<code>longjmp</code>, <code>main</code> and (for PPC) <code>__ptmf_null</code> or (for
451+
CFM68K) <code>__start</code> and <code>dummy_init_routine</code>.
452+
Next, add the .exp file to the project
444453
again and rebuild PythonCore. <p>
445454

446455
This rather convoluted procedure is needed to ensure that plugin modules don't
@@ -455,7 +464,7 @@ <H2>Odds and ends</H2>
455464

456465
<LI> It may be possible to use the <code>PythonCore</code> shared
457466
library to embed Python in another program, if your program can live
458-
with using GUSI for I/O. Use PythonCore in stead of your C library
467+
with using GUSI for I/O. Use PythonCore in stead of your MSL C library
459468
(or, at the very least, link it before the normal C library). Let me
460469
know whether this works.
461470

@@ -469,17 +478,17 @@ <H2>Odds and ends</H2>
469478
<LI> The Python shared library architecture is a variant of the architecture
470479
described as "application with shared libraries and dropins" in the MetroWerks
471480
"Targeting MacOS" documentation. The Python Application and applet-template use
472-
the <code>AppRuntime.Lib</code> runtime library (with properly set CFM
473-
initialization and termination routines). PythonCore uses <code>ShlibRuntime.Lib</code>
474-
and <code>MWRuntimeStaticLib.Lib</code>, which is almost identical to the MW
475-
standard <code>MWRuntimeLib</code>, but not dynamically loaded. This library contains
476-
the part of the runtime that can (or must) be shared between all modules in the program.
481+
the <code>MSL AppRuntime.Lib</code> runtime library (with properly set CFM
482+
initialization and termination routines). PythonCore uses <code>MSL Runtime.Lib</code>,
483+
which is really intended for standalone programs but which we fool into working by
484+
providing a dummy main program.
477485
It is linked statically into PythonCore (and exported to the applications and plugins)
478486
so we do not have to distribute yet another shared library. Plugin modules use
479-
<code>ShlibRuntime.Lib</code> and obtain the rest from PythonCore. PythonCore uses a
487+
<code>MSL ShlibRuntime.Lib</code> (not the dropin runtime: modules are never unloaded)
488+
and obtain the rest from PythonCore. PythonCore uses a
480489
non-standard initialization entry point, <code>__initialize_with_resources</code>, to
481-
be able to obtain resources from the library file lateron. Plugins can do the same or
482-
use the standard <code>__initialize</code> entry point.
490+
be able to obtain resources from the library file later on. Plugins can do the same
491+
(_tkinter does) or use the standard <code>__initialize</code> entry point.
483492

484493

485494
</UL>

0 commit comments

Comments
 (0)