mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
340e2ead77
Some extension may need to retrieve the `gdImagePtr` from an `GdImage` object; thus, we export the respective function. To not being forced to include gd.h in php_gd.h, we use the opaque `struct gdImageStruct *` as return type. We also rename php_gd2.dll to php_gd.dll, since there's not really much point in giving the DLL a version number, since there is no php_gd.dll for years (if there ever has been). Renaming, on the other hand, matches the name on other systems (gd.so), and allows to actually use `ADD_EXTENSION_DEP()`.
89 lines
3.5 KiB
JavaScript
89 lines
3.5 KiB
JavaScript
// vim:ft=javascript
|
|
|
|
ARG_WITH("gd", "Bundled GD support", "yes,shared");
|
|
ARG_WITH("libwebp", "webp support", "yes");
|
|
|
|
if (PHP_GD != "no") {
|
|
if (
|
|
CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) &&
|
|
CHECK_LIB("freetype_a.lib;freetype.lib", "gd", PHP_GD) &&
|
|
CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" + PHP_PHP_BUILD + "\\include\\freetype") &&
|
|
CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) &&
|
|
CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd") &&
|
|
(CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng16") ||
|
|
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng15") ||
|
|
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng12")) &&
|
|
(CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) &&
|
|
CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD) &&
|
|
(((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD) )) ||
|
|
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "gd", PHP_GD)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
|
|
CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) &&
|
|
CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11")
|
|
) {
|
|
|
|
if (PHP_LIBWEBP != "no") {
|
|
if ((CHECK_LIB("libwebp_a.lib", "gd", PHP_GD) || CHECK_LIB("libwebp.lib", "gd", PHP_GD)) &&
|
|
CHECK_HEADER_ADD_INCLUDE("decode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp") &&
|
|
CHECK_HEADER_ADD_INCLUDE("encode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp")) {
|
|
ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBWEBP /D HAVE_GD_WEBP");
|
|
} else {
|
|
WARNING("libwebp not enabled; libraries and headers not found");
|
|
}
|
|
}
|
|
CHECK_LIB("User32.lib", "gd", PHP_GD);
|
|
CHECK_LIB("Gdi32.lib", "gd", PHP_GD);
|
|
|
|
EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd");
|
|
ADD_SOURCES("ext/gd/libgd", "gd2copypal.c gd.c \
|
|
gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \
|
|
gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \
|
|
gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \
|
|
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_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd");
|
|
AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
|
|
ADD_FLAG("CFLAGS_GD", " \
|
|
/D PHP_GD_EXPORTS=1 \
|
|
/D HAVE_GD_DYNAMIC_CTX_EX=1 \
|
|
/D HAVE_GD_BUNDLED=1 \
|
|
/D HAVE_GD_GD2 \
|
|
/D HAVE_GD_GIF_READ=1 \
|
|
/D HAVE_GD_GIF_CREATE=1 \
|
|
/D HAVE_GDIMAGECOLORRESOLVE=1 \
|
|
/D HAVE_GD_IMAGESETBRUSH=1 \
|
|
/D HAVE_GD_IMAGESETTILE=1 \
|
|
/D HAVE_GD_FONTCACHESHUTDOWN=1 \
|
|
/D HAVE_GD_FONTMUTEX=1 \
|
|
/D HAVE_LIBFREETYPE=1 \
|
|
/D HAVE_GD_JPG \
|
|
/D HAVE_GD_PNG \
|
|
/D HAVE_GD_STRINGFTEX=1 \
|
|
/D HAVE_GD_STRINGTTF=1 \
|
|
/D HAVE_GD_WBMP \
|
|
/D HAVE_GD_XBM \
|
|
/D HAVE_GD_XPM \
|
|
/D HAVE_GD_FREETYPE=1 \
|
|
/D HAVE_GD_BMP \
|
|
/D HAVE_GD_TGA \
|
|
/D HAVE_LIBGD13=1 \
|
|
/D HAVE_LIBGD15=1 \
|
|
/D HAVE_LIBGD20=1 \
|
|
/D HAVE_LIBGD204=1 \
|
|
/D HAVE_LIBJPEG \
|
|
/D HAVE_LIBPNG \
|
|
/D HAVE_XPM \
|
|
/D HAVE_COLORCLOSESTHWB \
|
|
/D HAVE_GD_GET_INTERPOLATION \
|
|
/D USE_GD_IOCTX \
|
|
/D MSWIN32 \
|
|
");
|
|
if (ICC_TOOLSET) {
|
|
ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt");
|
|
}
|
|
|
|
PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" );
|
|
} else {
|
|
WARNING("gd not enabled; libraries and headers not found");
|
|
}
|
|
}
|