[Pythonmac-SIG] Building Python 2.0 modules on OSX PB (MySQLdb)

Andrew Zeldis azeldis@wesleyan.edu
Thu, 19 Oct 2000 12:53:23 -0400


Well much to my shock Python 2.0 built beautifully, with (I think) =
shared libraries using --with-dyld.  However I'm having some problems =
making the MySQLdb module.

I know next to nothing about development on Unix, but by messing with =
options in the setup script I was able to get the module to build.  The =
version for 2.0 is build using a new setup.py script:

> python setup.py build

I believe it gets to the linking phase, where the command:

cc -bundle -undefined suppress build/temp.darwin-1.2-Power =
Macintosh-2.0/_mysqlmodule.o -R/usr/local/lib/mysql -lmysqlclient -lz -o =
build/lib.darwin-1.2-Power Macintosh-2.0/_mysqlmodule.so

fails:

cc: unrecognized option `-R/usr/local/lib/mysql'

I guessed that -R is the runtime_library_dir, so I tried commenting out =
"runtime_library_dirs" uncommenting "library dirs" in the build script; =
it built and installed but failed on use:

dyld: python multiple definitions of symbol _strtol
/System/Library/Frameworks/System.framework/Versions/B/System(strtol.o) =
definition of _strtol
/usr/local/lib/python2.0/site-packages/_mysqlmodule.so definition of =
_strtol

No doubt this would be easily solved by someone who understood the =
intricacies of OSX's linker and loader...