1 // config.w32 for pecl/http
4 ARG_ENABLE("http", "whether to enable extended HTTP support", "no");
5 ARG_ENABLE("http-stream-wrapper", "whether to enable experimental stream wrapper", "no", "no");
7 function check_for_main_ext(ext, header)
10 header = "php_"+ ext +".h";
13 var r = new RegExp(PHP_VERSION +"."+ PHP_MINOR_VERSION);
14 var g = glob(configure_module_dirname +"\\..\\..\\*\\ext\\"+ ext +"\\"+ header);
16 STDOUT.Write("Checking for ext/"+ ext +" ... ");
17 for (i = 0; i < g.length; i++) {
19 var f = g[i].substr(0, g[i].length - header.length - 1);
24 STDOUT.WriteLine("<not found>");
28 function check_for_pecl_ext(ext, header)
31 header = "php_"+ ext +".h";
35 var s = ext +"\\"+ header;
37 STDOUT.Write("Checking for pecl/"+ ext +" ... ");
38 if ( (g = glob(configure_module_dirname +"\\..\\"+ s)) ||
39 (g = glob(configure_module_dirname +"\\..\\..\\..\\pecl\\"+ s))) {
40 var f = g[0].substr(0, g[0].length - header.length - 1);
44 STDOUT.WriteLine("<not found>");
48 if (PHP_HTTP != "no") {
51 "missing.c http.c http_functions.c http_exception_object.c "+
52 "http_util_object.c http_message_object.c http_requestpool_object.c "+
53 "http_request_object.c http_response_object.c "+
54 "http_api.c http_cache_api.c http_request_pool_api.c "+
55 "http_request_api.c http_date_api.c http_headers_api.c "+
56 "http_message_api.c http_send_api.c http_url_api.c "+
57 "http_info_api.c http_request_method_api.c http_encoding_api.c "+
58 "http_filter_api.c http_request_body_api.c http_wrapper_api.c",
60 "/I\"" + configure_module_dirname + "/phpstr\"");
61 ADD_SOURCES(configure_module_dirname + "/phpstr", "phpstr.c", "http");
62 AC_DEFINE("HAVE_HTTP", 1, "Have extended HTTP support");
64 if (PHP_HTTP_STREAM_WRAPPER == "yes") {
65 AC_DEFINE("HTTP_HAVE_WRAPPER", 1, "Have experimental HTTP stream wrapper");
68 if (PHP_DEBUG != "no") {
69 ADD_FLAG("CFLAGS_HTTP", "/W3");
72 if (CHECK_HEADER_ADD_INCLUDE('zlib.h', 'CFLAGS_HTTP', '..\\zlib;' + php_usual_include_suspects)) {
73 AC_DEFINE('HTTP_HAVE_ZLIB', 1, "Have zlib library");
74 ADD_FLAG("LDFLAGS_HTTP", "/FORCE:MULTIPLE");
76 WARNING("zlib encoding functions not enabled; libraries and headers not found");
79 if (PHP_HASH != "no") {
82 if ((f = check_for_pecl_ext("hash")) || (f = check_for_main_ext("hash"))) {
83 ADD_FLAG("CFLAGS_HTTP", "/I"+ f);
84 AC_DEFINE("HTTP_HAVE_EXT_HASH", 1, "");
85 ADD_EXTENSION_DEP("http", "hash", true);
89 CURL_LIB = PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib";
90 if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") &&
91 CHECK_HEADER_ADD_INCLUDE("openssl/crypto.h", "CFLAGS_HTTP") &&
92 CHECK_LIB(CURL_LIB, "http", PHP_HTTP) &&
93 CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) &&
94 CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&
95 CHECK_LIB("zlib.lib", "http", PHP_HTTP) &&
96 CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {
97 AC_DEFINE("HTTP_HAVE_CURL", 1, "Have CURL library");
98 AC_DEFINE("HTTP_HAVE_SSL", 1, "Have SSL");
99 AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, "");
100 AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, "");
101 AC_DEFINE("HAVE_CURL_EASY_RESET", 1, "");
103 WARNING("curl convenience functions not enabled; libraries and headers not found");
106 MAGIC_LIB = PHP_DEBUG != "no" ? "libmagic-staticd.lib":"libmagic-static.lib";
107 if (CHECK_HEADER_ADD_INCLUDE("magic.h", "CFLAGS_HTTP") &&
108 CHECK_LIB(MAGIC_LIB, "http", PHP_HTTP)) {
109 AC_DEFINE("HTTP_HAVE_MAGIC", 1, "Have magic library");
110 AC_DEFINE("USE_MAGIC_STATIC", "", "");
112 WARNING("content type guessing not enabled; libraries and headers not found");