matterkkila.com/

code monkey

building mod_python for leopard

December 20, 2007 - 10:51 AM

Leopard itself comes with recent versions of php, python, and apache. However it does not have mod_python, so if you want to play with things like django you must build mod_python from the source. Just running ./configure, make, make install won't cut it either. You need to edit the make file built during the ./configure step to include specific compiler flags. I found a lot of sites on the internet with ideas how to fix it, after trying 4 of them that didn't work I came across one that did.

Run:


./configure

Edit: src/Makefile and after the 'INCLUDES=' line add

INCLUDES+= -Wc,-arch -Wc,ppc -Wc,-arch -Wc,i386 -Wc,-arch -Wc,ppc64 -Wc,-arch -Wc,x86_64
INCLUDES+= -Wl,-arch -Wl,ppc -Wl,-arch -Wl,i386 -Wl,-arch -Wl,ppc64 -Wl,-arch -Wl,x86_64
export ARCHFLAGS='-arch i386 -arch ppc -arch ppc64 -arch x86_64'


Now run:


make
sudo make install

Posted In: