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

Skip to content

Commit e0b1e6a

Browse files
committed
Updated for CW7 and Tcl/Tk 8.3.4. Also added a few other things
that were changed but not yet reflected in this document.
1 parent 850bbcd commit e0b1e6a

1 file changed

Lines changed: 44 additions & 52 deletions

File tree

Mac/Demo/building.html

Lines changed: 44 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ <H1>Building Mac Python from source</H1>
1212
working knowledge of the CodeWarrior development environment, a good net
1313
connection and probably quite some time too. <p>
1414

15+
Note that if you only want to build new extension modules you don't need to
16+
build Python from source, see the <a href="#extending">note on extending Python</a>.<p>
17+
1518
The information density in this file is high, so you should probably
1619
print it and read it at your leasure. Most things are explained only
1720
once (and probably in the wrong place:-). <p>
@@ -20,7 +23,7 @@ <H1>Building Mac Python from source</H1>
2023
First a warning: this information may become outdated if a new CodeWarrior is
2124
released after MacPython. The
2225
<a href="http://www.cwi.nl/~jack/macpython.html">MacPython homepage</a> will
23-
hopefully have updated instructions in that case.
26+
hopefully have updated instructions in that case. These instructions are for CW7.
2427
</blockquote>
2528

2629
I am very interested in feedback on this document, send your
@@ -47,7 +50,7 @@ <H2>What you need.</H2>
4750
repository use</a> below.
4851

4952
<LI> You need MetroWerks CodeWarrior. The current distribution has
50-
been built with CodeWarrior Pro 6.1. Ordering information is
53+
been built with CodeWarrior Pro 7.1. Ordering information is
5154
available on the <A HREF="http://www.metrowerks.com/">MetroWerks
5255
homepage</A>. Building Python with MPW, Think/Symantec C or the OSX
5356
developer tools is impossible without major surgery.
@@ -56,8 +59,8 @@ <H2>What you need.</H2>
5659
Matthias Neeracher. The original GUSI is obtainable from <A
5760
HREF="ftp://gusi.sourceforge.net/pub/gusi/">
5861
ftp://gusi.sourceforge.net/pub/gusi/</A>. At
59-
the moment Python is built with a slightly modified version of GUSI
60-
2.1.1, so it may be better to check the <A
62+
the moment Python is built with a modified version of GUSI
63+
with Carbon adaptations, so it may be better to check the <A
6164
HREF="http://www.cwi.nl/~jack/macpython.html">MacPython homepage</A>
6265
for a GUSI that is most easily used for building Python.
6366

@@ -74,9 +77,8 @@ <H2>What you need.</H2>
7477

7578
<UL>
7679

77-
<LI> Tcl and Tk are in a sad state on the Mac, the standard source distributions
78-
simply don't compile, so I have created a distribution especially for use
79-
with MacPython.
80+
<LI> Tcl and Tk are somewhat less supported on the Mac than on Unix
81+
or Windows.
8082
See the section on <A HREF="#tcltk">building Tcl/Tk Python</A>
8183
below.
8284

@@ -116,7 +118,6 @@ <H2>Setting Up</H2>
116118
<PRE>
117119
Top-level-folder:
118120
GUSI2
119-
GUSI2Carbon
120121
imglibs
121122
jpeg
122123
netpbm
@@ -131,10 +132,7 @@ <H2>Setting Up</H2>
131132
Modules
132133
Build
133134
...
134-
Tcl/Tk Folder
135-
tcl8.0
136-
tk8.0
137-
MoreFiles 1.4.3
135+
Tcl/Tk Folder 8.3.4
138136
</PRE>
139137

140138
If your setup of the libraries is exactly the same as mine (which is
@@ -144,7 +142,7 @@ <H2>Setting Up</H2>
144142
fell swoop, otherwise you will have to build the libraries one by
145143
one. <p>
146144

147-
First build GUSI, both the norla one and the Carbon variant.
145+
First build GUSI, both the normal one and the Carbon variant.
148146
<p>
149147

150148
Next, in
@@ -156,22 +154,22 @@ <H2>Setting Up</H2>
156154

157155
<H2><A NAME="tcltk">Building Tcl/Tk</H2>
158156

159-
The Tcl/Tk 8.3.0 source distribution does not work on the Mac. I have created
160-
an archive of the sources that I used to build _tkinter for MacPython,
161-
you can obtain this from <a
162-
href="ftp://ftp.cwi.nl/pub/jack/python/mac/tcltk830src-for-python.sit">
163-
ftp://ftp.cwi.nl/pub/jack/python/mac/tcltk830src-for-python.sit</a>. Only the
164-
libraries needed to build _tkinter for PPC have been fixed. <P>
157+
Tkinter has been built with Tcl/Tk 8.3.4. Load the Mac source distribution
158+
from the tcl sourceforge site and build it. Build with CW7, but you will
159+
need CW6 to build the MDEF resource (or copy it from a binary
160+
installation). As of this writing the projects are CW6, so they need
161+
massaging to build with CW7, but this is a lot less work than applying
162+
all the workarounds for CW6 that the build instructions give. <P>
165163

166164
Note that if you use a different release of Tcl and Tk than the ones
167165
I have used you may have to adapt the Python <code>tkresources.rsrc</code> file.
168-
This is easiest done by building <code>SimpleTk</code> and copying the TEXT, ICON
166+
This is easiest done by building <code>Tk8.3.shlb</code> and copying the TEXT, ICON
169167
and CRSR resources from it to <code>tkresources.rsrc</code>. This allows
170168
the <code>_tkinter</code> module to work without an installed Tk/Tcl on your
171169
machine. <P>
172170

173171
Also note that the <code>_tkinter.ppc.slb</code> that is normally distributed
174-
in the <code>PlugIns</code> folder is the one from the Imaging extension,
172+
in the <code>lib-dynload</code> folder is the one from the Imaging extension,
175173
which has some extra features needed by PIL (and which features should not
176174
hinder normal operation).
177175

@@ -215,6 +213,12 @@ <H2>The organization of the Python source tree</H2>
215213
<DD> Machine-independent optional modules. Not all of these will work
216214
on the Mac.
217215

216+
<DT> Lib
217+
<DD> Machine-independent modules in Python.
218+
219+
<DT> Lib:lib-dynload
220+
<DD> This is where the Classic and Carbon dynamically-loaded plugin modules live.
221+
218222
<DT> Objects
219223
<DD> Machine-independent code for various object types. Most of these are
220224
not really optional: the interpreter will not function without them.
@@ -256,9 +260,9 @@ <H2>The organization of the Python source tree</H2>
256260
<DD> Mac-specific but compiler-independent include files.
257261

258262
<DT> Lib
259-
<DD> Mac-specific standard modules. The <code>toolbox</code> folder
263+
<DD> Mac-specific standard modules. The <code>Carbon</code> package
260264
contains modules specifically needed with various MacOS toolbox
261-
interface modules.
265+
interface modules, both for Carbon and classic PPC, despite the name.
262266

263267
<DT> Modules
264268
<DD> Mac-specific builtin modules. Theoretically these are all
@@ -285,8 +289,13 @@ <H2>The organization of the Python source tree</H2>
285289
possibly changing the list of files included in the project window, of
286290
course).
287291

288-
<DT> PlugIns
289-
<DD> This is where the Classic and Carbon dynamically-loaded plugin modules live.
292+
<DT> OSX
293+
<DD> Specific to unix-Python (also known as MachoPython) on OSX, not used
294+
by MacPython.
295+
296+
<DT> OSXResources
297+
<DD> Specific to unix-Python (also known as MachoPython) on OSX, not used
298+
by MacPython.
290299

291300
<DT> Python
292301
<DD> Mac-specific parts of the core interpreter.
@@ -312,7 +321,7 @@ <H2>The organization of the Python source tree</H2>
312321
</DL>
313322

314323
<H2>Building the PPC interpreter</H2>
315-
<em>This is different under 2.1. You are best off using the fullbuild.py
324+
<em>This is different since 2.1. You are best off using the fullbuild.py
316325
script, see <a href="#fullbuild">below</a>. </em><p>
317326

318327
First you optionally build the external libraries with buildlibs.prj. Next,
@@ -345,7 +354,10 @@ <H2>Building the PPC interpreter</H2>
345354
<DT> PythonInterpeter
346355
<DD> The interpreter. This is basically a routine to call out to the
347356
shared library. Unlike in previous releases the same program is used for
348-
creating applets (for which formerly PythonApplet was used). <p>
357+
creating applets (for which formerly PythonApplet was used). There are 4 targets
358+
in here: two for the classic and carbon templates (which are normally used, and
359+
converted to PythonInterpreter by the ConfigurePython* applets) and two
360+
for PythonInterpreter in it's classic and carbon version.<p>
349361

350362
<DT> Plugin projects
351363
<DD> Each plugin module has a separate project, and these can be rebuilt on
@@ -382,28 +394,7 @@ <H2>Building the PPC interpreter</H2>
382394
You are all set now, and should read the release notes and
383395
<code>ReadMe</code> file from the <code>Mac</code> folder.
384396

385-
<H2>Rebuilding <code>.exp</code> files</H2>
386-
387-
Occasionally it may be necessary to rebuild your PythonCore <code>.exp</code>
388-
file, a file that controls which symbols are exported by your PythonCore
389-
shared library. Rebuild it if you get unexpected undefined symbols when you
390-
are building a plugin module. <p>
391-
392-
Rebuilding the .exp file is done by first both removing the file and removing the
393-
reference to it in the project (in the "config" section). Next, build PythonCore or
394-
PythonCoreCarbon.
395-
This will create a new .exp file, with the name <code>PythonCore.mcp.exp</code>.
396-
Rename this file to either <code>PythonCore.exp</code> or <code>PythonCoreCarbon.exp</code>
397-
and add this file back to the project. Next, edit ot to remove the references to
398-
the symbols <code>__initialize</code>, <code>__terminate</code>, <code>setjmp</code>,
399-
<code>longjmp</code>, <code>vec_longjmp</code>, <code>main</code> and <code>__ptmf_null</code>.
400-
They are all close together about halfway the file.
401-
402-
Finally rebuild again. <p>
403-
404-
This rather convoluted procedure is needed to ensure that plugin modules don't
405-
accidentally link with those entrypoints from PythonCore, which will not work because
406-
those routines have to be in the same code fragment as they are used from.
397+
Rebuilding .exp files is no longer needed since CodeWarrior 7.
407398

408399
<H2><a name="cvs">Using the CVS source archive</a></H2>
409400

@@ -458,9 +449,10 @@ <H2>Odds and ends</H2>
458449
with using GUSI for I/O. Use PythonCore in stead of your MSL C library
459450
(or, at the very least, link it before the normal C library).
460451

461-
<LI> It is possible to build PPC extension modules without building a
462-
complete Python. The binary distribution installer can optionally install
463-
all the needed folders (the develop option). A template for a dynamic module can be found in
452+
<LI> <a name="extending"></a>It is possible to build PPC extension
453+
modules without building a complete Python. The binary distribution
454+
installer can optionally install all the needed folders (the develop
455+
option). A template for a dynamic module can be found in
464456
<code>xx.prj</code>.
465457

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

0 commit comments

Comments
 (0)