forked from pmmp/ext-pmmpthread
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.w32
30 lines (29 loc) · 1.38 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
var PTHREADS_EXT_NAME="pthreads";
var PTHREADS_EXT_SRC="monitor.c stack.c globals.c prepare.c store.c resources.c handlers.c object.c socket.c";
var PTHREADS_EXT_DIR=configure_module_dirname + "/src";
var PTHREADS_EXT_API="php_pthreads.c";
var PTHREADS_EXT_FLAGS="/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I" + configure_module_dirname;
/* --------------------------------------------------------------------- */
ARG_WITH("pthreads", "for pthreads support", "no");
if (PHP_PTHREADS != "no") {
if(CHECK_HEADER_ADD_INCLUDE("pthread.h", "CFLAGS_PTHREADS", PHP_PTHREADS + ";" + configure_module_dirname) &&
CHECK_HEADER_ADD_INCLUDE("sched.h", "CFLAGS_PTHREADS", PHP_PTHREADS + ";" + configure_module_dirname) &&
(
CHECK_LIB("pthreadVC2.lib", PTHREADS_EXT_NAME, PHP_PTHREADS) ||
(
CHECK_LIB("pthreadVC3.lib", PTHREADS_EXT_NAME, PHP_PTHREADS) &&
CHECK_HEADER_ADD_INCLUDE("_ptw32.h", "CFLAGS_PTHREADS", PHP_PTHREADS + ";" + configure_module_dirname) //extra header needed for v3
)
) &&
CHECK_LIB("ws2_32.lib", PTHREADS_EXT_NAME, PHP_PTHREADS) &&
CHECK_LIB("Iphlpapi.lib", PTHREADS_EXT_NAME, PHP_PTHREADS)) {
EXTENSION(PTHREADS_EXT_NAME, PTHREADS_EXT_API, PHP_PTHREADS_SHARED, PTHREADS_EXT_FLAGS);
ADD_SOURCES(
PTHREADS_EXT_DIR,
PTHREADS_EXT_SRC,
PTHREADS_EXT_NAME
);
} else {
WARNING("pthreads not enabled; libraries and headers not found");
}
}