xref: /ext-ds/config.w32 (revision 93e016c6)
1// vim:ft=javascript
2
3var DS_EXT_NAME="ds";
4var DS_EXT_DIR=configure_module_dirname + "/src";
5var DS_EXT_API="php_ds.c";
6var DS_EXT_FLAGS="/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I" + configure_module_dirname;
7
8function ds_src(dir, files) {
9    return ADD_SOURCES(
10        DS_EXT_DIR + dir,
11        files.join(" "),
12        DS_EXT_NAME
13    );
14}
15
16////////////////////////////////////
17ARG_ENABLE("ds", "for extended data structure support", "no");
18
19if (PHP_DS != "no") {
20    EXTENSION(DS_EXT_NAME, DS_EXT_API, PHP_DS_SHARED, DS_EXT_FLAGS);
21
22    ds_src("/",
23    [
24        "common.c"
25    ]);
26
27    ds_src("/ds",
28    [
29        "ds_deque.c",
30        "ds_vector.c",
31        "ds_htable.c",
32        "ds_set.c",
33        "ds_map.c",
34        "ds_stack.c",
35        "ds_priority_queue.c",
36        "ds_queue.c",
37    ]);
38
39    ds_src("/php/objects",
40    [
41        "php_deque.c",
42        "php_vector.c",
43        "php_map.c",
44        "php_pair.c",
45        "php_priority_queue.c",
46        "php_set.c",
47        "php_stack.c",
48        "php_queue.c",
49    ]);
50
51    ds_src("/php/iterators",
52    [
53        "php_vector_iterator.c",
54        "php_deque_iterator.c",
55        "php_set_iterator.c",
56        "php_map_iterator.c",
57        "php_stack_iterator.c",
58        "php_htable_iterator.c",
59        "php_priority_queue_iterator.c",
60        "php_queue_iterator.c",
61    ]);
62
63    ds_src("/php/handlers",
64    [
65        "php_common_handlers.c",
66        "php_vector_handlers.c",
67        "php_deque_handlers.c",
68        "php_set_handlers.c",
69        "php_map_handlers.c",
70        "php_stack_handlers.c",
71        "php_pair_handlers.c",
72        "php_priority_queue_handlers.c",
73        "php_queue_handlers.c",
74    ]);
75
76    ds_src("/php/classes",
77    [
78        "php_hashable_ce.c",
79        "php_collection_ce.c",
80        "php_sequence_ce.c",
81        "php_vector_ce.c",
82        "php_deque_ce.c",
83        "php_set_ce.c",
84        "php_map_ce.c",
85        "php_stack_ce.c",
86        "php_pair_ce.c",
87        "php_priority_queue_ce.c",
88        "php_queue_ce.c",
89    ]);
90
91    ADD_EXTENSION_DEP('ds', 'spl');
92    var dll = get_define('PHPDLL');
93    if (null != dll.match(/^php7/)) {
94        // only require dynamic json extension for PHP 7
95        // json is built statically in PHP 8
96        // https://github.com/php/php-src/pull/5495
97        ADD_EXTENSION_DEP('ds', 'json');
98    }
99}
100