- ditch warnings
[m6w6/ext-http] / config.w32
1 // config.w32 for pecl/http
2 // $Id$
3
4 ARG_ENABLE("http", "whether to enable extended HTTP support", "no");
5
6 function check_for_main_ext(ext, header)
7 {
8 if (!header) {
9 header = "php_"+ ext +".h";
10 }
11
12 var r = new RegExp(PHP_VERSION +"."+ PHP_MINOR_VERSION);
13 var g = glob(configure_module_dirname +"\\..\\..\\*\\ext\\"+ ext +"\\"+ header);
14
15 STDOUT.Write("Checking for ext/"+ ext +" ... ");
16 for (i = 0; i < g.length; i++) {
17 if (g[i].match(r)) {
18 var f = g[i].substr(0, g[i].length - header.length - 1);
19 STDOUT.WriteLine(f);
20 return f;
21 }
22 }
23 STDOUT.WriteLine("<not found>");
24 return false;
25 }
26
27 function check_for_pecl_ext(ext, header)
28 {
29 if (!header) {
30 header = "php_"+ ext +".h";
31 }
32
33 var g;
34 var s = ext +"\\"+ header;
35
36 STDOUT.Write("Checking for pecl/"+ ext +" ... ");
37 if ( (g = glob(configure_module_dirname +"\\..\\"+ s)) ||
38 (g = glob(configure_module_dirname +"\\..\\..\\..\\pecl\\"+ s))) {
39 var f = g[0].substr(0, g[0].length - header.length - 1);
40 STDOUT.WriteLine(f);
41 return f;
42 }
43 STDOUT.WriteLine("<not found>");
44 return false;
45 }
46
47 if (PHP_HTTP != "no") {
48
49 EXTENSION("http",
50 "missing.c http.c http_functions.c http_exception_object.c "+
51 "http_util_object.c http_message_object.c http_requestpool_object.c "+
52 "http_request_object.c http_response_object.c "+
53 "http_api.c http_cache_api.c http_request_pool_api.c "+
54 "http_request_api.c http_date_api.c http_headers_api.c "+
55 "http_message_api.c http_send_api.c http_url_api.c "+
56 "http_info_api.c http_request_method_api.c http_encoding_api.c "+
57 "http_filter_api.c http_request_body_api.c http_querystring_object.c "+
58 "http_deflatestream_object.c http_inflatestream_object.c "+
59 "http_cookie_api.c",
60 null,
61 "/I\"" + configure_module_dirname + "/phpstr\"");
62 ADD_SOURCES(configure_module_dirname + "/phpstr", "phpstr.c", "http");
63 AC_DEFINE("HAVE_HTTP", 1, "Have extended HTTP support");
64
65 if (PHP_DEBUG != "no") {
66 ADD_FLAG("CFLAGS_HTTP", "/W3");
67 }
68
69 if (CHECK_HEADER_ADD_INCLUDE('zlib.h', 'CFLAGS_HTTP', '..\\zlib;' + php_usual_include_suspects)) {
70 AC_DEFINE('HTTP_HAVE_ZLIB', 1, "Have zlib library");
71 ADD_FLAG("LDFLAGS_HTTP", "/FORCE:MULTIPLE");
72 } else {
73 WARNING("zlib encoding functions not enabled; libraries and headers not found");
74 }
75
76 if (PHP_HASH != "no") {
77 var f;
78
79 if ((f = check_for_pecl_ext("hash")) || (f = check_for_main_ext("hash"))) {
80 ADD_FLAG("CFLAGS_HTTP", "/I"+ f);
81 AC_DEFINE("HTTP_HAVE_EXT_HASH", 1, "");
82 ADD_EXTENSION_DEP("http", "hash", true);
83 }
84 }
85
86 if (PHP_SESSION != "no") {
87 ADD_EXTENSION_DEP("http", "session", true);
88 }
89
90 if (PHP_ICONV != "no") {
91 ADD_EXTENSION_DEP("http", "iconv", true);
92 }
93
94 CURL_LIB = PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib";
95 if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") &&
96 CHECK_HEADER_ADD_INCLUDE("openssl/crypto.h", "CFLAGS_HTTP") &&
97 CHECK_LIB(CURL_LIB, "http", PHP_HTTP) &&
98 CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) &&
99 CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&
100 CHECK_LIB("zlib.lib", "http", PHP_HTTP) &&
101 CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {
102 AC_DEFINE("HTTP_HAVE_CURL", 1, "Have CURL library");
103 AC_DEFINE("HTTP_HAVE_SSL", 1, "Have SSL");
104 AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, "");
105 AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, "");
106 AC_DEFINE("HAVE_CURL_EASY_RESET", 1, "");
107 } else {
108 WARNING("curl convenience functions not enabled; libraries and headers not found");
109 }
110
111 MAGIC_LIB = PHP_DEBUG != "no" ? "libmagic-staticd.lib":"libmagic-static.lib";
112 if (CHECK_HEADER_ADD_INCLUDE("magic.h", "CFLAGS_HTTP") &&
113 CHECK_LIB(MAGIC_LIB, "http", PHP_HTTP)) {
114 AC_DEFINE("HTTP_HAVE_MAGIC", 1, "Have magic library");
115 AC_DEFINE("USE_MAGIC_STATIC", "", "");
116 } else {
117 WARNING("content type guessing not enabled; libraries and headers not found");
118 }
119 }