fix regression introduced with http\Params::PARSE_RFC5987
[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 var PHP_HTTP_HEADERS=glob(configure_module_dirname + "/src/*.h");
49 for (var i=0; i<PHP_HTTP_HEADERS.length; ++i) {
50 var basename = FSO.GetFileName(PHP_HTTP_HEADERS[i]);
51 copy_and_subst("src/" + basename, basename, []);
52 }
53 var PHP_HTTP_SRC_ARRAY = glob(configure_module_dirname + "/src/*.c");
54 var PHP_HTTP_SOURCES="";
55 for (var i=0; i<PHP_HTTP_SRC_ARRAY.length; ++i) {
56 var basename = FSO.GetFileName(PHP_HTTP_SRC_ARRAY[i]);
57 copy_and_subst("src/" + basename, basename, []);
58 PHP_HTTP_SOURCES = PHP_HTTP_SOURCES + " " + basename;
59 }
60 EXTENSION("http", PHP_HTTP_SOURCES);
61
62 AC_DEFINE("HAVE_HTTP", 1, "Have extended HTTP support");
63 AC_DEFINE("HTTP_SHARED_DEPS", 1, "Depend on shared extensions");
64
65 AC_DEFINE("HAVE_GETHOSTNAME", 1);
66
67 if (PHP_DEBUG != "no") {
68 ADD_FLAG("CFLAGS_HTTP", "/W3");
69 }
70
71 if (CHECK_HEADER_ADD_INCLUDE('zlib.h', 'CFLAGS_HTTP', '..\\zlib;' + php_usual_include_suspects)) {
72 AC_DEFINE('HTTP_HAVE_ZLIB', 1, "Have zlib library");
73 ADD_FLAG("LDFLAGS_HTTP", "/FORCE:MULTIPLE");
74 } else {
75 WARNING("zlib encoding functions not enabled; libraries and headers not found");
76 }
77
78 if (typeof(PHP_HASH) != "undefined" && PHP_HASH != "no") {
79 var f;
80
81 if ((f = check_for_pecl_ext("hash")) || (f = check_for_main_ext("hash"))) {
82 ADD_FLAG("CFLAGS_HTTP", '/I "' + f + '" /DHTTP_HAVE_PHP_HASH_H=1');
83 ADD_EXTENSION_DEP("http", "hash", true);
84 }
85 }
86
87 if (PHP_SESSION != "no") {
88 ADD_EXTENSION_DEP("http", "session", true);
89 }
90
91 if (PHP_ICONV != "no") {
92 ADD_EXTENSION_DEP("http", "iconv", true);
93 }
94
95 if (PHP_CURL != "no") {
96 ADD_EXTENSION_DEP("http", "curl", true);
97 }
98
99
100 CURL_LIB="libcurl_a.lib;libcurl.lib;" + (PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib");
101 if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") &&
102 CHECK_HEADER_ADD_INCLUDE("openssl/crypto.h", "CFLAGS_HTTP") &&
103 CHECK_LIB(CURL_LIB, "http", PHP_HTTP) &&
104 CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) &&
105 CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&
106 CHECK_LIB("zlib.lib;zlib_a.lib", "http", PHP_HTTP) &&
107 CHECK_LIB("libcurl_a.lib", "http", PHP_HTTP) &&
108 ADD_EXTENSION_DEP("http", "propro", true) &&
109 ADD_EXTENSION_DEP("http", "raphf", true) &&
110 CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {
111 AC_DEFINE("PHP_HTTP_HAVE_CURL", 1, "Have CURL library");
112 AC_DEFINE("PHP_HTTP_HAVE_SSL", 1, "Have SSL");
113 AC_DEFINE("PHP_HAVE_CURL_MULTI_STRERROR", 1, "");
114 AC_DEFINE("PHP_HAVE_CURL_SHARE_STRERROR", 1, "");
115 AC_DEFINE("PHP_HAVE_CURL_EASY_STRERROR", 1, "");
116 AC_DEFINE("PHP_HAVE_CURL_EASY_RESET", 1, "");
117 AC_DEFINE("PHP_HAVE_CURL_GETFORMDATA", 1, "");
118 AC_DEFINE("PHP_HAVE_CURL_FORMGET", 1, "");
119 AC_DEFINE("PHP_HAVE_CURL_MULTI_SETOPT", 1, "");
120 AC_DEFINE("PHP_HAVE_CURL_MULTI_TIMEOUT", 1, "");
121 AC_DEFINE("PHP_HTTP_HAVE_CLIENT", 1, "Have HTTP client support");
122 if (CHECK_HEADER_ADD_INCLUDE("event2/event.h", "CFLAGS_HTTP") &&
123 CHECK_LIB("libevent.lib", "http", PHP_HTTP) &&
124 CHECK_LIB("libevent_core.lib", "http", PHP_HTTP) &&
125 CHECK_LIB("libevent_extras.lib", "http", PHP_HTTP)) {
126
127 AC_DEFINE("PHP_HTTP_HAVE_EVENT", 1);
128 AC_DEFINE("PHP_HTTP_HAVE_EVENT2", 1);
129 AC_DEFINE("PHP_HTTP_EVENT_VERSION", "2.0.21 or greater");
130 }
131 } else {
132 WARNING("curl convenience functions not enabled; libraries and headers not found");
133 }
134 }