This works for me for the hand library, but I am using gcc 4.2 and I am targeting armv7
DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer SDKROOT=$DEVROOT/SDKs/iPhoneOS4.2.sdk ./configure --host=arm-apple-darwin --without-readline --disable-ipv6 \ CC="$DEVROOT/usr/bin/gcc" \ CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin10/4.2.1/include/ \ -I$SDKROOT/usr/include/" \ CFLAGS="$CPPFLAGS -arch armv7 -pipe -no-cpp-precomp -isysroot $SDKROOT" \ CPP="$DEVROOT/usr/bin/cpp $CPPFLAGS" \ LD=$DEVROOT/usr/bin/ld make -C src/interfaces/libpq cp src/interfaces/libpq/libpq.a lib/libpq.arm
My old simulator script no longer works, and it works fine again iOS 3.2.
DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer SDKROOT=$DEVROOT/SDKs/iPhoneSimulator4.2.sdk $ROOT_DIR/configure --host=i386-apple-darwin \ CC="$DEVROOT/usr/bin/gcc" \ CPPFLAGS="-I$SDKROOT/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ \ -I$SDKROOT/usr/include/ -mmacosx-version-min=10.5" \ CFLAGS="$CPPFLAGS -arch i386 -pipe -no-cpp-precomp -isysroot $SDKROOT \ -mmacosx-version-min=10.5" \ CPP="$DEVROOT/usr/bin/cpp $CPPFLAGS" \ LD=$DEVROOT/usr/bin/ld make -C $ROOT_DIR/src/interfaces/libpq
Update
Here is the full script. Highlight the bash script in the postgres directory and build. Your project includes $ POSTGRESDIR / src / include and $ POSTGRESDIR / src / interfaces / libpq to get the necessary headers. Note that this works for Postgres 8. Did not test it on Postgres 9.
#!/bin/bash set -e if [ -d "./lib" ] then echo "Existing libs deleted" rm -rf lib/* else echo "Generating output directory" mkdir lib fi if [ -e "./src/Makefile.global" ] then make -C ./src/interfaces/libpq distclean fi chmod u+x ./configure
Atifm source share