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
|
|
|
|
|
|
|
PHP_ARG_WITH(curl, for CURL support,
|
2000-10-03 01:36:01 +08:00
|
|
|
[ --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
|
2002-11-18 20:00:21 +08:00
|
|
|
PHP_ARG_WITH(curlwrappers, if we should use CURL for url streams,
|
|
|
|
[ --with-curlwrappers 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
|
|
|
|
AC_MSG_CHECKING(for CURL in default path)
|
|
|
|
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
|
2001-09-09 00:51:00 +08:00
|
|
|
CURL_CONFIG=${CURL_DIR}/curl-config
|
|
|
|
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
|
2005-10-25 22:29:07 +08:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([for SSL support in libcurl])
|
|
|
|
CURL_SSL=`$CURL_CONFIG --features | $EGREP SSL`
|
|
|
|
if test "$CURL_SSL" == "SSL"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE([HAVE_CURL_SSL], [1], [Have cURL with SSL support])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for SSL library used])
|
|
|
|
CURL_SSL_FLAVOUR=
|
|
|
|
for i in $CURL_LIBS; do
|
|
|
|
if test "$i" == "-lssl"; then
|
|
|
|
CURL_SSL_FLAVOUR="openssl"
|
|
|
|
AC_MSG_RESULT([openssl])
|
|
|
|
AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support])
|
|
|
|
AC_CHECK_HEADERS([openssl/crypto.h])
|
|
|
|
break
|
|
|
|
elif test "$i" == "-lgnutls"; then
|
|
|
|
CURL_SSL_FLAVOUR="gnutls"
|
|
|
|
AC_MSG_RESULT([gnutls])
|
|
|
|
AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support])
|
|
|
|
AC_CHECK_HEADERS([gcrypt.h])
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test -z "$CURL_SSL_FLAVOUR"; then
|
|
|
|
AC_MSG_RESULT([unknown!])
|
|
|
|
AC_MSG_WARN([Could not determine the type of SSL library used!])
|
|
|
|
AC_MSG_WARN([Building will fail in ZTS mode!])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
2001-05-17 07:43:30 +08:00
|
|
|
|
2001-03-28 04:35:04 +08:00
|
|
|
PHP_ADD_INCLUDE($CURL_DIR/include)
|
2001-05-28 02:52:33 +08:00
|
|
|
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
|
2004-11-03 22:32:52 +08:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)
|
2000-07-17 03:37:33 +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
|
|
|
])
|
|
|
|
|
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
|