Skip to content

Commit 8f854c1

Browse files
committed
keep DIR option to --with-unixODBC for old versions without libodbc.pc
1 parent ac9ce0f commit 8f854c1

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

UPGRADING

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,8 @@ The following extensions and SAPIs are affected:
563563

564564
- ODBC:
565565
. --with-iodbc no longer accepts a directory.
566-
. --with-unixODBC no longer accepts a directory.
566+
. --with-unixODBC without directory now use pkg-config (preferred).
567+
Directory is still accepted for old versions without libodbc.pc.
567568

568569
- OpenSSL:
569570
. --with-openssl no longer accepts a directory.

ext/odbc/config.m4

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,20 @@ PHP_ARG_WITH([unixODBC],,
362362

363363
AC_MSG_CHECKING(whether to build with unixODBC support)
364364
if test "$PHP_UNIXODBC" != "no"; then
365-
AC_MSG_RESULT(yes)
366-
PKG_CHECK_MODULES([ODBC], [odbc])
367-
PHP_EVAL_INCLINE($ODBC_CFLAGS)
365+
if test "$PHP_UNIXODBC" = "yes"; then
366+
AC_MSG_RESULT(yes from pkgconfig)
367+
PKG_CHECK_MODULES([ODBC], [odbc])
368+
PHP_EVAL_INCLINE($ODBC_CFLAGS)
369+
else
370+
dnl keep old DIR way for old version without libodbc.pc
371+
ODBC_INCDIR=$PHP_UNIXODBC/include
372+
ODBC_LIBDIR=$PHP_UNIXODBC/$PHP_LIBDIR
373+
ODBC_LFLAGS=-L$ODBC_LIBDIR
374+
ODBC_CFLAGS=-I$ODBC_INCDIR
375+
ODBC_LIBS=-lodbc
376+
PHP_ODBC_CHECK_HEADER(sqlext.h)
377+
AC_MSG_RESULT(yes in $PHP_UNIXODBC)
378+
fi
368379
ODBC_TYPE=unixODBC
369380
AC_DEFINE(HAVE_UNIXODBC,1,[ ])
370381
else

0 commit comments

Comments
 (0)