1 // config.w32 for pecl/http
4 ARG_ENABLE("http", "whether to enable extended HTTP support", "no");
6 function check_for_main_ext(ext, header)
9 header = "php_"+ ext +".h";
12 /* When in configure, we're always in the root of PHP source */
13 var ext_path = "ext\\" + ext;
15 STDOUT.Write("Checking for ext/"+ ext +" ... ");
17 if (FSO.FileExists(ext_path + "\\" + header)) {
18 STDOUT.WriteLine(ext_path);
22 STDOUT.WriteLine("<not found>");
26 function check_for_pecl_ext(ext, header)
29 header = "php_"+ ext +".h";
33 var s = ext +"\\"+ header;
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);
42 STDOUT.WriteLine("<not found>");
46 if (PHP_HTTP != "no") {
49 "src/php_http.c src/php_http_buffer.c src/php_http_client.c " +
50 "src/php_http_client_request.c src/php_http_client_response.c " +
51 "src/php_http_cookie.c src/php_http_curl.c src/php_http_client_curl.c " +
52 "src/php_http_encoding.c src/php_http_env.c src/php_http_env_request.c " +
53 "src/php_http_env_response.c src/php_http_etag.c src/php_http_exception.c src/php_http_filter.c src/php_http_header_parser.c " +
54 "src/php_http_header.c src/php_http_info.c src/php_http_message.c src/php_http_message_body.c src/php_http_message_parser.c " +
55 "src/php_http_misc.c src/php_http_negotiate.c src/php_http_object.c src/php_http_options.c src/php_http_params.c " +
56 "src/php_http_querystring.c src/php_http_url.c src/php_http_version.c",
59 AC_DEFINE("HAVE_HTTP", 1, "Have extended HTTP support");
60 AC_DEFINE("HTTP_SHARED_DEPS", 1, "Depend on shared extensions");
62 AC_DEFINE("HAVE_GETHOSTNAME", 1);
64 if (PHP_DEBUG != "no") {
65 ADD_FLAG("CFLAGS_HTTP", "/W3");
68 if (CHECK_HEADER_ADD_INCLUDE('zlib.h', 'CFLAGS_HTTP', '..\\zlib;' + php_usual_include_suspects)) {
69 AC_DEFINE('HTTP_HAVE_ZLIB', 1, "Have zlib library");
70 ADD_FLAG("LDFLAGS_HTTP", "/FORCE:MULTIPLE");
72 WARNING("zlib encoding functions not enabled; libraries and headers not found");
75 if (typeof(PHP_HASH) != "undefined" && PHP_HASH != "no") {
78 if ((f = check_for_pecl_ext("hash")) || (f = check_for_main_ext("hash"))) {
79 ADD_FLAG("CFLAGS_HTTP", '/I "' + f + '" /DHTTP_HAVE_PHP_HASH_H=1');
80 ADD_EXTENSION_DEP("http", "hash", true);
84 if (PHP_SESSION != "no") {
85 ADD_EXTENSION_DEP("http", "session", true);
88 if (PHP_ICONV != "no") {
89 ADD_EXTENSION_DEP("http", "iconv", true);
92 if (PHP_CURL != "no") {
93 ADD_EXTENSION_DEP("http", "curl", true);
97 CURL_LIB="libcurl_a.lib;libcurl.lib;" + (PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib");
98 if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") &&
99 CHECK_HEADER_ADD_INCLUDE("openssl/crypto.h", "CFLAGS_HTTP") &&
100 CHECK_LIB(CURL_LIB, "http", PHP_HTTP) &&
101 CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) &&
102 CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&
103 CHECK_LIB("zlib.lib;zlib_a.lib", "http", PHP_HTTP) &&
104 CHECK_LIB("libcurl_a.lib", "http", PHP_HTTP) &&
105 ADD_EXTENSION_DEP("http", "propro", true) &&
106 ADD_EXTENSION_DEP("http", "raphf", true) &&
107 CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {
108 AC_DEFINE("PHP_HTTP_HAVE_CURL", 1, "Have CURL library");
109 AC_DEFINE("PHP_HTTP_HAVE_SSL", 1, "Have SSL");
110 AC_DEFINE("PHP_HAVE_CURL_MULTI_STRERROR", 1, "");
111 AC_DEFINE("PHP_HAVE_CURL_SHARE_STRERROR", 1, "");
112 AC_DEFINE("PHP_HAVE_CURL_EASY_STRERROR", 1, "");
113 AC_DEFINE("PHP_HAVE_CURL_EASY_RESET", 1, "");
114 AC_DEFINE("PHP_HAVE_CURL_GETFORMDATA", 1, "");
115 AC_DEFINE("PHP_HAVE_CURL_FORMGET", 1, "");
116 AC_DEFINE("PHP_HAVE_CURL_MULTI_SETOPT", 1, "");
117 AC_DEFINE("PHP_HAVE_CURL_MULTI_TIMEOUT", 1, "");
119 if (CHECK_HEADER_ADD_INCLUDE("event2/event.h", "CFLAGS_HTTP") &&
120 CHECK_LIB("libevent.lib", "http", PHP_HTTP) &&
121 CHECK_LIB("libevent_core.lib", "http", PHP_HTTP) &&
122 CHECK_LIB("libevent_extras.lib", "http", PHP_HTTP)) {
124 AC_DEFINE("PHP_HTTP_HAVE_EVENT", 1);
125 AC_DEFINE("PHP_HTTP_HAVE_EVENT2", 1);
126 AC_DEFINE("PHP_HTTP_EVENT_VERSION", "2.0.21 or greater");
129 WARNING("curl convenience functions not enabled; libraries and headers not found");