Skip to content

Commit f16ab75

Browse files
authored
Refactor HAVE_SQLDATASOURCES check (#15222)
On Windows, this preprocessor macro is moved to odbc extension, in Autotools check CS is synced and some basic help text is added.
1 parent dcdcb3c commit f16ab75

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

ext/odbc/config.m4

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,13 @@ fi
440440

441441
dnl Extension setup
442442
if test -n "$ODBC_TYPE"; then
443-
if test "$ODBC_TYPE" != "dbmaker"; then
444-
PHP_EVAL_LIBLINE([$ODBC_LFLAGS $ODBC_LIBS], ODBC_SHARED_LIBADD)
445-
if test "$ODBC_TYPE" != "solid"; then
446-
AC_DEFINE(HAVE_SQLDATASOURCES,1,[ ])
447-
fi
448-
fi
443+
AS_VAR_IF([ODBC_TYPE], [dbmaker],, [
444+
PHP_EVAL_LIBLINE([$ODBC_LFLAGS $ODBC_LIBS], [ODBC_SHARED_LIBADD])
445+
AS_VAR_IF([ODBC_TYPE], [solid],,
446+
[AC_DEFINE([HAVE_SQLDATASOURCES], [1],
447+
[Define to 1 if ODBC library has 'SQLDataSources', as a function or
448+
macro.])])
449+
])
449450

450451
AC_DEFINE([HAVE_UODBC], [1],
451452
[Define to 1 if the PHP extension 'odbc' is available.])

ext/odbc/config.w32

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if (PHP_ODBC == "yes") {
99
&& CHECK_HEADER_ADD_INCLUDE("sqlext.h", "CFLAGS_ODBC")) {
1010
EXTENSION("odbc", "php_odbc.c odbc_utils.c", PHP_ODBC_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
1111
AC_DEFINE("HAVE_UODBC", 1, "Define to 1 if the PHP extension 'odbc' is available.");
12+
AC_DEFINE("HAVE_SQLDATASOURCES", 1, "Define to 1 if ODBC library has 'SQLDataSources', as a function or macro.");
1213
if ("no" == PHP_ODBCVER) {
1314
AC_DEFINE("ODBCVER", "0x0350", "The highest supported ODBC version", false);
1415
} else if ("0" != PHP_ODBCVER) {

win32/build/config.w32.h.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
#define HAVE_GLOB
9696
#define PHP_SHLIB_SUFFIX "dll"
9797
#define PHP_SHLIB_EXT_PREFIX "php_"
98-
#define HAVE_SQLDATASOURCES
9998

10099
/* Win32 supports socketpair by the emulation in win32/sockets.c */
101100
#define HAVE_SOCKETPAIR 1

0 commit comments

Comments
 (0)