version: 8.3.3
source: postgresql.org
installer: PostgreSQL
check if arch flags can be used directly instead of ccub.
add contrib compilation instructions.
Postgres can't be compiled universal out of the box. This is because ld is used directly to assemble intermediate object files, and ld doesn't do multiple architectures. It's simple to fix - use gcc -Wl,-r -nostdlib to assemble those object files. Here's what to do:
Edit src/makefile.global.in, change the LDREL line to:
LDREL = -Wl,-r
Don't worry about LD, that will be change from configure.
In the postgresql source folder:
export MACOSX_DEPLOYMENT_TARGET=10.5 ./configure --with-openssl --with-pam --with-krb5 --with-ldap --enable-thread-safety \ --with-bonjour --with-python --without-perl --enable-nls \ CC=ccub_3264 CFLAGS="-Os -D_FILE_OFFSET_BITS=64" LD="ccub_3264 -nostdlib"
I left out perl support because perl is like python, only partially 64bits, and I haven't tried adding it (I'm not really interested in perl).
When configure is done, a couple files must be patched for endianess and 64bits:
replace in each:
– the ALIGNOF_DOUBLE line with:
#ifdef __LP64__ #define ALIGNOF_DOUBLE 8 #else #define ALIGNOF_DOUBLE 4 #endif
– the ALIGNOF_LONG line with:
#ifdef __LP64__ #define ALIGNOF_LONG 8 #else #define ALIGNOF_LONG 4 #endif
– the ALIGNOF_LONG_LONG_INT line with:
#ifndef __LP64__ #define ALIGNOF_LONG_LONG_INT 4 #endif
– the HAVE_LL_CONSTANTS line with:
#ifndef __LP64__ #define HAVE_LL_CONSTANTS 1 #endif
– the HAVE_LONG_INT_64 and HAVE_LONG_LONG_INT_64 lines with:
#ifdef __LP64__ #define HAVE_LONG_INT_64 #else #define HAVE_LONG_LONG_INT_64 #endif
– the INT64_FORMAT line with:
#ifdef __LP64__ #define INT64_FORMAT "%ld" #else #define INT64_FORMAT "%lld" #endif
– the MAXIMUM_ALIGNOF line with:
#ifdef __LP64__ #define MAXIMUM_ALIGNOF 8 #else #define MAXIMUM_ALIGNOF 4 #endif
– the SIZEOF_SIZE_T line with:
#ifdef __LP64__ #define SIZEOF_SIZE_T 8 #else #define SIZEOF_SIZE_T 4 #endif
– the SIZEOF_UNSIGNED_LONG line with:
#ifdef __LP64__ #define SIZEOF_UNSIGNED_LONG 8 #else #define SIZEOF_UNSIGNED_LONG 4 #endif
– the UINT64_FORMAT line with:
#ifdef __LP64__ #define UINT64_FORMAT "%lu" #else #define UINT64_FORMAT "%llu" #endif
– the WORDS_BIGENDIAN line with:
#ifdef __BIG_ENDIAN__ #define WORDS_BIGENDIAN 1 #else #undef WORDS_BIGENDIAN #endif
– the HAVE_LONG_INT_64 and HAVE_LONG_LONG_INT_64 lines with:
#ifdef __LP64__ #define HAVE_LONG_INT_64 #else #define HAVE_LONG_LONG_INT_64 #endif
make sudo make install
In the postgresql source folder:
export MACOSX_DEPLOYMENT_TARGET=10.4 ./configure --with-openssl --with-pam --with-krb5 --with-ldap --enable-thread-safety \ --with-bonjour --with-python --without-perl --enable-nls \ CC=ccub_3264 CFLAGS="-Os -D_FILE_OFFSET_BITS=64" LD="ccub_3264 -nostdlib"
When adding Python support, an up-to-date package from python.org is recommended.
When configure is done, a couple files must be patched for endianess and 64bits:
Apply just the endian edits from the Leopard notes.
make sudo make install
In the postgresql source folder:
export MACOSX_DEPLOYMENT_TARGET=10.3 ./configure --with-openssl --with-pam --with-krb5 --with-ldap --enable-thread-safety \ --with-bonjour --with-python --without-perl --enable-nls \ CFLAGS="-Os -D_FILE_OFFSET_BITS=64" LD="gcc -nostdlib" make sudo make install
When adding Python support, an up-to-date package from python.org is recommended.
For now, see the Postgres documentation and the Installation section of the README.postgis document.