mirror of
https://github.com/php/php-src.git
synced 2024-12-18 22:41:20 +08:00
2d29904f25
Only set HAVE_CURL_OPENSSL flag, and remove Windows specific code, as all of this is only relevant for OpenSSL < 1.1, which is not used on Windows.
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
// vim:ft=javascript
|
|
|
|
ARG_WITH("curl", "cURL support", "no");
|
|
|
|
if (PHP_CURL != "no") {
|
|
var ver_num = NaN;
|
|
var f = PHP_PHP_BUILD + "/include/curl/curlver.h";
|
|
if (FSO.FileExists(f)) {
|
|
var reg = /LIBCURL_VERSION_NUM\s+(0x[a-z0-9]+)/gi;
|
|
var m = reg.exec(file_get_contents(PHP_PHP_BUILD + "/include/curl/curlver.h"));
|
|
if (!!m && m.length >= 2) {
|
|
ver_num = parseInt(m[1]);
|
|
}
|
|
}
|
|
|
|
if (CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL) &&
|
|
CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") &&
|
|
SETUP_OPENSSL("curl", PHP_CURL) > 0 &&
|
|
CHECK_LIB("winmm.lib", "curl", PHP_CURL) &&
|
|
CHECK_LIB("wldap32.lib", "curl", PHP_CURL) &&
|
|
(((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "curl", PHP_CURL))) ||
|
|
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "curl", PHP_CURL)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
|
|
!isNaN(ver_num) &&
|
|
(ver_num <= parseInt("0x073b00") || ver_num > parseInt("0x073b00") &&
|
|
CHECK_LIB("normaliz.lib", "curl", PHP_CURL) &&
|
|
CHECK_LIB("libssh2.lib", "curl", PHP_CURL) &&
|
|
CHECK_LIB("nghttp2.lib", "curl", PHP_CURL))
|
|
) {
|
|
EXTENSION("curl", "interface.c multi.c share.c curl_file.c");
|
|
AC_DEFINE('HAVE_CURL', 1, 'Have cURL library');
|
|
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB");
|
|
// TODO: check for curl_version_info
|
|
} else {
|
|
WARNING("curl not enabled; libraries and headers not found");
|
|
}
|
|
}
|