SQLite is a small, lightweight, zero-configuration embedded SQL database engine. For Mac or iPhone applications that need to store more than a simple plist file (accessed through NSUserDefaults) would be able to handle, and for those who wish to avoid using Apple’s Core Data, SQLite provides a remarkably powerful and simple way of storing sortable and searchable content in your application.
While nearly all Macs ship with SQLite, you’re not always guaranteed to have the same version or the latest bug fixes, which often leads developers to wish to compile their own version for inclusion in their application.
After downloading and extracting the tarball, the SQLite code compiles harmlessly from the command line. Getting it into a Framework format that you can include in your Xcode projects, however, requires a bit more work.
And so I sat down and threw together a script you can run to build SQLite as a framework that you can then drop into Xcode and distribute with your projects. To use:
# cd sqlite source diretory (i.e. sqlite-3.6.19)
# wget http://chipmunkninja.com/download/SQLite-Framework-MacOSX.tar.bz2
# tar xfj SQLite-Framework-MacOSX.tar.bz2
# ./MacOSX-Framework
And you’re done! All you have to do now is copy the libsqlite.framework bundle to your Xcode project and link it with your project executable(s) and you’re good to go!
You can get the scripts here from chipmunkninja.com
The code for the MacOSX-Framework bourne shell script is inspired by the script of the same name that is included with libcurl.