From b1b8059e6c98eb5feb021d2f1dd7509d749756e2 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 2 Sep 2024 02:04:27 +0200 Subject: [PATCH] Autotools: Move PHP_ODBC_* defines to configuration header The PHP_ODBC_* defines are remains of the PHP 2 and 3 era where the ODBC functionality was part of the PHP core and was later moved to an extension. This moves these defines to a regular PHP configuration header (php_config.h) as done in other extensions. --- UPGRADING.INTERNALS | 3 +++ ext/odbc/config.m4 | 13 +++++++++---- main/build-defs.h.in | 4 ---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index e4cf9e9c94b0d..432754528f09a 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -52,6 +52,9 @@ PHP 8.5 INTERNALS UPGRADE NOTES - Linux build system changes . libdir is properly set when --libdir (ex: /usr/lib64) and --with-libdir (ex lib64) configure options are used to ${libdir}/php (ex: /usr/lib64/php) + . PHP_ODBC_CFLAGS, PHP_ODBC_LFLAGS, PHP_ODBC_LIBS, PHP_ODBC_TYPE preprocessor + macros defined by ext/odbc are now defined in php_config.h instead of the + build-defs.h header. ======================== 3. Module changes diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4 index eb6572c2c5c2d..9baa8dbd8e646 100644 --- a/ext/odbc/config.m4 +++ b/ext/odbc/config.m4 @@ -428,11 +428,16 @@ if test -n "$ODBC_TYPE"; then AC_DEFINE([HAVE_UODBC], [1], [Define to 1 if the PHP extension 'odbc' is available.]) + AC_DEFINE_UNQUOTED([PHP_ODBC_CFLAGS], ["$ODBC_CFLAGS"], + [The compile options that PHP odbc extension was built with.]) + AC_DEFINE_UNQUOTED([PHP_ODBC_LIBS], ["$ODBC_LIBS"], + [The libraries linker flags that PHP odbc extension was built with.]) + AC_DEFINE_UNQUOTED([PHP_ODBC_LFLAGS], ["$ODBC_LFLAGS"], + [The linker flags that PHP odbc extension was built with.]) + AC_DEFINE_UNQUOTED([PHP_ODBC_TYPE], ["$ODBC_TYPE"], + [The ODBC library used in the PHP odbc extension.]) + PHP_SUBST([ODBC_SHARED_LIBADD]) - AC_SUBST([ODBC_CFLAGS]) - AC_SUBST([ODBC_LIBS]) - AC_SUBST([ODBC_LFLAGS]) - AC_SUBST([ODBC_TYPE]) PHP_NEW_EXTENSION([odbc], [php_odbc.c odbc_utils.c], diff --git a/main/build-defs.h.in b/main/build-defs.h.in index f0cbdb631c0d5..72cd9c30fb743 100644 --- a/main/build-defs.h.in +++ b/main/build-defs.h.in @@ -15,10 +15,6 @@ */ #define CONFIGURE_COMMAND "@CONFIGURE_COMMAND@" -#define PHP_ODBC_CFLAGS "@ODBC_CFLAGS@" -#define PHP_ODBC_LFLAGS "@ODBC_LFLAGS@" -#define PHP_ODBC_LIBS "@ODBC_LIBS@" -#define PHP_ODBC_TYPE "@ODBC_TYPE@" #define PHP_PROG_SENDMAIL "@PROG_SENDMAIL@" #define PEAR_INSTALLDIR "@EXPANDED_PEAR_INSTALLDIR@" #define PHP_INCLUDE_PATH "@INCLUDE_PATH@"