3 [1] You need to build Python for macosx. The latest release (2.1b2)
4 builds out of the box for macosx -- use:
5 configure --with-dyld --with-suffix=.x
6 ( get the latest version -- you'll have to fix the build process
7 to get earlier versions to build.)
10 [2] You need a copy of Apple's Universal Interfaces CIncludes.
12 The Carbon.framework include files on macosx are not as backwards
13 compatible as the ones in Universal Interfaces. For example
14 UI has a Windows.h file that includes MacWindows.h, while
15 Carbon.framework only has MacWindows.h
16 ( actually, it's: HIToolbox.framework/Headers/MacWindows.h )
18 Until macpython sources are converted to be more Carbon compliant
19 you need to get a copy of Universal Interfaces (downloadable from
20 Apple's web site if you don't have a copy. If you have Metrowerks
21 Compiler, there is probably a copy on your CD. )
24 [3] If your are building from patches, you need to download the cvs
25 distribution and apply the patches. ( The "If" is there because I
26 may eventually package this up in a separate patched distribution.)
28 cvs -d:pserver:ropython@pythoncvs.oratrix.nl:/hosts/mm/CVSREMOTE login
31 cvs -d:pserver:ropython@pythoncvs.oratrix.nl:/hosts/mm/CVSREMOTE co python/Mac
33 The normal macpython distributions have classic-mac line endings.
34 macosx gnu tools want unix line endings. Getting sources from
35 the cvs server avoids having to do a bunch of conversions on
39 New files (go in python/Mac/Modules/ directory)
40 README.macosx (this file)
41 Makefile (makefile also creates a dummy .h file)
45 python/Mac/Python/macglue.c
46 python/Mac/Modules/Win/Winmodule.c
49 [4] There are two lines you have to edit in the Makefile to point to
50 Universal Interfaces CIncludes and the Python source distribution.
51 (eventually, disutils will be used to find the Python sources.
52 eventually, macpython sources will use the more modern headers.)
55 # Point this to the directory with the Universal Interfaces CIncludes:
56 UINCLUDE= /Local/Carbon/Universal.Interfaces/CIncludes/
58 # Point this to your python source directory:
59 PYTHONHOME= /Users/sdm7g/Src/Python-2.1a2/
61 After changing those lines, you can type "make" .
63 "-undefined warning" is used rather than "-undefined supress" --
64 and there are always some undefined symbols that are resolved
65 in the main python module. If there is something *REALLY*
66 unresolved (or often the problem is multiple definitions)
67 you will get an error on importing Carbonmodule.so.
69 [5] Installation is manual for now.
70 If you want to run it out of the python/Mac/Modules directory, you
71 need to copy it to /usr/local/lib/python2.1/site-packages/
72 ( or whatever is the appropriate directory on your machine )
75 [6] All of the toolbox modules are built into a single container module
76 named Carbon. All of the other modules are in the Carbon namespace:
77 i.e. Carbon.Win. You can do a "from Carbon import *", however all
78 modules get put into sys.modules under their own name, so once
79 Carbon has been imported, statements like "import Win" will work --
80 there is no Winmodule.so file, but import will find 'Win' in the
81 sys.modules cache before it tries to match a filename.
84 These are the modules currently linked:
86 Python 2.1a2 (#1, 02/12/01, 19:49:54)
87 [GCC Apple DevKit-based CPP 5.0] on Darwin1.2
88 Type "copyright", "credits" or "license" for more information.
91 ['AE', 'App', 'Cm', 'ColorPicker', 'Ctl', 'Dlg', 'Drag', 'Evt', 'Fm', 'HtmlRender', 'Icn', 'List', 'Menu', 'Qd', 'Qdoffs', 'Res', 'Scrap', 'Snd', 'TE', 'Win', '__doc__', '__file__', '__name__', 'macfs']
97 >>> Snd.SysBeep( 100 )
99 The main one missing is macosmodule, which has some functions for handling
100 resource forks of files, file types and creators, and how and whether
101 MacPython handles events or your script does. Some of these functions
102 require others in Python/macmain.c, which may drag in other symbols, either
103 undefined or multiply defined ( because there is a unix-Python implementation
104 parallel to the macpython one. ) It's likely that we will need (or at least
105 want) new macosx implementations of some of these functions.
107 If you're interested in trying to add them, there is an additional target
108 in the Makefile "make Experimental", which compiles and links with the
109 $(XXX) modules: currently just macosmodule.c and macmain.c -- you
110 can add others to try to resolve undefined symbols or edit the files
111 to remove some symbols or functions.
113 -- Steve Majewski <sdm7g@Virginia.EDU>