2001-12-01 03:00:13 +08:00
|
|
|
dnl
|
2002-11-14 06:25:33 +08:00
|
|
|
dnl $Id$
|
2001-12-01 03:00:13 +08:00
|
|
|
dnl
|
2000-07-17 03:37:33 +08:00
|
|
|
|
2005-11-10 16:04:57 +08:00
|
|
|
PHP_ARG_WITH(curl, for cURL support,
|
|
|
|
[ --with-curl[=DIR] Include cURL support])
|
2000-07-17 03:37:33 +08:00
|
|
|
|
2002-08-12 23:56:13 +08:00
|
|
|
dnl Temporary option while we develop this aspect of the extension
|
2006-09-10 04:03:55 +08:00
|
|
|
PHP_ARG_WITH(curlwrappers, if we should use cURL for url streams,
|
2009-07-26 04:58:51 +08:00
|
|
|
[ --with-curlwrappers EXPERIMENTAL: Use cURL for url streams], no, no)
|
2002-08-12 23:56:13 +08:00
|
|
|
|
2000-07-17 03:37:33 +08:00
|
|
|
if test "$PHP_CURL" != "no"; then
|
|
|
|
if test -r $PHP_CURL/include/curl/easy.h; then
|
|
|
|
CURL_DIR=$PHP_CURL
|
|
|
|
else
|
2006-09-10 04:03:55 +08:00
|
|
|
AC_MSG_CHECKING(for cURL in default path)
|
2000-07-17 03:37:33 +08:00
|
|
|
for i in /usr/local /usr; do
|
|
|
|
if test -r $i/include/curl/easy.h; then
|
|
|
|
CURL_DIR=$i
|
|
|
|
AC_MSG_RESULT(found in $i)
|
2003-03-24 02:14:41 +08:00
|
|
|
break
|
2000-07-17 03:37:33 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$CURL_DIR"; then
|
|
|
|
AC_MSG_RESULT(not found)
|
|
|
|
AC_MSG_ERROR(Please reinstall the libcurl distribution -
|
|
|
|
easy.h should be in <curl-dir>/include/curl/)
|
|
|
|
fi
|
|
|
|
|
2001-05-17 07:43:30 +08:00
|
|
|
CURL_CONFIG="curl-config"
|
2003-05-21 23:47:01 +08:00
|
|
|
AC_MSG_CHECKING(for cURL 7.10.5 or greater)
|
2001-05-17 07:43:30 +08:00
|
|
|
|
2005-02-10 00:22:48 +08:00
|
|
|
if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then
|
2001-05-17 07:43:30 +08:00
|
|
|
CURL_CONFIG=${CURL_DIR}/bin/curl-config
|
2001-09-09 00:51:00 +08:00
|
|
|
else
|
2005-02-10 00:22:48 +08:00
|
|
|
if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then
|
2005-10-26 19:33:17 +08:00
|
|
|
CURL_CONFIG=${CURL_DIR}/curl-config
|
2001-09-09 00:51:00 +08:00
|
|
|
fi
|
2001-05-17 07:43:30 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
curl_version_full=`$CURL_CONFIG --version`
|
2005-05-07 10:51:53 +08:00
|
|
|
curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
|
2003-05-21 23:47:01 +08:00
|
|
|
if test "$curl_version" -ge 7010005; then
|
2001-05-17 07:43:30 +08:00
|
|
|
AC_MSG_RESULT($curl_version_full)
|
2001-05-28 02:52:33 +08:00
|
|
|
CURL_LIBS=`$CURL_CONFIG --libs`
|
2001-05-17 07:43:30 +08:00
|
|
|
else
|
2003-05-22 21:08:49 +08:00
|
|
|
AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support)
|
2001-05-17 07:43:30 +08:00
|
|
|
fi
|
2009-05-03 03:53:33 +08:00
|
|
|
|
|
|
|
PHP_ADD_INCLUDE($CURL_DIR/include)
|
|
|
|
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)
|
2005-10-25 22:29:07 +08:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([for SSL support in libcurl])
|
2005-11-23 06:54:22 +08:00
|
|
|
CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL`
|
2005-10-26 19:33:17 +08:00
|
|
|
if test "$CURL_SSL" = "SSL"; then
|
2009-05-03 03:53:33 +08:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE([HAVE_CURL_SSL], [1], [Have cURL with SSL support])
|
2007-05-17 05:19:53 +08:00
|
|
|
|
2009-05-03 03:53:33 +08:00
|
|
|
save_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="`$CURL_CONFIG --cflags`"
|
2007-05-17 05:19:53 +08:00
|
|
|
|
2009-05-03 03:53:33 +08:00
|
|
|
AC_PROG_CPP
|
|
|
|
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_HEADERS([openssl/crypto.h], [
|
|
|
|
AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support])
|
|
|
|
])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
2007-05-17 05:19:53 +08:00
|
|
|
])
|
|
|
|
|
2009-05-03 03:53:33 +08:00
|
|
|
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([gcrypt.h], [
|
|
|
|
AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support])
|
|
|
|
])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
2007-05-17 05:19:53 +08:00
|
|
|
])
|
|
|
|
|
2009-05-03 03:53:33 +08:00
|
|
|
CFLAGS="$save_CFLAGS"
|
2005-10-25 22:29:07 +08:00
|
|
|
else
|
2009-05-03 03:53:33 +08:00
|
|
|
AC_MSG_RESULT([no])
|
2005-10-25 22:29:07 +08:00
|
|
|
fi
|
2001-05-17 07:43:30 +08:00
|
|
|
|
2001-09-05 21:18:09 +08:00
|
|
|
PHP_CHECK_LIBRARY(curl,curl_easy_perform,
|
2001-03-11 08:49:16 +08:00
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_CURL,1,[ ])
|
|
|
|
],[
|
2001-05-28 02:52:33 +08:00
|
|
|
AC_MSG_ERROR(There is something wrong. Please check config.log for more information.)
|
2001-08-06 23:40:47 +08:00
|
|
|
],[
|
2004-11-03 22:32:52 +08:00
|
|
|
$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
|
2001-03-11 08:49:16 +08:00
|
|
|
])
|
2000-07-17 03:37:33 +08:00
|
|
|
|
2002-11-06 18:24:48 +08:00
|
|
|
PHP_CHECK_LIBRARY(curl,curl_version_info,
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_CURL_VERSION_INFO,1,[ ])
|
|
|
|
],[],[
|
2004-11-03 22:32:52 +08:00
|
|
|
$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
|
2002-11-06 18:24:48 +08:00
|
|
|
])
|
|
|
|
|
2006-09-15 21:43:55 +08:00
|
|
|
PHP_CHECK_LIBRARY(curl,curl_easy_strerror,
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_CURL_EASY_STRERROR,1,[ ])
|
|
|
|
],[],[
|
|
|
|
$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
|
|
|
|
])
|
|
|
|
|
2006-09-15 23:42:39 +08:00
|
|
|
PHP_CHECK_LIBRARY(curl,curl_multi_strerror,
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_CURL_MULTI_STRERROR,1,[ ])
|
|
|
|
],[],[
|
|
|
|
$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
|
|
|
|
])
|
2006-09-15 21:43:55 +08:00
|
|
|
|
2002-11-18 20:00:21 +08:00
|
|
|
if test "$PHP_CURLWRAPPERS" != "no" ; then
|
|
|
|
AC_DEFINE(PHP_CURL_URL_WRAPPERS,1,[ ])
|
|
|
|
fi
|
2002-08-12 23:56:13 +08:00
|
|
|
|
2002-11-14 06:25:33 +08:00
|
|
|
PHP_NEW_EXTENSION(curl, interface.c multi.c streams.c, $ext_shared)
|
2001-05-28 02:52:33 +08:00
|
|
|
PHP_SUBST(CURL_SHARED_LIBADD)
|
2000-10-03 01:36:01 +08:00
|
|
|
fi
|