Core Development Environment on Macintosh Snow Leopard 64-Bit.

It took me some time to work out the details for creating a viable development environment on Snow Leopard, and I thought my notes might be useful to others. This is the quick and dirty version.

Macintosh Snow Leopard 64 Bit Development Environment

Install Xcode.

Xcode includes Subversion command line tools, but you'll have to download and install RapidSVN if you use it.

Download, configure, and install PostgreSQL. Version 8.2.15 was used in this example. 

http://wwwmaster.postgresql.org/download/mirrors-ftp/source/v8.2.15/post...

Create a folder called \opt\postgresql\source and extract the files there.
Create a second folder called \opt\postgresql\psql . This is where we will build.
While you are at it, create a folder called \opt\qt and \opt\xtuple as well.

Open a terminal window and issue the following commands:

cd \opt\postgresql\source
sudu -s

CFLAGS="-arch x86_64" LDFLAGS="-ltcl" ./configure --with-krb5 --with-pam --with-ldap --with-openssl --with-readline --with-bonjour --prefix=/opt/postgresql/psql
make
make check
cd contrib/pgcrypto
make
cd ../..
make install
cd contrib/pgcrypto
make install

PostgreSQL is now configured and installed. Close the terminal window.

Create .bash_profile file at user root ~/

The contents of this file will set the PATH. The contents are:

#**** BEGIN .bash_profile *****

# Add to the original path

PATH=/opt/postgresql/psql/bin:$PATH
PATH=/opt/postgresql/psql/lib:$PATH
PATH=/opt/postgresql/psql/include:$PATH
PATH=/opt/qt/bin:$PATH
PATH=/opt/qt/lib:$PATH
export PATH

#**** END .bash_profile *****

Download QT SDK 

ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz

Extract the file to the /opt/qt/ directory.

Open terminal window and issue the following commands:

cd /opt/qt/qt-everywhere-opensouce-src-4.6.2
sudo -s

CFLAGS="-arch x86_64" LDFLAGS="-ltcl" ./configure -prefix-install -prefix /opt/qt -platform macx-g++-64 -plugin-sql-psql -plugin-sql-odbc -plugin-sql-sqlite -qt3support -qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-framework -I/opt/postgresql/psql/include -L/opt/postgresql/psql/lib 

make
make -j1 install

Qt is now installed. Close terminal window.

Download OpenRPT and PostBooks source through SVN into the \opt\xtuple folder.

Open terminal window and issue the following commands:

cd \opt\xtuple\openrpt
sudo -s

qmake
make

cd \opt\xtuple\postbooks
qmake
make

When the process completes, in order to run the applications, you will need to include certain resources in the .app file. To do this, open Finder and locate \opt\xtuple\openrpt\bin\openrpt.app. Right click on the application and select SHOW PACKAGE CONTENTS. Browse to /Contents/Resources. Open another finder window and browse to /opt/qt/qt-everywhere-opensource-src-4.6.2/src/gui/mac and copy the three objects (1 folder, 2 files) from that location into the /Contents/Resources folder. 

Copy these three objects also into the /Contents/Resources folder of all the .app files in /opt/xtuple/openrpt/bin/ and /opt/xtuple/postbooks/bin/xtuple.app as well. 

The applications should now work.

Oddball tip:

If you get an error that looks like this: 

ISO C++ says that these are ambiguous, even
though the worst conversion for the first is
better than the worst conversion for the second:

during the build, it's probably caused by \opt\xtuple\openrpt\openrpt\wrtembed\fontutils.cpp. Open it and find the code that looks like this:

void setItemFontSize(QGraphicsItem *gi, const QString s)
{
int size = s.toInt();
if(s<=0)
return;

QFont font = getItemFont(gi);
font.setPointSize(size);
setItemFont(gi, font);
}

and change the if statement to read:

if(size<=0)

and rebuild.