From c3cf71b448ef1976d6f4ee6db270b4fbe82cc0d1 Mon Sep 17 00:00:00 2001 From: Raymond Chandler Date: Wed, 11 Feb 2009 18:51:12 +0000 Subject: [PATCH] improve odbc detection git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11885 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- build/config/odbc.m4 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/build/config/odbc.m4 b/build/config/odbc.m4 index 295b4bfedc..ada2baf97e 100644 --- a/build/config/odbc.m4 +++ b/build/config/odbc.m4 @@ -24,6 +24,7 @@ AC_DEFUN([ODBC_INC_WHERE], [ AC_DEFUN([ODBC_LIB_WHERE1], [ saved_LIBS=$LIBS +saved_CFLAGS=$CFLAGS case "$host" in *darwin*) LIBS="$saved_LIBS -L$1 -lodbc -framework CoreFoundation" @@ -32,6 +33,7 @@ case "$host" in LIBS="$saved_LIBS -L$1 -lodbc" ;; esac +CFLAGS="$saved_CFLAGS -I$ac_cv_odbc_where_inc" AC_TRY_LINK( [#include ], [SQLHDBC con; @@ -39,6 +41,7 @@ SQLDisconnect(con);], [ac_cv_found_odbc_lib=yes], ac_cv_found_odbc_lib=no) LIBS=$saved_LIBS +CFLAGS=$saved_CFLAGS ]) AC_DEFUN([TEST_LIBPATH], [ @@ -115,6 +118,13 @@ AC_ARG_WITH(odbc-include, fi fi + if test "X$with_odbc_include" != "X"; then + ac_cv_odbc_where_inc=$with_odbc_include + fi + if test "X$ac_cv_odbc_where_inc" = "X"; then + ODBC_INC_WHERE(/usr/include /usr/local/include) + fi + if test "X$with_odbc_lib" != "X"; then ac_cv_odbc_where_lib=$with_odbc_lib fi @@ -124,13 +134,6 @@ AC_ARG_WITH(odbc-include, ]) fi - if test "X$with_odbc_include" != "X"; then - ac_cv_odbc_where_inc=$with_odbc_include - fi - if test "X$ac_cv_odbc_where_inc" = "X"; then - ODBC_INC_WHERE(/usr/include /usr/local/include) - fi - AC_MSG_CHECKING(whether to include odbc) if test "X$ac_cv_odbc_where_lib" = "X" -a "X$ac_cv_odbc_where_inc" = "X"; then ac_cv_found_odbc=no @@ -138,9 +141,9 @@ AC_ARG_WITH(odbc-include, else ac_cv_found_odbc=yes AC_MSG_RESULT(yes) - ODBC_INC_DIR=$ac_cv_pcap_where_inc - ODBC_LIB_DIR=$ac_cv_pcap_where_lib - ODBC_INC_FLAGS="-I$ac_cv_pcap_where_inc" + ODBC_INC_DIR=$ac_cv_odbc_where_inc + ODBC_LIB_DIR=$ac_cv_odbc_where_lib + ODBC_INC_FLAGS="-I$ac_cv_odbc_where_inc" ODBC_LIB_FLAGS="-Wl,-lodbc" case "$host" in *darwin*)