Commits

Greg Ward committed 843914d

build: smarter detection of SQLite3 library

- look for sqlite3_open_v2(), since that's the function we actually use now
- define HAVE_SQLITE3 if both the header and library are good

Comments (0)

Files changed (4)

 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+#undef HAVE_SQLITE3
 #undef HAVE_SQLITE3_H
+#undef HAVE_LIBSQLITE3
+
+#if HAVE_SQLITE3_H && HAVE_LIBSQLITE3
+#  define HAVE_SQLITE3 1
+#endif
 
 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
    <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
 AC_PROG_CC
 AC_PROG_MAKE_SET
 
-# Checks for libraries.
-AC_CHECK_LIB(sqlite3, sqlite3_open)
-
 # Checks for header files.
 AC_CHECK_HEADERS([arpa/inet.h stdlib.h string.h sys/time.h unistd.h])
+
+# Checks for third-party libraries.
 AC_CHECK_HEADERS([sqlite3.h])
+AC_CHECK_LIB(sqlite3, sqlite3_open_v2)
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_MODE_T
 #include <string.h>
 #include <stdio.h>
 #include <unistd.h>
-#if HAVE_SQLITE3_H
+#if HAVE_SQLITE3
 # include <sqlite3.h>
 #endif
 
 }
 
 
-#if HAVE_SQLITE3_H
+#if HAVE_SQLITE3
 static int
 svn_read_sqlite(vccontext_t *context, result_t *result)
 {
     "svn-1.4",
     "svn-1.5",
     "svn-1.6",
-#if HAVE_SQLITE3_H
+#if HAVE_SQLITE3
     "svn-1.7",
     "svn-1.8",
 #endif