-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconfig.w32
80 lines (71 loc) · 3.32 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
71
72
73
74
75
76
77
78
79
80
// config.w32 for ffmpeg
ARG_ENABLE("ffmpeg", "whether to enable ffmpeg", "no");
function check_for_main_ext(ext, header)
{
if (!header) {
header = "php_"+ ext +".h";
}
/* When in configure, we're always in the root of PHP source */
var ext_path = "ext\\" + ext;
STDOUT.Write("Checking for ext/"+ ext +" ... ");
if (FSO.FileExists(ext_path + "\\" + header)) {
STDOUT.WriteLine(ext_path);
return ext_path;
}
STDOUT.WriteLine("<not found>");
return false;
}
if (PHP_FFMPEG != "no") {
if (
// put the libs in deps\lib or win64build\lib and win32build\lib
// put the headers below deps\include, win64build\include and win32build\include or besides ext\ffmpeg\msvc
CHECK_LIB("avcodec.lib", "ffmpeg", PHP_FFMPEG) &&
CHECK_LIB("avdevice.lib", "ffmpeg", PHP_FFMPEG) &&
CHECK_LIB("avformat.lib", "ffmpeg", PHP_FFMPEG) &&
CHECK_LIB("avutil.lib", "ffmpeg", PHP_FFMPEG) &&
CHECK_LIB("swscale.lib", "ffmpeg", PHP_FFMPEG) &&
CHECK_HEADER_ADD_INCLUDE("inttypes.h", "CFLAGS_FFMPEG", PHP_FFMPEG + ";ext\\ffmpeg\\msvc") &&
CHECK_HEADER_ADD_INCLUDE("stdint.h", "CFLAGS_FFMPEG", PHP_FFMPEG + ";ext\\ffmpeg\\msvc") &&
CHECK_HEADER_ADD_INCLUDE("avcodec.h", "CFLAGS_FFMPEG", PHP_FFMPEG + ";ext\\ffmpeg\\libavcodec") &&
CHECK_HEADER_ADD_INCLUDE("avdevice.h", "CFLAGS_FFMPEG", PHP_FFMPEG + ";ext\\ffmpeg\\libavdevice") &&
CHECK_HEADER_ADD_INCLUDE("avformat.h", "CFLAGS_FFMPEG", PHP_FFMPEG + ";ext\\ffmpeg\\libavformat") &&
CHECK_HEADER_ADD_INCLUDE("avutil.h", "CFLAGS_FFMPEG", PHP_FFMPEG + ";ext\\ffmpeg\\libavutil") &&
CHECK_HEADER_ADD_INCLUDE("swscale.h", "CFLAGS_FFMPEG", PHP_FFMPEG + ";ext\\ffmpeg\\libswscale")
) {
EXTENSION('ffmpeg', 'ffmpeg-php.c ffmpeg_errorhandler.c ffmpeg_frame.c ffmpeg_movie.c ffmpeg_tools.c',
null,
"/I\"" +
configure_module_dirname + "/libavcodec\"" +
configure_module_dirname + "/libavdevice\"" +
configure_module_dirname + "/libavformat\"" +
configure_module_dirname + "/libavutil\"" +
configure_module_dirname + "/libswscale\""
);
ADD_FLAG("CFLAGS_FFMPEG", " \
/D HAVE_SWSCALER=1 \
/D HAVE_FFMPEG_PHP=1 \
");
var f;
if ( (f = check_for_main_ext("gd") ) &&
CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_FFMPEG", f + "\\libgd") &&
CHECK_HEADER_ADD_INCLUDE("gd_io.h", "CFLAGS_FFMPEG", f + "\\libgd") &&
CHECK_HEADER_ADD_INCLUDE("php_gd.h", "CFLAGS_FFMPEG", f)
) {
ADD_FLAG("CFLAGS_FFMPEG", '/I "' + f + '" /I "' + f + '\\libgd" /D HAVE_LIBGD20=1');
if ((PHP_VERSION <= 7) && (PHP_MINOR_VERSION < 2)) {
ADD_EXTENSION_DEP("ffmpeg", "gd2", true);
}
if (PHP_VERSION > 7) {
ADD_EXTENSION_DEP("ffmpeg", "gd", true);
}
STDOUT.WriteLine("ffmpeg-php gd support enabled; headers found at " + f + "\\libgd");
} else {
WARNING("ffmpeg-php gd support not enabled; headers not found at " + f);
}
if (PHP_DEBUG != "no") {
ADD_FLAG("CFLAGS_FFMPEG", "/W3");
}
} else {
WARNING("ffmpeg not enabled; libraries or headers not found");
}
}