xref: /PHP-5.6/ext/gd/config.w32 (revision b5aca81d)
1// $Id$
2// vim:ft=javascript
3
4ARG_WITH("gd", "Bundled GD support", "yes,shared");
5ARG_WITH("t1lib", "t1lib support", "yes");
6ARG_WITH("libvpx", "vpx support", "yes");
7
8if (PHP_GD != "no") {
9	if (
10		CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) &&
11		CHECK_LIB("freetype_a.lib;freetype.lib", "gd", PHP_GD) &&
12		CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include" + ";" + PHP_PHP_BUILD + "\\include\\freetype") &&
13		CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) &&
14		CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd") &&
15		(CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD +  ";" + PHP_PHP_BUILD + "\\include\\libpng15") ||
16		CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD +  ";" + PHP_PHP_BUILD + "\\include\\libpng12")) &&
17		(CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) &&
18		 CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD) &&
19		(((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD) )) ||
20			(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "gd", PHP_GD)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
21		CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) &&
22		CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11")
23		) {
24		if (PHP_T1LIB != "no") {
25			if (CHECK_LIB("T1_StaticMD.lib", "gd", PHP_GD) &&
26				CHECK_HEADER_ADD_INCLUDE("t1lib.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\t1lib")
27				) {
28				ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBT1");
29				} else {
30				WARNING("t1lib not enabled; libraries and headers not found");
31			}
32		}
33
34		if (PHP_LIBVPX != "no") {
35			if (CHECK_LIB("vpxmt.lib", "gd", PHP_GD) &&
36				CHECK_HEADER_ADD_INCLUDE("vp8.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\vpx")) {
37				ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBVPX /D HAVE_GD_WEBP");
38			} else {
39				WARNING("libvpx not enabled; libraries and headers not found");
40			}
41		}
42		CHECK_LIB("User32.lib", "gd", PHP_GD);
43		CHECK_LIB("Gdi32.lib", "gd", PHP_GD);
44
45		EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd", "php_gd2.dll");
46		ADD_SOURCES("ext/gd/libgd", "gd2copypal.c gd_arc_f_buggy.c gd.c \
47			gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \
48			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 \
49			gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \
50			gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c xbm.c gd_security.c gd_transform.c \
51			gd_filter.c gd_pixelate.c gd_arc.c gd_rotate.c gd_color.c webpimg.c gd_webp.c \
52			gd_crop.c gd_interpolation.c gd_matrix.c", "gd");
53		AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
54		ADD_FLAG("CFLAGS_GD", " \
55/D HAVE_GD_DYNAMIC_CTX_EX=1 \
56/D HAVE_GD_BUNDLED=1  \
57/D HAVE_GD_GD2  \
58/D HAVE_GD_GIF_READ=1  \
59/D HAVE_GD_GIF_CREATE=1  \
60/D HAVE_GDIMAGECOLORRESOLVE=1  \
61/D HAVE_GD_IMAGESETBRUSH=1  \
62/D HAVE_GD_IMAGESETTILE=1 \
63/D HAVE_GD_FONTCACHESHUTDOWN=1 \
64/D HAVE_GD_FONTMUTEX=1 \
65/D HAVE_LIBFREETYPE=1 \
66/D HAVE_GD_JPG  \
67/D HAVE_GD_PNG  \
68/D HAVE_GD_STRINGFTEX=1  \
69/D HAVE_GD_STRINGTTF=1  \
70/D HAVE_GD_WBMP  \
71/D HAVE_GD_XBM  \
72/D HAVE_GD_XPM  \
73/D HAVE_GD_FREETYPE=1  \
74/D HAVE_LIBGD13=1  \
75/D HAVE_LIBGD15=1  \
76/D HAVE_LIBGD20=1  \
77/D HAVE_LIBGD204=1 \
78/D HAVE_LIBJPEG  \
79/D HAVE_LIBPNG  \
80/D HAVE_XPM  \
81/D HAVE_COLORCLOSESTHWB  \
82/D USE_GD_IMGSTRTTF  \
83/D USE_GD_IOCTX \
84/D MSWIN32 \
85		");
86
87		PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" );
88	} else {
89		WARNING("gd not enabled; libraries and headers not found");
90	}
91}
92