-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfig.w32
More file actions
167 lines (150 loc) · 8.54 KB
/
Copy pathconfig.w32
File metadata and controls
167 lines (150 loc) · 8.54 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// vim:ft=javascript
// Windows build manifest for fastchart. Mirrors config.m4 — every
// source listed there must appear here, every optional codec
// (libpng / libjpeg-turbo / libwebp) is gated by the same
// HAVE_LIBxxx define, and the plutovg / plutosvg / qrcodegen vendor
// trees compile with the same -DPLUTOVG_BUILD_STATIC /
// -DPLUTOSVG_BUILD_STATIC flags so their symbols stay internal.
//
// Library names + include paths follow ext/gd's config.w32 because
// the PHP SDK deps layout (..\deps\lib\<libname>_a.lib;
// ..\deps\include\<subdir>) is what the action's libs: input
// deploys. Per-lib file resolution:
// freetype_a.lib + ..\deps\include\freetype2\ft2build.h
// libpng_a.lib + ..\deps\include\libpng16\png.h
// libjpeg_a.lib + ..\deps\include\jpeglib.h
// libwebp_a.lib + ..\deps\include\webp\encode.h
ARG_ENABLE("fastchart", "Enable fastchart support", "no");
ARG_ENABLE("fastchart-dev", "Upgrade wrapper warnings to /WX (development builds)", "no");
// PDF output via system pdfio (msweet.org). Opt-in, off by default —
// mirrors config.m4's --with-pdfio. When enabled, fastchart_pdf.c joins
// the build and HAVE_FASTCHART_PDF gates renderPdf() / renderToFile('*.pdf').
ARG_WITH("pdfio", "fastchart: enable PDF output via pdfio (msweet.org)", "no");
if (PHP_FASTCHART != "no") {
if (PHP_VERSION < 8 ||
(PHP_VERSION == 8 && PHP_MINOR_VERSION < 1)) {
ERROR("fastchart requires PHP 8.1.0 or later");
}
// FreeType is mandatory (text rendering: glyph metrics, family
// name resolution, FT_Outline_Decompose for SVG_TEXT_PATHS).
if (CHECK_LIB("freetype_a.lib;freetype.lib", "fastchart", PHP_FASTCHART) &&
CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_FASTCHART",
PHP_FASTCHART + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" +
PHP_PHP_BUILD + "\\include\\freetype")) {
// freetype found; the checks above added the lib + include path.
// No define needed — the sources reference FreeType unconditionally.
} else {
WARNING("fastchart not enabled — freetype is required.");
PHP_FASTCHART = "no";
}
if (PHP_FASTCHART != "no") {
// Optional codec libs. Each missing lib drops its
// corresponding renderXxx() — the encoder compiles to a
// stub that returns -2 and the PHP method throws a clear
// "format not compiled in" error at call time. Mirrors the
// config.m4 per-lib loop.
if (CHECK_LIB("libpng_a.lib;libpng.lib", "fastchart", PHP_FASTCHART) &&
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_FASTCHART",
PHP_FASTCHART + ";" + PHP_PHP_BUILD + "\\include\\libpng16")) {
AC_DEFINE("HAVE_LIBPNG", 1, "Have libpng");
ADD_FLAG("CFLAGS_FASTCHART", "/DHAVE_LIBPNG=1");
STDOUT.WriteLine("fastchart: libpng found");
} else {
STDOUT.WriteLine("fastchart: libpng not found — PNG output disabled");
}
if (CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "fastchart", PHP_FASTCHART) &&
CHECK_HEADER_ADD_INCLUDE("jpeglib.h", "CFLAGS_FASTCHART",
PHP_FASTCHART + ";" + PHP_PHP_BUILD + "\\include")) {
AC_DEFINE("HAVE_LIBJPEG", 1, "Have libjpeg-turbo");
ADD_FLAG("CFLAGS_FASTCHART", "/DHAVE_LIBJPEG=1");
STDOUT.WriteLine("fastchart: libjpeg-turbo found");
} else {
STDOUT.WriteLine("fastchart: libjpeg-turbo not found — JPEG output disabled");
}
if (CHECK_LIB("libwebp_a.lib;libwebp.lib", "fastchart", PHP_FASTCHART) &&
CHECK_HEADER_ADD_INCLUDE("encode.h", "CFLAGS_FASTCHART",
PHP_FASTCHART + ";" + PHP_PHP_BUILD + "\\include\\webp")) {
AC_DEFINE("HAVE_LIBWEBP", 1, "Have libwebp");
ADD_FLAG("CFLAGS_FASTCHART", "/DHAVE_LIBWEBP=1");
STDOUT.WriteLine("fastchart: libwebp found");
} else {
STDOUT.WriteLine("fastchart: libwebp not found — WebP output disabled");
}
// Optional PDF output via system pdfio. Unlike the codecs above
// (auto-detected), --with-pdfio must be requested; a
// request that can't be satisfied is a hard error rather than a
// silent skip, mirroring config.m4. pdfio is not vendored.
var fastchart_pdf_source = "";
if (PHP_PDFIO != "no") {
if (CHECK_LIB("pdfio_a.lib;pdfio.lib;pdfio1.lib", "fastchart", PHP_FASTCHART) &&
CHECK_HEADER_ADD_INCLUDE("pdfio.h", "CFLAGS_FASTCHART",
PHP_FASTCHART + ";" + PHP_PHP_BUILD + "\\include;" +
PHP_PHP_BUILD + "\\include\\pdfio")) {
AC_DEFINE("HAVE_FASTCHART_PDF", 1, "Have pdfio PDF output");
ADD_FLAG("CFLAGS_FASTCHART", "/DHAVE_FASTCHART_PDF=1");
fastchart_pdf_source = "fastchart_pdf.c";
STDOUT.WriteLine("fastchart: pdfio found, PDF output enabled");
} else {
ERROR("fastchart: --with-pdfio given but pdfio " +
"(pdfio.lib + pdfio.h) was not found");
}
}
// Vendor include paths so #include "plutovg.h" /
// "plutosvg.h" / "qrcodegen.h" resolve.
ADD_FLAG("CFLAGS_FASTCHART",
"/I" + configure_module_dirname + "\\vendor\\qrcodegen " +
"/I" + configure_module_dirname + "\\vendor\\plutovg\\include " +
"/I" + configure_module_dirname + "\\vendor\\plutovg\\source " +
"/I" + configure_module_dirname + "\\vendor\\plutosvg\\source");
// PLUTOVG_BUILD_STATIC / PLUTOSVG_BUILD_STATIC make those
// libraries' API decorators stop applying dllexport, so the
// vendored symbols compile in as static. Mirrors the
// -DPLUTOVG_BUILD_STATIC -DPLUTOSVG_BUILD_STATIC flags on
// the Unix side.
ADD_FLAG("CFLAGS_FASTCHART",
"/DPLUTOVG_BUILD_STATIC /DPLUTOSVG_BUILD_STATIC");
// /WX (warnings as errors) only with --enable-fastchart-dev,
// matching the Unix side's --enable-fastchart-dev gate.
if (PHP_FASTCHART_DEV == "yes") {
ADD_FLAG("CFLAGS_FASTCHART", "/WX");
}
var wrapper_sources =
"fastchart.c fastchart_palette.c fastchart_text.c " +
"fastchart_target.c fastchart_svg.c fastchart_axis.c " +
"fastchart_line.c fastchart_area.c fastchart_bar.c " +
"fastchart_pie.c fastchart_scatter.c fastchart_stock.c " +
"fastchart_radar.c fastchart_bubble.c fastchart_surface.c " +
"fastchart_gauge.c fastchart_gantt.c fastchart_boxplot.c " +
"fastchart_polar.c fastchart_contour.c fastchart_treemap.c " +
"fastchart_funnel.c fastchart_waterfall.c fastchart_heatmap.c " +
"fastchart_linear_meter.c fastchart_bullet.c fastchart_pareto.c " +
"fastchart_calendar.c fastchart_sunburst.c fastchart_sankey.c " +
"fastchart_marimekko.c fastchart_vector.c fastchart_effects.c " +
"fastchart_encoder.c fastchart_rasterize.c fastchart_symbol.c " +
"fastchart_code128.c fastchart_qrcode.c " +
// Graph family (shared node/link data model) + the remaining
// v1.2 chart classes. Must mirror config.m4 or fastchart.c
// references their render entry points as unresolved externals.
"fastchart_graph.c fastchart_arc.c fastchart_chord.c " +
"fastchart_network.c fastchart_pyramid.c fastchart_violin.c " +
"fastchart_circlepack.c fastchart_pictogram.c fastchart_venn.c " +
"fastchart_wordcloud.c fastchart_serpentine.c fastchart_dendrogram.c " +
"fastchart_partition.c" +
// fastchart_pdf.c only when --with-pdfio resolved above.
(fastchart_pdf_source != "" ? " " + fastchart_pdf_source : "");
var qrcode_sources = "qrcodegen.c";
var plutovg_sources =
"plutovg-blend.c plutovg-canvas.c plutovg-font.c " +
"plutovg-ft-math.c plutovg-ft-raster.c plutovg-ft-stroker.c " +
"plutovg-matrix.c plutovg-paint.c plutovg-path.c " +
"plutovg-rasterize.c plutovg-surface.c";
var plutosvg_sources = "plutosvg.c";
EXTENSION("fastchart", wrapper_sources, null, "$(CFLAGS_FASTCHART)");
ADD_SOURCES(configure_module_dirname + "\\vendor\\qrcodegen",
qrcode_sources, "fastchart");
ADD_SOURCES(configure_module_dirname + "\\vendor\\plutovg\\source",
plutovg_sources, "fastchart");
ADD_SOURCES(configure_module_dirname + "\\vendor\\plutosvg\\source",
plutosvg_sources, "fastchart");
}
}