Friday, June 22, 2007

Compiling libbzip2.dylib on Panther

Is a pain :)
The default Makefile does not allow you to generate a shared library.
Edit the main Makefile, add a -fPIC to the compiler flags, and link like this.


libtool -dynamic -compatibility_version 1.0.0 -o libbz2.dylib blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o -lc


Copy that in /usr/lib and create the right symlink.
Then you'll be able to uncompress / compress with bzip2 (using python 2.4 binaries that does not ship this shared library)


Traceback (most recent call last):
File "common.py", line 295, in ?
level8()
File "common.py", line 280, in level8
from bz2 import decompress
ImportError: Failure linking new module: /usr/lib/libbz2.1.0.dylib: dyld: /Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python can't open library: /usr/lib/libbz2.1.0.dylib (No such file or directory, errno = 2)

0 Comments:

Post a Comment

<< Home