--- gw/shared.c.orig 2006-03-08 15:46:00.000000000 +0800 +++ gw/shared.c 2006-03-08 15:46:11.000000000 +0800 @@ -74,7 +74,7 @@ #include #endif #ifdef HAVE_SQLITE -#include +#include #endif --- gwlib/dbpool_sqlite.c.orig 2006-03-08 16:07:32.000000000 +0800 +++ gwlib/dbpool_sqlite.c 2006-03-10 08:44:42.000000000 +0800 @@ -61,7 +61,9 @@ */ #ifdef HAVE_SQLITE -#include +#include + +typedef sqlite3 sqlite; static void *sqlite_open_conn(const DBConf *db_conf) { @@ -73,7 +75,8 @@ if (conf == NULL) return NULL; - if ((db = sqlite_open(octstr_get_cstr(conf->file), 0, &errmsg)) == NULL) { + if ((db = sqlite3_open(octstr_get_cstr(conf->file), 0)) == NULL) { + errmsg = sqlite3_errcode(db); error(0, "SQLite: can not open database file `%s'!", octstr_get_cstr(conf->file)); error(0, "SQLite: %s", errmsg); @@ -81,7 +84,7 @@ } info(0, "SQLite: Opened database file `%s'.", octstr_get_cstr(conf->file)); - info(0, "SQLite: library version %s.", sqlite_version); + info(0, "SQLite: library version %s.", sqlite3_version); return db; @@ -94,7 +97,7 @@ if (conn == NULL) return; - sqlite_close((sqlite*) conn); + sqlite3_close((sqlite*) conn); gw_free(conn); } --- test/test_dbpool.c.orig 2006-03-10 08:46:38.000000000 +0800 +++ test/test_dbpool.c 2006-03-10 08:46:58.000000000 +0800 @@ -215,7 +215,7 @@ #endif #ifdef HAVE_SQLITE -#include +#include static DBConf *sqlite_create_conf(Octstr *db) { --- configure.orig 2006-03-10 08:50:27.000000000 +0800 +++ configure 2006-03-10 08:51:20.000000000 +0800 @@ -4884,14 +4884,14 @@ done LIBS="$LIBS -L/usr/local/lib" - echo $ac_n "checking for sqlite_open in -lsqlite""... $ac_c" 1>&6 -echo "configure:4889: checking for sqlite_open in -lsqlite" >&5 + echo $ac_n "checking for sqlite_open in -lsqlite3""... $ac_c" 1>&6 +echo "configure:4889: checking for sqlite_open in -lsqlite3" >&5 ac_lib_var=`echo sqlite'_'sqlite_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lsqlite $LIBS" +LIBS="-lsqlite3 $LIBS" cat > conftest.$ac_ext <&6 - LIBS="$LIBS -lsqlite" + LIBS="$LIBS -lsqlite3" else echo "$ac_t""no" 1>&6 fi --- configure.in.orig 2006-03-10 08:50:23.000000000 +0800 +++ configure.in 2006-03-10 08:51:26.000000000 +0800 @@ -946,7 +946,7 @@ AC_MSG_RESULT(searching) AC_CHECK_HEADERS(sqlite.h) LIBS="$LIBS -L/usr/local/lib" - AC_CHECK_LIB(sqlite, sqlite_open, [LIBS="$LIBS -lsqlite"]) + AC_CHECK_LIB(sqlite, sqlite_open, [LIBS="$LIBS -lsqlite3"]) AC_PATH_PROGS(SQLITE, sqlite, no) AC_MSG_CHECKING([sqlite version]) sqlite_version=`$SQLITE -version` --- configure.in.orig 2006-03-10 09:25:23.000000000 +0800 +++ configure.in 2006-03-10 09:26:47.000000000 +0800 @@ -944,10 +944,10 @@ AC_MSG_RESULT(disabled) else AC_MSG_RESULT(searching) - AC_CHECK_HEADERS(sqlite.h) + AC_CHECK_HEADERS(sqlite3.h) LIBS="$LIBS -L/usr/local/lib" - AC_CHECK_LIB(sqlite, sqlite_open, [LIBS="$LIBS -lsqlite3"]) - AC_PATH_PROGS(SQLITE, sqlite, no) + AC_CHECK_LIB(sqlite, sqlite3_open, [LIBS="$LIBS -lsqlite3"]) + AC_PATH_PROGS(SQLITE, sqlite3, no) AC_MSG_CHECKING([sqlite version]) sqlite_version=`$SQLITE -version` AC_MSG_RESULT([$sqlite_version]) --- configure.orig 2006-03-10 09:23:22.000000000 +0800 +++ configure 2006-03-10 09:27:32.000000000 +0800 @@ -4843,7 +4843,7 @@ echo "$ac_t""disabled" 1>&6 else echo "$ac_t""searching" 1>&6 - for ac_hdr in sqlite.h + for ac_hdr in sqlite3.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -4884,9 +4884,9 @@ done LIBS="$LIBS -L/usr/local/lib" - echo $ac_n "checking for sqlite_open in -lsqlite3""... $ac_c" 1>&6 -echo "configure:4889: checking for sqlite_open in -lsqlite3" >&5 -ac_lib_var=`echo sqlite'_'sqlite_open | sed 'y%./+-%__p_%'` + echo $ac_n "checking for sqlite3_open in -lsqlite3""... $ac_c" 1>&6 +echo "configure:4889: checking for sqlite3_open in -lsqlite3" >&5 +ac_lib_var=`echo sqlite'_'sqlite3_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4898,10 +4898,10 @@ /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char sqlite_open(); +char sqlite3_open(); int main() { -sqlite_open() +sqlite3_open() ; return 0; } EOF if { (eval echo configure:4908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then @@ -4924,7 +4924,7 @@ echo "$ac_t""no" 1>&6 fi - for ac_prog in sqlite + for ac_prog in sqlite3 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 --- test/test_dbpool.c.orig 2006-03-10 09:33:22.000000000 +0800 +++ test/test_dbpool.c 2006-03-10 09:33:31.000000000 +0800 @@ -259,7 +259,7 @@ debug("",0,"Query %ld/%ld: sqlite conn obj at %p", i, queries, (void*) pconn->conn); - state = sqlite_exec(pconn->conn, octstr_get_cstr(sql), callback, 0, &errmsg); + state = sqlite3_exec(pconn->conn, octstr_get_cstr(sql), callback, 0, &errmsg); if (state != SQLITE_OK) { error(0, "SQLite: %s", errmsg); failed++;