Index: Makefile.in
--- Makefile.in.orig	2009-07-06 16:29:57 +0200
+++ Makefile.in	2009-08-12 20:12:13 +0200
@@ -187,6 +187,17 @@
 USE_AMALGAMATION = @USE_AMALGAMATION@
 LIBOBJ = $(OBJS$(USE_AMALGAMATION))
 
+# FTS3 support
+ifdef FTS3
+TCC    += -DSQLITE_ENABLE_FTS3 -I$(TOP)/ext/fts3
+LIBOBJ += fts3.lo fts3_hash.lo fts3_expr.lo fts3_porter.lo fts3_icu.lo fts3_tokenizer1.lo fts3_tokenizer.lo
+endif
+
+# RTREE support
+ifdef RTREE
+TCC    += -DSQLITE_ENABLE_RTREE -I$(TOP)/ext/rtree
+LIBOBJ += rtree.lo
+endif
 
 # All of the source code files.
 #
@@ -477,6 +488,24 @@
 		-o $@ $(TOP)/src/shell.c libsqlite3.la \
 		$(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
 
+fts3.lo:	$(TOP)/ext/fts3/fts3.c $(HDR)
+	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3.c
+fts3_hash.lo:	$(TOP)/ext/fts3/fts3_hash.c $(HDR)
+	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_hash.c
+fts3_expr.lo:	$(TOP)/ext/fts3/fts3_expr.c $(HDR)
+	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_expr.c
+fts3_icu.lo:	$(TOP)/ext/fts3/fts3_icu.c $(HDR)
+	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_icu.c
+fts3_porter.lo:	$(TOP)/ext/fts3/fts3_porter.c $(HDR)
+	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_porter.c
+fts3_tokenizer.lo:	$(TOP)/ext/fts3/fts3_tokenizer.c $(HDR)
+	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_tokenizer.c
+fts3_tokenizer1.lo:	$(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR)
+	$(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_tokenizer1.c
+
+rtree.lo:	$(TOP)/ext/rtree/rtree.c $(HDR)
+	$(LTCOMPILE) -c $(TOP)/ext/rtree/rtree.c
+
 # This target creates a directory named "tsrc" and fills it with
 # copies of all of the C source code and header files needed to
 # build on the target system.  Some of the C source code and header
Index: configure
--- configure.orig	2009-08-01 17:04:20 +0200
+++ configure	2009-08-12 20:12:13 +0200
@@ -6012,11 +6012,7 @@
 if $ac_preproc_ok; then
   :
 else
-  { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  :
 fi
 
 ac_ext=c
Index: sqlite3.pc.in
--- sqlite3.pc.in.orig	2009-05-05 05:39:51 +0200
+++ sqlite3.pc.in	2009-08-12 20:12:13 +0200
@@ -8,6 +8,5 @@
 Name: SQLite
 Description: SQL database engine
 Version: @RELEASE@
-Libs: -L${libdir} -lsqlite3
-Libs.private: @LIBS@
+Libs: -L${libdir} -lsqlite3 @LIBS@
 Cflags: -I${includedir}
