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])
8 PHP_ARG_WITH([mhash], [for mhash support],
9 [ --with-mhash[=DIR] Include mhash support])
11 if test "$PHP_HTTP" != "no"; then
17 AC_MSG_CHECKING(for netdb.h)
18 if test -r /usr/include/netdb.h -o -r /usr/local/include/netdb.h; then
19 AC_DEFINE(HAVE_NETDB_H, 1, [Have netdb.h])
20 AC_MSG_RESULT(found in default path)
22 AC_MSG_RESULT(not found in default path)
28 if test "$PHP_CURL" != "no"; then
29 if test -r $PHP_CURL/include/curl/easy.h; then
32 AC_MSG_CHECKING(for CURL in default path)
33 for i in /usr/local /usr; do
34 if test -r $i/include/curl/easy.h; then
36 AC_MSG_RESULT(found in $i)
42 if test -z "$CURL_DIR"; then
43 AC_MSG_RESULT(not found)
44 AC_MSG_ERROR(Please reinstall the libcurl distribution -
45 easy.h should be in <curl-dir>/include/curl/)
48 CURL_CONFIG="curl-config"
50 if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then
51 CURL_CONFIG=${CURL_DIR}/bin/curl-config
53 if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then
54 CURL_CONFIG=${CURL_DIR}/curl-config
58 PHP_ADD_INCLUDE($CURL_DIR/include)
59 PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
60 PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, HTTP_SHARED_LIBADD)
62 PHP_CHECK_LIBRARY(curl,curl_easy_init,
64 AC_DEFINE(HTTP_HAVE_CURL,1,[Have CURL easy support])
66 AC_MSG_ERROR(There is something wrong with libcurl. Please check config.log for more information.)
68 $CURL_LIBS -L$CURL_DIR/lib
77 if test "$PHP_MHASH" != "no"; then
78 for i in $PHP_MHASH /usr/local /usr /opt/mhash; do
79 test -f $i/include/mhash.h && MHASH_DIR=$i && break
82 if test -z "$MHASH_DIR"; then
83 AC_MSG_ERROR(Please reinstall libmhash - cannot find mhash.h)
86 PHP_ADD_INCLUDE($MHASH_DIR/include)
87 PHP_ADD_LIBRARY_WITH_PATH(mhash, $MHASH_DIR/lib, MHASH_SHARED_LIBADD)
88 AC_DEFINE(HAVE_LIBMHASH,1,[HAve mhash support])
94 PHP_HTTP_SOURCES="missing.c http.c http_functions.c phpstr/phpstr.c \
95 http_util_object.c http_message_object.c http_request_object.c http_request_pool_api.c \
96 http_response_object.c http_exception_object.c http_requestpool_object.c \
97 http_api.c http_cache_api.c http_request_api.c http_date_api.c \
98 http_headers_api.c http_message_api.c http_send_api.c http_url_api.c \
100 PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, [$ext_shared])
101 PHP_ADD_BUILD_DIR($ext_builddir/phpstr, 1)
102 PHP_SUBST([HTTP_SHARED_LIBADD])
103 PHP_ADD_MAKEFILE_FRAGMENT
104 AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])
109 dnl CFLAGS=" -g -O2 -W -Wchar-subscripts -Wformat=2 -Wno-format-y2k -Wimplicit -Wmissing-braces -Wunused-variable -Wbad-function-cast -Wpointer-arith -Wsign-compare -Winline"
110 dnl PHP_SUBST([CFLAGS])