blob: 9235e3428c1090762872d1ac8e81a6fcb1f2f0fa [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
Owen Taylor3473f882001-02-23 17:55:21 +00002AC_INIT(entities.c)
Daniel Veillard01791d51998-07-24 19:24:09 +00003AM_CONFIG_HEADER(config.h)
Daniel Veillardd2ade932000-09-30 14:39:55 +00004AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00005
Daniel Veillardcf461992000-03-14 18:30:20 +00006LIBXML_MAJOR_VERSION=2
Daniel Veillard4fc52812003-09-01 20:33:13 +00007LIBXML_MINOR_VERSION=6
Daniel Veillardc3d7cb42004-11-10 14:34:45 +00008LIBXML_MICRO_VERSION=16
Daniel Veillard3e35f8e2003-10-21 00:05:38 +00009LIBXML_MICRO_VERSION_SUFFIX=
Daniel Veillard4fc52812003-09-01 20:33:13 +000010LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
Daniel Veillard14fff061999-06-22 21:49:07 +000011LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
12
Daniel Veillard361d8452000-04-03 19:48:13 +000013LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
14
William M. Brackf4025492004-08-18 21:08:46 +000015if test -f CVS/Entries; then
Daniel Veillarddab93ea2004-08-20 16:47:10 +000016 extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
17 echo extra=$extra
18 if test "$extra" != ""
19 then
20 LIBXML_VERSION_EXTRA="-CVS$extra"
21 fi
William M. Brackf4025492004-08-18 21:08:46 +000022fi
Daniel Veillard14fff061999-06-22 21:49:07 +000023AC_SUBST(LIBXML_MAJOR_VERSION)
24AC_SUBST(LIBXML_MINOR_VERSION)
25AC_SUBST(LIBXML_MICRO_VERSION)
26AC_SUBST(LIBXML_VERSION)
27AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000028AC_SUBST(LIBXML_VERSION_NUMBER)
William M. Brackf4025492004-08-18 21:08:46 +000029AC_SUBST(LIBXML_VERSION_EXTRA)
Daniel Veillard14fff061999-06-22 21:49:07 +000030
Daniel Veillard361d8452000-04-03 19:48:13 +000031VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000032
Daniel Veillardedfb29b2000-03-14 19:59:05 +000033AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000034
Daniel Veillard01791d51998-07-24 19:24:09 +000035dnl Checks for programs.
36AC_PROG_CC
37AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000038AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000039AC_PATH_PROG(RM, rm, /bin/rm)
40AC_PATH_PROG(MV, mv, /bin/mv)
41AC_PATH_PROG(TAR, tar, /bin/tar)
William M. Brack1826d0a2004-07-21 09:03:57 +000042AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard8b817da2004-09-30 09:19:33 +000043AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
Daniel Veillard06500c82004-09-07 09:12:44 +000044AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
Daniel Veillard01791d51998-07-24 19:24:09 +000045
Daniel Veillard03109292000-08-14 14:58:22 +000046dnl Make sure we have an ANSI compiler
47AM_C_PROTOTYPES
48test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
49
Daniel Veillard6984e6d2003-12-09 14:20:17 +000050AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000051AM_PROG_LIBTOOL
52
Daniel Veillardd8cf9062003-11-11 21:12:36 +000053# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000054
Daniel Veillard4432df22003-09-28 18:58:27 +000055dnl
William M. Brack21e4ef22005-01-02 09:53:13 +000056dnl We process the AC_ARG_WITH first so that later we can modify
57dnl some of them to try to prevent impossible combinations. This
58dnl also allows up so alphabetize the choices
Daniel Veillard4432df22003-09-28 18:58:27 +000059dnl
Daniel Veillard4432df22003-09-28 18:58:27 +000060
William M. Brack21e4ef22005-01-02 09:53:13 +000061dnl
62dnl zlib option might change flags, so we save them initially
63dnl
Owen Taylor3473f882001-02-23 17:55:21 +000064_cppflags="${CPPFLAGS}"
65_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000066
William M. Brack21e4ef22005-01-02 09:53:13 +000067AC_ARG_WITH(c14n,
68[ --with-c14n add the Canonicalization support (on)])
69AC_ARG_WITH(catalog,
70[ --with-catalog add the Catalog support (on)])
71AC_ARG_WITH(debug,
72[ --with-debug add the debugging module (on)])
73AC_ARG_WITH(docbook,
74[ --with-docbook add Docbook SGML support (on)])
75AC_ARG_WITH(fexceptions,
76[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
77AC_ARG_WITH(ftp,
78[ --with-ftp add the FTP support (on)])
79AC_ARG_WITH(history,
80[ --with-history add history support to xmllint shell(off)])
81AC_ARG_WITH(html,
82[ --with-html add the HTML support (on)])
83dnl Specific dir for HTML output ?
84AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
85 [path to base html directory, default $datadir/doc/html]),
86 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
Daniel Veillard259ff742001-10-06 13:49:59 +000087
William M. Brack21e4ef22005-01-02 09:53:13 +000088AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
89 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
90 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
91 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
92AC_SUBST(HTML_DIR)
93AC_ARG_WITH(http,
94[ --with-http add the HTTP support (on)])
95AC_ARG_WITH(iconv,
96[ --with-iconv[[=DIR]] add ICONV support (on)])
97AC_ARG_WITH(iso8859x,
98[ --with-iso8859x add ISO8859X support if no iconv (on)])
99AC_ARG_WITH(legacy,
100[ --with-legacy add deprecated APIs for compatibility (on)])
101AC_ARG_WITH(mem_debug,
102[ --with-mem-debug add the memory debugging module (off)])
103AC_ARG_WITH(minimum,
104[ --with-minimum build a minimally sized library (off)])
105AC_ARG_WITH(output,
106[ --with-output add the serialization support (on)])
107AC_ARG_WITH(pattern,
108[ --with-pattern add the xmlPattern selection interface (on)])
109AC_ARG_WITH(push,
110[ --with-push add the PUSH parser interfaces (on)])
111AC_ARG_WITH(python,
112[ --with-python[[=DIR]] build Python bindings if found])
113AC_ARG_WITH(reader,
114[ --with-reader add the xmlReader parsing interface (on)])
115AC_ARG_WITH(readline,
116[ --with-readline=DIR use readline in DIR],[
117 if test "$withval" != "no" -a "$withval" != "yes"; then
118 RDL_DIR=$withval
119 CPPFLAGS="${CPPFLAGS} -I$withval/include"
120 LDFLAGS="${LDFLAGS} -L$withval/lib"
121 fi
122])
123AC_ARG_WITH(regexps,
124[ --with-regexps add Regular Expressions support (on)])
125AC_ARG_WITH(run_debug,
126[ --with-run-debug add the runtime debugging module (off)])
127AC_ARG_WITH(sax1,
128[ --with-sax1 add the older SAX1 interface (on)])
129AC_ARG_WITH(schemas,
130[ --with-schemas add Relax-NG and experimental Schemas support (on)])
131AC_ARG_WITH(threads,
132[ --with-threads add multithread support(on)])
133AC_ARG_WITH(thread-alloc,
134[ --with-thread-alloc add per-thread memory(off)])
135AC_ARG_WITH(tree,
136[ --with-tree add the DOM like tree manipulation APIs (on)])
137AC_ARG_WITH(valid,
138[ --with-valid add the DTD validation support (on)])
139AC_ARG_WITH(writer,
140[ --with-writer add the xmlWriter saving interface (on)])
141AC_ARG_WITH(xinclude,
142[ --with-xinclude add the XInclude support (on)])
143AC_ARG_WITH(xpath,
144[ --with-xpath add the XPATH support (on)])
145AC_ARG_WITH(xptr,
146[ --with-xptr add the XPointer support (on)])
Owen Taylor3473f882001-02-23 17:55:21 +0000147AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +0000148[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +0000149 if test "$withval" != "no" -a "$withval" != "yes"; then
150 Z_DIR=$withval
151 CPPFLAGS="${CPPFLAGS} -I$withval/include"
152 LDFLAGS="${LDFLAGS} -L$withval/lib"
153 fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000154])
William M. Brack21e4ef22005-01-02 09:53:13 +0000155
156dnl
157dnl option to build a minimal libxml2 library
158dnl
159if test "$with_minimum" = "yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000160then
William M. Brack21e4ef22005-01-02 09:53:13 +0000161 echo "Configuring for a minimal library"
162 if test "$with_c14n" = ""
163 then
164 with_c14n=no
165 fi
166 if test "$with_catalog" = ""
167 then
168 with_catalog=no
169 fi
170 echo So far so good!
171 if test "$with_debug" = ""
172 then
173 with_debug=no
174 fi
175 if test "$with_docbook" = ""
176 then
177 with_docbook=no
178 fi
179 if test "$with_fexceptions" = ""
180 then
181 with_fexceptions=no
182 fi
183 if test "$with_ftp" = ""
184 then
185 with_ftp=no
186 fi
187 if test "$with_history" = ""
188 then
189 with_history=no
190 fi
191 if test "$with_html" = ""
192 then
193 with_html=no
194 fi
195 if test "$with_http" = ""
196 then
197 with_http=no
198 fi
199 if test "$with_iconv" = ""
200 then
201 with_iconv=no
202 fi
203 if test "$with_iso8859x" = ""
204 then
205 with_iso8859x=no
206 fi
207 if test "$with_legacy" = ""
208 then
209 with_legacy=no
210 fi
211 if test "$with_mem_debug" = ""
212 then
213 with_mem_debug=no
214 fi
215 if test "$with_output" = ""
216 then
217 with_output=no
218 fi
219 if test "$with_pattern" = ""
220 then
221 with_pattern=no
222 fi
223 if test "$with_push" = ""
224 then
225 with_push=no
226 fi
227 if test "$with_python" = ""
228 then
229 with_python=no
230 fi
231 if test "$with_reader" = ""
232 then
233 with_reader=no
234 fi
235 if test "$with_readline" = ""
236 then
237 with_readline=no
238 fi
239 if test "$with_regexp" = ""
240 then
241 with_regexp=no
242 fi
243 if test "$with_run_debug" = ""
244 then
245 with_run_debug=no
246 fi
247 if test "$with_sax1" = ""
248 then
249 with_sax1=no
250 fi
251 if test "$with_schemas" = ""
252 then
253 with_schemas=no
254 fi
255 if test "$with_threads" = ""
256 then
257 with_threads=no
258 fi
259 if test "$with_thread_alloc" = ""
260 then
261 with_thread_alloc=no
262 fi
263 if test "$with_tree" = ""
264 then
265 with_tree=no
266 fi
267 if test "$with_valid" = ""
268 then
269 with_valid=no
270 fi
271 if test "$with_writer" = ""
272 then
273 with_writer=no
274 fi
275 if test "$with_xinclude" = ""
276 then
277 with_xinclude=no
278 fi
279 if test "$with_xpath" = ""
280 then
281 with_xpath=no
282 fi
283 if test "$with_xptr" = ""
284 then
285 with_xptr=no
286 fi
287 if test "$with_zlib" = ""
288 then
289 with_zlib=no
290 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000291fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000292
293echo Checking zlib
294
295dnl Checks for zlib library.
296
Daniel Veillard259ff742001-10-06 13:49:59 +0000297if test "$with_zlib" = "no"; then
298 echo "Disabling compression support"
299else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000300 AC_CHECK_HEADERS(zlib.h,
301 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +0000302 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000303 if test "x${Z_DIR}" != "x"; then
304 Z_CFLAGS="-I${Z_DIR}/include"
305 Z_LIBS="-L${Z_DIR}/lib -lz"
306 [case ${host} in
307 *-*-solaris*)
308 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
309 ;;
310 esac]
311 else
312 Z_LIBS="-lz"
313 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +0000314fi
Owen Taylor3473f882001-02-23 17:55:21 +0000315
Owen Taylor3473f882001-02-23 17:55:21 +0000316AC_SUBST(Z_CFLAGS)
317AC_SUBST(Z_LIBS)
318
319CPPFLAGS=${_cppflags}
320LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000321
William M. Brack21e4ef22005-01-02 09:53:13 +0000322echo Checking headers
323
Daniel Veillard01791d51998-07-24 19:24:09 +0000324dnl Checks for header files.
325AC_HEADER_DIRENT
326AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000327AC_CHECK_HEADERS([fcntl.h])
328AC_CHECK_HEADERS([unistd.h])
329AC_CHECK_HEADERS([ctype.h])
330AC_CHECK_HEADERS([dirent.h])
331AC_CHECK_HEADERS([errno.h])
332AC_CHECK_HEADERS([malloc.h])
333AC_CHECK_HEADERS([stdarg.h])
334AC_CHECK_HEADERS([sys/stat.h])
335AC_CHECK_HEADERS([sys/types.h])
336AC_CHECK_HEADERS([time.h])
337AC_CHECK_HEADERS([ansidecl.h])
338AC_CHECK_HEADERS([ieeefp.h])
339AC_CHECK_HEADERS([nan.h])
340AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000341AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000342AC_CHECK_HEADERS([fp_class.h])
343AC_CHECK_HEADERS([float.h])
344AC_CHECK_HEADERS([stdlib.h])
345AC_CHECK_HEADERS([sys/socket.h], [], [],
346[#if HAVE_SYS_TYPES_H
347# include <sys/types.h>
348# endif
349])
350AC_CHECK_HEADERS([netinet/in.h], [], [],
351[#if HAVE_SYS_TYPES_H
352# include <sys/types.h>
353# endif
354])
355AC_CHECK_HEADERS([arpa/inet.h], [], [],
356[#if HAVE_SYS_TYPES_H
357# include <sys/types.h>
358# endif
359#if HAVE_ARPA_INET_H
360# include <arpa/inet.h>
361# endif
362])
363AC_CHECK_HEADERS([netdb.h])
364AC_CHECK_HEADERS([sys/time.h])
365AC_CHECK_HEADERS([sys/select.h])
366AC_CHECK_HEADERS([sys/mman.h])
367AC_CHECK_HEADERS([sys/timeb.h])
368AC_CHECK_HEADERS([signal.h])
369AC_CHECK_HEADERS([arpa/nameser.h], [], [],
370[#if HAVE_SYS_TYPES_H
371# include <sys/types.h>
372# endif
373])
374AC_CHECK_HEADERS([resolv.h], [], [],
375[#if HAVE_SYS_TYPES_H
376# include <sys/types.h>
377# endif
378#if HAVE_NETINET_IN_H
379# include <netinet/in.h>
380# endif
381#if HAVE_ARPA_NAMESER_H
382# include <arpa/nameser.h>
383# endif
384])
Daniel Veillard01791d51998-07-24 19:24:09 +0000385
Daniel Veillardfc979062004-03-04 22:07:16 +0000386
William M. Brack21e4ef22005-01-02 09:53:13 +0000387echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000388
Daniel Veillard01791d51998-07-24 19:24:09 +0000389dnl Checks for library functions.
390AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000391AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000392AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000393AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000394AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000395
Daniel Veillard92ad2102001-03-27 12:47:33 +0000396dnl Checking the standard string functions availability
397AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
398 NEED_TRIO=1)
399
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000400dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000401AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
402AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000403AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(net, setsockopt))
Daniel Veillard71b656e2000-01-05 14:46:17 +0000404AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000405
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000406dnl Determine what socket length (socklen_t) data type is
407AC_MSG_CHECKING([for type of socket length (socklen_t)])
408AC_TRY_COMPILE2([
409#include <stddef.h>
410#include <sys/types.h>
411#include <sys/socket.h>],[
412(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
413 AC_MSG_RESULT(socklen_t *)
414 SOCKLEN_T=socklen_t],[
415 AC_TRY_COMPILE2([
416#include <stddef.h>
417#include <sys/types.h>
418#include <sys/socket.h>],[
419(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
420 AC_MSG_RESULT(size_t *)
421 SOCKLEN_T=size_t],[
422 AC_TRY_COMPILE2([
423#include <stddef.h>
424#include <sys/types.h>
425#include <sys/socket.h>],[
426(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
427 AC_MSG_RESULT(int *)
428 SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000429 AC_MSG_WARN(could not determine)
Daniel Veillardc7e3cc42004-09-28 12:33:52 +0000430 SOCKLEN_T="int"])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000431AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000432
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000433dnl ***********************Checking for availability of IPv6*******************
434
435AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000436AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000437if test "$with_minimum" = "yes"
438then
439 enable_ipv6=no
440fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000441if test $enable_ipv6 = yes; then
442 have_ipv6=no
443 AC_TRY_COMPILE([
444 #include <sys/socket.h>
445 #include <sys/types.h>], [
446 struct sockaddr_storage ss;
447 socket(AF_INET6, SOCK_STREAM, 0)
448 ],
449 have_ipv6=yes,
450 have_ipv6=no
451 )
452 AC_MSG_RESULT($have_ipv6)
453
William M. Brack476cd962003-08-13 11:09:42 +0000454 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000455 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000456 have_broken_ss_family=no
457
458 dnl *********************************************************************
459 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
460 dnl a ss_family member, but rather __ss_family. Let's detect that
461 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these platforms.
462 dnl ********************************************************************
463 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
464 AC_TRY_COMPILE([
465 #include <sys/socket.h>
466 #include <sys/types.h>], [
467 struct sockaddr_storage ss ;
468 ss.__ss_family = 0 ;
469 ],
470 have_broken_ss_family=yes,
471 have_broken_ss_family=no
472 )
473 AC_MSG_RESULT($have_broken_ss_family)
474 if test x$have_broken_ss_family = xyes ; then
475 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [], [Whether struct sockaddr::__ss_family exists])
476 AC_DEFINE(ss_family, __ss_family, [ss_family is not defined here, use __ss_family instead])
477 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000478
479 have_getaddrinfo=no
480 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
481 if test $have_getaddrinfo != yes; then
482 for lib in bsd socket inet; do
483 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
484 done
485 fi
486
William M. Brack476cd962003-08-13 11:09:42 +0000487 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000488 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000489 fi
490 fi
491fi
492
493dnl ******************************End IPv6 checks******************************
494
Daniel Veillardb05deb71999-08-10 19:04:08 +0000495dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000496AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000497 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000498
Daniel Veillardc790bf42003-10-11 10:50:10 +0000499AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
500 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000501
502XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000503XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000504
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000505dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000506dnl Extra flags
507dnl
508XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000509RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000510
511dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000512dnl Workaround for native compilers
513dnl HP : http://bugs.gnome.org/db/31/3163.html
514dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000515dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000516if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000517 case "${host}" in
518 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000519 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000520 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000521 *-dec-osf* )
522 CFLAGS="${CFLAGS} -ieee"
523 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000524 alpha*-*-linux* )
525 CFLAGS="${CFLAGS} -ieee"
526 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000527 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000528else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000529 if test "$with_fexceptions" = "yes"
530 then
531 #
532 # Not activated by default because this inflates the code size
533 # Used to allow propagation of C++ exceptions through the library
534 #
535 CFLAGS="${CFLAGS} -fexceptions"
536 fi
537
Daniel Veillard05f97352004-10-31 15:35:32 +0000538 CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
Daniel Veillard14839d52001-06-06 16:11:56 +0000539 case "${host}" in
540 alpha*-*-linux* )
541 CFLAGS="${CFLAGS} -mieee"
542 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000543 alpha*-*-osf* )
544 CFLAGS="${CFLAGS} -mieee"
545 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000546 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000547fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000548case ${host} in
549 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000550 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
551 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000552 hppa*-hp-mpeix)
553 NEED_TRIO=1
554 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000555esac
556
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000557
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000558dnl
559dnl check for python
560dnl
561
562PYTHON=
563PYTHON_VERSION=
564PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000565PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000566PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000567pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000568if test "$with_python" != "no" ; then
569 if test -x "$with_python/bin/python"
570 then
571 echo Found python in $with_python/bin/python
572 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000573 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000574 if test -x "$with_python"
575 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000576 echo Found python in $with_python
577 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000578 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000579 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000580 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000581 fi
582 if test "$PYTHON" != ""
583 then
584 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
585 echo Found Python version $PYTHON_VERSION
586 fi
587 if test "$PYTHON_VERSION" != ""
588 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000589 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
590 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000591 then
592 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000593 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000594 else
595 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
596 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000597 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000598 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000599 else
600 if test -r /usr/include/python$PYTHON_VERSION/Python.h
601 then
602 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000603 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000604 else
605 echo could not find python$PYTHON_VERSION/Python.h
606 fi
607 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000608 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000609 then
610 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
611 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000612 fi
613 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000614 if test "$with_python" != ""
615 then
616 pythondir='$(PYTHON_SITE_PACKAGES)'
617 else
618 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
619 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000620fi
621AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000622if test "$PYTHON_INCLUDES" != ""
623then
624 PYTHON_SUBDIR=python
625else
626 PYTHON_SUBDIR=
627fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000628AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000629AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000630
Daniel Veillard437b87b2000-01-03 17:30:46 +0000631dnl
632dnl Tester makes use of readline if present
633dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000634
Daniel Veillard361d8452000-04-03 19:48:13 +0000635dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000636dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000637dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000638dnl
William M. Brack871611b2003-10-18 04:53:14 +0000639if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000640 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000641 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
William M. Brack4119d1c2004-06-24 02:24:44 +0000642 [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000643 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000644 if test "$with_minimum" != "yes"
645 then
646 if test "${with_mem_debug}" = "" ; then
647 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000648 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000649 fi
650 if test "${with_docbook}" = "" ; then
651 with_docbook="yes"
652 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000653 fi
Daniel Veillardeff45a92004-10-29 12:10:55 +0000654 if test "${CC}" = "gcc" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000655 CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
Daniel Veillardeff45a92004-10-29 12:10:55 +0000656 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000657 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000658dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000659else
660 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000661fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000662AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000663
664dnl
665dnl Check for trio string functions
666dnl
667
668if test "${NEED_TRIO}" = "1" ; then
669 echo Adding trio library for string functions
670 WITH_TRIO=1
671else
672 WITH_TRIO=0
673fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000674AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000675AC_SUBST(WITH_TRIO)
676
Daniel Veillardf6eea272001-01-18 12:17:12 +0000677dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000678dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000679dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000680echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000681
William M. Brack21e4ef22005-01-02 09:53:13 +0000682dnl
683dnl Thread-related stuff
684dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000685THREAD_LIBS=""
686WITH_THREADS=0
687THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000688TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000689THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000690
Daniel Veillard84942712003-04-18 14:40:05 +0000691if test "$with_threads" = "no" ; then
692 echo Disabling multithreaded support
693else
Daniel Veillardb8478642001-10-12 17:29:10 +0000694 echo Enabling multithreaded support
695
696 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000697 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000698 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000699 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
700 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000701 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000702 case $host_os in
703 *mingw32*) WITH_THREADS="1"
704 THREADS_W32="Win32"
705 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
706 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000707 *beos*) WITH_THREADS="1"
708 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
709 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000710 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000711 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000712 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
713 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000714 fi
715fi
William M. Brack306e33c2004-06-12 01:01:22 +0000716if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000717 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000718fi
719
Daniel Veillardb8478642001-10-12 17:29:10 +0000720AC_SUBST(THREAD_LIBS)
721AC_SUBST(WITH_THREADS)
722AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000723AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000724AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000725
William M. Brack21e4ef22005-01-02 09:53:13 +0000726dnl
727dnl xmllint shell history
728dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000729if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000730 echo Enabling xmllint shell history
731 dnl check for terminal library. this is a very cool solution
732 dnl from octave's configure.in
733 unset tcap
734 for termlib in ncurses curses termcap terminfo termlib; do
735 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
736 test -n "$tcap" && break
737 done
738
739 AC_CHECK_HEADER(readline/history.h,
740 AC_CHECK_LIB(history, append_history,[
741 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000742 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000743 AC_CHECK_HEADER(readline/readline.h,
744 AC_CHECK_LIB(readline, readline,[
745 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000746 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000747 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
748 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
749 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000750 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000751fi
752
William M. Brack21e4ef22005-01-02 09:53:13 +0000753dnl
754dnl Tree functions
755dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000756if test "$with_tree" = "no" ; then
757 echo Disabling DOM like tree manipulation APIs
758 WITH_TREE=0
759else
760 WITH_TREE=1
761fi
762AC_SUBST(WITH_TREE)
763
Daniel Veillard361d8452000-04-03 19:48:13 +0000764if test "$with_ftp" = "no" ; then
765 echo Disabling FTP support
766 WITH_FTP=0
767 FTP_OBJ=
768else
769 WITH_FTP=1
770 FTP_OBJ=nanoftp.o
771fi
772AC_SUBST(WITH_FTP)
773AC_SUBST(FTP_OBJ)
774
Daniel Veillard361d8452000-04-03 19:48:13 +0000775if test "$with_http" = "no" ; then
776 echo Disabling HTTP support
777 WITH_HTTP=0
778 HTTP_OBJ=
779else
780 WITH_HTTP=1
781 HTTP_OBJ=nanohttp.o
782fi
783AC_SUBST(WITH_HTTP)
784AC_SUBST(HTTP_OBJ)
785
Daniel Veillard4432df22003-09-28 18:58:27 +0000786if test "$with_legacy" = "no" ; then
787 echo Disabling deprecated APIs
788 WITH_LEGACY=0
789else
790 WITH_LEGACY=1
791fi
792AC_SUBST(WITH_LEGACY)
793
Daniel Veillard81273902003-09-30 00:43:48 +0000794if test "$with_reader" = "no" ; then
795 echo Disabling the xmlReader parsing interface
796 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000797 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000798else
799 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000800 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +0000801 if test "$with_push" = "no" ; then
802 echo xmlReader requires Push interface - enabling it
803 with_push=yes
804 fi
Daniel Veillard81273902003-09-30 00:43:48 +0000805fi
806AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000807AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000808
William M. Brack21e4ef22005-01-02 09:53:13 +0000809if test "$with_writer" = "no" ; then
810 echo Disabling the xmlWriter saving interface
811 WITH_WRITER=0
812# WRITER_TEST=
813else
814 WITH_WRITER=1
815# WRITER_TEST=Writertests
816 if test "$with_push" = "no" ; then
817 echo xmlWriter requires Push interface - enabling it
818 with_push=yes
819 fi
820 if test "$with_output" = "no" ; then
821 echo xmlWriter requires Output interface - enabling it
822 with_output=yes
823 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000824fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000825AC_SUBST(WITH_WRITER)
826#AC_SUBST(WRITER_TEST)
827
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000828if test "$with_pattern" = "no" ; then
829 echo Disabling the xmlPattern parsing interface
830 WITH_PATTERN=0
831 PATTERN_TEST=
832else
833 WITH_PATTERN=1
834 PATTERN_TEST=Patterntests
835fi
836AC_SUBST(WITH_PATTERN)
837AC_SUBST(PATTERN_TEST)
838
Daniel Veillard81273902003-09-30 00:43:48 +0000839if test "$with_sax1" = "no" ; then
840 echo Disabling the older SAX1 interface
841 WITH_SAX1=0
842 TEST_SAX=
843else
844 WITH_SAX1=1
845 TEST_SAX=SAXtests
846fi
847AC_SUBST(WITH_SAX1)
848AC_SUBST(TEST_SAX)
849
Daniel Veillard73b013f2003-09-30 12:36:01 +0000850if test "$with_push" = "no" ; then
851 echo Disabling the PUSH parser interfaces
852 WITH_PUSH=0
853 TEST_PUSH=
854else
855 WITH_PUSH=1
856 TEST_PUSH="XMLPushtests"
857fi
858AC_SUBST(WITH_PUSH)
859AC_SUBST(TEST_PUSH)
860
Daniel Veillard73b013f2003-09-30 12:36:01 +0000861if test "$with_html" = "no" ; then
862 echo Disabling HTML support
863 WITH_HTML=0
864 HTML_OBJ=
865 TEST_HTML=
866else
867 WITH_HTML=1
868 HTML_OBJ="HTMLparser.o HTMLtree.o"
869 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000870 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000871 TEST_PHTML=HTMLPushtests
872 else
873 TEST_PHTML=
874 fi
875fi
876AC_SUBST(WITH_HTML)
877AC_SUBST(HTML_OBJ)
878AC_SUBST(TEST_HTML)
879AC_SUBST(TEST_PHTML)
880
Daniel Veillard73b013f2003-09-30 12:36:01 +0000881if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000882 echo Disabling DTD validation support
883 WITH_VALID=0
884 TEST_VALID=
885 TEST_VTIME=
886else
887 WITH_VALID=1
888 TEST_VALID=Validtests
889 TEST_VTIME=VTimingtests
890fi
891AC_SUBST(WITH_VALID)
892AC_SUBST(TEST_VALID)
893AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000894
Daniel Veillarda7374592001-05-10 14:17:55 +0000895if test "$with_catalog" = "no" ; then
896 echo Disabling Catalog support
897 WITH_CATALOG=0
898 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000899 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000900else
901 WITH_CATALOG=1
902 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000903 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000904fi
905AC_SUBST(WITH_CATALOG)
906AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000907AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000908
Daniel Veillardb59076b2001-04-29 17:04:07 +0000909if test "$with_docbook" = "no" ; then
910 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000911 WITH_DOCB=0
912 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000913else
914 WITH_DOCB=1
915 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000916fi
917AC_SUBST(WITH_DOCB)
918AC_SUBST(DOCB_OBJ)
919
920
William M. Brack21e4ef22005-01-02 09:53:13 +0000921if test "$with_xptr" = "no" ; then
922 echo Disabling XPointer support
923 WITH_XPTR=0
924 XPTR_OBJ=
925 TEST_XPTR=
926else
927 WITH_XPTR=1
928 XPTR_OBJ=xpointer.o
929 TEST_XPTR=XPtrtests
930 if test "$with_xpath" = "no" ; then
931 echo XPointer requires XPath support - enabling it
932 with_xpath=yes
933 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000934fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000935AC_SUBST(WITH_XPTR)
936AC_SUBST(XPTR_OBJ)
937AC_SUBST(TEST_XPTR)
938
939if test "$with_c14n" = "no" ; then
940 echo Disabling C14N support
941 WITH_C14N=0
942 C14N_OBJ=
943 TEST_C14N=
944else
945 WITH_C14N=1
946 C14N_OBJ="c14n.c"
947 TEST_C14N=C14Ntests
948 if test "$with_xpath" = "no" ; then
949 echo C14N requires XPath support - enabling it
950 with_xpath=yes
951 fi
952fi
953AC_SUBST(WITH_C14N)
954AC_SUBST(C14N_OBJ)
955AC_SUBST(TEST_C14N)
956
957if test "$with_xinclude" = "no" ; then
958 echo Disabling XInclude support
959 WITH_XINCLUDE=0
960 XINCLUDE_OBJ=
961 with_xinclude="no"
962 TEST_XINCLUDE=
963else
964 WITH_XINCLUDE=1
965 XINCLUDE_OBJ=xinclude.o
966 TEST_XINCLUDE=XIncludetests
967 if test "$with_xpath" = "no" ; then
968 echo XInclude requires XPath support - enabling it
969 with_xpath=yes
970 fi
971fi
972AC_SUBST(WITH_XINCLUDE)
973AC_SUBST(XINCLUDE_OBJ)
974AC_SUBST(TEST_XINCLUDE)
975
Daniel Veillard361d8452000-04-03 19:48:13 +0000976if test "$with_xpath" = "no" ; then
977 echo Disabling XPATH support
978 WITH_XPATH=0
979 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000980 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000981else
982 WITH_XPATH=1
983 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000984 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000985fi
986AC_SUBST(WITH_XPATH)
987AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000988AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000989
William M. Brack21e4ef22005-01-02 09:53:13 +0000990dnl
991dnl output functions
992dnl
993if test "$with_output" = "no" ; then
994 echo Disabling serialization/saving support
995 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000996else
William M. Brack21e4ef22005-01-02 09:53:13 +0000997 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000998fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000999AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001000
Daniel Veillard6e90d192001-07-03 16:37:49 +00001001WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001002if test "$with_iconv" = "no" ; then
1003 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001004else
Daniel Veillard220346d2001-12-07 11:33:54 +00001005 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001006 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001007 # Export this since our headers include iconv.h
1008 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001009 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001010 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001011
1012 AC_CHECK_HEADER(iconv.h,
1013 AC_MSG_CHECKING(for iconv)
1014 AC_TRY_LINK([#include <stdlib.h>
1015#include <iconv.h>],[
1016iconv_t cd = iconv_open ("","");
1017iconv (cd, NULL, NULL, NULL, NULL);],[
1018 AC_MSG_RESULT(yes)
1019 WITH_ICONV=1],[
1020 AC_MSG_RESULT(no)
1021 AC_MSG_CHECKING(for iconv in -liconv)
1022
1023 _ldflags="${LDFLAGS}"
1024 _libs="${LIBS}"
1025 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1026 LIBS="${LIBS} -liconv"
1027
1028 AC_TRY_LINK([#include <stdlib.h>
1029#include <iconv.h>],[
1030iconv_t cd = iconv_open ("","");
1031iconv (cd, NULL, NULL, NULL, NULL);],[
1032 AC_MSG_RESULT(yes)
1033 WITH_ICONV=1
1034 ICONV_LIBS="${ICONV_LIBS} -liconv"
1035 LIBS="${_libs}"
1036 LDFLAGS="${_ldflags}"],[
1037 AC_MSG_RESULT(no)
1038 LIBS="${_libs}"
1039 LDFLAGS="${_ldflags}"])]))
1040fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001041case "$host" in
1042 *mingw*) M_LIBS=""
1043 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001044 *beos*) M_LIBS=""
1045 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001046 *) M_LIBS="-lm"
1047 ;;
1048esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001049XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001050XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001051AC_SUBST(WITH_ICONV)
1052
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001053WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001054if test "$WITH_ICONV" != "1" ; then
1055if test "$with_iso8859x" = "no" ; then
1056 echo Disabling ISO8859X support
1057 WITH_ISO8859X=0
1058fi
1059fi
1060AC_SUBST(WITH_ISO8859X)
1061
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001062if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001063 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001064 WITH_SCHEMAS=0
1065 TEST_SCHEMAS=
1066else
Daniel Veillard71531f32003-02-05 13:19:53 +00001067 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001068 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001069 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001070 if test "$PYTHON_INCLUDES" != "" ; then
1071 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1072 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001073 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001074fi
1075AC_SUBST(WITH_SCHEMAS)
1076AC_SUBST(TEST_SCHEMAS)
1077
Daniel Veillard23e73572002-09-19 19:56:43 +00001078if test "$with_regexps" = "no" ; then
1079 echo Disabling Regexps support
1080 WITH_REGEXPS=0
1081 TEST_REGEXPS=
1082else
1083 WITH_REGEXPS=1
1084 TEST_REGEXPS="Regexptests Automatatests"
1085fi
1086AC_SUBST(WITH_REGEXPS)
1087AC_SUBST(TEST_REGEXPS)
1088
Daniel Veillard361d8452000-04-03 19:48:13 +00001089if test "$with_debug" = "no" ; then
1090 echo Disabling DEBUG support
1091 WITH_DEBUG=0
1092 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001093 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001094else
1095 WITH_DEBUG=1
1096 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001097 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001098fi
1099AC_SUBST(WITH_DEBUG)
1100AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001101AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001102
Daniel Veillard361d8452000-04-03 19:48:13 +00001103if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001104 if test "$with_thread_alloc" = "yes" ; then
1105 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1106 WITH_MEM_DEBUG=0
1107 else
1108 echo Enabling memory debug support
1109 WITH_MEM_DEBUG=1
1110 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001111else
1112 WITH_MEM_DEBUG=0
1113fi
1114AC_SUBST(WITH_MEM_DEBUG)
1115
Daniel Veillard22cdb842004-10-04 14:09:17 +00001116if test "$with_run_debug" = "yes" ; then
1117 echo Enabling runtime debug support
1118 WITH_RUN_DEBUG=1
1119else
1120 WITH_RUN_DEBUG=0
1121fi
1122AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001123
1124WIN32_EXTRA_LIBADD=
1125WIN32_EXTRA_LDFLAGS=
1126case "$host" in
1127 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001128 CPPFLAGS="$CPPFLAGS -DWIN32"
1129 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001130 WIN32_EXTRA_LDFLAGS="-no-undefined"
1131 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1132 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1133 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1134 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001135 *-*-cygwin*)
1136 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
1137 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python2.3/config -lpython2.3"
1138 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001139esac
1140AC_SUBST(WIN32_EXTRA_LIBADD)
1141AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001142AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1143AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001144
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001145AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001146AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001147AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001148
Daniel Veillardb05deb71999-08-10 19:04:08 +00001149AC_SUBST(XML_LIBDIR)
1150AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001151AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001152AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001153AC_SUBST(XML_INCLUDEDIR)
1154AC_SUBST(HTML_DIR)
1155AC_SUBST(HAVE_ISNAN)
1156AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001157AC_SUBST(PYTHON)
1158AC_SUBST(PYTHON_VERSION)
1159AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001160AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001161
Daniel Veillardb05deb71999-08-10 19:04:08 +00001162AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001163AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001164
Daniel Veillard9715c172002-11-25 16:33:40 +00001165dnl for the spec file
1166RELDATE=`date +'%a %b %e %Y'`
1167AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001168AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001169
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001170rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001171ln -s Copyright COPYING
1172
Daniel Veillarde4177a52004-01-08 16:43:57 +00001173# keep on one line for cygwin c.f. #130896
Daniel Veillardb1da40c2004-09-06 11:57:44 +00001174AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001175
Daniel Veillard06d25242004-02-25 13:01:42 +00001176chmod +x xml2-config python/setup.py