Thursday, May 11, 2006

Compile an universal binary version of the sqlite 3 library

So far my blog didn't contains a lot of technical posts, maybe this could be the first of a long series...
I'll show you how to compile an universal binary version of the latest sqlite 3.3.5 database engine library.



This is a step by step tutorial...

Open the Terminal and grab a copy of the latest sqlite library:
curl -O http://www.sqlite.org/sqlite-3.3.5.tar.gz

Expand the archive:
tar xzvf sqlite-3.3.5.tar.gz

Go into the folder and create a new directory:
cd sqlite-3.3.5
mkdir bld
cd bld

Run the configure script with some custom parameters:
../configure --enable-shared=no --enable-threadsafe --disable-tcl
--enable-cross-thread-connections --enable-threads-override-locks
--enable-debug=no

Now the interesting part...
Edit the newly created Makefile and add these after the empty TCC += line:
TCC+=-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc

Now save your changes and run:
make

In the .libs directory there is now an universal libsqlite3.a that you can use with XCode or with gcc.

2 Comments:

  • Thanks very much for posting your solution. I used it and it worked great!

    todd

    By Anonymous, at 7:36 PM  

  • Thank you for this. I never would have figured it out myself. It works great and has helped me out a lot.

    By John Seward, at 9:03 PM  

Post a Comment

<< Home