Compiling PostgreSQL 7.4 under Panther...

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

#!/bin/bash

export ANT_HOME=/Developer/Java/J2EE/Ant
export PATH="${ANT_HOME}"/bin:"${PATH}"
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.
Here is a tested configure script:



Authored by: Anonymous on Monday, April 26 2004 @ 05:28 AM BST
Although Bison compiles and installs fine, readline is a bit more troublesome
to install on OSX Panther. Here is a synopsis and solution to that problem:

There appears to be a framework for readline, but at least on my system it is
empty, and there's nothing in /usr/lib/ either. If you go to the readline
download site, the main link appears broken. But you can click on "older
versions" and nevertheless find version 4.3.


Download that, and extract it. Now configure it with

./configure --with-curses

and then (stealing a trick from Fink) edit shlib/Makefile to replace

SHLIB_LIBS = -lSystem

with

SHLIB_LIBS = -lSystem -lcc_dynamic -lncurses

Without this trick, you will encounter various undefined symbols.



Now you can make && make install.



- Brian K. Boonstra

Compiling PostgreSQL 7.4 under Panther...
Authored by: Anonymous on Sunday, June 13 2004 @ 08:55 PM BST
I did that, installed bison, and set my YACC env var, and when I do the
make (postgresql 7.4.2) I get ::::
--------------------------------------------------
make[4]: `SUBSYS.o' is up to date.
make -C transam SUBSYS.o
gcc -no-cpp-precomp -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations -I../../../../src/include -I/sw/include -c -o xlog.o
xlog.c
/var/tmp/ccsKkaaa.s:2139:Parameter error: r0 not allowed for parameter 2
(code as 0 not r0)
make[4]: *** [xlog.o] Error 1
make[3]: *** [transam-recursive] Error 2
make[2]: *** [access-recursive] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2