- huh?
[m6w6/ext-http] / config.m4
1 dnl config.m4 for pecl/http
2 dnl $Id$
3
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
9 if test "$PHP_HTTP" != "no"; then
10
11 dnl -------
12 dnl NETDB.H
13 dnl -------
14
15 AC_MSG_CHECKING(for netdb.h)
16 if test -r /usr/include/netdb.h -o -r /usr/local/include/netdb.h; then
17 AC_DEFINE(HAVE_NETDB_H, 1, [Have netdb.h])
18 AC_MSG_RESULT(found in default path)
19 else
20 AC_MSG_RESULT(not found in default path)
21 fi
22
23 dnl ----
24 dnl CURL
25 dnl ----
26 if test "$PHP_CURL" != "no"; then
27 if test -r $PHP_CURL/include/curl/easy.h; then
28 CURL_DIR=$PHP_CURL
29 else
30 AC_MSG_CHECKING(for CURL in default path)
31 for i in /usr/local /usr; do
32 if test -r $i/include/curl/easy.h; then
33 CURL_DIR=$i
34 AC_MSG_RESULT(found in $i)
35 break
36 fi
37 done
38 fi
39
40 if test -z "$CURL_DIR"; then
41 AC_MSG_RESULT(not found)
42 AC_MSG_ERROR(Please reinstall the libcurl distribution -
43 easy.h should be in <curl-dir>/include/curl/)
44 fi
45
46 CURL_CONFIG="curl-config"
47
48 if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then
49 CURL_CONFIG=${CURL_DIR}/bin/curl-config
50 else
51 if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then
52 CURL_CONFIG=${CURL_DIR}/curl-config
53 fi
54 fi
55
56 PHP_ADD_INCLUDE($CURL_DIR/include)
57 PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
58 PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, HTTP_SHARED_LIBADD)
59
60 PHP_CHECK_LIBRARY(curl,curl_easy_init,
61 [
62 AC_DEFINE(HTTP_HAVE_CURL,1,[Have CURL easy support])
63 ],[
64 AC_MSG_ERROR(There is something wrong with libcurl. Please check config.log for more information.)
65 ],[
66 $CURL_LIBS -L$CURL_DIR/lib
67 ])
68
69 fi
70
71 dnl ----
72 dnl DONE
73 dnl ----
74 PHP_HTTP_SOURCES="http.c http_functions.c http_methods.c phpstr/phpstr.c \
75 http_util_object.c http_message_object.c http_request_object.c \
76 http_response_object.c http_exception_object.c \
77 http_api.c http_auth_api.c http_cache_api.c http_request_api.c http_date_api.c \
78 http_headers_api.c http_message_api.c http_send_api.c http_url_api.c"
79 PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, [$ext_shared])
80 PHP_SUBST([HTTP_SHARED_LIBADD])
81 AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])
82 fi
83 =======
84 dnl config.m4 for pecl/http
85 dnl $Id$
86
87 PHP_ARG_ENABLE([http], [whether to enable extended HTTP support],
88 [ --enable-http Enable extended HTTP support])
89 PHP_ARG_WITH([curl], [for CURL support],
90 [ --with-curl[=DIR] Include CURL support])
91
92 if test "$PHP_HTTP" != "no"; then
93
94 dnl -------
95 dnl NETDB.H
96 dnl -------
97
98 AC_MSG_CHECKING(for netdb.h)
99 if test -r /usr/include/netdb.h -o -r /usr/local/include/netdb.h; then
100 AC_DEFINE(HAVE_NETDB_H, 1, [Have netdb.h])
101 AC_MSG_RESULT(found in default path)
102 else
103 AC_MSG_RESULT(not found in default path)
104 fi
105
106 dnl ----
107 dnl CURL
108 dnl ----
109 if test "$PHP_CURL" != "no"; then
110 if test -r $PHP_CURL/include/curl/easy.h; then
111 CURL_DIR=$PHP_CURL
112 else
113 AC_MSG_CHECKING(for CURL in default path)
114 for i in /usr/local /usr; do
115 if test -r $i/include/curl/easy.h; then
116 CURL_DIR=$i
117 AC_MSG_RESULT(found in $i)
118 break
119 fi
120 done
121 fi
122
123 if test -z "$CURL_DIR"; then
124 AC_MSG_RESULT(not found)
125 AC_MSG_ERROR(Please reinstall the libcurl distribution -
126 easy.h should be in <curl-dir>/include/curl/)
127 fi
128
129 CURL_CONFIG="curl-config"
130
131 if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then
132 CURL_CONFIG=${CURL_DIR}/bin/curl-config
133 else
134 if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then
135 CURL_CONFIG=${CURL_DIR}/curl-config
136 fi
137 fi
138
139 PHP_ADD_INCLUDE($CURL_DIR/include)
140 PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
141 PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, HTTP_SHARED_LIBADD)
142
143 PHP_CHECK_LIBRARY(curl,curl_easy_init,
144 [
145 AC_DEFINE(HTTP_HAVE_CURL,1,[Have CURL easy support])
146 ],[
147 AC_MSG_ERROR(There is something wrong with libcurl. Please check config.log for more information.)
148 ],[
149 $CURL_LIBS -L$CURL_DIR/lib
150 ])
151
152 fi
153
154 dnl ----
155 dnl DONE
156 dnl ----
157 PHP_HTTP_SOURCES="http.c http_functions.c http_methods.c phpstr/phpstr.c \
158 http_util_object.c http_message_object.c http_request_object.c \
159 http_response_object.c http_exception_object.c \
160 http_api.c http_auth_api.c http_cache_api.c http_curl_api.c http_date_api.c \
161 http_headers_api.c http_message_api.c http_send_api.c http_url_api.c"
162 PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, [$ext_shared])
163 PHP_SUBST([HTTP_SHARED_LIBADD])
164 PHP_ADD_MAKEFILE_FRAGMENT
165 AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])
166 fi
167