-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.w32
119 lines (105 loc) · 5.27 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
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
// vim:ft=javascript
ARG_WITH("perforce", "Perforce support", "no");
ARG_ENABLE("perforce-shared", "Perforce shared lib", "false");
if (PHP_PERFORCE != "no") {
if (CHECK_LIB("libclient.lib", "perforce", PHP_PERFORCE) &&
CHECK_LIB("librpc.lib", "perforce", PHP_PERFORCE) &&
CHECK_LIB("libp4script_c.lib", "perforce", PHP_PERFORCE) &&
CHECK_LIB("libp4script.lib", "perforce", PHP_PERFORCE) &&
CHECK_LIB("libp4script_sqlite.lib", "perforce", PHP_PERFORCE) &&
CHECK_LIB("libp4script_curl.lib", "perforce", PHP_PERFORCE) &&
CHECK_LIB("libsupp.lib", "perforce", PHP_PERFORCE) &&
CHECK_LIB("libeay32.lib", "perforce", PHP_PERFORCE) &&
CHECK_LIB("ssleay32.lib", "perforce", PHP_PERFORCE) &&
CHECK_LIB("Crypt32.lib", "perforce", PHP_PERFORCE) &&
//CHECK_LIB("advapi32.lib", "perforce") &&
//CHECK_LIB("oldnames.lib", "perforce") &&
//CHECK_LIB("kernel32.lib", "perforce") &&
//CHECK_LIB("ws2_32.lib", "perforce") &&
//CHECK_LIB("User32.lib", "perforce") &&
//CHECK_LIB("Ole32.lib", "perforce") &&
//CHECK_LIB("Oleaut32.lib", "perforce") &&
CHECK_LIB("Gdi32.lib", "perforce"))
{
/* check headers. */
if (CHECK_HEADER_ADD_INCLUDE("clientapi.h", "CFLAGS_PERFORCE", PHP_PERFORCE + "\\include\\p4" ))
/* openssl header, not needed for stub
&& CHECK_HEADER_ADD_INCLUDE("openssl/ssl.h", "CFLAGS_PERFORCE")) */
{
var p4phpPath = ".\\ext\\p4_php";
if (!FSO.FolderExists(p4phpPath)) {
FSO.CreateFolder(p4phpPath);
}
/* copy Version from p4 source if it exists */
if (FSO.FileExists(PHP_PERFORCE + "\\..\\p4php-source\\p4php\\Version")) {
FSO.CopyFile(PHP_PERFORCE + "\\..\\p4php-source\\p4php\\Version", p4phpPath + "\\Version");
}
/* verify we have a Version file to work with */
if (FSO.FileExists(p4phpPath + "\\Version")) {
EXTENSION("perforce", "perforce.cc php_clientapi.cc \
php_clientuser.cc php_mergedata.cc php_p4.cc \
php_p4_depotfile.cc php_p4_integration.cc \
php_p4_map.cc php_p4_exception.cc php_p4mapmaker.cc \
php_p4_mergedata.cc php_p4_resolver.cc \
php_p4_output_handler.cc php_p4_revision.cc \
php_p4result.cc specmgr.cc", PHP_PERFORCE_SHARED);
AC_DEFINE("HAVE_PERFORCE", 1, "Define if perforce extension is enabled");
ADD_FLAG("CFLAGS_PERFORCE", "/DOS_NT");
ADD_FLAG("CFLAGS_PERFORCE", "/DCASE_INSENSITIVE");
ADD_FLAG("LDFLAGS_PERFORCE", "/NODEFAULTLIB:msvcrtd");
ADD_FLAG("LDFLAGS_PERFORCE", "/FORCE:MULTIPLE");
/* get information about p4api version */
var apiVersionFile = FSO.OpenTextFile(PHP_PERFORCE + "\\sample\\Version");
var apiRelease = apiVersionFile.ReadAll();
var match = apiRelease.match(/^RELEASE\s+= (.*) ;$/m);
if (match) {
var ID_API_REL = match[1].replace(/ /g, ".");
}
var match = apiRelease.match(/^PATCHLEVEL\s+= (.*) ;$/m);
if (match) {
var ID_API_PATCH = match[1].replace(/ /g, ".");
}
apiVersionFile.Close();
var ID_API = ID_API_REL + "/" + ID_API_PATCH;
/* get suppdate info */
var versionFile = FSO.OpenTextFile(p4phpPath + "\\Version");
var release = versionFile.ReadAll();
var match = release.match(/^RELEASE\s+=\s(.*) ;$/m);
if (match) {
var ID_REL = match[1].replace(/ /g, ".");
}
var match = release.match(/^PATCHLEVEL\s+=\s*(.*) ;$/m);
if (match) {
var ID_PATCH = match[1].replace(/ /g, ".");
}
var match = release.match(/^SUPPDATE\s+=\s(\d+)\s+(\d+)\s+(\d+) ;$/m);
if (match) {
var ID_Y = match[1];
var ID_M = match[2];
var ID_D = match[3];
}
versionFile.Close();
var cl = PATH_PROG('cl', null, 'P4PHP_CL');
if (!cl) {
ERROR("MS C++ compiler is required");
}
if (probe_binary( cl, 64)) {
var ID_OS = "NTX64";
} else {
var ID_OS = "NTX86";
}
AC_DEFINE("ID_REL", ID_REL, "Setting release ID");
AC_DEFINE("ID_API", ID_API, "Setting API ID");
AC_DEFINE("ID_Y", ID_Y, "Setting build year");
AC_DEFINE("ID_M", ID_M, "Setting build month");
AC_DEFINE("ID_D", ID_D, "Setting build day");
AC_DEFINE("ID_PATCH", ID_PATCH, "Setting the patch level");
AC_DEFINE("ID_OS", ID_OS, "Setting OS ID");
} else {
WARNING("Perforce support not enabled; no version file found.");
}
} else {
WARNING("Perforce support not enabled; headers not found");
}
}
}