Kaydet (Commit) 1473af76 authored tarafından Jack Jansen's avatar Jack Jansen

Updated for building with MSL libraries

üst 2fe3a371
...@@ -32,7 +32,10 @@ The following things you definitely need: ...@@ -32,7 +32,10 @@ The following things you definitely need:
<LI> You need a MacPython source distribution, of course. You can <LI> You need a MacPython source distribution, of course. You can
obtain one from <A obtain one from <A
HREF="ftp://ftp.cwi.nl/pub/jack/python/mac">ftp://ftp.cwi.nl/pub/jack/python/mac</A>, HREF="ftp://ftp.cwi.nl/pub/jack/python/mac">ftp://ftp.cwi.nl/pub/jack/python/mac</A>
or from the companion webpage at <A HREF="http://www.cwi.nl/~jack/macpython.html">
http://www.cwi.nl/~jack/macpython.html</A> (which has up-to-date links to the other
packages needed too)
and possibly also from the standard <A and possibly also from the standard <A
HREF="ftp://ftp.python.org/pub/python/mac">python.org ftp HREF="ftp://ftp.python.org/pub/python/mac">python.org ftp
site</A>. Everything you need is also included in the standard Python site</A>. Everything you need is also included in the standard Python
...@@ -41,18 +44,19 @@ directory <code>Mac/mwerks/projects</code> for the project files and ...@@ -41,18 +44,19 @@ directory <code>Mac/mwerks/projects</code> for the project files and
related stuff. related stuff.
<LI> You need MetroWerks CodeWarrior. The current distribution has <LI> You need MetroWerks CodeWarrior. The current distribution has
been built with version 10 of CodeWarrior. Ordering information is been built with version 11 of CodeWarrior. Ordering information is
available on the <A HREF="http://www.metrowerks.com/">MetroWerks available on the <A HREF="http://www.metrowerks.com/">MetroWerks
homepage</A>. You might still be able to build Python with MPW or homepage</A>. You might still be able to build Python with MPW or
Think/Symantec C but you are basically on your own. Think/Symantec C but you are basically on your own.
<LI> You need GUSI, the Grand Unified Socket Interface, by Matthias <LI> You need GUSI, the Grand Unified Socket Interface, by Matthias
Neeracher. The current distribution has been built with a modified version of Neeracher. The original CWGUSI is
CWGUSI 1.8.0. CWGUSI is
obtainable from <A obtainable from <A
HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/src"> HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/src">
ftp://sunsite.cnlab-switch.ch/software/platform/macos/src</A>. ftp://sunsite.cnlab-switch.ch/software/platform/macos/src</A>,
It is possible to build a non-GUSI Python, see below. but at the moment Python is built with a rather hacked-up version of GUSI,
available from Jack's Python webpage and ftp-directory referenced above.
It is also possible to build a non-GUSI Python, see below.
</UL> </UL>
...@@ -82,30 +86,30 @@ was built using version 1.2, which you can obtain from <A ...@@ -82,30 +86,30 @@ was built using version 1.2, which you can obtain from <A
HREF="ftp://rhino.harvard.edu/pub/dan/WASTE">&lt;ftp://rhino.harvard.edu/pub/dan/WASTE&gt;</A> HREF="ftp://rhino.harvard.edu/pub/dan/WASTE">&lt;ftp://rhino.harvard.edu/pub/dan/WASTE&gt;</A>
and various other places. and various other places.
<LI> JPEG library by the Independent JPEG Group. Python is still built <LI> Gdbm library for the Mac. Available from Jack's Mac software page at
using an archaic version of the library, version 4. It can be obtained <A HREF="http://www.cwi.nl/~jack/macsoftware.html">
from the <A HREF="ftp://ftp.cwi.nl/pub/jack/python/mac"> http://www.cwi.nl/~jack/macsoftware.html</A> and <A HREF="ftp://ftp.cwi.nl/pub/jack/mac">
ftp://ftp.cwi.nl/pub/jack/python/mac</A> directory, complete with CW8 ftp://ftp.cwi.nl/pub/jack/mac</A>.
projects. If someone manages to build Python with the version 6
library I would be grateful if they sent me the changes needed. The <LI> JPEG library by the Independent JPEG Group. A version including
most recent JPEG library can always be obtained from <A Mac projects can be found at Jack's page mentioned above.
The most recent JPEG library can always be obtained from <A
HREF="ftp://ftp.uu.net/graphics/jpeg/">ftp://ftp.uu.net/graphics/jpeg/</A>. HREF="ftp://ftp.uu.net/graphics/jpeg/">ftp://ftp.uu.net/graphics/jpeg/</A>.
<LI> The netpbm/pbmplus and libtiff libraries. The netpbm distribution <LI> The netpbm/pbmplus, libtiff, zlib and png libraries. The netpbm distribution
(which includes libtiff) is generally available on Internet ftp (which includes libtiff) is generally available on Internet ftp
servers. For Python pbmplus, an older incarnation of netpbm, is servers. For Python pbmplus, an older incarnation of netpbm, is
functionally identical to netpbm, since Python only uses the library functionally identical to netpbm, since Python only uses the library
and not the complete applications. A distribution with correct and not the complete applications. A distribution with correct
projects and library source only is available from, you guessed it, <A projects and library source only is available from, you guessed it, Jack's Mac software
HREF="ftp://ftp.cwi.nl/pub/jack/python/mac">ftp://ftp.cwi.nl/pub/jack/python/mac</A>. page mentioned above.
</UL> </UL>
<H2>Setting Up</H2> <H2>Setting Up</H2>
Now that you have collected everything you should start with building Now that you have collected everything you should start with building
the various parts. Everything is independent, with the single the various parts. If you don't want to fix
exception that Tcl and Tk depend on CWGUSI. If you don't want to fix
access paths try to set things up as follows: access paths try to set things up as follows:
<PRE> <PRE>
...@@ -114,7 +118,10 @@ Top-level-folder: ...@@ -114,7 +118,10 @@ Top-level-folder:
imglibs imglibs
libjpeg libjpeg
pbmplus pbmplus
libtiff libtiff
zlib
libpng
gdbm
MoreFiles 1.4.3 (not needed by Python, only by tcl/tk) MoreFiles 1.4.3 (not needed by Python, only by tcl/tk)
Python Python
Tcl 7.6 Tcl 7.6
...@@ -122,7 +129,8 @@ Top-level-folder: ...@@ -122,7 +129,8 @@ Top-level-folder:
Waste 1.2 distribution (if you want waste) Waste 1.2 distribution (if you want waste)
</PRE> </PRE>
First build GUSI. Move the files from the "CWGUSI-mods" to the right First build GUSI. If you didn't get the python-specific GUSI you have to
move the files from the "CWGUSI-mods" to the right
place in the CWGUSI distribution folder, and build the place in the CWGUSI distribution folder, and build the
projects <code>GUSI.68K.µ</code>, <code>GUSI.CFM68K.µ</code> and projects <code>GUSI.68K.µ</code>, <code>GUSI.CFM68K.µ</code> and
<code>GUSI.PPC.µ</code>. <code>GUSI.PPC.µ</code>.
...@@ -141,8 +149,10 @@ in the Python sources. This will disable the "default file creator/type" and ...@@ -141,8 +149,10 @@ in the Python sources. This will disable the "default file creator/type" and
"Delay Sioux window" preferences in Python. "Delay Sioux window" preferences in Python.
Next, in Next, in
<code>MoreFiles</code>, <code>libjpeg</code>, <code>pbmplus</code> <code>MoreFiles</code>, <code>libjpeg</code>, <code>pbmplus</code>,
and<code>libtiff</code> you build all projects. Tcl/tk is a special <code>zlib</code>, <code>libpng</code>, <code>gdbm</code>,
and<code>libtiff</code> you build all projects. Sometimes the projects are in "mac"
subfolders, sometimes they are in the main folder. Tcl/tk is a special
case, see below. Of course, if you are only interested in one of case, see below. Of course, if you are only interested in one of
static 68K, CFM68K or PPC you can skip building the other libraries. static 68K, CFM68K or PPC you can skip building the other libraries.
...@@ -187,6 +197,8 @@ and CRSR resources from it to <code>tkresources.rsrc</code>. This allows ...@@ -187,6 +197,8 @@ and CRSR resources from it to <code>tkresources.rsrc</code>. This allows
the <code>_tkinter</code> module to work without an installed Tk/Tcl on your the <code>_tkinter</code> module to work without an installed Tk/Tcl on your
machine. machine.
<LI> You have to adapt the projects to use the MSL libraries. This is important.
</UL> </UL>
Build first the Tcl library, then Build first the Tcl library, then
...@@ -215,7 +227,7 @@ folders: ...@@ -215,7 +227,7 @@ folders:
<DL> <DL>
<DT> build.mac68k.stand <DT> build.mac68k.stand
<DD> This is where you will build static 68K interpreters. <DD> This is where you build static 68K interpreters.
<DT> build.mac68k.shared <DT> build.mac68k.shared
<DD> This is where you build the CFM68K shared library, interpreter <DD> This is where you build the CFM68K shared library, interpreter
...@@ -363,10 +375,6 @@ folder <code>build.macppc.stand</code>. The order to build things is ...@@ -363,10 +375,6 @@ folder <code>build.macppc.stand</code>. The order to build things is
the following: the following:
<DL> <DL>
<DT> MWRuntimeStaticLib
<DD> A modified version of the MetroWerks runtime library that is
suitable for Pythons' shared library architecture. The sources all
come from the MW distribution.
<DT> PythonCorePPC <DT> PythonCorePPC
<DD> The shared library that contains the bulk of the interpreter and <DD> The shared library that contains the bulk of the interpreter and
...@@ -377,11 +385,10 @@ moving the file will cause you grief later. ...@@ -377,11 +385,10 @@ moving the file will cause you grief later.
<DT> PythonPPC <DT> PythonPPC
<DD> The interpreter. This is basically a routine to call out to the <DD> The interpreter. This is basically a routine to call out to the
shared library. Because of the organization of GUSI it also contains shared library. Do
the Gusi settings resource (together with a ResEdit template, so you
can change the gusi settings should you feel like doing so). Do
<em>not</em> run it yet, this will possibly result in a garbled <em>not</em> run it yet, this will possibly result in a garbled
preferences file. <p> preferences file. See the section below on rebuilding .exp files if you
get funny linker errors. <p>
<DT> PythonAppletPPC <DT> PythonAppletPPC
<DD> The applet skeleton application. Very similar to <DD> The applet skeleton application. Very similar to
...@@ -440,7 +447,9 @@ Rebuilding the .exp file is done by first removing the file and removing the ...@@ -440,7 +447,9 @@ Rebuilding the .exp file is done by first removing the file and removing the
reference to it in the project (in the "config" section). Next, build PythonCore. reference to it in the project (in the "config" section). Next, build PythonCore.
This will create a new .exp file. Edit this file to remove the references to This will create a new .exp file. Edit this file to remove the references to
the symbols <code>__initialize</code>, <code>__terminate</code>, <code>setjmp</code>, the symbols <code>__initialize</code>, <code>__terminate</code>, <code>setjmp</code>,
<code>longjmp</code> and <code>__ptmf_null</code>. Next, add the .exp file to the project <code>longjmp</code>, <code>main</code> and (for PPC) <code>__ptmf_null</code> or (for
CFM68K) <code>__start</code> and <code>dummy_init_routine</code>.
Next, add the .exp file to the project
again and rebuild PythonCore. <p> again and rebuild PythonCore. <p>
This rather convoluted procedure is needed to ensure that plugin modules don't This rather convoluted procedure is needed to ensure that plugin modules don't
...@@ -455,7 +464,7 @@ Some remarks that I could not fit in elsewhere: ...@@ -455,7 +464,7 @@ Some remarks that I could not fit in elsewhere:
<LI> It may be possible to use the <code>PythonCore</code> shared <LI> It may be possible to use the <code>PythonCore</code> shared
library to embed Python in another program, if your program can live library to embed Python in another program, if your program can live
with using GUSI for I/O. Use PythonCore in stead of your C library with using GUSI for I/O. Use PythonCore in stead of your MSL C library
(or, at the very least, link it before the normal C library). Let me (or, at the very least, link it before the normal C library). Let me
know whether this works. know whether this works.
...@@ -469,17 +478,17 @@ all set. A template for a dynamic module can be found in ...@@ -469,17 +478,17 @@ all set. A template for a dynamic module can be found in
<LI> The Python shared library architecture is a variant of the architecture <LI> The Python shared library architecture is a variant of the architecture
described as "application with shared libraries and dropins" in the MetroWerks described as "application with shared libraries and dropins" in the MetroWerks
"Targeting MacOS" documentation. The Python Application and applet-template use "Targeting MacOS" documentation. The Python Application and applet-template use
the <code>AppRuntime.Lib</code> runtime library (with properly set CFM the <code>MSL AppRuntime.Lib</code> runtime library (with properly set CFM
initialization and termination routines). PythonCore uses <code>ShlibRuntime.Lib</code> initialization and termination routines). PythonCore uses <code>MSL Runtime.Lib</code>,
and <code>MWRuntimeStaticLib.Lib</code>, which is almost identical to the MW which is really intended for standalone programs but which we fool into working by
standard <code>MWRuntimeLib</code>, but not dynamically loaded. This library contains providing a dummy main program.
the part of the runtime that can (or must) be shared between all modules in the program.
It is linked statically into PythonCore (and exported to the applications and plugins) 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 so we do not have to distribute yet another shared library. Plugin modules use
<code>ShlibRuntime.Lib</code> and obtain the rest from PythonCore. PythonCore uses a <code>MSL ShlibRuntime.Lib</code> (not the dropin runtime: modules are never unloaded)
and obtain the rest from PythonCore. PythonCore uses a
non-standard initialization entry point, <code>__initialize_with_resources</code>, to non-standard initialization entry point, <code>__initialize_with_resources</code>, to
be able to obtain resources from the library file lateron. Plugins can do the same or be able to obtain resources from the library file later on. Plugins can do the same
use the standard <code>__initialize</code> entry point. (_tkinter does) or use the standard <code>__initialize</code> entry point.
</UL> </UL>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment