[Pythonmac-SIG] Building Mac extensions for Apple Python

Bob Ippolito bob@redivi.com
Sun, 9 Feb 2003 18:09:05 -0500


On Friday, Jan 3, 2003, at 16:52 America/New_York, Kevin Ollivier wrote:

> Hi Jack,
>
> Thanks for your help! I am also clueless as to why PyObject_Del would 
> be causing that error message. Do those extensions get built with a 
> framework build as well? I did some playing around (removing the 
> extensions that were not building and changing $(scripts)/Lib/Mac to 
> its new home), but I'm getting import errors for the mac modules 
> during the import_BuildApplet phase. It cannot find import macfsn and 
> EasyDialogs, which are of course in the CVS but the path is probably 
> not set properly. Are these supposed to be copied over to 
> /Applications/MacPython-OSX-2.3 before this portion of setup is run?

I took a look at this yesterday, as I was trying to do some stuff with 
quicktime and I thought it'd be nice to be able to backport it to 
jaguar python.  I had some problems with this, because Makefile.jaguar 
is broken, so I tried doing what I wanted in ctypes, but that gave me 
bus errors left and right just defining Structures and whatnot, so I 
had to stop there.. and then I started writing my own python extension, 
but that started taking too long.. so I think I'm going to try and fix 
Makefile.jaguar again.

Anyways, here's the definition of PyObject_Del:
#define PyObject_Del(op) _PyObject_Del((PyObject *)(op))

See the problem is that in the implementation of _AE, and the other 
modules that cause problems, we're attempting to put this macro inside 
of a type definition.  You can't get a pointer to PyObject_Del because 
it's not an actual function, it's a macro function.  My lazy fix was 
just to load each file that had this issue and do this (in vim)  
:%s/(#define.*)\<PyObject_Del/\1_PyObject_Del -- which solved it.  
Right now, the problem seems to be that a large number of the Mac 
modules are not built at all by Makefile.jaguar, so I'm going to have 
to start getting into setup.jaguar.py.

-bob