[PYTHON-CRYPTO] Building M2Crypto-0.17 on MacOS X

Marc Hedlund marc at PRECIPICE.ORG
Wed Jan 31 04:22:32 CET 2007


This (building M2Crypto-0.17 Universal on MacOS X) was a big pain, so here 
are my notes on it:

First, download OpenSSL 0.9.8d and unpack it.  Edit the OpenSSL Makefiles 
per PROBLEMS.  Then:

./config no-shared no-asm --prefix=/usr/local
make
make test
sudo make install
make clean
./Configure no-shared no-asm --prefix=/usr/local darwin-ppc-cc
make build_libs "CC=cc -arch ppc"
lipo -info lib*
mkdir -p build/ppc
mv lib* build/ppc
make clean
./Configure no-shared no-asm --prefix=/usr/local darwin-i386-cc
make build_libs "CC=cc -arch i386"
lipo -info lib*
mkdir -p build/i386
mv lib* build/i386/
/bin/ls -1 build/i386/ > libnames.tmp
mkdir universal

Create a script in the OpenSSL directory called 'make_universal', with 
these contents:

#!/bin/sh
for lib in `cat libnames.tmp`; do
  lipo -create build/*/$lib -output universal/$lib
done
exit 0

Then:

sh make_universal
lipo -info universal/lib*
sudo cp universal/lib* /usr/local/lib
lipo -info /usr/local/lib/lib{crypto,ssl}*
cd ../m2crypto-0.17

Then edit the m2crypto setup.py and uncomment the extra_link_args line at 
the end.

python setup.py build --openssl=/usr/local
sudo python setup.py install --openssl=/usr/local

I'm happy to contribute a built, zipped mpkg installer (statically linked) 
if that's desirable.

Thanks to everyone who gave suggestions.

-M



More information about the python-crypto mailing list