Skip to content

Autotools: Sync CS in gd extension #15364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 31 additions & 39 deletions ext/gd/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,26 @@ PHP_ARG_WITH([external-gd],
[no],
[no])

if test -z "$PHP_AVIF"; then
PHP_ARG_WITH([avif],
[for libavif],
[AS_HELP_STRING([--with-avif],
[GD: Enable AVIF support (only for bundled libgd)])],
[no],
[no])
fi
PHP_ARG_WITH([avif],
[for libavif],
[AS_HELP_STRING([--with-avif],
[GD: Enable AVIF support (only for bundled libgd)])],
[no],
[no])

if test -z "$PHP_WEBP"; then
PHP_ARG_WITH([webp],
[for libwebp],
[AS_HELP_STRING([--with-webp],
[GD: Enable WEBP support (only for bundled libgd)])],
[no],
[no])
fi
PHP_ARG_WITH([webp],
[for libwebp],
[AS_HELP_STRING([--with-webp],
[GD: Enable WEBP support (only for bundled libgd)])],
[no],
[no])

if test -z "$PHP_JPEG"; then
PHP_ARG_WITH([jpeg],
[for libjpeg],
[AS_HELP_STRING([--with-jpeg],
[GD: Enable JPEG support (only for bundled libgd)])],
[no],
[no])
fi
PHP_ARG_WITH([jpeg],
[for libjpeg],
[AS_HELP_STRING([--with-jpeg],
[GD: Enable JPEG support (only for bundled libgd)])],
[no],
[no])

PHP_ARG_WITH([xpm],
[for libXpm],
Expand Down Expand Up @@ -73,73 +67,72 @@ AC_DEFUN([PHP_GD_PNG],[
AC_DEFINE([HAVE_LIBPNG], [1], [Define to 1 if you have the libpng library.])
])

AC_DEFUN([PHP_GD_AVIF],[
if test "$PHP_AVIF" != "no"; then
AC_DEFUN([PHP_GD_AVIF], [
AS_VAR_IF([PHP_AVIF], [no],, [
PKG_CHECK_MODULES([AVIF], [libavif >= 0.8.2])
PHP_EVAL_LIBLINE([$AVIF_LIBS], [GD_SHARED_LIBADD])
PHP_EVAL_INCLINE([$AVIF_CFLAGS])
AC_DEFINE([HAVE_LIBAVIF], [1],
[Define to 1 if you have the libavif library.])
AC_DEFINE([HAVE_GD_AVIF], [1],
[Define to 1 if gd extension has AVIF support.])
fi
])
])

AC_DEFUN([PHP_GD_WEBP],[
if test "$PHP_WEBP" != "no"; then
AS_VAR_IF([PHP_WEBP], [no],, [
PKG_CHECK_MODULES([WEBP], [libwebp >= 0.2.0])
PHP_EVAL_LIBLINE([$WEBP_LIBS], [GD_SHARED_LIBADD])
PHP_EVAL_INCLINE([$WEBP_CFLAGS])
AC_DEFINE([HAVE_LIBWEBP], [1],
[Define to 1 if you have the libwebp library.])
AC_DEFINE([HAVE_GD_WEBP], [1],
[Define to 1 if gd extension has WebP support.])
fi
])
])

AC_DEFUN([PHP_GD_JPEG],[
if test "$PHP_JPEG" != "no"; then
AS_VAR_IF([PHP_JPEG], [no],, [
PKG_CHECK_MODULES([JPEG], [libjpeg])
PHP_EVAL_LIBLINE([$JPEG_LIBS], [GD_SHARED_LIBADD])
PHP_EVAL_INCLINE([$JPEG_CFLAGS])
AC_DEFINE([HAVE_LIBJPEG], [1],
[Define to 1 if you have the libjpeg library.])
AC_DEFINE([HAVE_GD_JPG], [1],
[Define to 1 if gd extension has JPEG support.])
fi
])
])

AC_DEFUN([PHP_GD_XPM],[
if test "$PHP_XPM" != "no"; then
AS_VAR_IF([PHP_XPM], [no],, [
PKG_CHECK_MODULES([XPM], [xpm])
PHP_EVAL_LIBLINE([$XPM_LIBS], [GD_SHARED_LIBADD])
PHP_EVAL_INCLINE([$XPM_CFLAGS])
AC_DEFINE([HAVE_XPM], [1], [Define to 1 if you have the xpm library.])
AC_DEFINE([HAVE_GD_XPM], [1],
[Define to 1 if gd extension has XPM support.])
fi
])
])

AC_DEFUN([PHP_GD_FREETYPE2],[
if test "$PHP_FREETYPE" != "no"; then
AS_VAR_IF([PHP_FREETYPE], [no],, [
PKG_CHECK_MODULES([FREETYPE2], [freetype2])

PHP_EVAL_INCLINE([$FREETYPE2_CFLAGS])
PHP_EVAL_LIBLINE([$FREETYPE2_LIBS], [GD_SHARED_LIBADD])
AC_DEFINE([HAVE_LIBFREETYPE], [1],
[Define to 1 if you have the FreeType library.])
AC_DEFINE([HAVE_GD_FREETYPE], [1],
[Define to 1 if gd extension has FreeType support.])
fi
])
])

AC_DEFUN([PHP_GD_JISX0208],[
if test "$PHP_GD_JIS_CONV" = "yes"; then
AS_VAR_IF([PHP_GD_JIS_CONV], [yes], [
AC_DEFINE([USE_GD_JISX0208], [1],
[Define to 1 if gd extension has JIS-mapped Japanese font support.])
AC_DEFINE([JISX0208], [1],
[Define to 1 if GD library has JIS-mapped Japanese font support.])
fi
])
])

dnl
Expand Down Expand Up @@ -222,7 +215,6 @@ dnl Main GD configure
dnl

if test "$PHP_GD" != "no"; then

if test "$PHP_EXTERNAL_GD" = "no"; then
extra_sources=m4_normalize(["
libgd/gd_avif.c
Expand Down
Loading