From 9df3e097b88533dd9abae4360500c849054dc410 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Mon, 20 May 2019 22:48:14 +1000 Subject: [PATCH] Use PKG_CHECK_MODULES to detect unixODBC --- UPGRADING | 1 + ext/odbc/config.m4 | 19 ++++++------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/UPGRADING b/UPGRADING index 1de5b39187..91f26e9a07 100644 --- a/UPGRADING +++ b/UPGRADING @@ -536,6 +536,7 @@ The following extensions and SAPIs are affected: - ODBC: . --with-iodbc no longer accepts a directory. + . --with-unixODBC no longer accepts a directory. - OpenSSL: . --with-openssl no longer accepts a directory. diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4 index 792aaef5bb..1fdce146cd 100644 --- a/ext/odbc/config.m4 +++ b/ext/odbc/config.m4 @@ -357,23 +357,16 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH([unixODBC],, - [AS_HELP_STRING([[--with-unixODBC[=DIR]]], - [Include unixODBC support [/usr/local]])]) + [AS_HELP_STRING([--with-unixODBC], + [Include unixODBC support])]) - AC_MSG_CHECKING(for unixODBC support) + AC_MSG_CHECKING(whether to build with unixODBC support) if test "$PHP_UNIXODBC" != "no"; then - if test "$PHP_UNIXODBC" = "yes"; then - PHP_UNIXODBC=/usr/local - fi - ODBC_INCDIR=$PHP_UNIXODBC/include - ODBC_LIBDIR=$PHP_UNIXODBC/$PHP_LIBDIR - ODBC_LFLAGS=-L$ODBC_LIBDIR - ODBC_CFLAGS=-I$ODBC_INCDIR - ODBC_LIBS=-lodbc + AC_MSG_RESULT(yes) + PKG_CHECK_MODULES([ODBC], [odbc]) + PHP_EVAL_INCLINE($ODBC_CFLAGS) ODBC_TYPE=unixODBC - PHP_ODBC_CHECK_HEADER(sqlext.h) AC_DEFINE(HAVE_UNIXODBC,1,[ ]) - AC_MSG_RESULT([$ext_output]) else AC_MSG_RESULT(no) fi -- 2.40.0