[Pythonmac-SIG] dynamic loader in 2.2
Bob Ippolito
bob@redivi.com
Sat, 5 Jan 2002 23:15:08 -0500
I've done a lot of work recently with Python 2.2 on Mac OS X in my
effort to port pygame and its dependencies to Mac OS X
The largest issue so far (other than a few distutils quirks) is the
dynamic loader for next style dylibs is broken, it doesn't differentiate
between blah/module.so and anotherpath/module.so, it only loads the
first.
My solution to this is to download libcompat from darwin cvs, and to use
the standard libdl implementation for loading .so files, this works
beautifully but it requires patching the configure script for python to
get it to work.
In a few days, after I release my binaries as a nice easy to install
package, I'll try and get my changes to python, distutils, SDL, pygame,
and PyOpenGL into their respective source trees.
I think that dependency on libdl might not be the best thing, since it
doesn't come with OS X (as of 10.1.2), but if someone else who has more
time can look through it and patch the dylib loader already in python to
work properly that'd be awesome.
Another issue I've noticed is that when starting python from the command
prompt, it's just about impossible to get menus and the dock working,
I've yet to find a way around this. However, one can still create
windows like this with one caveat. If the python interpreter is
initiated from the path (i.e. "python somefile.py") the WindowServer
will be unable to find it. The solution to this is to re-write argv[0]
with a full-path location. Unfortunately the setproctitle in darwin cvs
is totally worthless, and the source for top and ps don't use the same
way for reading the process title as the WindowServer and Cocoa does.
I'm currently working on my own setproctitle, and it has yielded good
results so far but causes a segfault when the arguments message is
passed to a NSProcessInfo instance (only under certain conditions).
Unfortunately this part of Mac OS X (like many others) isn't documented
at all so I'm trying to resolve this issue by "guess and check" and some
playing around in GDB.
PyOpenGL on Mac OS X works well so far but I had to disable
GL_VERTEX_ARRAY_EXT and the GL.ARB.TEXTURECOMPRESS to get it to
compile. GL_VERTEX_ARRAY doesn't seem to be a supported enumerator in
Mac OS X's implementation of OpenGL (at least on my g4-400), none of the
GLUT demos use it either so I really don't know if we're stuck without
it or if something is screwing up otherwise.
I'm also trying to hack Tkinter into working properly. Wish/Tk works
great on it's own, but the python module as is so far doesn't seem to be
working quite right. I don't really have much experience with any of
these libraries, but hopefully I'll be able to track down what's going
on.
Screenshots of what I've got working so far (regarding pygame mostly)
are available at http://redivi.com/~bob - I hope to be releasing my
package by Monday.
-bob