Compiling python 2.3.5 on Mac OS X Tiger
Tiger comes with python 2.3.5 bundled, which is nice, but sometimes you want to recompile it, or you want to add site-packages to it without disturbing the standard OS installation. Here's what I had to do to compile it, and python-ldap with it.
Building python 2.3.5:
./configure
vi pyconfig.h
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
#define HAVE_BROKEN_POSIX_SEMAPHORES
#define SETPGRP_HAVE_ARG
make
make test
sudo make install
Updated: Added commenting-out of _POSIX_C_SOURCE, otherwise ESHUTDOWN cannot be imported from errno (which makes asyncore fail). Added SETPGRP_HAVE_ARG.
Building Berkeley DB 4.3.28 (needed by OpenLDAP):
cd build_unix
../dist/configure
make
sudo make install
Building OpenLDAP 2.2.26:
CPPFLAGS=-I/usr/local/BerkeleyDB.4.3/include LDFLAGS=-L/usr/local/BerkeleyDB.4.3/lib ./configure
vi config.status
# replace s%@LIBS@%%g with:
s%@LIBS@%-lresolv%g
./config.status
make depend
make
sudo make install
Building python-ldap 2.0.7:
vi setup.cfg
library_dirs = /usr/local/lib
include_dirs = /usr/local/include
# comment libs = sasl2 in libs:
libs = ldap_r lber ssl crypto
/usr/local/bin/python2.3 setup.py build
sudo /usr/local/bin/python2.3 setup.py install
Subscribe to Feed
Follow us on Twitter

