1 dnl config.m4 for pecl/http
4 PHP_ARG_ENABLE([http], [whether to enable extended HTTP support],
5 [ --enable-http Enable extended HTTP support])
6 PHP_ARG_WITH([curl], [for CURL support],
7 [ --with-curl[=DIR] Include CURL support])
9 if test "$PHP_HTTP" != "no"; then
14 if test -r /usr/include/ctype.h -o -r /usr/local/include/ctype.h ; then
15 AC_DEFINE([HAVE_CTYPE], [1], [Have ctype support])
21 if test "$PHP_CURL" != "no"; then
22 if test -r $PHP_CURL/include/curl/easy.h; then
25 AC_MSG_CHECKING(for CURL in default path)
26 for i in /usr/local /usr; do
27 if test -r $i/include/curl/easy.h; then
29 AC_MSG_RESULT(found in $i)
35 if test -z "$CURL_DIR"; then
36 AC_MSG_RESULT(not found)
37 AC_MSG_ERROR(Please reinstall the libcurl distribution -
38 easy.h should be in <curl-dir>/include/curl/)
41 CURL_CONFIG="curl-config"
43 if ${CURL_DIR}/bin/curl-config --libs print > /dev/null 2>&1; then
44 CURL_CONFIG=${CURL_DIR}/bin/curl-config
46 if ${CURL_DIR}/curl-config --libs print > /dev/null 2>&1; then
47 CURL_CONFIG=${CURL_DIR}/curl-config
51 PHP_ADD_INCLUDE($CURL_DIR/include)
52 PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
53 PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, HTTP_SHARED_LIBADD)
55 PHP_CHECK_LIBRARY(curl,curl_easy_init,
57 AC_DEFINE(HAVE_CURL,1,[Have CURL easy support])
59 AC_MSG_ERROR(There is something wrong with libcurl. Please check config.log for more information.)
61 $CURL_LIBS -L$CURL_DIR/lib
64 PHP_CHECK_LIBRARY(curl,curl_version_info,
66 AC_DEFINE(HAVE_CURL_VERSION_INFO,1,[ ])
68 $CURL_LIBS -L$CURL_DIR/lib
75 PHP_NEW_EXTENSION([http], [http.c http_api.c], [$ext_shared])
76 PHP_SUBST([HTTP_SHARED_LIBADD])
77 AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])