diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/Makefile.am | 1 | ||||
-rw-r--r-- | m4/libgnurl.m4 | 269 |
2 files changed, 0 insertions, 270 deletions
diff --git a/m4/Makefile.am b/m4/Makefile.am index d41788460..79010513f 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am | |||
@@ -21,7 +21,6 @@ inttypes-pri.m4\ | |||
21 | isc-posix.m4\ | 21 | isc-posix.m4\ |
22 | lcmessage.m4\ | 22 | lcmessage.m4\ |
23 | libgcrypt.m4\ | 23 | libgcrypt.m4\ |
24 | libgnurl.m4\ | ||
25 | libcurl.m4\ | 24 | libcurl.m4\ |
26 | lib-ld.m4\ | 25 | lib-ld.m4\ |
27 | lib-link.m4\ | 26 | lib-link.m4\ |
diff --git a/m4/libgnurl.m4 b/m4/libgnurl.m4 deleted file mode 100644 index d030c5dd8..000000000 --- a/m4/libgnurl.m4 +++ /dev/null | |||
@@ -1,269 +0,0 @@ | |||
1 | ########################################################################### | ||
2 | # LIBGNURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], | ||
3 | # [ACTION-IF-YES], [ACTION-IF-NO]) | ||
4 | # ---------------------------------------------------------- | ||
5 | # David Shaw <dshaw@jabberwocky.com> May-09-2006 | ||
6 | # | ||
7 | # Checks for libgnurl. DEFAULT-ACTION is the string yes or no to | ||
8 | # specify whether to default to --with-libgnurl or --without-libgnurl. | ||
9 | # If not supplied, DEFAULT-ACTION is yes. MINIMUM-VERSION is the | ||
10 | # minimum version of libgnurl to accept. Pass the version as a regular | ||
11 | # version number like 7.10.1. If not supplied, any version is | ||
12 | # accepted. ACTION-IF-YES is a list of shell commands to run if | ||
13 | # libgnurl was successfully found and passed the various tests. | ||
14 | # ACTION-IF-NO is a list of shell commands that are run otherwise. | ||
15 | # Note that using --without-libgnurl does run ACTION-IF-NO. | ||
16 | # | ||
17 | # This macro #defines HAVE_LIBGNURL if a working libgnurl setup is | ||
18 | # found, and sets @LIBGNURL@ and @LIBGNURL_CPPFLAGS@ to the necessary | ||
19 | # values. Other useful defines are LIBGNURL_FEATURE_xxx where xxx are | ||
20 | # the various features supported by libgnurl, and LIBGNURL_PROTOCOL_yyy | ||
21 | # where yyy are the various protocols supported by libgnurl. Both xxx | ||
22 | # and yyy are capitalized. See the list of AH_TEMPLATEs at the top of | ||
23 | # the macro for the complete list of possible defines. Shell | ||
24 | # variables $libgnurl_feature_xxx and $libgnurl_protocol_yyy are also | ||
25 | # defined to 'yes' for those features and protocols that were found. | ||
26 | # Note that xxx and yyy keep the same capitalization as in the | ||
27 | # gnurl-config list (e.g. it's "HTTP" and not "http"). | ||
28 | # | ||
29 | # Users may override the detected values by doing something like: | ||
30 | # LIBGNURL="-lgnurl" LIBGNURL_CPPFLAGS="-I/usr/myinclude" ./configure | ||
31 | # | ||
32 | # For the sake of sanity, this macro assumes that any libgnurl that is | ||
33 | # found is after version 7.7.2, the first version that included the | ||
34 | # gnurl-config script. Note that it is very important for people | ||
35 | # packaging binary versions of libgnurl to include this script! | ||
36 | # Without gnurl-config, we can only guess what protocols are available, | ||
37 | # or use gnurl_version_info to figure it out at runtime. | ||
38 | |||
39 | AC_DEFUN([LIBGNURL_CHECK_CONFIG], | ||
40 | [ | ||
41 | AH_TEMPLATE([LIBGNURL_FEATURE_SSL],[Defined if libgnurl supports SSL]) | ||
42 | AH_TEMPLATE([LIBGNURL_FEATURE_KRB4],[Defined if libgnurl supports KRB4]) | ||
43 | AH_TEMPLATE([LIBGNURL_FEATURE_IPV6],[Defined if libgnurl supports IPv6]) | ||
44 | AH_TEMPLATE([LIBGNURL_FEATURE_LIBZ],[Defined if libgnurl supports libz]) | ||
45 | AH_TEMPLATE([LIBGNURL_FEATURE_ASYNCHDNS],[Defined if libgnurl supports AsynchDNS]) | ||
46 | AH_TEMPLATE([LIBGNURL_FEATURE_IDN],[Defined if libgnurl supports IDN]) | ||
47 | AH_TEMPLATE([LIBGNURL_FEATURE_SSPI],[Defined if libgnurl supports SSPI]) | ||
48 | AH_TEMPLATE([LIBGNURL_FEATURE_NTLM],[Defined if libgnurl supports NTLM]) | ||
49 | |||
50 | AH_TEMPLATE([LIBGNURL_PROTOCOL_HTTP],[Defined if libgnurl supports HTTP]) | ||
51 | AH_TEMPLATE([LIBGNURL_PROTOCOL_HTTPS],[Defined if libgnurl supports HTTPS]) | ||
52 | AH_TEMPLATE([LIBGNURL_PROTOCOL_FTP],[Defined if libgnurl supports FTP]) | ||
53 | AH_TEMPLATE([LIBGNURL_PROTOCOL_FTPS],[Defined if libgnurl supports FTPS]) | ||
54 | AH_TEMPLATE([LIBGNURL_PROTOCOL_FILE],[Defined if libgnurl supports FILE]) | ||
55 | AH_TEMPLATE([LIBGNURL_PROTOCOL_TELNET],[Defined if libgnurl supports TELNET]) | ||
56 | AH_TEMPLATE([LIBGNURL_PROTOCOL_LDAP],[Defined if libgnurl supports LDAP]) | ||
57 | AH_TEMPLATE([LIBGNURL_PROTOCOL_DICT],[Defined if libgnurl supports DICT]) | ||
58 | AH_TEMPLATE([LIBGNURL_PROTOCOL_TFTP],[Defined if libgnurl supports TFTP]) | ||
59 | AH_TEMPLATE([LIBGNURL_PROTOCOL_RTSP],[Defined if libgnurl supports RTSP]) | ||
60 | AH_TEMPLATE([LIBGNURL_PROTOCOL_POP3],[Defined if libgnurl supports POP3]) | ||
61 | AH_TEMPLATE([LIBGNURL_PROTOCOL_IMAP],[Defined if libgnurl supports IMAP]) | ||
62 | AH_TEMPLATE([LIBGNURL_PROTOCOL_SMTP],[Defined if libgnurl supports SMTP]) | ||
63 | |||
64 | AC_ARG_WITH(libgnurl, | ||
65 | AS_HELP_STRING([--with-libgnurl=PREFIX],[look for the gnurl library in PREFIX/lib and headers in PREFIX/include]), | ||
66 | [_libgnurl_with=$withval],[_libgnurl_with=ifelse([$1],,[yes],[$1])]) | ||
67 | |||
68 | if test "$_libgnurl_with" != "no" ; then | ||
69 | |||
70 | AC_PROG_AWK | ||
71 | |||
72 | _libgnurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'" | ||
73 | |||
74 | _libgnurl_try_link=yes | ||
75 | |||
76 | if test -d "$_libgnurl_with" ; then | ||
77 | LIBGNURL_CPPFLAGS="-I$withval/include" | ||
78 | _libgnurl_ldflags="-L$withval/lib" | ||
79 | AC_PATH_PROG([_libgnurl_config],[gnurl-config],[], | ||
80 | ["$withval/bin"]) | ||
81 | else | ||
82 | AC_PATH_PROG([_libgnurl_config],[gnurl-config],[],[$PATH]) | ||
83 | fi | ||
84 | |||
85 | if test x$_libgnurl_config != "x" ; then | ||
86 | AC_CACHE_CHECK([for the version of libgnurl], | ||
87 | [libgnurl_cv_lib_gnurl_version], | ||
88 | [libgnurl_cv_lib_gnurl_version=`$_libgnurl_config --version | $AWK '{print $[]2}'`]) | ||
89 | |||
90 | _libgnurl_version=`echo $libgnurl_cv_lib_gnurl_version | $_libgnurl_version_parse` | ||
91 | _libgnurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libgnurl_version_parse` | ||
92 | |||
93 | if test $_libgnurl_wanted -gt 0 ; then | ||
94 | AC_CACHE_CHECK([for libgnurl >= version $2], | ||
95 | [libgnurl_cv_lib_version_ok], | ||
96 | [ | ||
97 | if test $_libgnurl_version -ge $_libgnurl_wanted ; then | ||
98 | libgnurl_cv_lib_version_ok=yes | ||
99 | else | ||
100 | libgnurl_cv_lib_version_ok=no | ||
101 | fi | ||
102 | ]) | ||
103 | fi | ||
104 | |||
105 | if test $_libgnurl_wanted -eq 0 || test x$libgnurl_cv_lib_version_ok = xyes ; then | ||
106 | if test x"$LIBGNURL_CPPFLAGS" = "x" ; then | ||
107 | LIBGNURL_CPPFLAGS=`$_libgnurl_config --cflags` | ||
108 | fi | ||
109 | if test x"$LIBGNURL" = "x" ; then | ||
110 | LIBGNURL=`$_libgnurl_config --libs` | ||
111 | |||
112 | # This is so silly, but Apple actually has a bug in their | ||
113 | # gnurl-config script. Fixed in Tiger, but there are still | ||
114 | # lots of Panther installs around. | ||
115 | case "${host}" in | ||
116 | powerpc-apple-darwin7*) | ||
117 | LIBGNURL=`echo $LIBGNURL | sed -e 's|-arch i386||g'` | ||
118 | ;; | ||
119 | esac | ||
120 | fi | ||
121 | |||
122 | # All gnurl-config scripts support --feature | ||
123 | _libgnurl_features=`$_libgnurl_config --feature` | ||
124 | |||
125 | # Is it modern enough to have --protocols? (7.12.4) | ||
126 | if test $_libgnurl_version -ge 461828 ; then | ||
127 | _libgnurl_protocols=`$_libgnurl_config --protocols` | ||
128 | fi | ||
129 | else | ||
130 | _libgnurl_try_link=no | ||
131 | fi | ||
132 | |||
133 | unset _libgnurl_wanted | ||
134 | fi | ||
135 | |||
136 | if test $_libgnurl_try_link = yes ; then | ||
137 | |||
138 | # we didn't find gnurl-config, so let's see if the user-supplied | ||
139 | # link line (or failing that, "-lgnurl") is enough. | ||
140 | LIBGNURL=${LIBGNURL-"$_libgnurl_ldflags -lgnurl"} | ||
141 | |||
142 | AC_CACHE_CHECK([whether libgnurl is usable], | ||
143 | [libgnurl_cv_lib_gnurl_usable], | ||
144 | [ | ||
145 | _libgnurl_save_cppflags=$CPPFLAGS | ||
146 | CPPFLAGS="$LIBGNURL_CPPFLAGS $CPPFLAGS" | ||
147 | _libgnurl_save_libs=$LIBS | ||
148 | LIBS="$LIBGNURL $LIBS" | ||
149 | |||
150 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curl/curl.h>]],[[ | ||
151 | /* Try and use a few common options to force a failure if we are | ||
152 | missing symbols or can't link. */ | ||
153 | int x; | ||
154 | curl_easy_setopt(NULL,CURLOPT_URL,NULL); | ||
155 | x=CURL_ERROR_SIZE; | ||
156 | x=CURLOPT_WRITEFUNCTION; | ||
157 | x=CURLOPT_WRITEDATA; | ||
158 | x=CURLOPT_ERRORBUFFER; | ||
159 | x=CURLOPT_STDERR; | ||
160 | x=CURLOPT_VERBOSE; | ||
161 | if (x) {;} | ||
162 | ]])],libgnurl_cv_lib_gnurl_usable=yes,libgnurl_cv_lib_gnurl_usable=no) | ||
163 | |||
164 | # BEGIN Changes from original libcurl.m4: | ||
165 | # Give it a second shot using 'gnurl/curl.h' | ||
166 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnurl/curl.h>]],[[ | ||
167 | /* Try and use a few common options to force a failure if we are | ||
168 | missing symbols or can't link. */ | ||
169 | int x; | ||
170 | curl_easy_setopt(NULL,CURLOPT_URL,NULL); | ||
171 | x=CURL_ERROR_SIZE; | ||
172 | x=CURLOPT_WRITEFUNCTION; | ||
173 | x=CURLOPT_WRITEDATA; | ||
174 | x=CURLOPT_ERRORBUFFER; | ||
175 | x=CURLOPT_STDERR; | ||
176 | x=CURLOPT_VERBOSE; | ||
177 | if (x) {;} | ||
178 | ]])],libgnurl_cv_lib_gnurl_usable=yes,libgnurl_cv_lib_gnurl_usable=no) | ||
179 | # END Changes from original libcurl.m4 | ||
180 | |||
181 | CPPFLAGS=$_libgnurl_save_cppflags | ||
182 | LIBS=$_libgnurl_save_libs | ||
183 | unset _libgnurl_save_cppflags | ||
184 | unset _libgnurl_save_libs | ||
185 | ]) | ||
186 | |||
187 | if test $libgnurl_cv_lib_gnurl_usable = yes ; then | ||
188 | |||
189 | # Does curl_free() exist in this version of libgnurl? | ||
190 | # If not, fake it with free() | ||
191 | |||
192 | _libgnurl_save_cppflags=$CPPFLAGS | ||
193 | CPPFLAGS="$CPPFLAGS $LIBGNURL_CPPFLAGS" | ||
194 | _libgnurl_save_libs=$LIBS | ||
195 | LIBS="$LIBS $LIBGNURL" | ||
196 | |||
197 | AC_CHECK_FUNC(curl_free,, | ||
198 | AC_DEFINE(curl_free,free, | ||
199 | [Define curl_free() as free() if our version of gnurl lacks curl_free.])) | ||
200 | |||
201 | CPPFLAGS=$_libgnurl_save_cppflags | ||
202 | LIBS=$_libgnurl_save_libs | ||
203 | unset _libgnurl_save_cppflags | ||
204 | unset _libgnurl_save_libs | ||
205 | |||
206 | AC_DEFINE(HAVE_LIBGNURL,1, | ||
207 | [Define to 1 if you have a functional gnurl library.]) | ||
208 | AC_SUBST(LIBGNURL_CPPFLAGS) | ||
209 | AC_SUBST(LIBGNURL) | ||
210 | |||
211 | for _libgnurl_feature in $_libgnurl_features ; do | ||
212 | AC_DEFINE_UNQUOTED(AS_TR_CPP(libgnurl_feature_$_libgnurl_feature),[1]) | ||
213 | eval AS_TR_SH(libgnurl_feature_$_libgnurl_feature)=yes | ||
214 | done | ||
215 | |||
216 | if test "x$_libgnurl_protocols" = "x" ; then | ||
217 | |||
218 | # We don't have --protocols, so just assume that all | ||
219 | # protocols are available | ||
220 | _libgnurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP" | ||
221 | |||
222 | if test x$libgnurl_feature_SSL = xyes ; then | ||
223 | _libgnurl_protocols="$_libgnurl_protocols HTTPS" | ||
224 | |||
225 | # FTPS wasn't standards-compliant until version | ||
226 | # 7.11.0 (0x070b00 == 461568) | ||
227 | if test $_libgnurl_version -ge 461568; then | ||
228 | _libgnurl_protocols="$_libgnurl_protocols FTPS" | ||
229 | fi | ||
230 | fi | ||
231 | |||
232 | # RTSP, IMAP, POP3 and SMTP were added in | ||
233 | # 7.20.0 (0x071400 == 463872) | ||
234 | if test $_libgnurl_version -ge 463872; then | ||
235 | _libgnurl_protocols="$_libgnurl_protocols RTSP IMAP POP3 SMTP" | ||
236 | fi | ||
237 | fi | ||
238 | |||
239 | for _libgnurl_protocol in $_libgnurl_protocols ; do | ||
240 | AC_DEFINE_UNQUOTED(AS_TR_CPP(libgnurl_protocol_$_libgnurl_protocol),[1]) | ||
241 | eval AS_TR_SH(libgnurl_protocol_$_libgnurl_protocol)=yes | ||
242 | done | ||
243 | else | ||
244 | unset LIBGNURL | ||
245 | unset LIBGNURL_CPPFLAGS | ||
246 | fi | ||
247 | fi | ||
248 | |||
249 | unset _libgnurl_try_link | ||
250 | unset _libgnurl_version_parse | ||
251 | unset _libgnurl_config | ||
252 | unset _libgnurl_feature | ||
253 | unset _libgnurl_features | ||
254 | unset _libgnurl_protocol | ||
255 | unset _libgnurl_protocols | ||
256 | unset _libgnurl_version | ||
257 | unset _libgnurl_ldflags | ||
258 | fi | ||
259 | |||
260 | if test x$_libgnurl_with = xno || test x$libgnurl_cv_lib_gnurl_usable != xyes ; then | ||
261 | # This is the IF-NO path | ||
262 | ifelse([$4],,:,[$4]) | ||
263 | else | ||
264 | # This is the IF-YES path | ||
265 | ifelse([$3],,:,[$3]) | ||
266 | fi | ||
267 | |||
268 | unset _libgnurl_with | ||
269 | ])dnl | ||