diff --git a/configure.ac b/configure.ac index ba4ae31a0..676f7f98e 100644 --- a/configure.ac +++ b/configure.ac @@ -767,23 +767,31 @@ AC_ARG_ENABLE(msg-storage, [enable_msg_storage=auto] ) - AM_CONDITIONAL(BUILD_MSG_STORAGE, test x$enable_msg_storage = xtrue) + if test x$enable_msg_storage != xfalse; then - PKG_CHECK_MODULES(SQLITE3,[ sqlite3 >= 3.6.0],[ + PKG_CHECK_MODULES(SQLITE3,[sqlite3 >= 3.6.0],[found_sqlite=yes],[found_sqlite=no]) + if test "$found_sqlite" = "no"; then + dnl Check the lib presence in case the PKG-CONFIG version is not found + AC_CHECK_LIB(sqlite3, sqlite3_open, [SQLITE3_LIBS+=" -lsqlite3 " + found_sqlite=yes], + [AC_MSG_ERROR([No pkg-config or alternate SQLITE found, needed for message storage.])] + ) + fi + if test "$found_sqlite" = "yes"; then SQLITE3_CFLAGS+="-DMSG_STORAGE_ENABLED" - AC_SUBST(SQLITE3_CFLAGS) - AC_SUBST(SQLITE3_LIBS) - enable_msg_storage=true - ],[ - if test x$enable_msg_storage = xtrue; then - AC_MSG_ERROR([sqlite3 required for message storage not found.]) + else + if test x$enable_msg_storage = xtrue; then + AC_MSG_ERROR([sqlite3, required for message storage, not found]) + enable_msg_storage=false fi - enable_msg_storage=false - ] ) + fi + AC_SUBST(SQLITE3_CFLAGS) + AC_SUBST(SQLITE3_LIBS) fi + PKG_CHECK_MODULES(BELLESIP, [belle-sip >= 1.3.1])