initial load of upstream version 1.06.32
[xmlrpc-c] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT(include/xmlrpc-c/base.h)
4 AM_CONFIG_HEADER(xmlrpc_amconfig.h)
5
6 dnl =======================================================================
7 dnl Define PACKAGE, VERSION, @PACKAGE@, @VERSION@
8 dnl =======================================================================
9
10 dnl Increment the package version for each release.
11 AM_INIT_AUTOMAKE(xmlrpc-c, 1.06.32)
12
13 dnl This version number needs to be changed in several *different* tricky
14 dnl ways for each release. Please read the libtool documentation very
15 dnl closely before touching this or making a release!
16 VERSION_INFO="-version-info 7:0:6"
17 AC_SUBST(VERSION_INFO)
18
19 dnl Define @build@, @build_cpu@, @build_vendor@, @build_os,
20 dnl @host, @host_cpu@, @host_vender, and @host_os@ substitutions.
21 dnl "host" means the target system -- the one for which we are building.
22 dnl "build" means the system that will do the building.
23 AC_CANONICAL_HOST
24
25 dnl We need this to compensate for an incompatibility between autoconf
26 dnl and our libtool.  autoconf generates an invalid ltconfig command
27 dnl otherwise.
28 test -z "$target" && target=NONE
29
30 dnl =======================================================================
31 dnl Decide What To Build
32 dnl =======================================================================
33
34 FEATURE_LIST=
35
36 AC_ARG_ENABLE(wininet-client,
37   [  --disable-wininet-client  Don't build the Wininet client transport], , 
38 enable_wininet_client=maybe)
39
40 if test $enable_wininet_client = maybe; then
41   AC_CHECK_PROG(have_wininet_config, wininet-config, yes, no)
42   if test $have_wininet_config = no; then
43     AC_MSG_NOTICE([You don't appear to have Wininet installed (no working wininet-config in your command search path), so we will not build the Wininet client XML transport])
44     MUST_BUILD_WININET_CLIENT=no
45   else
46     MUST_BUILD_WININET_CLIENT=yes
47   fi
48 else
49   MUST_BUILD_WININET_CLIENT=$enable_wininet_client
50 fi
51
52 AC_MSG_CHECKING(whether to build Wininet client XML transport module)
53 AC_MSG_RESULT($MUST_BUILD_WININET_CLIENT)
54 AC_SUBST(MUST_BUILD_WININET_CLIENT)
55
56
57 AC_ARG_ENABLE(curl-client,
58   [  --disable-curl-client     Don't build the Curl client transport], , 
59 enable_curl_client=maybe)
60
61 if test $enable_curl_client = maybe; then
62   AC_CHECK_PROG(have_curl_config, curl-config, yes, no)
63   if test $have_curl_config = no; then
64     AC_MSG_NOTICE([You don't appear to have Curl installed (no working curl-config in your command search path), so we will not build the Curl client XML transport])
65     MUST_BUILD_CURL_CLIENT=no
66   else
67     MUST_BUILD_CURL_CLIENT=yes
68   fi
69 else
70   MUST_BUILD_CURL_CLIENT=$enable_curl_client
71 fi
72
73 AC_MSG_CHECKING(whether to build Curl client XML transport module)
74 AC_MSG_RESULT($MUST_BUILD_CURL_CLIENT)
75 AC_SUBST(MUST_BUILD_CURL_CLIENT)
76
77
78 AC_ARG_ENABLE(libwww-client,
79   [  --disable-libwww-client   Don't build the Libwww client transport], , 
80 enable_libwww_client=maybe)
81
82 if test $enable_libwww_client = maybe; then
83   AC_CHECK_PROG(have_libwww_config, libwww-config, yes, no)
84   if test $have_libwww_config = no; then
85     AC_MSG_NOTICE([You don't appear to have Libwww installed (no working libwww-config in your command search path), so we will not build the Libwww client XML transport])
86     MUST_BUILD_LIBWWW_CLIENT=no
87   else
88     MUST_BUILD_LIBWWW_CLIENT=yes
89   fi
90 else
91   MUST_BUILD_LIBWWW_CLIENT=$enable_libwww_client
92 fi
93
94 AC_MSG_CHECKING(whether to build Libwww client XML transport module)
95 AC_MSG_RESULT($MUST_BUILD_LIBWWW_CLIENT)
96 AC_SUBST(MUST_BUILD_LIBWWW_CLIENT)
97
98
99 if test "$MUST_BUILD_WININET_CLIENT $MUST_BUILD_CURL_CLIENT $MUST_BUILD_LIBWWW_CLIENT" = "no no no"; then
100   AC_MSG_NOTICE([We are not building any client XML transport, therefore we will not build the client library at all.])
101 fi
102
103
104 dnl Set up the appropriate Makefile substitutions.
105
106 LIBXMLRPC_CLIENT_LA=libxmlrpc_client.la
107 AC_SUBST(LIBXMLRPC_CLIENT_LA)
108 CLIENTTEST=clienttest
109 AC_SUBST(CLIENTTEST)
110 XMLRPC_CLIENT_H=xmlrpc_client.h
111 AC_SUBST(XMLRPC_CLIENT_H)
112 XMLRPC_TRANSPORT_H=xmlrpc_transport.h
113 AC_SUBST(XMLRPC_TRANSPORT_H)
114 SYNCH_CLIENT=synch_client
115 AC_SUBST(SYNCH_CLIENT)
116 ASYNCH_CLIENT=asynch_client
117 AC_SUBST(ASYNCH_CLIENT)
118 AUTH_CLIENT=auth_client
119 AC_SUBST(AUTH_CLIENT)
120 QUERY_MEERKAT=query-meerkat
121 AC_SUBST(QUERY_MEERKAT)
122
123 if test $MUST_BUILD_WININET_CLIENT = yes; then
124     FEATURE_LIST="wininet-client $FEATURE_LIST"
125 fi
126 if test $MUST_BUILD_CURL_CLIENT = yes; then
127     FEATURE_LIST="curl-client $FEATURE_LIST"
128 fi
129 if test $MUST_BUILD_LIBWWW_CLIENT = yes; then
130     FEATURE_LIST="libwww-client $FEATURE_LIST"
131 fi
132
133 dnl Check to see if we should build our Abyss server module.
134 AC_MSG_CHECKING(whether to build Abyss server module)
135 AC_ARG_ENABLE(abyss-server,
136   [  --disable-abyss-server    Don't build the Abyss server module], ,
137 enable_abyss_server=yes)
138 AC_MSG_RESULT($enable_abyss_server)
139 ENABLE_ABYSS_SERVER=$enable_abyss_server
140 AC_SUBST(ENABLE_ABYSS_SERVER)
141
142 dnl Set up the appropriate Makefile substitutions.
143 ABYSS_SUBDIR=
144 LIBXMLRPC_ABYSS_SERVER_LA=
145 SERVERTEST=
146 VALIDATEE=
147 XMLRPC_ABYSS_H=
148 SERVER=
149 if test x"$enable_abyss_server" != xno; then
150     FEATURE_LIST="abyss-server $FEATURE_LIST"
151     ABYSS_SUBDIR=abyss
152     LIBXMLRPC_ABYSS_SERVER_LA=libxmlrpc_abyss_server.la
153     SERVERTEST=servertest
154     VALIDATEE=validatee
155     XMLRPC_ABYSS_H=xmlrpc_abyss.h
156     SERVER=server
157 fi
158 AC_SUBST(ABYSS_SUBDIR)
159 AC_SUBST(LIBXMLRPC_ABYSS_SERVER_LA)
160 AC_SUBST(SERVERTEST)
161 AC_SUBST(VALIDATEE)
162 AC_SUBST(XMLRPC_ABYSS_H)
163 AC_SUBST(SERVER)
164
165 dnl Check to see if we should build our CGI server module.
166 AC_MSG_CHECKING(whether to build CGI server module)
167 AC_ARG_ENABLE(cgi-server,
168   [  --disable-cgi-server      Don't build the CGI server module], ,
169 enable_cgi_server=yes)
170 AC_MSG_RESULT($enable_cgi_server)
171 ENABLE_CGI_SERVER=$enable_cgi_server
172 AC_SUBST(ENABLE_CGI_SERVER)
173
174 dnl Check to see if we should build our C++ stuff.
175 AC_MSG_CHECKING(whether to build C++ wrappers and tools)
176 AC_ARG_ENABLE(cplusplus,
177   [  --disable-cplusplus       Don't build the C++ wrapper classes or tools], ,
178 enable_cplusplus=yes)
179 AC_MSG_RESULT($enable_cplusplus)
180 ENABLE_CPLUSPLUS=$enable_cplusplus
181 AC_SUBST(ENABLE_CPLUSPLUS)
182
183 dnl Set up the appropriate Makefile substitutions.
184 LIBXMLRPC_CPP_A=
185 CPPTEST=
186 XMLRPCCPP_H=
187 XML_RPC_API2CPP_SUBDIR=
188 MEERKAT_APP_LIST=
189 INTEROP_CLIENT_SUBDIR=
190 if test x"$enable_cplusplus" != xno; then
191     FEATURE_LIST="c++ $FEATURE_LIST"
192     LIBXMLRPC_CPP_A=libxmlrpc_cpp.a
193     CPPTEST=cpptest
194     XMLRPCCPP_H=XmlRpcCpp.h
195
196     if test $MUST_BUILD_LIBWWW_CLIENT = yes; then
197         XML_RPC_API2CPP_SUBDIR=xml-rpc-api2cpp
198     elif test $MUST_BUILD_CURL_CLIENT = yes; then
199         XML_RPC_API2CPP_SUBDIR=xml-rpc-api2cpp
200     fi
201 fi
202 AC_SUBST(LIBXMLRPC_CPP_A)
203 AC_SUBST(CPPTEST)
204 AC_SUBST(XMLRPCCPP_H)
205 AC_SUBST(XML_RPC_API2CPP_SUBDIR)
206
207
208 AC_SUBST(FEATURE_LIST)
209
210
211 dnl =======================================================================
212 dnl Checks for programs.
213 dnl =======================================================================
214
215 AC_PROG_CC
216 if test x"$enable_cplusplus" != xno; then
217     AC_PROG_CXX
218 fi
219
220
221 dnl =======================================================================
222 dnl Checks for libraries.
223 dnl =======================================================================
224
225 # Code by albert chin <china@thewrittenword.com> to check for various
226 # oddball networking libraries.  Solaris and some other operating systems
227 # hide their networking code in various places.  (Yes, this links too many
228 # of our libraries against -lsocket, but a finer-grained mechanism would
229 # require too much testing.)
230 AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
231
232 # Above sets LIBS, which is not all that useful because we don't want
233 # to include every library in every link.  It also sets
234 # ac_cv_lib_socket_socket, which we use to pass more specific information
235 # to the configuration files.
236
237 if test x"$ac_cv_lib_socket_socket" = xyes; then
238   LSOCKET=-lsocket
239 else
240   LSOCKET=
241 fi
242 AC_SUBST(LSOCKET)
243
244 # For some reason, we don't seem to need this on Solaris.  If you do
245 # need it, go ahead and try it.
246 # AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
247
248
249 dnl =======================================================================
250 dnl Checks for header files.
251 dnl =======================================================================
252
253 AC_STDC_HEADERS
254
255 dnl We don't use AM_CONFIG_HEADER to define HAVE_WCHAR_H, etc. because
256 dnl the following is more straightforward and easier to understand,
257 dnl especially for a newcomer.  Furthermore, AM_CONFIG_HEADER represents
258 dnl false as undefined, whereas our scheme represents it as 0.  undefined
259 dnl is a poor choice because it often means just that you neglected to
260 dnl choose a value for some reason.
261
262 dnl defines ac_cv_header_wchar_h, etc:
263 AC_CHECK_HEADERS(wchar.h)
264
265 if test x"$ac_cv_header_wchar_h" = xyes; then
266   HAVE_WCHAR_H_DEFINE=1
267 else
268   HAVE_WCHAR_H_DEFINE=0
269 fi
270 AC_SUBST(HAVE_WCHAR_H_DEFINE)
271
272 # Needed by Abyss on Solaris:
273
274 AC_CHECK_HEADERS(sys/filio.h)
275 if test x"$ac_cv_header_sys_filio_h" = xyes; then
276   HAVE_SYS_FILIO_H_DEFINE=1
277 else
278   HAVE_SYS_FILIO_H_DEFINE=0
279 fi
280 AC_SUBST(HAVE_SYS_FILIO_H_DEFINE)
281
282 # Needed by Abyss on Solaris:
283
284 AC_CHECK_HEADERS(sys/ioctl.h)
285 if test x"$ac_cv_header_sys_ioctl_h" = xyes; then
286   HAVE_SYS_IOCTL_H_DEFINE=1
287 else
288   HAVE_SYS_IOCTL_H_DEFINE=0
289 fi
290 AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE)
291
292
293 AC_CHECK_HEADERS(stdarg.h, , [
294 AC_MSG_ERROR(stdarg.h is required to build this library)
295 ])
296
297
298 dnl =======================================================================
299 dnl Checks for typedefs, structures, and compiler characteristics.
300 dnl =======================================================================
301
302 dnl AC_C_BIGENDIAN
303 AC_TYPE_SIZE_T
304
305 dnl This check is borrowed from Python 1.5.2.
306 va_list_is_array=no
307 AC_MSG_CHECKING(whether va_list is an array)
308 AC_TRY_COMPILE([
309 #include <stdarg.h>
310 ], [va_list list1, list2; list1 = list2;], , 
311 va_list_is_array=yes)
312 AC_MSG_RESULT($va_list_is_array)
313 if test x"$va_list_is_array" = xyes; then
314   VA_LIST_IS_ARRAY_DEFINE=1
315 else
316   VA_LIST_IS_ARRAY_DEFINE=0
317 fi
318 AC_SUBST(VA_LIST_IS_ARRAY_DEFINE)
319
320 AC_MSG_CHECKING(whether compiler has __attribute__)
321 AC_TRY_COMPILE(, [int x __attribute__((__unused__));],
322 compiler_has_attribute=yes,
323 compiler_has_attribute=no)
324 AC_MSG_RESULT($compiler_has_attribute)
325 if test x"$compiler_has_attribute" = xyes; then
326     ATTR_UNUSED="__attribute__((__unused__))"
327 else
328     ATTR_UNUSED=
329 fi
330 AC_SUBST(ATTR_UNUSED)
331
332
333 dnl =======================================================================
334 dnl Checks for library functions.
335 dnl =======================================================================
336
337 AC_CHECK_FUNC(vsnprintf, , [
338 AC_MSG_ERROR(your C library does not provide vsnprintf)
339 ])
340
341 dnl Unicode function needed by test suites.
342 AC_CHECK_FUNCS(wcsncmp)
343
344 dnl CygWin looks like Unix, but doesn't provide setgroups.
345 AC_CHECK_FUNCS(setgroups)
346
347 AC_CHECK_FUNCS(asprintf)
348
349 AC_CHECK_FUNCS(setenv)
350
351
352 dnl =======================================================================
353 dnl Checks for operating system features.
354 dnl =======================================================================
355
356 dnl Non-Unix systems will need to set up their platform configuration file
357 dnl by hand.
358 DIRECTORY_SEPARATOR="/"
359 AC_SUBST(DIRECTORY_SEPARATOR)
360
361
362 dnl =======================================================================
363 dnl ABYSS Configuration
364 dnl =======================================================================
365
366 AC_MSG_CHECKING(whether to use Abyss pthread function)
367 AC_ARG_ENABLE(abyss-threads,
368   [  --disable-abyss-threads   Use fork in Abyss instead of pthreads], ,
369   enable_abyss_threads=yes)
370 AC_MSG_RESULT($enable_abyss_threads)
371
372 ENABLE_ABYSS_THREADS=$enable_abyss_threads
373 AC_SUBST(ENABLE_ABYSS_THREADS)
374
375 if test x"$enable_abyss_threads" != xno; then
376     CFLAGS="$CFLAGS -D_THREAD"
377 fi
378
379
380 dnl =======================================================================
381 dnl Finding wininet stubs
382 dnl =======================================================================
383 dnl If you implement the parts of wininet.h the wininet_transport uses,
384 dnl you will need to configure this way..
385
386 if test $MUST_BUILD_WININET_CLIENT = yes; then
387
388     dnl You can control which of these gets chosen by fooling around with PATH.
389     AC_PATH_PROGS(WININET_CONFIG, wininet-xmlrpc-config wininet-config, no)
390     if test "x$WININET_CONFIG" = "xno"; then
391         AC_MSG_ERROR(wininet lib not found; see './configure --help')
392     fi
393
394     dnl Get our wininet version.
395     dnl Adapted from a macro which called gtk-config.
396     AC_MSG_CHECKING(for wininet version >= 1.0.0)
397     W3VER=`$WININET_CONFIG --version`
398     WININET_MAJOR=\
399 `echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
400     WININET_MINOR=\
401 `echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
402     WININET_MICRO=\
403 `echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
404     AC_MSG_RESULT($WININET_MAJOR.$WININET_MINOR.$WININET_MICRO)
405
406     dnl Check to make sure our version is OK.
407     WININET_VERSION_OK=yes
408     if test $WININET_MAJOR -lt 1; then
409         WININET_VERSION_OK=no
410     else
411         if test $WININET_MAJOR -eq 1 -a $WININET_MINOR -lt 0; then
412             WININET_VERSION_OK=no
413         else
414             if test $WININET_MAJOR -eq 1 -a $WININET_MINOR -eq 0 \
415                 -a $WININET_MICRO -lt 0; then
416                 WININET_VERSION_OK=no
417             fi
418         fi
419     fi
420     if test "x$WININET_VERSION_OK" = "xno"; then
421         AC_MSG_ERROR(wininet version >= 1.0.0 required)
422     fi
423
424     dnl Get the necessary CFLAGS, and merge them into our master list.
425     WININET_CFLAGS="`$WININET_CONFIG --cflags`"
426     AC_SUBST(WININET_CFLAGS)
427     CFLAGS="$CFLAGS $WININET_CFLAGS" 
428
429     dnl Get the huge list of libraries we need to link against.
430     WININET_LDADD="`$WININET_CONFIG --libs`"
431     AC_SUBST(WININET_LDADD)
432
433     dnl Oh, such massive brain damage! Because there may be another copy
434     dnl of libwww in the default dynamic loader search path, we need to
435     dnl adjust the search patch manually. Just gag me with a backquote, OK?
436     AC_MSG_CHECKING(for wininet library directory)
437     if $WININET_CONFIG --rpath-dir > /dev/null 2>&1; then
438        dnl Yay! We're using our smart version of wininet.
439        WININET_LIBDIR="`$WININET_CONFIG --rpath-dir`"
440     else
441        dnl Yawn. We're using the regular boring version.
442        WININET_LIBDIR="`$WININET_CONFIG --prefix`/lib"
443     fi
444     AC_MSG_RESULT($WININET_LIBDIR)
445     AC_SUBST(WININET_LIBDIR)
446     WININET_RPATH="-rpath $WININET_LIBDIR"
447     AC_SUBST(WININET_RPATH)
448     WININET_WL_RPATH="-Wl,--rpath -Wl,$WININET_LIBDIR"
449     AC_SUBST(WININET_WL_RPATH)
450
451 fi # MUST_BUILD_WININET_CLIENT
452
453 dnl =======================================================================
454 dnl Finding w3c-libwww
455 dnl =======================================================================
456 dnl Once upon a time, we used a patched copy of libwww that needed to
457 dnl co-exist with the system copy of libwww. We have some vestigal function
458 dnl for keeping track of libwww's rpath, although this is no longer really
459 dnl necessary.
460
461 if test $MUST_BUILD_LIBWWW_CLIENT = yes; then
462
463     dnl First of all, locate the semi-broken libwww config program.
464     dnl You can control which of these gets chosen by fooling around with PATH.
465     AC_PATH_PROGS(LIBWWW_CONFIG, libwww-xmlrpc-config libwww-config, no)
466     if test "x$LIBWWW_CONFIG" = "xno"; then
467         AC_MSG_ERROR(w3c-libwww not found; see './configure --help')
468     fi
469
470     dnl Get our libwww version.
471     dnl Adapted from a macro which called gtk-config.
472     AC_MSG_CHECKING(for w3c-libwww version >= 5.2.8)
473     W3VER=`$LIBWWW_CONFIG --version`
474     LIBWWW_MAJOR=\
475 `echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
476     LIBWWW_MINOR=\
477 `echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
478     LIBWWW_MICRO=\
479 `echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
480     AC_MSG_RESULT($LIBWWW_MAJOR.$LIBWWW_MINOR.$LIBWWW_MICRO)
481
482     dnl Check to make sure our version is OK.
483     LIBWWW_VERSION_OK=yes
484     if test $LIBWWW_MAJOR -lt 5; then
485         LIBWWW_VERSION_OK=no
486     else
487         if test $LIBWWW_MAJOR -eq 5 -a $LIBWWW_MINOR -lt 2; then
488             LIBWWW_VERSION_OK=no
489         else
490             if test $LIBWWW_MAJOR -eq 5 -a $LIBWWW_MINOR -eq 2 \
491                 -a $LIBWWW_MICRO -lt 8; then
492                 LIBWWW_VERSION_OK=no
493             fi
494         fi
495     fi
496     if test "x$LIBWWW_VERSION_OK" = "xno"; then
497         AC_MSG_ERROR(w3c-libwww version >= 5.2.8 required)
498     fi
499
500     dnl Get the huge list of libraries we need to link against.
501     LIBWWW_LDADD="`$LIBWWW_CONFIG --libs`"
502     AC_SUBST(LIBWWW_LDADD)
503
504     dnl Oh, such massive brain damage! Because there may be another copy
505     dnl of libwww in the default dynamic loader search path, we need to
506     dnl adjust the search patch manually. Just gag me with a backquote, OK?
507     AC_MSG_CHECKING(for libwww library directory)
508     if $LIBWWW_CONFIG --rpath-dir > /dev/null 2>&1; then
509        dnl Yay! We're using our smart version of libwww.
510        LIBWWW_LIBDIR="`$LIBWWW_CONFIG --rpath-dir`"
511     else
512        dnl Yawn. We're using the regular boring version.
513        LIBWWW_LIBDIR="`$LIBWWW_CONFIG --prefix`/lib"
514     fi
515     AC_MSG_RESULT($LIBWWW_LIBDIR)
516     AC_SUBST(LIBWWW_LIBDIR)
517
518     # Some ancient rpath stuff, now disabled.  I turned this off because it
519     # breaks Debian (and Mandrake?) policy, and we don't use it anymore.
520     # If you have multiple copies of w3c-libwww lying around, you can turn
521     # it back on.
522     #LIBWWW_RPATH="-rpath $LIBWWW_LIBDIR"
523     LIBWWW_RPATH=""
524     AC_SUBST(LIBWWW_RPATH)
525     #LIBWWW_WL_RPATH="-Wl,--rpath -Wl,$LIBWWW_LIBDIR"
526     LIBWWW_WL_RPATH=""
527     AC_SUBST(LIBWWW_WL_RPATH)
528
529 fi # MUST_BUILD_LIBWWW_CLIENT
530
531
532 dnl =======================================================================
533 dnl Finding cURL
534 dnl =======================================================================
535
536 if test $MUST_BUILD_CURL_CLIENT = yes; then
537
538     dnl First of all, locate the curl config program.
539     dnl You can control which of these gets chosen by fooling around with PATH.
540     AC_PATH_PROGS(CURL_CONFIG, curl-xmlrpc-config curl-config, no)
541     if test "x$CURL_CONFIG" = "xno"; then
542         AC_MSG_ERROR(cURL not found; see './configure --help')
543     fi
544     
545     dnl There used to be code here to check the Curl version and make sure
546     dnl it is at least 7.8.  But there were bugs both in the code and in 
547     dnl curl (curl-config --vernum, at least in older versios of Curl,
548     dnl omits the leading zero).  So it didn't work.  Plus, checking version
549     dnl numbers isn't a good idea.  Better to check for feature presence.
550     dnl So we don't do any check now.  If we find out there's a problem with
551     dnl older Curls, we will revisit that.
552
553     dnl Get the huge list of libraries we need to link against.
554     dnl MRB-20010516-For some reason, curl-config
555     dnl does not list itself '-lcurl'.  2004.12.12.  It seems to do so
556     dnl now.
557     CURL_LDADD=`$CURL_CONFIG --libs`
558     AC_SUBST(CURL_LDADD)
559
560     dnl Oh, such massive brain damage! Because there may be another copy
561     dnl of curl in the default dynamic loader search path, we need to
562     dnl adjust the search patch manually. Just gag me with a backquote, OK?
563     AC_MSG_CHECKING(for curl library directory)
564     dnl Yawn. We're using the regular boring version.
565     CURL_LIBDIR="`$CURL_CONFIG --prefix`/lib"
566
567     AC_MSG_RESULT($CURL_LIBDIR)
568     AC_SUBST(CURL_LIBDIR)
569     CURL_RPATH="-rpath $CURL_LIBDIR"
570     AC_SUBST(CURL_RPATH)
571     CURL_WL_RPATH="-Wl,--rpath -Wl,$CURL_LIBDIR"
572     AC_SUBST(CURL_WL_RPATH)
573
574 fi # MUST_BUILD_CURL_CLIENT
575
576
577 dnl =======================================================================
578 dnl Checks for build options.
579 dnl =======================================================================
580
581 AC_ARG_WITH(libwww-ssl,
582   [  --with-libwww-ssl       Include libwww SSL capability.]
583    ) 
584
585 if test x"$enable_libwww_client" != xno; then
586     AC_MSG_CHECKING(whether to use SSL with libwww)
587     if test x"$with_libwww_ssl" = xyes; then
588         AC_MSG_RESULT(yes)
589         HAVE_LIBWWW_SSL_DEFINE=1
590     else
591         AC_MSG_RESULT(no)
592         HAVE_LIBWWW_SSL_DEFINE=0
593     fi
594 fi
595 AC_SUBST(HAVE_LIBWWW_SSL_DEFINE)
596
597 dnl Check to see if we should build the libxml2 backend.
598 AC_ARG_ENABLE(libxml2-backend,
599   [  --enable-libxml2-backend  Use libxml2 instead of built-in expat], ,
600 enable_libxml2_backend=no)
601 AC_MSG_CHECKING(whether to build the libxml2 backend)
602 AC_MSG_RESULT($enable_libxml2_backend)
603
604 if test $enable_libxml2_backend = yes; then
605   AC_CHECK_PROG(have_xml2_config, xml2-config, yes, no)
606   if test $have_xml2_config = no; then
607     AC_MSG_ERROR([You specified --enable-libxml2_backend, but don't appear to have libxml2 installed (no working xml2-config inyour command search path), so we cannot not build for libxml2])
608   fi
609 fi
610 ENABLE_LIBXML2_BACKEND=$enable_libxml2_backend
611 AC_SUBST(ENABLE_LIBXML2_BACKEND)
612
613 dnl =======================================================================
614 dnl Compiler information
615 dnl =======================================================================
616 C_COMPILER_GNU=$ac_cv_c_compiler_gnu
617 AC_SUBST(C_COMPILER_GNU)
618 CXX_COMPILER_GNU=$ac_cv_cxx_compiler_gnu
619 AC_SUBST(CXX_COMPILER_GNU)
620
621 dnl obsolete variables, need to be removed from Makefile.in:
622 CC_WARN_FLAGS=
623 AC_SUBST(CC_WARN_FLAGS)
624 CPP_WARN_FLAGS=
625 AC_SUBST(CPP_WARN_FLAGS)
626
627
628 BUILDDIR=`pwd`
629 AC_SUBST(BUILDDIR)
630
631 dnl =======================================================================
632 dnl Libtool
633 dnl =======================================================================
634 AM_PROG_LIBTOOL
635
636
637 dnl =======================================================================
638 dnl Output our results.
639 dnl =======================================================================
640
641 dnl Note that AM_CONFIG_HEADER at the top of this file outputs another
642 dnl result: xmlrpc_amconfig.h .
643
644 AC_OUTPUT(xmlrpc-c-config \
645           xmlrpc-c-config.test \
646           Makefile.config \
647           xmlrpc_config.h \
648           )
649 chmod +x xmlrpc-c-config
650 chmod +x xmlrpc-c-config.test