summaryrefslogtreecommitdiff
path: root/ext/ming/config.w32
blob: 228e620a77a7d07b74615acaff3e0095b9766b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// $Id$
// vim:ft=javascript

ARG_WITH("ming", "MING support", "no");

// this is a temporary hack
function ming_check_version()
{
	var c = null;
	var v;
	var ming_h = CHECK_HEADER_ADD_INCLUDE("ming.h", "CFLAGS_MING", PHP_MING);

	if (!ming_h) {
		return false;
	}

	c = file_get_contents(ming_h + "\\ming.h");
	if (typeof(c) == "string" && c.match(/MING_VERSION\s+(0.[a-zA-Z0-9]+)/)) {
		v = RegExp.$1;
		if (v > "0.2") {
			if (CHECK_LIB("libungif.lib", "ming", PHP_MING) &&
				CHECK_LIB("libpng.lib", "ming", PHP_MING)) {
				AC_DEFINE('HAVE_NEW_MING', 1);
				AC_DEFINE('HAVE_SWFPREBUILTCLIP', 1);
				if (PHP_ZLIB != "no") {
					AC_DEFINE('HAVE_MING_ZLIB', 1);
				}
			}
		}
	}
	return true;
}

if (PHP_MING != "no") {
	if (ming_check_version() && CHECK_LIB("libming.lib", "ming", PHP_MING)) {
		if (PHP_ZLIB_SHARED) {
			CHECK_LIB("zlib.lib", "ming", PHP_MING);
		}
		EXTENSION('ming', 'ming.c');
		AC_DEFINE('HAVE_MING', 1);
	} else {
		WARNING("ming not enabled; libraries and headers not found");
	}
}