Only build SQLite when there's no system-provided library.

This commit is contained in:
Gunnar Beutner 2012-05-29 15:59:00 +02:00
parent 3027ea1758
commit b31591997c
2 changed files with 52 additions and 3 deletions

View File

@ -64,10 +64,48 @@ AC_CHECK_LIB(socket, getsockname)
AC_CHECK_LIB(ws2_32, getsockname)
AC_CHECK_LIB(shlwapi, PathRemoveFileSpecA)
AC_MSG_CHECKING([for OpenSSL])
AC_LANG_PUSH(C)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], [])],
[],
[AC_MSG_ERROR([You need the OpenSSL headers and libraries in order to build this application]) ])
AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], []),
[
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([You need the OpenSSL headers and libraries in order to build this application])
]
)
AC_LANG_POP(C)
AC_CHECK_LIB(sqlite, sqlite3_open)
AC_MSG_CHECKING([for SQLite3])
AC_LANG_PUSH(C)
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([[#include <sqlite3.h>]], []),
[
AC_MSG_RESULT([yes])
bundled_sqlite3=no
],
[
AC_MSG_ERROR([no])
bundled_sqlite3=yes
]
)
AC_LANG_POP(C)
AM_CONDITIONAL([USE_BUNDLED_SQLITE3], [test "$bundled_sqlite3" = yes])
if test "$bundled_sqlite3" = yes; then
SQLITE3_LDFLAGS=${top_builddir}/third-party/sqlite/libsqlite3.la
SQLITE3_CPPFLAGS=-I${top_srcdir}/third-party/sqlite
else
SQLITE3_LDFLAGS=
SQLITE3_CPPFLAGS=
fi
AC_SUBST([SQLITE3_LDFLAGS])
AC_SUBST([SQLITE3_CPPFLAGS])
AC_OUTPUT([
Makefile

11
third-party/Makefile.am vendored Normal file
View File

@ -0,0 +1,11 @@
## Process this file with automake to produce Makefile.in
if USE_BUNDLED_SQLITE3
BUNDLED_SQLITE3=sqlite
endif
SUBDIRS = \
ltdl \
$(BUNDLED_SQLITE3) \
cJSON \
mmatch