Small. Fast. Reliable.
Choose any three.

This information is obsolete. You are looking at the CVSTrac source management system display for SQLite that was replaced by Fossil on 2009-08-11. The information shown here has not been updated since that cut-over. These pages are retained for historical reference only.

All of the below was done on an Intel Macbook Pro with Mac OS X 10.4.11 using bash shell and Xcode 2.4.1 development tools (org dot eidesis at punkish)

Step 0: Add an env variable to the shell so that the compiler is forced to compile correctly for Tiger. If this is not done, a lot of errors to do with -flat_namespace will plague you.

	computer:~/Projects/sqlite me$ export MACOSX_DEPLOYMENT_TARGET=10.3

Step 1. Download the source and create the directories. I have created a folder called sqlite under a Projects directory. I will compile SQLite in this folder.

	computer:~/Projects/sqlite me$ tar xvzf sqlite-3.5.2.tar.gz
	computer:~/Projects/sqlite me$ cd sqlite-3.5.2
	computer:~/Projects/sqlite/sqlite-3.5.2 me$ cp Makefile.in Makefile.bak

Step 2. Edit Makefile.in We are going to do three things. (1) We will comment a switch that takes away the ability to load extensions; this is on line 119 in my Makefile.in. After my edit, that line looks like

	117: # You should not have to change anything below this line
	118: ###############################################################################
	119: #TCC += -DSQLITE_OMIT_LOAD_EXTENSION=1

(2) We will add two switches to enable SQLITE_CORE and FTS3. Note that fts1 and fts2 are NOT compatible with SQLite 3.5.x. In my Makefile.in I add these switches right after the OMIT_EXTENSION switch

	120: TCC += -DSQLITE_CORE=1
	121: TCC += -DSQLITE_ENABLE_FTS3=1

(3) This is the most complicated step. We will add information about the fts3.c and fts3.h files to the Makefile.in and requires several edits/additions. I have given the line numbers in my Makefile.in

	137: # FTS3 (optional)
	138: LIBOBJ += fts3.lo fts3_hash.lo fts3_porter.lo fts3_tokenizer.lo fts3_tokenizer1.lo
        ..
	206: # Source code for extensions
	207: #
	208: SRC += \
	209:   $(TOP)/ext/fts3/fts3.c \
	210:   $(TOP)/ext/fts3/fts3.h \
	211:   $(TOP)/ext/fts3/fts3_hash.c \
	212:   $(TOP)/ext/fts3/fts3_hash.h \
	213:   $(TOP)/ext/fts3/fts3_icu.c \
	214:   $(TOP)/ext/fts3/fts3_porter.c \
	215:   $(TOP)/ext/fts3/fts3_tokenizer.c \
	216:   $(TOP)/ext/fts3/fts3_tokenizer.h \
	217:   $(TOP)/ext/fts3/fts3_tokenizer1.c
        ..
	287: # Header files used by extensions
	288: #
	289: HDR += \
	290:   $(TOP)/ext/fts3/fts3.h \
	291:   $(TOP)/ext/fts3/fts3_hash.h \
	292:   $(TOP)/ext/fts3/fts3_tokenizer.h
        ..
	542: fts3.lo:	$(TOP)/ext/fts3/fts3.c $(HDR)
	543: 	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3.c
	544:
	545: fts3_hash.lo:	$(TOP)/ext/fts3/fts3_hash.c $(HDR)
	546: 	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_hash.c
	547:
	548: fts3_porter.lo:	$(TOP)/ext/fts3/fts3_porter.c $(HDR)
	549: 	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_porter.c
	550:
	551: fts3_tokenizer.lo:	$(TOP)/ext/fts3/fts3_tokenizer.c $(HDR)
	552: 	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_tokenizer.c
	553:
	554: fts3_tokenizer1.lo:	$(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR)
	555: 	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_tokenizer1.c

Step 3. Build the program. I will create a separate build folder so the source code folder is not messed up with built files.

	computer:~/Projects/sqlite/sqlite-3.5.2 me$ cd ..
	computer:~/Projects/sqlite me$ mkdir sqlite-3.5.2-build
	computer:~/Projects/sqlite me$ cd sqlite-3.5.2-build
	computer:~/Projects/sqlite/sqlite-3.5.2 me$ ../sqlite-3.5.2/configure
	computer:~/Projects/sqlite/sqlite-3.5.2 me$ make
	computer:~/Projects/sqlite/sqlite-3.5.2 me$ sudo make install

That's it. You are done. Now go back to the fts documentation and create your virtual tables to start searching.