1// vim:ft=javascript 2 3ARG_WITH("curl", "cURL support", "no"); 4 5if (PHP_CURL != "no") { 6 var ver_num = NaN; 7 var f = PHP_PHP_BUILD + "/include/curl/curlver.h"; 8 if (FSO.FileExists(f)) { 9 var reg = /LIBCURL_VERSION_NUM\s+(0x[a-z0-9]+)/gi; 10 var m = reg.exec(file_get_contents(PHP_PHP_BUILD + "/include/curl/curlver.h")); 11 if (!!m && m.length >= 2) { 12 ver_num = parseInt(m[1]); 13 } 14 } 15 16 if (CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL) && 17 CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") && 18 SETUP_OPENSSL("curl", PHP_CURL) >= 2 && 19 CHECK_LIB("winmm.lib", "curl", PHP_CURL) && 20 CHECK_LIB("wldap32.lib", "curl", PHP_CURL) && 21 (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "curl", PHP_CURL))) || 22 (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "curl", PHP_CURL)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) && 23 !isNaN(ver_num) && 24 (CHECK_LIB("normaliz.lib", "curl", PHP_CURL) && 25 CHECK_LIB("libssh2.lib", "curl", PHP_CURL) && 26 CHECK_LIB("nghttp2.lib", "curl", PHP_CURL)) 27 ) { 28 EXTENSION("curl", "interface.c multi.c share.c curl_file.c"); 29 AC_DEFINE('HAVE_CURL', 1, "Define to 1 if the PHP extension 'curl' is available."); 30 ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB /D PHP_CURL_EXPORTS=1"); 31 PHP_INSTALL_HEADERS("ext/curl", "php_curl.h"); 32 } else { 33 WARNING("curl not enabled; libraries and headers not found"); 34 } 35} 36