Tag Archives: ezrets

Build libcurl as a universal binary

I release one of the projects from work as a universal binary on OS X.  Up until tomorrow that mean just i386 and ppc.  With snow leopard, it looks like it’ll be a good idea to support the 64-bit architectures as well, especially considering its an ODBC driver I’m working on and the native apps running at 64-bit will want to talk to it that way.

Since we used a lot of open source libraries to save us time, I need to have those built super-universal as well.  The first one I tackled was curl, which had some issues due to configure, so I had to write a shell script to do the hardwork for me.  It needs to run configure three times, and I got a lot of the information for it from http://curl.haxx.se/mail/lib-2009-05/0000.html.

#!/bin/sh
export CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc"
./configure --prefix=/usr/local/encap/curl-7.19.6 --with-ssl=/usr --without-ca-bundle --disable-dependency-tracking

cp include/curl/curlbuild.h include/curl/curlbuild32.h

make distclean

export CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch x86_64 -arch ppc64"
./configure --prefix=/usr/local/encap/curl-7.19.6 --with-ssl=/usr --without-ca-bundle --disable-dependency-tracking

cp include/curl/curlbuild.h include/curl/curlbuild64.h

make distclean

export CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64 -arch ppc64"
./configure --prefix=/usr/local/encap/curl-7.19.6 --with-ssl=/usr --without-ca-bundle --disable-dependency-tracking

cat > include/curl/curlbuild.h <

There will be more of these as I build the other dependencies.