From 78b8371bf18b853489550761bcfd92acc6e5738b Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sun, 4 Aug 2024 14:17:19 +0200 Subject: [PATCH] Fix HAVE_LIBGD usage When PHP gd extension uses the external system GD library, the HAVE_LIBGD preprocessor macro gets defined in Autotools. On Windows it was previously always defined when bundled library is used. This fixes the usage and adds help texts. --- ext/gd/config.m4 | 6 ++++-- ext/gd/config.w32 | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index b66626e65b110..329deffe4e719 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -253,7 +253,8 @@ if test "$PHP_GD" != "no"; then "]) dnl These are always available with bundled library - AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ]) + AC_DEFINE([HAVE_GD_BUNDLED], [1], + [Define to 1 if gd extension uses GD library bundled in PHP.]) AC_DEFINE(HAVE_GD_PNG, 1, [ ]) AC_DEFINE(HAVE_GD_BMP, 1, [ ]) AC_DEFINE(HAVE_GD_TGA, 1, [ ]) @@ -284,7 +285,8 @@ dnl Various checks for GD features PKG_CHECK_MODULES([GDLIB], [gdlib >= 2.1.0]) PHP_EVAL_LIBLINE([$GDLIB_LIBS], [GD_SHARED_LIBADD]) PHP_EVAL_INCLINE([$GDLIB_CFLAGS]) - AC_DEFINE(HAVE_LIBGD, 1, [ ]) + AC_DEFINE([HAVE_LIBGD], [1], + [Define to 1 gd extension uses external system GD library.]) PHP_GD_CHECK_VERSION PHP_NEW_EXTENSION([gd], [gd.c $extra_sources], [$ext_shared]) diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index b779df48e91d8..075b3f219ac19 100644 --- a/ext/gd/config.w32 +++ b/ext/gd/config.w32 @@ -55,8 +55,7 @@ if (PHP_GD != "no") { gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c gd_xbm.c gd_security.c gd_transform.c \ gd_filter.c gd_pixelate.c gd_rotate.c gd_color_match.c gd_webp.c gd_avif.c \ gd_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd"); - AC_DEFINE('HAVE_LIBGD', 1, 'GD support'); - AC_DEFINE('HAVE_GD_BUNDLED', 1, "Bundled GD"); + AC_DEFINE('HAVE_GD_BUNDLED', 1, "Define to 1 if gd extension uses GD library bundled in PHP."); AC_DEFINE('HAVE_GD_PNG', 1, "PNG support"); AC_DEFINE('HAVE_GD_BMP', 1, "BMP support"); AC_DEFINE('HAVE_GD_TGA', 1, "TGA support");