2003-12-07 09:59:28 +08:00
|
|
|
// vim:ft=javascript
|
|
|
|
|
2004-01-08 07:36:36 +08:00
|
|
|
ARG_WITH("gd", "Bundled GD support", "yes,shared");
|
2015-07-14 06:29:05 +08:00
|
|
|
ARG_WITH("libwebp", "webp support", "yes");
|
2003-12-07 09:59:28 +08:00
|
|
|
|
|
|
|
if (PHP_GD != "no") {
|
2010-10-05 06:30:35 +08:00
|
|
|
if (
|
|
|
|
CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) &&
|
2009-04-06 17:39:02 +08:00
|
|
|
CHECK_LIB("freetype_a.lib;freetype.lib", "gd", PHP_GD) &&
|
2016-09-26 02:55:13 +08:00
|
|
|
CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" + PHP_PHP_BUILD + "\\include\\freetype") &&
|
2009-04-06 17:39:02 +08:00
|
|
|
CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) &&
|
2008-07-07 01:07:26 +08:00
|
|
|
CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd") &&
|
2015-07-23 22:09:35 +08:00
|
|
|
(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") ||
|
2013-01-28 20:23:31 +08:00
|
|
|
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng12")) &&
|
2010-06-29 07:26:48 +08:00
|
|
|
(CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) &&
|
2018-10-13 20:17:28 +08:00
|
|
|
CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD) &&
|
|
|
|
(((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD) )) ||
|
2012-10-24 16:36:52 +08:00
|
|
|
(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")
|
2005-04-25 17:08:48 +08:00
|
|
|
) {
|
2003-12-07 09:59:28 +08:00
|
|
|
|
2015-07-14 06:29:05 +08:00
|
|
|
if (PHP_LIBWEBP != "no") {
|
2015-07-24 23:06:01 +08:00
|
|
|
if ((CHECK_LIB("libwebp_a.lib", "gd", PHP_GD) || CHECK_LIB("libwebp.lib", "gd", PHP_GD)) &&
|
2015-07-14 06:29:05 +08:00
|
|
|
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");
|
2013-02-06 23:22:27 +08:00
|
|
|
} else {
|
2015-07-14 06:29:05 +08:00
|
|
|
WARNING("libwebp not enabled; libraries and headers not found");
|
2013-02-06 23:22:27 +08:00
|
|
|
}
|
|
|
|
}
|
2007-04-17 23:31:45 +08:00
|
|
|
CHECK_LIB("User32.lib", "gd", PHP_GD);
|
|
|
|
CHECK_LIB("Gdi32.lib", "gd", PHP_GD);
|
|
|
|
|
2008-07-18 09:16:25 +08:00
|
|
|
EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd", "php_gd2.dll");
|
2016-09-20 05:48:23 +08:00
|
|
|
ADD_SOURCES("ext/gd/libgd", "gd2copypal.c gd.c \
|
2003-12-07 10:58:56 +08:00
|
|
|
gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \
|
2004-07-23 06:38:59 +08:00
|
|
|
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 \
|
2003-12-07 10:58:56 +08:00
|
|
|
gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \
|
2016-09-20 06:10:49 +08:00
|
|
|
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 \
|
2019-06-21 05:40:51 +08:00
|
|
|
gd_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd");
|
2003-12-07 09:59:28 +08:00
|
|
|
AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
|
|
|
|
ADD_FLAG("CFLAGS_GD", " \
|
2005-08-08 05:00:28 +08:00
|
|
|
/D HAVE_GD_DYNAMIC_CTX_EX=1 \
|
2003-12-07 10:58:56 +08:00
|
|
|
/D HAVE_GD_BUNDLED=1 \
|
|
|
|
/D HAVE_GD_GD2 \
|
|
|
|
/D HAVE_GD_GIF_READ=1 \
|
2004-07-23 06:38:59 +08:00
|
|
|
/D HAVE_GD_GIF_CREATE=1 \
|
2003-12-07 10:58:56 +08:00
|
|
|
/D HAVE_GDIMAGECOLORRESOLVE=1 \
|
|
|
|
/D HAVE_GD_IMAGESETBRUSH=1 \
|
|
|
|
/D HAVE_GD_IMAGESETTILE=1 \
|
2007-04-11 19:44:20 +08:00
|
|
|
/D HAVE_GD_FONTCACHESHUTDOWN=1 \
|
2007-04-06 23:38:35 +08:00
|
|
|
/D HAVE_GD_FONTMUTEX=1 \
|
|
|
|
/D HAVE_LIBFREETYPE=1 \
|
2003-12-07 10:58:56 +08:00
|
|
|
/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 \
|
2012-10-24 16:36:52 +08:00
|
|
|
/D HAVE_GD_XPM \
|
2013-05-15 20:24:21 +08:00
|
|
|
/D HAVE_GD_FREETYPE=1 \
|
2016-07-24 20:14:57 +08:00
|
|
|
/D HAVE_GD_BMP \
|
2019-06-21 05:40:51 +08:00
|
|
|
/D HAVE_GD_TGA \
|
2003-12-07 10:58:56 +08:00
|
|
|
/D HAVE_LIBGD13=1 \
|
|
|
|
/D HAVE_LIBGD15=1 \
|
|
|
|
/D HAVE_LIBGD20=1 \
|
|
|
|
/D HAVE_LIBGD204=1 \
|
|
|
|
/D HAVE_LIBJPEG \
|
|
|
|
/D HAVE_LIBPNG \
|
2012-10-24 16:36:52 +08:00
|
|
|
/D HAVE_XPM \
|
2008-07-21 03:03:18 +08:00
|
|
|
/D HAVE_COLORCLOSESTHWB \
|
2020-01-06 19:49:07 +08:00
|
|
|
/D HAVE_GD_GET_INTERPOLATION \
|
2003-12-07 10:58:56 +08:00
|
|
|
/D USE_GD_IOCTX \
|
|
|
|
/D MSWIN32 \
|
2003-12-07 09:59:28 +08:00
|
|
|
");
|
2014-11-08 02:24:17 +08:00
|
|
|
if (ICC_TOOLSET) {
|
2014-11-08 02:13:41 +08:00
|
|
|
ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt");
|
|
|
|
}
|
2018-10-13 20:17:28 +08:00
|
|
|
|
2010-12-12 06:18:10 +08:00
|
|
|
PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" );
|
2013-03-20 14:46:59 +08:00
|
|
|
} else {
|
2003-12-07 09:59:28 +08:00
|
|
|
WARNING("gd not enabled; libraries and headers not found");
|
|
|
|
}
|
|
|
|
}
|