From ab2bc7c6891d37f1fdd966e54401e3f91429314f Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Sat, 1 Feb 2014 15:39:28 +0000 Subject: [PATCH] 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 --- configure.in | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index a41fb924b9..c5a08c9ba5 100644 --- a/configure.in +++ b/configure.in @@ -402,14 +402,17 @@ AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"]) AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"]) -AC_ARG_ENABLE(core-odbc-support, - [AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support])],,[enable_core_odbc_support="no"]) -AX_LIB_ODBC -if test "$ac_cv_found_odbc" = "yes" ; then - enable_core_odbc_support="yes" -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])) +AC_ARG_ENABLE(core-odbc-support, + [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 + if test "$ac_cv_found_odbc" = "yes" ; then + 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 CHECK_LIBUUID