]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Improve configure handling of ODBC
authorTravis Cross <tc@traviscross.com>
Sat, 1 Feb 2014 15:39:28 +0000 (15:39 +0000)
committerTravis Cross <tc@traviscross.com>
Sat, 1 Feb 2014 16:33:09 +0000 (16:33 +0000)
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>
configure.in

index f8db4899e24b264bcb5154860de2b7cd25037323..13e8d61f202ce38a960c5b9eaea710ad1816bbcc 100644 (file)
@@ -397,14 +397,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