diff --git a/configure b/configure
index c7aa6b2..bb33b29 100755
--- a/configure
+++ b/configure
@@ -41,6 +41,8 @@ f_bison=NO
 f_search=NO
 f_langs=nl,sv,cz,fr,id,it,de,jp,je,es,fi,ru,hr,pl,pt,hu,kr,ke,ro,si,cn,no,mk,br,dk,sk,ua,gr,tw,sr,ca,lt,za,ar,fa,sc,vi,tr,eo,am
 f_sqlite3=NO
+f_sqlite3static=NO
+f_sqlite3_path=NO
 f_libclang=NO
 f_libclangstatic=NO

@@ -103,6 +105,13 @@ while test -n "$1";  do
     --with-sqlite3 | -with-sqlite3)
        f_sqlite3=YES
        ;;
+    --with-sqlite3-static | -with-sqlite3-static)
+       f_sqlite3=YES
+       f_sqlite3static=YES
+       ;;
+    --sqlite3-path | -sqlite3-path)
+       shift; f_sqlite3_path=$1
+       ;;
     --with-libclang | -with-libclang)
        f_libclang=YES
        ;;
@@ -128,7 +137,8 @@ Usage: $0 [--help] [--shared] [--static] [--release] [--debug]
           [--perl name] [--flex name] [--bison name] [--make name]
           [--dot name] [--platform target] [--prefix dir] [--docdir dir]
           [--install name] [--english-only] [--enable-langs list]
-          [--with-sqlite3] [--with-libclang]
+          [--with-sqlite3] [--with-sqlite3-static] [--sqlite3-path]
+          [--with-libclang] [--with-libclang-static]
           [--with-doxywizard] [--with-doxysearch] [--with-doxyapp]

 Options:
@@ -138,30 +148,33 @@ Options:
                        [default: shared]
   --release | --debug   Build for release or debug
                        [default: release]
-  --perl name           Use \`name' as the name of the perl interpreter
+  --perl name           Use 'name' as the name of the perl interpreter
                        [default: autodetect]
-  --flex name           Use \`name' as the name of the GNU lexical scanner
+  --flex name           Use 'name' as the name of the GNU lexical scanner
                        [default: autodetect]
-  --bison name          Use \`name' as the name of the GNU compiler generator
+  --bison name          Use 'name' as the name of the GNU compiler generator
                        [default: autodetect]
-  --make name           Use \`name' as the name of the GNU make tool
+  --make name           Use 'name' as the name of the GNU make tool
                        [default: autodetect]
-  --dot name            Use \`name' as the name of the dot tool that
+  --dot name            Use 'name' as the name of the dot tool that
                         is part of the Graphviz package.
                         [default: autodetect]
-  --platform target     Do not detect platform but use \`target' instead.
+  --platform target     Do not detect platform but use 'target' instead.
                         See PLATFORMS for a list of possibilities
   --prefix dir          Installation prefix directory (doxygen will be
                         put in PREFIX/bin/doxygen)
                         [default: $f_prefix]
   --docdir dir          Documentation is installed in DOCDIR/
                         [default: PREFIX/share/doc/packages/doxygen]
-  --install name        Use \`name' as the name of the GNU install tool
+  --install name        Use 'name' as the name of the GNU install tool
                         [default: autodetect]
   --english-only        Include support for English only.
   --enable-langs list  Include support for output languages listed in list.
                        [default: $f_langs]
   --with-sqlite3        Add support for sqlite3 output [experimental]
+  --with-sqlite3-static Add support for sqlite3 output, using the libsqlite3.a static archive [experimental]
+  --sqlite3-path path   Use the SQLite install available under 'path'
+                       [default: /usr]
   --with-libclang       Add support for libclang parsing
   --with-doxywizard     Build the GUI frontend for doxygen. This
                         requires Qt version 4.
@@ -420,9 +433,18 @@ fi

 if test "$f_sqlite3" = YES; then
   printf "  Checking for sqlite3 ... "
-  sqlite3_hdr_dir="/usr/include /usr/local/include /opt/local/include"
-  sqlite3_lib_dir="/usr/lib /usr/local/lib /opt/local/lib /usr/lib/x86_64-linux-gnu"
-  sqlite3_lib_name="libsqlite3.so libsqlite3.dylib libsqlite3.a"
+  if test "$f_sqlite_path" = NO; then
+    sqlite3_hdr_dir="/usr/include /usr/local/include /opt/local/include"
+    sqlite3_lib_dir="/usr/lib /usr/local/lib /opt/local/lib /usr/lib/x86_64-linux-gnu"
+  else
+    sqlite3_hdr_dir="$f_sqlite3_path/include"
+    sqlite3_lib_dir="$f_sqlite3_path/lib"
+  fi
+  if test "$f_sqlite3static" = NO; then
+    sqlite3_lib_name="libsqlite3.so libsqlite3.dylib libsqlite3.a"
+  else
+    sqlite3_lib_name="libsqlite3.a"
+  fi
   sqlite3_hdr=NO
   sqlite3_lib=NO
   sqlite3_link=
@@ -436,8 +458,13 @@ if test "$f_sqlite3" = YES; then
     if test "$sqlite3_lib" = NO; then
       for j in $sqlite3_lib_name; do
         if test -e "$i/$j"; then
-          sqlite3_lib="$i/$j"
-          sqlite3_link="-L $i -lsqlite3"
+          if test "$f_sqlite3static" = NO; then
+            sqlite3_lib="$i/$j"
+            sqlite3_link="-L$i -lsqlite3"
+          else
+            sqlite3_lib="$i/$j"
+            sqlite3_link="$i/$j -ldl"
+          fi
           break
         fi
       done
@@ -792,7 +819,7 @@ EOF
      #if test "$f_thread" = YES; then
      #  realopts="$realopts thread"
      #fi
-     cat $SRC .tmakeconfig | sed -e "s/\$extraopts/$realopts/g" -e "s;%%SQLITE3_LIBS%%;$sqlite3_link;g" -e "s;%%LIBCLANG_LIBS%%;$libclang_link;g" >> $DST
+     cat $SRC .tmakeconfig | sed -e "s/\$extraopts/$realopts/g" -e "s;%%SQLITE3_INC%%;$sqlite3_hdr_dir;g" -e "s;%%SQLITE3_LIBS%%;$sqlite3_link;g" -e "s;%%LIBCLANG_LIBS%%;$libclang_link;g" >> $DST
      echo "  Created $DST from $SRC..."
 done

diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in
index 2140a8e..c4e79da 100644
--- a/src/libdoxygen.pro.in
+++ b/src/libdoxygen.pro.in
@@ -278,6 +278,7 @@ linux-g++:TMAKE_CXXFLAGS    += -fno-exceptions -fno-rtti
 INCLUDEPATH                += ../qtools
 #INCLUDEPATH                += ../libpng
 INCLUDEPATH                += ../libmd5
+INCLUDEPATH                += %%SQLITE3_INC%%
 win32:INCLUDEPATH          += .
 #win32-g++:INCLUDEPATH      = ../qtools /usr/include/libpng12 ../libmd5
 win32-g++:INCLUDEPATH      = ../qtools ../libmd5
diff --git a/src/settings.h b/src/settings.h
index a9fd128..d332a0c 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -1,7 +1,7 @@
 #ifndef SETTINGS_H
 #define SETTINGS_H

-#define USE_SQLITE3  0
+#define USE_SQLITE3  1
 #define USE_LIBCLANG 0

 #define IS_SUPPORTED(x) \
