You are not logged in Log in Join
You are here: Home » Members » Jeffrey P Shell » Building Zope and Python on Mac OS X

Log in
Name

Password

 

Building Zope and Python on Mac OS X

Building Zope 2.4 with Python 2.1 on Mac OS X / Darwin

This document covers building Zope and Python 2.1 on Mac OS X and Mac OS X Server 10.0.x , which are based on Darwin 1.3. For information on building for Mac OS X 10.1 or later (based on Darwin Kernel 5.1), see Jens' document. Recent changes are hilighted in blue.

This how-to assumes basic knowledge of building and configuring Python on Unix.

Python::

You can download a prebuilt Python 2.1 binary for Mac OS X here. Zope works quite well with it. However, if you're interested in building Python for yourself, these instructions should work. These instructions are in the Python installation/building documentation as well, but it's not immediately obvious that you would want to use the configuration options spelled out below.

The default file system for Mac OS X, HFS+, is case-preserving but insensitive. This creates a couple of issues for Python. The first is the fact that Python has the modules "fcntl" and "FCNTL", one of which is actually an extension module. The second issue is that in the build directory for Python is the directory 'Python' (upper case P), and when the build is finished, the Python executable wants to move into the root build directory, and it's name is 'python' (lower case P). HFS+ won't allow this. Fortunately, Python 2.1 and later address this by actually paying attention to configuration option that places a suffix on the Python binary.

First - configuring

./configure --program-suffix=.exe --with-dyld

The '--with-dyld' option tells Python to use Mac OS X's Dynamic Loader. The '--program-suffix=.exe' option tells the Makefiles to build Python with the extension '.exe'. This gets around the 'Python' versus 'python' problem. Note that if you are using the UFS file system, this is not an issue. However, Carbon and Classic apps tend not to like UFS, and I wouldn't recommend using this file system outside of a purely-as-server setup (or pure Darwin).

MAKE

OPT="-traditional-cpp"; make
sudo make install

We have to pass "-traditional-cpp" into the compiler, otherwise there will be an endless fleet of warnings.

If tyou're a user with 'Administrator' access in Mac OS X (or are otherwise marked as a 'sudoer'), the last step will install Python into /usr/local. As a final step, you might want to go to /usr/local/bin and rename 'python.exe' to 'python'.

Zope::

Zope builds quite easily now on Mac OS X. You might still get quite a bit of warning when building extension classes. But now, all you have to do is run wo_pcgi:

/usr/local/bin/python2.1.exe ./wo_pcgi.py

(with the text in blue being the path to a valid Python 2.1 executable). and you *should* be golden.