Compiling PostgreSQL 7.4 under Panther...

Tuesday, December 02 2003 @ 10:14 AM GMT

Contributed by: unix

How to compile PosgreSQL under X with a maximum of options ?

Here is a tested configure script:

#!/bin/bash

export ANT_HOME=/Developer/Java/J2EE/Ant
export PATH="$"/bin:"$"
export JAVA_HOME=/Library/Java/Home
export YACC=/usr/local/bin/bison
export THREAD_SUPPORT=yes

./configure --bindir=/usr/local/bin --mandir=/usr/local/share/man/ 
    --enable-recode --with-CXX --enable-odbc --enable-syslog --with-java 
    --with-pam --with-rendezvous --enable-unicode-conversion --enable-multibyte 
    --with-perl --with-python --with-krb5=/usr --with-openssl=/usr --enable-thread-safety  
Copy it and put it in a myconfigure file into the postgresql-7.4 generated by the expanding of the archive you have downloaded from PostgreSQL site.
Before running it, you also have to download, compile and install readline and bison from GNU.
The bison version coming with Panther is too old for PostgreSQL 7.4.
The default installation will put it in /usr/local/bin leaving intact the original one, hence the YACC line in the configure script.
The lines regarding ant are copied-pasted from the Apple's ant installation coming with Panther's developer tools.
You are now ready to execute ./myconfigure from Terminal.app.
If everything goes right, you should be able to make. Here you will get some problems with Python, but these can't be solved until a first (failing) make has been done.
To fix these problems, open the src/Makefile.global and fix the line defining python_libspec by replacing it with:
python_libspec          = -framework Python
Now go to the src/pl/plpython/ directory and open the Makefile with your favorite text editor, comment out the lines testing for a shared Python library (since on Mac OS X, this one is in a Framework, the test fails as written).
#ifneq (,$(wildcard $(python_configdir)/libpython*$(DLSUFFIX)*))
#shared_libpython = yes
#endif
and
#ifneq (,$(findstring yes, $(shared_libpython)$(allow_nonpic_in_shlib)))
and don't forget the else part of it at the end of the file:
#else # can't build

#all:
#       @echo ""; 
#        echo "*** Cannot build PL/Python because libpython is not a shared #library." ; 
#        echo "*** You might have to rebuild your Python installation.  Refer to"; 
#        echo "*** the documentation for details."; 
#        echo ""

#endif # can't build
Now you are ready to make again. It should work.
Of course, if you run the configuration process again, you would also have to redo these changes again.

7 comments



http://www.macosxguru.net/article.php?story=20031202101454698