PHP_ARG_WITH([webp],
[for libwebp],
[AS_HELP_STRING([--with-webp],
- [GD: Enable WEBP support])],
+ [GD: Enable WEBP support (only for bundled libgd)])],
[no],
[no])
fi
PHP_ARG_WITH([jpeg],
[for libjpeg],
[AS_HELP_STRING([--with-jpeg],
- [GD: Enable JPEG support])],
+ [GD: Enable JPEG support (only for bundled libgd)])],
[no],
[no])
fi
PHP_ARG_WITH([xpm],
[for libXpm],
[AS_HELP_STRING([--with-xpm],
- [GD: Enable XPM support])],
+ [GD: Enable XPM support (only for bundled libgd)])],
[no],
[no])
PHP_ARG_WITH([freetype],
[for FreeType 2],
[AS_HELP_STRING([--with-freetype],
- [GD: Enable FreeType 2 support])],
+ [GD: Enable FreeType 2 support (only for bundled libgd)])],
[no],
[no])
PHP_ARG_ENABLE([gd-jis-conv],
[whether to enable JIS-mapped Japanese font support in GD],
[AS_HELP_STRING([--enable-gd-jis-conv],
- [GD: Enable JIS-mapped Japanese font support])],
+ [GD: Enable JIS-mapped Japanese font support (only for bundled libgd)])],
[no],
[no])
], [ $GD_SHARED_LIBADD ], [char foobar () {}])
else
- dnl for png.h in gd_compat (PNG_LIBPNG_VER_STRING)
- PHP_GD_PNG
- dnl for jpeglib.h in gd_compat (JPEG_LIB_VERSION)
- PHP_GD_JPEG
- dnl for X11/xpm.h in gd.c (XpmLibraryVersion)
- PHP_GD_XPM
- dnl for ft2build.h in gd.c (FREETYPE_MAJOR...)
- PHP_GD_FREETYPE2
-
extra_sources="gd_compat.c"
PKG_CHECK_MODULES([GDLIB], [gdlib >= 2.1.0])
PHP_EVAL_LIBLINE($GDLIB_LIBS, GD_SHARED_LIBADD)
#include "php_open_temporary_file.h"
-#if HAVE_SYS_WAIT_H
+#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef PHP_WIN32
# include <Wingdi.h>
#endif
-#ifdef HAVE_GD_XPM
+#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
# include <X11/xpm.h>
#endif
#include <gdfontl.h> /* 4 Large font */
#include <gdfontg.h> /* 5 Giant font */
-#if HAVE_LIBFREETYPE
+#if defined(HAVE_GD_FREETYPE) && defined(HAVE_GD_BUNDLED)
# include <ft2build.h>
# include FT_FREETYPE_H
#endif
#define M_PI 3.14159265358979323846
#endif
-#if HAVE_LIBFREETYPE
+#ifdef HAVE_GD_FREETYPE
static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int);
#endif
ZEND_ARG_INFO(0, im)
ZEND_END_ARG_INFO()
-#if HAVE_LIBFREETYPE
+#ifdef HAVE_GD_FREETYPE
ZEND_BEGIN_ARG_INFO_EX(arginfo_imageftbbox, 0, 0, 4)
ZEND_ARG_INFO(0, size)
ZEND_ARG_INFO(0, angle)
PHP_FE(imagegetclip, arginfo_imagegetclip)
PHP_FE(imagedashedline, arginfo_imagedashedline)
-#if HAVE_LIBFREETYPE
+#ifdef HAVE_GD_FREETYPE
PHP_FE(imagettfbbox, arginfo_imagettfbbox)
PHP_FE(imagettftext, arginfo_imagettftext)
-#if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
PHP_FE(imageftbbox, arginfo_imageftbbox)
PHP_FE(imagefttext, arginfo_imagefttext)
-#endif
#endif
PHP_FE(imagetypes, arginfo_imagetypes)
PHP_MINIT(gd),
PHP_MSHUTDOWN(gd),
NULL,
-#if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
PHP_RSHUTDOWN(gd),
-#else
- NULL,
-#endif
PHP_MINFO(gd),
PHP_GD_VERSION,
STANDARD_MODULE_PROPERTIES
le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, "gd", module_number);
le_gd_font = zend_register_list_destructors_ex(php_free_gd_font, NULL, "gd font", module_number);
-#if HAVE_GD_BUNDLED && HAVE_LIBFREETYPE
+#if defined(HAVE_GD_FREETYPE) && defined(HAVE_GD_BUNDLED)
gdFontCacheMutexSetup();
#endif
gdSetErrorMethod(php_gd_error_method);
*/
PHP_MSHUTDOWN_FUNCTION(gd)
{
-#if HAVE_GD_BUNDLED && HAVE_LIBFREETYPE
+#if defined(HAVE_GD_FREETYPE) && defined(HAVE_GD_BUNDLED)
gdFontCacheMutexShutdown();
#endif
return SUCCESS;
/* {{{ PHP_RSHUTDOWN_FUNCTION
*/
-#if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
PHP_RSHUTDOWN_FUNCTION(gd)
{
+#ifdef HAVE_GD_FREETYPE
gdFontCacheShutdown();
+#endif
return SUCCESS;
}
-#endif
/* }}} */
#if defined(HAVE_GD_BUNDLED)
#endif
#endif
-#if HAVE_LIBFREETYPE
+#ifdef HAVE_GD_FREETYPE
php_info_print_table_row(2, "FreeType Support", "enabled");
php_info_print_table_row(2, "FreeType Linkage", "with freetype");
+#ifdef HAVE_GD_BUNDLED
{
char tmp[256];
#endif
php_info_print_table_row(2, "FreeType Version", tmp);
}
+#endif
#endif
php_info_print_table_row(2, "GIF Read Support", "enabled");
#ifdef HAVE_GD_JPG
{
php_info_print_table_row(2, "JPEG Support", "enabled");
+#if defined(HAVE_GD_BUNDLED)
php_info_print_table_row(2, "libJPEG Version", gdJpegGetVersionString());
+#endif
}
#endif
#ifdef HAVE_GD_PNG
php_info_print_table_row(2, "PNG Support", "enabled");
+#if defined(HAVE_GD_BUNDLED)
php_info_print_table_row(2, "libPNG Version", gdPngGetVersionString());
+#endif
#endif
php_info_print_table_row(2, "WBMP Support", "enabled");
#if defined(HAVE_GD_XPM)
php_info_print_table_row(2, "XPM Support", "enabled");
+#if defined(HAVE_GD_BUNDLED)
{
char tmp[12];
snprintf(tmp, sizeof(tmp), "%d", XpmLibraryVersion());
php_info_print_table_row(2, "libXpm Version", tmp);
}
+#endif
#endif
php_info_print_table_row(2, "XBM Support", "enabled");
#if defined(USE_GD_JISX0208)
add_assoc_string(return_value, "GD Version", PHP_GD_VERSION_STRING);
-#if HAVE_LIBFREETYPE
+#ifdef HAVE_GD_FREETYPE
add_assoc_bool(return_value, "FreeType Support", 1);
add_assoc_string(return_value, "FreeType Linkage", "with freetype");
#else
}
/* }}} */
-#if HAVE_LIBFREETYPE
#define TTFTEXT_DRAW 0
#define TTFTEXT_BBOX 1
-#endif
-
-#if HAVE_LIBFREETYPE
-#if HAVE_GD_FREETYPE
+#ifdef HAVE_GD_FREETYPE
/* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo])
Give the bounding box of a text using fonts via freetype2 */
PHP_FUNCTION(imageftbbox)
php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 1);
}
/* }}} */
-#endif /* HAVE_GD_FREETYPE */
/* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text)
Give the bounding box of a text using TrueType fonts */
PHP_GD_CHECK_OPEN_BASEDIR(fontname, "Invalid font filename");
-#ifdef HAVE_GD_FREETYPE
if (extended) {
error = gdImageStringFTEx(im, brect, col, fontname, ptsize, angle, x, y, str, &strex);
- }
- else
+ } else {
error = gdImageStringFT(im, brect, col, fontname, ptsize, angle, x, y, str);
-
-#endif /* HAVE_GD_FREETYPE */
+ }
if (error) {
php_error_docref(NULL, E_WARNING, "%s", error);
}
}
/* }}} */
-#endif /* HAVE_LIBFREETYPE */
+#endif /* HAVE_GD_FREETYPE */
/* {{{ proto bool image2wbmp(resource im [, string filename [, int foreground]])
Output WBMP image to browser or file */