2001-11-30 19:00:13 +00:00
|
|
|
dnl
|
2002-11-13 22:25:33 +00:00
|
|
|
dnl $Id$
|
2001-11-30 19:00:13 +00:00
|
|
|
dnl
|
2000-07-16 19:37:33 +00:00
|
|
|
|
|
|
|
PHP_ARG_WITH(curl, for CURL support,
|
2000-10-02 17:36:01 +00:00
|
|
|
[ --with-curl[=DIR] Include CURL support])
|
2000-07-16 19:37:33 +00:00
|
|
|
|
2002-08-12 15:56:13 +00:00
|
|
|
dnl Temporary option while we develop this aspect of the extension
|
2002-11-18 12:00:21 +00: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 15:56:13 +00:00
|
|
|
|
2000-07-16 19:37:33 +00: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-23 18:14:41 +00:00
|
|
|
break
|
2000-07-16 19:37:33 +00: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-16 23:43:30 +00:00
|
|
|
CURL_CONFIG="curl-config"
|
2003-05-21 15:47:01 +00:00
|
|
|
AC_MSG_CHECKING(for cURL 7.10.5 or greater)
|
2001-05-16 23:43:30 +00:00
|
|
|
|
|
|
|
if ${CURL_DIR}/bin/curl-config --libs print > /dev/null 2>&1; then
|
|
|
|
CURL_CONFIG=${CURL_DIR}/bin/curl-config
|
2001-09-08 16:51:00 +00:00
|
|
|
else
|
|
|
|
if ${CURL_DIR}/curl-config --libs print > /dev/null 2>&1; then
|
|
|
|
CURL_CONFIG=${CURL_DIR}/curl-config
|
|
|
|
fi
|
2001-05-16 23:43:30 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
curl_version_full=`$CURL_CONFIG --version`
|
|
|
|
curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
|
2003-05-21 15:47:01 +00:00
|
|
|
if test "$curl_version" -ge 7010005; then
|
2001-05-16 23:43:30 +00:00
|
|
|
AC_MSG_RESULT($curl_version_full)
|
2001-05-27 18:52:33 +00:00
|
|
|
CURL_LIBS=`$CURL_CONFIG --libs`
|
2001-05-16 23:43:30 +00:00
|
|
|
else
|
2003-05-22 13:08:49 +00:00
|
|
|
AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support)
|
2001-05-16 23:43:30 +00:00
|
|
|
fi
|
|
|
|
|
2001-03-27 20:35:04 +00:00
|
|
|
PHP_ADD_INCLUDE($CURL_DIR/include)
|
2001-05-27 18:52:33 +00:00
|
|
|
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
|
2004-11-03 14:32:52 +00:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)
|
2000-07-16 19:37:33 +00:00
|
|
|
|
2001-09-05 13:18:09 +00:00
|
|
|
PHP_CHECK_LIBRARY(curl,curl_easy_perform,
|
2001-03-11 00:49:16 +00:00
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_CURL,1,[ ])
|
|
|
|
],[
|
2001-05-27 18:52:33 +00:00
|
|
|
AC_MSG_ERROR(There is something wrong. Please check config.log for more information.)
|
2001-08-06 15:40:47 +00:00
|
|
|
],[
|
2004-11-03 14:32:52 +00:00
|
|
|
$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
|
2001-03-11 00:49:16 +00:00
|
|
|
])
|
2000-07-16 19:37:33 +00:00
|
|
|
|
2002-11-06 10:24:48 +00:00
|
|
|
PHP_CHECK_LIBRARY(curl,curl_version_info,
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_CURL_VERSION_INFO,1,[ ])
|
|
|
|
],[],[
|
2004-11-03 14:32:52 +00:00
|
|
|
$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
|
2002-11-06 10:24:48 +00:00
|
|
|
])
|
|
|
|
|
2002-11-18 12:00:21 +00:00
|
|
|
if test "$PHP_CURLWRAPPERS" != "no" ; then
|
|
|
|
AC_DEFINE(PHP_CURL_URL_WRAPPERS,1,[ ])
|
|
|
|
fi
|
2002-08-12 15:56:13 +00:00
|
|
|
|
2002-11-13 22:25:33 +00:00
|
|
|
PHP_NEW_EXTENSION(curl, interface.c multi.c streams.c, $ext_shared)
|
2001-05-27 18:52:33 +00:00
|
|
|
PHP_SUBST(CURL_SHARED_LIBADD)
|
2000-10-02 17:36:01 +00:00
|
|
|
fi
|