building mod_python for leopard

Copied from http://matterkkila.com/2007/12/20/building-mod_python-for-leopard/ in case it goes away in the future

 

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

Leave a Reply

You must be logged in to post a comment.