- include everything in http.c
[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 /* When in configure, we're always in the root of PHP source */
13 var ext_path = "ext\\" + ext;
14
15 STDOUT.Write("Checking for ext/"+ ext +" ... ");
16
17 if (FSO.FileExists(ext_path + "\\" + header)) {
18 STDOUT.WriteLine(ext_path);
19 return ext_path;
20 }
21
22 STDOUT.WriteLine("<not found>");
23 return false;
24 }
25
26 function check_for_pecl_ext(ext, header)
27 {
28 if (!header) {
29 header = "php_"+ ext +".h";
30 }
31
32 var g;
33 var s = ext +"\\"+ header;
34
35 STDOUT.Write("Checking for pecl/"+ ext +" ... ");
36 if ( (g = glob(configure_module_dirname +"\\..\\"+ s)) ||
37 (g = glob(configure_module_dirname +"\\..\\..\\..\\pecl\\"+ s))) {
38 var f = g[0].substr(0, g[0].length - header.length - 1);
39 STDOUT.WriteLine(f);
40 return f;
41 }
42 STDOUT.WriteLine("<not found>");
43 return false;
44 }
45
46 if (PHP_HTTP != "no") {
47
48 EXTENSION("http",
49 "missing.c http.c http_functions.c http_exception_object.c "+
50 "http_util_object.c http_message_object.c http_requestpool_object.c "+
51 "http_request_object.c http_response_object.c "+
52 "http_api.c http_cache_api.c http_request_pool_api.c "+
53 "http_request_api.c http_date_api.c http_headers_api.c "+
54 "http_message_api.c http_send_api.c http_url_api.c "+
55 "http_info_api.c http_request_method_api.c http_encoding_api.c "+
56 "http_filter_api.c http_request_body_api.c http_querystring_object.c "+
57 "http_deflatestream_object.c http_inflatestream_object.c "+
58 "http_cookie_api.c http_querystring_api.c http_request_datashare_api.c "+
59 "http_requestdatashare_object.c http_request_info.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 AC_DEFINE("HTTP_SHARED_DEPS", 1, "Depend on shared extensions");
65
66 AC_DEFINE("HAVE_GETHOSTNAME", 1);
67 AC_DEFINE("HAVE_GETSERVBYPORT", 1);
68 AC_DEFINE("HAVE_GETSERVBYNAME", 1);
69
70 if (PHP_DEBUG != "no") {
71 ADD_FLAG("CFLAGS_HTTP", "/W3");
72 }
73
74 if (CHECK_HEADER_ADD_INCLUDE('zlib.h', 'CFLAGS_HTTP', '..\\zlib;' + php_usual_include_suspects)) {
75 AC_DEFINE('HTTP_HAVE_ZLIB', 1, "Have zlib library");
76 ADD_FLAG("LDFLAGS_HTTP", "/FORCE:MULTIPLE");
77 } else {
78 WARNING("zlib encoding functions not enabled; libraries and headers not found");
79 }
80
81 if (typeof(PHP_HASH) != "undefined" && PHP_HASH != "no") {
82 var f;
83
84 if ((f = check_for_pecl_ext("hash")) || (f = check_for_main_ext("hash"))) {
85 ADD_FLAG("CFLAGS_HTTP", '/I "' + f + '" /DHTTP_HAVE_PHP_HASH_H=1');
86 ADD_EXTENSION_DEP("http", "hash", true);
87 }
88 }
89
90 if (PHP_SESSION != "no") {
91 ADD_EXTENSION_DEP("http", "session", true);
92 }
93
94 if (PHP_ICONV != "no") {
95 ADD_EXTENSION_DEP("http", "iconv", true);
96 }
97
98 CURL_LIB = PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib";
99 if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") &&
100 CHECK_HEADER_ADD_INCLUDE("openssl/crypto.h", "CFLAGS_HTTP") &&
101 CHECK_LIB(CURL_LIB, "http", PHP_HTTP) &&
102 CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) &&
103 CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&
104 CHECK_LIB("zlib.lib", "http", PHP_HTTP) &&
105 CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {
106 AC_DEFINE("HTTP_HAVE_CURL", 1, "Have CURL library");
107 AC_DEFINE("HTTP_HAVE_SSL", 1, "Have SSL");
108 AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, "");
109 AC_DEFINE("HAVE_CURL_SHARE_STRERROR", 1, "");
110 AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, "");
111 AC_DEFINE("HAVE_CURL_EASY_RESET", 1, "");
112 AC_DEFINE("HAVE_CURL_GETFORMDATA", 1, "");
113 AC_DEFINE("HAVE_CURL_FORMGET", 1, "");
114 AC_DEFINE("HAVE_CURL_MULTI_SETOPT", 1, "");
115 AC_DEFINE("HAVE_CURL_MULTI_TIMEOUT", 1, "");
116 } else {
117 WARNING("curl convenience functions not enabled; libraries and headers not found");
118 }
119
120 MAGIC_LIB = PHP_DEBUG != "no" ? "libmagic-staticd.lib":"libmagic-static.lib";
121 if (CHECK_HEADER_ADD_INCLUDE("magic.h", "CFLAGS_HTTP") &&
122 CHECK_LIB(MAGIC_LIB, "http", PHP_HTTP)) {
123 AC_DEFINE("HTTP_HAVE_MAGIC", 1, "Have magic library");
124 AC_DEFINE("USE_MAGIC_STATIC", "", "");
125 } else {
126 WARNING("content type guessing not enabled; libraries and headers not found");
127 }
128 }