@@ -47,27 +47,27 @@ dnl INN_LIB_SQLITE3_SWITCH was called.
4747AC_DEFUN ( [ INN_LIB_SQLITE3_RESTORE] , [ INN_LIB_HELPER_RESTORE([ SQLITE3] )] )
4848
4949dnl Checks if SQLite v3 is present. The single argument, if "true", says to
50- dnl fail if the SQLite library could not be found. Prefer probing with
51- dnl pkg-config if available and the --with flags were not given.
50+ dnl fail if the SQLite library could not be found. We do not use pkg-config
51+ dnl like the upstream version of this file as we have a specific check to
52+ dnl ensure that SQLite v3 meets our minimum version requirement.
5253AC_DEFUN ( [ _INN_LIB_SQLITE3_INTERNAL] ,
53- [ INN_LIB_HELPER_PATHS([ SQLITE3] )
54- AS_IF ( [ test x"$SQLITE3_CPPFLAGS" = x && test x"$SQLITE3_LDFLAGS" = x] ,
55- [ PKG_PROG_PKG_CONFIG([ ] , [ PKG_CONFIG=false] )
56- AS_IF ( [ test x"$PKG_CONFIG" = x] , [ PKG_CONFIG=false] )
57- PKG_CHECK_EXISTS([ sqlite3] ,
58- [ PKG_CHECK_MODULES([ SQLITE3] , [ sqlite3] )
59- SQLITE3_CPPFLAGS="$SQLITE3_CFLAGS"] )] )
60- AS_IF ( [ test x"$SQLITE3_LIBS" = x] ,
61- [ INN_LIB_SQLITE3_SWITCH
62- LIBS=
63- AC_SEARCH_LIBS ( [ sqlite3_open_v2] , [ sqlite3] ,
64- [ SQLITE3_LIBS="$LIBS"] ,
65- [ AS_IF ( [ test x"$1 " = xtrue] ,
66- [ AC_MSG_ERROR ( [ cannot find usable libsqlite3 library] ) ] ) ] )
54+ [ AC_CACHE_CHECK ( [ for a sufficiently recent SQLite] ,
55+ [ inn_cv_have_sqlite3] ,
56+ [ INN_LIB_HELPER_PATHS([ SQLITE3] )
57+ INN_LIB_SQLITE3_SWITCH
58+ LIBS="-lsqlite3 $LIBS"
59+ AC_COMPUTE_INT ( [ _INN_LIB_SQLITE3_VERSION] , [ SQLITE_VERSION_NUMBER] ,
60+ [ #include <sqlite3.h>] )
61+ AS_IF ( [ test "x$_INN_LIB_SQLITE3_VERSION" != x] ,
62+ [ AS_IF ( [ test "$_INN_LIB_SQLITE3_VERSION" -ge 3008002] ,
63+ [ inn_cv_have_sqlite3=yes] ,
64+ [ inn_cv_have_sqlite3=no] ) ] ,
65+ [ inn_cv_have_sqlite3=no] )
6766 INN_LIB_SQLITE3_RESTORE] )
68- INN_LIB_SQLITE3_SWITCH
69- AC_CHECK_HEADERS ( [ sqlite3.h] )
70- INN_LIB_SQLITE3_RESTORE] )
67+ AS_IF ( [ test x"$inn_cv_have_sqlite3" = xyes] ,
68+ [ SQLITE3_LIBS="-lsqlite3"] ,
69+ [ AS_IF ( [ test x"$1 " = xtrue] ,
70+ [ AC_MSG_ERROR ( [ cannot find usable SQLite v3 library] ) ] ) ] ) ] )
7171
7272dnl The main macro for packages with mandatory SQLite v3 support.
7373AC_DEFUN ( [ INN_LIB_SQLITE3] ,
0 commit comments