xref: /PHP-8.3/sapi/apache2handler/config.w32 (revision 6e3600f4)
1// vim:ft=javascript
2
3ARG_ENABLE('apache2handler', 'Build Apache 2.x handler', 'no');
4
5if (PHP_APACHE2HANDLER != "no") {
6	if (PHP_ZTS == "no") {
7		WARNING("Apache 2.0 module requires an --enable-zts build of PHP on windows");
8	} else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2HANDLER", PHP_PHP_BUILD + "\\include\\apache2") &&
9			CHECK_LIB("libhttpd.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") &&
10			CHECK_LIB("libapr.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") &&
11			CHECK_LIB("libaprutil.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2")
12			) {
13		SAPI('apache2handler', 'mod_php.c sapi_apache2.c apache_config.c php_functions.c',
14				'php' + PHP_VERSION + 'apache2.dll',
15				'/D PHP_APACHE2_EXPORTS /I win32 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
16	} else {
17		WARNING("Could not find apache2 libraries/headers");
18	}
19}
20
21ARG_ENABLE('apache2-2handler', 'Build Apache 2.2.x handler', 'no');
22
23if (PHP_APACHE2_2HANDLER != "no") {
24	if (PHP_ZTS == "no") {
25		WARNING("Apache 2.2 module requires an --enable-zts build of PHP on windows");
26	} else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_2HANDLER", PHP_PHP_BUILD + "\\include\\apache2_2") &&
27			CHECK_LIB("libhttpd.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
28			CHECK_LIB("libapr-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
29			CHECK_LIB("libaprutil-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2")
30			) {
31		SAPI('apache2_2handler', 'mod_php.c sapi_apache2.c apache_config.c php_functions.c',
32				'php' + PHP_VERSION + 'apache2_2.dll',
33				'/D PHP_APACHE2_EXPORTS /I win32 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1',
34				'sapi\\apache2_2handler');
35	} else {
36		WARNING("Could not find apache2.2 libraries/headers");
37	}
38}
39
40ARG_ENABLE('apache2-4handler', 'Build Apache 2.4.x handler', 'no');
41if (PHP_APACHE2_4HANDLER != "no") {
42	if (PHP_ZTS == "no") {
43		WARNING("Apache 2.4 module requires an --enable-zts build of PHP on windows");
44	} else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_4HANDLER", PHP_PHP_BUILD + "\\include\\apache2_4") &&
45			CHECK_LIB("libhttpd.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") &&
46			CHECK_LIB("libapr-1.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") &&
47			CHECK_LIB("libaprutil-1.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4")
48			) {
49		SAPI('apache2_4handler', 'mod_php.c sapi_apache2.c apache_config.c php_functions.c',
50				'php' + PHP_VERSION + 'apache2_4.dll',
51				'/D PHP_APACHE2_EXPORTS /I win32 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1',
52				'sapi\\apache2handler');
53	} else {
54		WARNING("Could not find apache 2.4 libraries/headers");
55	}
56}
57