[Zope-dev] Compiling on Mac OS X 10.2

Aparajita Fishman aparajita@aparajitaworld.com
Thu, 3 Oct 2002 15:26:31 -0400


Hi all,

For the benefit of all Jaguar (10.2) users, here is the complete steps  
I followed to compile and install readline 4.3, postgres 7.2.2,  
mxDateTime 2.0.4 and psycopg 1.0.12. All were compiled from the source  
tarballs available from the respective web sites.

Preliminary steps
-----------------
1. cd /usr/lib/python2.2/config

2. Edit Makefile (with sudo), look for the line that begins "LDFLAGS=".  
In mine it is line 62.

3. If the line reads:

LDFLAGS=   -arch i386 -arch ppc

change it to:

LDFLAGS=  -arch ppc

In other words, remove the errant "-arch i386". Why that is there only  
the people at Apple know. Maybe they did a build of Darwin on x86 and  
forgot to remove that flag in the final build.

4. Save the changes.


readline
--------
1. After untarring, cd into readline-4.3/support

2. Edit shobj-conf and find the section that begins with "#  
Darwin/MacOS X". The section begins with "darwin*|macosx*)" and ends  
with ";;".

3. Copy that whole section and then paste it below the ";;" at the end  
of the section but before the "openbsd*)" starting the next section.  
This will be a new darwin6 section.

4. Go back to the top of the original and change "darwin*|macosx*)" to  
"darwin[0-5]*)".

5. Go to the top of the new darwin6 section and change  
"darwin*|macosx*)" to "darwin6*)".

6. In the darwin6 section, look for the line that begins with  
"SHLIB_XLDFLAGS=".

7. Towards the end of that line, change "$(SHLIB_MAJOR)" to  
"$(SHLIB_MAJOR).2".

8. The next line should read:

SHLIB_LIBS='-lSystem'

Change it to this:

SHLIB_LIBS='-lSystem -lcc_dynamic -lncurses'

9. Save you changes, cd up one level, and then:

./configure
make
make install

Ignore any warnings about duplicate symbols. The readline libs will now  
be installed in /usr/local/lib.


postgres
--------
1. After untarring the source and cd into the postgres directory, do  
the following:

cd src/include/port/darwin
mv sem.h sem.orig.h
echo '#include <sys/sem.h>' > sem.h
cd ../../../backend/port

2. Edit Makefile.in, look for the 3 lines in the beginning section:

ifeq ($(PORTNAME), darwin)
OBJS += darwin/SUBSYS.o
endif

3. Delete or comment out those lines and save your changes.
4. Now do the following:

cd ../../..
./configure --mandir=/usr/local/share/man --with-openssl=/usr/lib  
--enable-recode
make
make install
make install-all-headers


mxDateTime
----------
I had no problems with this. After untarring, cd into the egenix  
directory and do the following:

python setup.py install

To install in a Zope python, it would be:

<zope>/bin/python setup.py install

where <zope> is your Zope directory.


psycopg
-------
Finally we can compile psycopg!

1. After untarring, cd into psycopg and do the following:

setenv LDFLAGS -lssl

This is in tcsh, do the equivalent in your shell to set the LDFLAGS  
environment variable.

2. Now do this to configure:

For the default Apple python:

./configure --mandir=/usr/local/share/man  
--with-postgres-libraries=/usr/local/pgsql/lib  
--with-postgres-includes=/usr/local/pgsql/include  
--with-mxdatetime-includes=/usr/lib/python2.2/site-packages/mx/ 
DateTime/mxDateTime

For a Zope python:

./configure --mandir=/usr/local/share/man  
--with-postgres-libraries=/usr/local/pgsql/lib  
--with-postgres-includes=/usr/local/pgsql/include  
--with-mxdatetime-includes=<zope>/lib/python2.1/site-packages/mx/ 
DateTime/mxDateTime --with-python=<zope>/bin/python

where <zope> is your Zope directory.

3. If this works:

make
make install

That's all there is to it!  ;-)

    Aparajita
    Victory-Heart Productions
    aparajita@aparajitaworld.com
    www.aparajitaworld.com