- PHP_CHECK_LIBRARY(curl, curl_share_strerror,
- [AC_DEFINE([HAVE_CURL_SHARE_STRERROR], [1], [ ])], [ ],
- [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
- )
- PHP_CHECK_LIBRARY(curl, curl_multi_strerror,
- [AC_DEFINE([HAVE_CURL_MULTI_STRERROR], [1], [ ])], [ ],
- [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
- )
- PHP_CHECK_LIBRARY(curl, curl_easy_strerror,
- [AC_DEFINE([HAVE_CURL_EASY_STRERROR], [1], [ ])], [ ],
- [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
- )
- PHP_CHECK_LIBRARY(curl, curl_easy_reset,
- [AC_DEFINE([HAVE_CURL_EASY_RESET], [1], [ ])], [ ],
- [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
- )
- dnl Debian suddenly (>=7.14.1-2) hides all symbols not starting with "curl"
- PHP_CHECK_LIBRARY(curl, Curl_getFormData,
- [AC_DEFINE([HAVE_CURL_GETFORMDATA], [1], [ ])], [ ],
- [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
- )
- dnl New API function which obsoletes use of Curl_getFormData (>=7.15.5)
- PHP_CHECK_LIBRARY(curl, curl_formget,
- [AC_DEFINE([HAVE_CURL_FORMGET], [1], [ ])], [ ],
- [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
- )
- PHP_CHECK_LIBRARY(curl, curl_multi_setopt,
- [AC_DEFINE([HAVE_CURL_MULTI_SETOPT], [1], [ ])], [ ],
- [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
- )
- PHP_CHECK_LIBRARY(curl, curl_multi_timeout,
- [AC_DEFINE([HAVE_CURL_MULTI_TIMEOUT], [1], [ ])], [ ],
- [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
- )
+ AC_MSG_CHECKING([for SSL support in libcurl])
+ CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL`
+ CURL_SSL_LIBS=""
+ if test "$CURL_SSL" = "SSL"; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([PHP_HTTP_HAVE_SSL], [1], [ ])
+
+ AC_MSG_CHECKING([for openssl support in libcurl])
+ AC_TRY_RUN([
+ #include <curl/curl.h>
+ int main(int argc, char *argv[]) {
+ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
+ if (data && data->ssl_version && *data->ssl_version) {
+ const char *ptr = data->ssl_version;
+ while(*ptr == ' ') ++ptr;
+ return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1);
+ }
+ return 1;
+ }
+ ], [
+ AC_MSG_RESULT([yes])
+ AC_CHECK_HEADER([openssl/ssl.h], [
+ AC_CHECK_HEADER([openssl/crypto.h], [
+ AC_DEFINE([PHP_HTTP_HAVE_OPENSSL], [1], [ ])
+ CURL_SSL_LIBS="ssl crypto"
+ ])
+ ])
+ ], [
+ AC_MSG_RESULT([no])
+ ], [
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_MSG_CHECKING([for gnutls support in libcurl])
+ AC_TRY_RUN([
+ #include <curl/curl.h>
+ int main(int argc, char *argv[]) {
+ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
+ if (data && data->ssl_version && *data->ssl_version) {
+ const char *ptr = data->ssl_version;
+ while(*ptr == ' ') ++ptr;
+ return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1);
+ }
+ return 1;
+ }
+ ], [
+ AC_MSG_RESULT([yes])
+ AC_CHECK_HEADER([gnutls.h], [
+ AC_CHECK_HEADER([gcrypt.h], [
+ AC_DEFINE([PHP_HTTP_HAVE_GNUTLS], [1], [ ])
+ CURL_SSL_LIBS="gnutls gcrypt"
+ ])
+ ])
+ ], [
+ AC_MSG_RESULT([no])
+ ], [
+ AC_MSG_RESULT([no])
+ ])
+ else
+ AC_MSG_RESULT([no])
+ fi
+
+ AC_MSG_CHECKING([for ares support in libcurl])
+ AC_TRY_RUN([
+ #include <curl/curl.h>
+ int main(int argc, char *argv[]) {
+ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
+ if (data && data->ares && data->ares_num0) {
+ return 0;
+ }
+ return 1;
+ }
+ ], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([PHP_HTTP_HAVE_ARES], [1], [ ])
+ ], [
+ AC_MSG_RESULT([no])
+ ], [
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_MSG_CHECKING([whether CURLOPT_TLSAUTH_TYPE expects CURL_TLSAUTH_SRP or literal "SRP"])
+ AC_TRY_RUN([
+ #include <curl/curl.h>
+ int main(int argc, char *argv[]) {
+ CURL *ch = curl_easy_init();
+ return curl_easy_setopt(ch, CURLOPT_TLSAUTH_TYPE, CURL_TLSAUTH_SRP);
+ }
+ ], [
+ AC_MSG_RESULT([CURL_TLSAUTH_SRP])
+ AC_DEFINE([PHP_HTTP_CURL_TLSAUTH_SRP], [CURL_TLSAUTH_SRP], [ ])
+ AC_DEFINE([PHP_HTTP_CURL_TLSAUTH_DEF], [CURL_TLSAUTH_NONE], [ ])
+ ], [
+ AC_TRY_RUN([
+ #include <curl/curl.h>
+ int main(int argc, char *argv[]) {
+ CURL *ch = curl_easy_init();
+ return curl_easy_setopt(ch, CURLOPT_TLSAUTH_TYPE, "SRP");
+ }
+ ], [
+ AC_MSG_RESULT(["SRP"])
+ AC_DEFINE([PHP_HTTP_CURL_TLSAUTH_SRP], ["SRP"], [ ])
+ AC_DEFINE([PHP_HTTP_CURL_TLSAUTH_DEF], [""], [ ])
+ ], [
+ AC_MSG_RESULT([neither])
+ ], [
+ AC_MSG_RESULT([neither])
+ ])
+ ], [
+ AC_MSG_RESULT([neither])
+ ])