Creating Universal OSX binaries - Mailing list pgsql-hackers

From Bruce Momjian
Subject Creating Universal OSX binaries
Date
Msg-id 200807311828.m6VISpS25148@momjian.us
Whole thread Raw
Responses Re: Creating Universal OSX binaries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Do we know this trick for creating Universal (four-architecture)
binaries for OSX?
http://r0ml.net/blog/2008/06/19/universal-postgres

---------------------------------------------------------------------------

It turns out that nobody seems to know how to build a Universal version
of PostgreSQL for OSX. This turned into a problem for me when I was
trying to build a version of PHP with support for postgres — I
needed Universal (four-architecture) libraries.

The following seems to work (I’m running an Intel Leopard):

1) I have the following variables set in my .bashrc --- I build
everything Universal. If you don’t have these variables set, you
should set them now.

export CCFLAGS='-arch ppc -arch ppc64 -arch i386 -arch x86_64 -pipe'
export CFLAGS='-arch ppc -arch ppc64 -arch i386 -arch x86_64 -pipe
-no-cpp-precomp'
export CXXFLAGS='-arch ppc -arch ppc64 -arch i386 -arch x86_64 -pipe'
export LDFLAGS='-arch ppc -arch ppc64 -arch i386 -arch x86_64
-bind_at_load'

2) ./configure --with-the-options-of-your-choice

3) LD=gcc AR=libtool AROPT='-static -o' LDREL='$(LDFLAGS) -nostartfiles
-r' make -e

4) sudo make install

Step 3 was the tricky bit ;) 

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: window function v03 against HEAD
Next
From: Tom Lane
Date:
Subject: Re: Creating Universal OSX binaries