[Python-Dev] Dynamically loaded extension modules on MacOS X

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Thu, 28 Sep 2000 21:32:00 +0200


Has anybody succeeded in building extension modules for 2.0b1 on MacOS
X? On xml-sig, we had a report that the pyexpat module would not build
dynamically when building was initiated by the distutils, see the
report in

http://sourceforge.net/bugs/?func=detailbug&bug_id=115544&group_id=6473

Essentially, Python was configured with "-with-threads -with-dyld
-with-suffix=.exe", which causes extension modules to be linked as

cc -bundle -prebind {object files} -o {target}.so

With this linker line, the linker reported

/usr/bin/ld: warning -prebind has no effect with -bundle

and then

/usr/bin/ld: Undefined symbols:
_PyArg_ParseTuple
_PyArg_ParseTupleAndKeywords
...*removed a few dozen more symbols*...

So apparently the command line options are bogus for the compiler,
which identifies itself as

    Reading specs from /usr/libexec/ppc/2.95.2/specs
    Apple Computer, Inc. version cc-796.3, based on gcc driver version
     2.7.2.1 executing gcc version 2.95.2

Also, these options apparently won't cause creation of a shared
library. I wonder whether a simple "cc -shared" won't do the trick -
can a Mac expert enlighten me?

Regards,
Martin