Commit: a3fa25e857ca5d714e72b25c7f6a2999d1df8a6b Author: Ole Markus With <olemar...@olemarkus.org> Sat, 17 Aug 2013 14:22:11 +0200 Committer: Stanislav Malyshev <s...@php.net> Sun, 18 Aug 2013 14:16:17 -0700 Parents: 3da2fb335db1f8ed64967164e090688ba0eb793d Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a3fa25e857ca5d714e72b25c7f6a2999d1df8a6b Log: Use pkg-config to detect iodbc Changed paths: M ext/odbc/config.m4 Diff: diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4 index 5be3288..a1201db 100644 --- a/ext/odbc/config.m4 +++ b/ext/odbc/config.m4 @@ -370,18 +370,33 @@ PHP_ARG_WITH(iodbc,, if test "$PHP_IODBC" != "no"; then AC_MSG_CHECKING(for iODBC support) - if test "$PHP_IODBC" = "yes"; then - PHP_IODBC=/usr/local + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libiodbc ; then + PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR) + ODBC_TYPE=iodbc + ODBC_INCLUDE=`$PKG_CONFIG --cflags-only-I libiodbc` + ODBC_LFLAGS=`$PKG_CONFIG --libs-only-L libiodbc` + ODBC_LIBS=`$PKG_CONFIG --libs-only-l libiodbc` + PHP_EVAL_INCLINE($ODBC_INCLUDE) + AC_DEFINE(HAVE_IODBC,1,[ ]) + AC_DEFINE(HAVE_ODBC2,1,[ ]) + AC_MSG_RESULT([$ext_output]) + else + if test "$PHP_IODBC" = "yes"; then + PHP_IODBC=/usr/local + fi + PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR) + PHP_ADD_INCLUDE($PHP_IODBC/include, 1) + ODBC_TYPE=iodbc + ODBC_INCLUDE=-I$PHP_IODBC/include + ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR + ODBC_LIBS=-liodbc + AC_DEFINE(HAVE_IODBC,1,[ ]) + AC_DEFINE(HAVE_ODBC2,1,[ ]) + AC_MSG_RESULT([$ext_output]) fi - PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR) - PHP_ADD_INCLUDE($PHP_IODBC/include, 1) - ODBC_TYPE=iodbc - ODBC_INCLUDE=-I$PHP_IODBC/include - ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR - ODBC_LIBS=-liodbc - AC_DEFINE(HAVE_IODBC,1,[ ]) - AC_DEFINE(HAVE_ODBC2,1,[ ]) - AC_MSG_RESULT([$ext_output]) fi fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php