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

Important announcement: Join the Nuxeo team and contribute to the Nuxeo project! We have open positions in France and the UK for open source Java EE developers and sales engineers, both junior and senior.

Like this post? Share it:


Trackback Pings

Trackback URL for this entry:
http://blogs.nuxeo.com/sections/blogs/florent_guillaume/2005_05_21_compiling_python_2_3_5/tbping
Posted by Florent Guillaume @ 05/21/2005 03:12 AM. - Categories: python -  0 comments

Nuxeo Bloggers: Log in!
Nuxeo - Indesko - Nuxeo 5 Project
All content is copyrighted by their author.
CPSSkins is Copyright © 2003-2006 by Jean-Marc Orliaguet. | CPS is Copyright © 2002-2006 by Nuxeo SAS.