Improve configure handling of ODBC

This commit changes behavior such that if --disable-core-odbc-support
is provided we'll build without ODBC even if the libraries are there.

Previously we would always quietly build with ODBC support if it was
on the system.

Contrary to what was said in commit 72a804983, my 2012 commit
ffc8e81b7 did not affect the behavior of --disable-core-odbc-support.
We never recognized the flag as being different from not providing the
option at all.

What the commit did do was to cause us to fail loudly if
--enable-core-odbc-support was provided but the system libraries were
not there.  This behavior is preserved.

(That commit also caused us to potentially run certain checks twice,
which this commit resolves.)

You can also now provide --enable-core-odbc-support=optional which has
the same effect as the default behavior.

FS-6173 --resolve

Thanks-to: James Le Cuirot <chewi@aura-online.co.uk>
This commit is contained in:
Travis Cross 2014-02-01 15:39:28 +00:00
parent 3cad316804
commit ab2bc7c689
1 changed files with 11 additions and 8 deletions

View File

@ -403,13 +403,16 @@ AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"])
AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"]) AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
AC_ARG_ENABLE(core-odbc-support, AC_ARG_ENABLE(core-odbc-support,
[AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support])],,[enable_core_odbc_support="no"]) [AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support (default is optional)])],,[enable_core_odbc_support="optional"])
if ! test "$enable_core_odbc_support" = "no"; then
AX_LIB_ODBC AX_LIB_ODBC
if test "$ac_cv_found_odbc" = "yes" ; then if test "$ac_cv_found_odbc" = "yes" ; then
enable_core_odbc_support="yes" enable_core_odbc_support="yes"
elif test "$enable_core_odbc_support" = "yes"; then
AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent])
else
enable_core_odbc_support="no"
fi fi
if test "x$enable_core_odbc_support" != "xno"; then
AC_CHECK_LIB([odbc], [SQLDisconnect],, AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent]))
fi fi
CHECK_LIBUUID CHECK_LIBUUID