From: Gunnar Beutner Date: Tue, 29 May 2012 13:59:00 +0000 (+0200) Subject: Only build SQLite when there's no system-provided library. X-Git-Tag: v0.0.1~467 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b31591997cec291ea8c49cbcb78ffbed035c988e;p=icinga2 Only build SQLite when there's no system-provided library. --- diff --git a/configure.ac b/configure.ac index 549239875..1b3268366 100644 --- a/configure.ac +++ b/configure.ac @@ -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 ]], [])], - [], - [AC_MSG_ERROR([You need the OpenSSL headers and libraries in order to build this application]) ]) + AC_LANG_PROGRAM([[#include ]], []), + [ + 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 ]], []), + [ + 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 diff --git a/third-party/Makefile.am b/third-party/Makefile.am new file mode 100644 index 000000000..58a732359 --- /dev/null +++ b/third-party/Makefile.am @@ -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