forked from gtkforphp/cairo
-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.w32
executable file
·70 lines (64 loc) · 3.71 KB
/
config.w32
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* $Id$ */
ARG_WITH("cairo", "Cairo Graphics Library Bindings", "no");
if (PHP_CAIRO != "no") {
configure_module_dirname = configure_module_dirname + "\\src";
var PHP_CAIRO_SRC_ARRAY = glob(configure_module_dirname + "/*.c");
var PHP_CAIRO_SOURCES="";
for (var i=0; i<PHP_CAIRO_SRC_ARRAY.length; ++i) {
var basename = FSO.GetFileName(PHP_CAIRO_SRC_ARRAY[i]);
PHP_CAIRO_SOURCES = PHP_CAIRO_SOURCES + " " + basename;
}
if (CHECK_HEADER_ADD_INCLUDE("cairo/cairo.h", "CFLAGS_CAIRO", PHP_CAIRO + "\\include", null, true) &&
CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_CAIRO", PHP_CAIRO + ";" + PHP_PHP_BUILD + "\\include" + ";" + PHP_PHP_BUILD + "\\include\\freetype")) {
/* Check for static lib first, because that will need an extra define */
if (CHECK_LIB("cairo_a.lib", "cairo", PHP_CAIRO + "\\lib")) {
if (CHECK_LIB("libpng_a.lib", "cairo", PHP_CAIRO + "\\lib")) {
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_CAIRO", PHP_CAIRO + ";" + PHP_PHP_BUILD + "\\include" + ";" + PHP_PHP_BUILD + "\\include\\png");
}
if (CHECK_LIB("freetype_a.lib", "cairo", PHP_CAIRO + "\\lib")) {
CHECK_HEADER_ADD_INCLUDE("freetype/freetype.h", "CFLAGS_CAIRO", PHP_CAIRO + "\\include", null, true);
AC_DEFINE("HAVE_FREETYPE", 1);
ADD_FLAG("CFLAGS_CAIRO", "/D HAVE_FREETYPE");
if (CHECK_LIB("fontconfig.lib", "cairo", PHP_CAIRO + "\\lib") &&
CHECK_HEADER_ADD_INCLUDE("fontconfig/fontconfig.h", "CFLAGS_CAIRO", PHP_CAIRO + "\\include", null, true)) {
AC_DEFINE("CAIRO_HAS_FT_FONT", 1);
}
}
if (CHECK_LIB("Gdi32.lib", "cairo", PHP_CAIRO + "\\lib")) {
AC_DEFINE("HAVE_WIN32_FONT", 1);
ADD_FLAG("CFLAGS_CAIRO", "/D HAVE_WIN32_FONT");
}
EXTENSION("cairo", PHP_CAIRO_SOURCES);
ADD_EXTENSION_DEP("cairo", "eos_datastructures");
ADD_FLAG("CFLAGS_CAIRO", "/D CAIRO_WIN32_STATIC_BUILD=1 /I" + configure_module_dirname);
AC_DEFINE("HAVE_CAIRO", 1);
PHP_INSTALL_HEADERS("ext/cairo", "src/php_cairo_internal.h");
} else if (CHECK_LIB("cairo.lib", "cairo", PHP_CAIRO + "\\lib")) {
if (CHECK_LIB("libpng_a.lib", "cairo", PHP_CAIRO + "\\lib")) {
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_CAIRO", PHP_CAIRO + ";" + PHP_PHP_BUILD + "\\include" + ";" + PHP_PHP_BUILD + "\\include\\png");
}
if (CHECK_LIB("freetype_a.lib", "cairo", PHP_CAIRO + "\\lib")) {
CHECK_HEADER_ADD_INCLUDE("freetype/freetype.h", "CFLAGS_CAIRO", PHP_CAIRO + "\\include", null, true);
AC_DEFINE("HAVE_FREETYPE", 1);
ADD_FLAG("CFLAGS_CAIRO", "/D HAVE_FREETYPE");
if (CHECK_LIB("fontconfig.lib", "cairo", PHP_CAIRO + "\\lib") &&
CHECK_HEADER_ADD_INCLUDE("fontconfig/fontconfig.h", "CFLAGS_CAIRO", PHP_CAIRO + "\\include", null, true)) {
AC_DEFINE("CAIRO_HAS_FT_FONT", 1);
}
}
if (CHECK_LIB("Gdi32.lib", "cairo", PHP_CAIRO + "\\lib")) {
AC_DEFINE("HAVE_WIN32_FONT", 1);
ADD_FLAG("CFLAGS_CAIRO", "/D HAVE_WIN32_FONT");
}
EXTENSION("cairo", PHP_CAIRO_SOURCES);
ADD_EXTENSION_DEP("cairo", "eos_datastructures");
ADD_FLAG("CFLAGS_CAIRO", "/I" + configure_module_dirname);
AC_DEFINE("HAVE_CAIRO", 1);
PHP_INSTALL_HEADERS("ext/cairo", "src/php_cairo_internal.h");
} else {
WARNING('Could not find cairo.lib or cairo_a.lib; skipping');
}
} else {
WARNING('Could not find cairo.h; skipping');
}
}