blob: 77a4943a76e2130d01856ce0a693ddf117f70b9a [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)])
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000147AC_ARG_WITH(modules,
148[ --with-modules add the dynamic modules support (on)])
Owen Taylor3473f882001-02-23 17:55:21 +0000149AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +0000150[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +0000151 if test "$withval" != "no" -a "$withval" != "yes"; then
152 Z_DIR=$withval
153 CPPFLAGS="${CPPFLAGS} -I$withval/include"
154 LDFLAGS="${LDFLAGS} -L$withval/lib"
155 fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000156])
William M. Brack21e4ef22005-01-02 09:53:13 +0000157
158dnl
159dnl option to build a minimal libxml2 library
160dnl
161if test "$with_minimum" = "yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000162then
William M. Brack21e4ef22005-01-02 09:53:13 +0000163 echo "Configuring for a minimal library"
164 if test "$with_c14n" = ""
165 then
166 with_c14n=no
167 fi
168 if test "$with_catalog" = ""
169 then
170 with_catalog=no
171 fi
172 echo So far so good!
173 if test "$with_debug" = ""
174 then
175 with_debug=no
176 fi
177 if test "$with_docbook" = ""
178 then
179 with_docbook=no
180 fi
181 if test "$with_fexceptions" = ""
182 then
183 with_fexceptions=no
184 fi
185 if test "$with_ftp" = ""
186 then
187 with_ftp=no
188 fi
189 if test "$with_history" = ""
190 then
191 with_history=no
192 fi
193 if test "$with_html" = ""
194 then
195 with_html=no
196 fi
197 if test "$with_http" = ""
198 then
199 with_http=no
200 fi
201 if test "$with_iconv" = ""
202 then
203 with_iconv=no
204 fi
205 if test "$with_iso8859x" = ""
206 then
207 with_iso8859x=no
208 fi
209 if test "$with_legacy" = ""
210 then
211 with_legacy=no
212 fi
213 if test "$with_mem_debug" = ""
214 then
215 with_mem_debug=no
216 fi
217 if test "$with_output" = ""
218 then
219 with_output=no
220 fi
221 if test "$with_pattern" = ""
222 then
223 with_pattern=no
224 fi
225 if test "$with_push" = ""
226 then
227 with_push=no
228 fi
229 if test "$with_python" = ""
230 then
231 with_python=no
232 fi
233 if test "$with_reader" = ""
234 then
235 with_reader=no
236 fi
237 if test "$with_readline" = ""
238 then
239 with_readline=no
240 fi
241 if test "$with_regexp" = ""
242 then
243 with_regexp=no
244 fi
245 if test "$with_run_debug" = ""
246 then
247 with_run_debug=no
248 fi
249 if test "$with_sax1" = ""
250 then
251 with_sax1=no
252 fi
253 if test "$with_schemas" = ""
254 then
255 with_schemas=no
256 fi
257 if test "$with_threads" = ""
258 then
259 with_threads=no
260 fi
261 if test "$with_thread_alloc" = ""
262 then
263 with_thread_alloc=no
264 fi
265 if test "$with_tree" = ""
266 then
267 with_tree=no
268 fi
269 if test "$with_valid" = ""
270 then
271 with_valid=no
272 fi
273 if test "$with_writer" = ""
274 then
275 with_writer=no
276 fi
277 if test "$with_xinclude" = ""
278 then
279 with_xinclude=no
280 fi
281 if test "$with_xpath" = ""
282 then
283 with_xpath=no
284 fi
285 if test "$with_xptr" = ""
286 then
287 with_xptr=no
288 fi
289 if test "$with_zlib" = ""
290 then
291 with_zlib=no
292 fi
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000293 if test "$with_modules" = ""
294 then
295 with_modules=no
296 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000297fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000298
299echo Checking zlib
300
301dnl Checks for zlib library.
302
Daniel Veillard259ff742001-10-06 13:49:59 +0000303if test "$with_zlib" = "no"; then
304 echo "Disabling compression support"
305else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000306 AC_CHECK_HEADERS(zlib.h,
307 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +0000308 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000309 if test "x${Z_DIR}" != "x"; then
310 Z_CFLAGS="-I${Z_DIR}/include"
311 Z_LIBS="-L${Z_DIR}/lib -lz"
312 [case ${host} in
313 *-*-solaris*)
314 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
315 ;;
316 esac]
317 else
318 Z_LIBS="-lz"
319 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +0000320fi
Owen Taylor3473f882001-02-23 17:55:21 +0000321
Owen Taylor3473f882001-02-23 17:55:21 +0000322AC_SUBST(Z_CFLAGS)
323AC_SUBST(Z_LIBS)
324
325CPPFLAGS=${_cppflags}
326LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000327
William M. Brack21e4ef22005-01-02 09:53:13 +0000328echo Checking headers
329
Daniel Veillard01791d51998-07-24 19:24:09 +0000330dnl Checks for header files.
331AC_HEADER_DIRENT
332AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000333AC_CHECK_HEADERS([fcntl.h])
334AC_CHECK_HEADERS([unistd.h])
335AC_CHECK_HEADERS([ctype.h])
336AC_CHECK_HEADERS([dirent.h])
337AC_CHECK_HEADERS([errno.h])
338AC_CHECK_HEADERS([malloc.h])
339AC_CHECK_HEADERS([stdarg.h])
340AC_CHECK_HEADERS([sys/stat.h])
341AC_CHECK_HEADERS([sys/types.h])
342AC_CHECK_HEADERS([time.h])
343AC_CHECK_HEADERS([ansidecl.h])
344AC_CHECK_HEADERS([ieeefp.h])
345AC_CHECK_HEADERS([nan.h])
346AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000347AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000348AC_CHECK_HEADERS([fp_class.h])
349AC_CHECK_HEADERS([float.h])
350AC_CHECK_HEADERS([stdlib.h])
351AC_CHECK_HEADERS([sys/socket.h], [], [],
352[#if HAVE_SYS_TYPES_H
353# include <sys/types.h>
354# endif
355])
356AC_CHECK_HEADERS([netinet/in.h], [], [],
357[#if HAVE_SYS_TYPES_H
358# include <sys/types.h>
359# endif
360])
361AC_CHECK_HEADERS([arpa/inet.h], [], [],
362[#if HAVE_SYS_TYPES_H
363# include <sys/types.h>
364# endif
365#if HAVE_ARPA_INET_H
366# include <arpa/inet.h>
367# endif
368])
369AC_CHECK_HEADERS([netdb.h])
370AC_CHECK_HEADERS([sys/time.h])
371AC_CHECK_HEADERS([sys/select.h])
372AC_CHECK_HEADERS([sys/mman.h])
373AC_CHECK_HEADERS([sys/timeb.h])
374AC_CHECK_HEADERS([signal.h])
375AC_CHECK_HEADERS([arpa/nameser.h], [], [],
376[#if HAVE_SYS_TYPES_H
377# include <sys/types.h>
378# endif
379])
380AC_CHECK_HEADERS([resolv.h], [], [],
381[#if HAVE_SYS_TYPES_H
382# include <sys/types.h>
383# endif
384#if HAVE_NETINET_IN_H
385# include <netinet/in.h>
386# endif
387#if HAVE_ARPA_NAMESER_H
388# include <arpa/nameser.h>
389# endif
390])
Daniel Veillard01791d51998-07-24 19:24:09 +0000391
Daniel Veillardfc979062004-03-04 22:07:16 +0000392
William M. Brack21e4ef22005-01-02 09:53:13 +0000393echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000394
Daniel Veillard01791d51998-07-24 19:24:09 +0000395dnl Checks for library functions.
396AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000397AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000398AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000399AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000400AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000401
Daniel Veillard92ad2102001-03-27 12:47:33 +0000402dnl Checking the standard string functions availability
403AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
404 NEED_TRIO=1)
405
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000406dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000407AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
408AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000409AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(net, setsockopt))
Daniel Veillard71b656e2000-01-05 14:46:17 +0000410AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000411
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000412dnl Determine what socket length (socklen_t) data type is
413AC_MSG_CHECKING([for type of socket length (socklen_t)])
414AC_TRY_COMPILE2([
415#include <stddef.h>
416#include <sys/types.h>
417#include <sys/socket.h>],[
418(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
419 AC_MSG_RESULT(socklen_t *)
420 SOCKLEN_T=socklen_t],[
421 AC_TRY_COMPILE2([
422#include <stddef.h>
423#include <sys/types.h>
424#include <sys/socket.h>],[
425(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
426 AC_MSG_RESULT(size_t *)
427 SOCKLEN_T=size_t],[
428 AC_TRY_COMPILE2([
429#include <stddef.h>
430#include <sys/types.h>
431#include <sys/socket.h>],[
432(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
433 AC_MSG_RESULT(int *)
434 SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000435 AC_MSG_WARN(could not determine)
Daniel Veillardc7e3cc42004-09-28 12:33:52 +0000436 SOCKLEN_T="int"])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000437AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000438
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000439dnl ***********************Checking for availability of IPv6*******************
440
441AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000442AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000443if test "$with_minimum" = "yes"
444then
445 enable_ipv6=no
446fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000447if test $enable_ipv6 = yes; then
448 have_ipv6=no
449 AC_TRY_COMPILE([
450 #include <sys/socket.h>
451 #include <sys/types.h>], [
452 struct sockaddr_storage ss;
453 socket(AF_INET6, SOCK_STREAM, 0)
454 ],
455 have_ipv6=yes,
456 have_ipv6=no
457 )
458 AC_MSG_RESULT($have_ipv6)
459
William M. Brack476cd962003-08-13 11:09:42 +0000460 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000461 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000462 have_broken_ss_family=no
463
464 dnl *********************************************************************
465 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
466 dnl a ss_family member, but rather __ss_family. Let's detect that
467 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these platforms.
468 dnl ********************************************************************
469 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
470 AC_TRY_COMPILE([
471 #include <sys/socket.h>
472 #include <sys/types.h>], [
473 struct sockaddr_storage ss ;
474 ss.__ss_family = 0 ;
475 ],
476 have_broken_ss_family=yes,
477 have_broken_ss_family=no
478 )
479 AC_MSG_RESULT($have_broken_ss_family)
480 if test x$have_broken_ss_family = xyes ; then
481 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [], [Whether struct sockaddr::__ss_family exists])
482 AC_DEFINE(ss_family, __ss_family, [ss_family is not defined here, use __ss_family instead])
483 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000484
485 have_getaddrinfo=no
486 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
487 if test $have_getaddrinfo != yes; then
488 for lib in bsd socket inet; do
489 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
490 done
491 fi
492
William M. Brack476cd962003-08-13 11:09:42 +0000493 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000494 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000495 fi
496 fi
497fi
498
499dnl ******************************End IPv6 checks******************************
500
Daniel Veillardb05deb71999-08-10 19:04:08 +0000501dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000502AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000503 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000504
Daniel Veillardc790bf42003-10-11 10:50:10 +0000505AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
506 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000507
508XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000509XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000510
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000511dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000512dnl Extra flags
513dnl
514XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000515RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000516
517dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000518dnl Workaround for native compilers
519dnl HP : http://bugs.gnome.org/db/31/3163.html
520dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000521dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000522if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000523 case "${host}" in
524 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000525 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000526 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000527 *-dec-osf* )
528 CFLAGS="${CFLAGS} -ieee"
529 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000530 alpha*-*-linux* )
531 CFLAGS="${CFLAGS} -ieee"
532 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000533 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000534else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000535 if test "$with_fexceptions" = "yes"
536 then
537 #
538 # Not activated by default because this inflates the code size
539 # Used to allow propagation of C++ exceptions through the library
540 #
541 CFLAGS="${CFLAGS} -fexceptions"
542 fi
543
Daniel Veillard05f97352004-10-31 15:35:32 +0000544 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 +0000545 case "${host}" in
546 alpha*-*-linux* )
547 CFLAGS="${CFLAGS} -mieee"
548 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000549 alpha*-*-osf* )
550 CFLAGS="${CFLAGS} -mieee"
551 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000552 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000553fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000554case ${host} in
555 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000556 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
557 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000558 hppa*-hp-mpeix)
559 NEED_TRIO=1
560 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000561esac
562
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000563
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000564dnl
565dnl check for python
566dnl
567
568PYTHON=
569PYTHON_VERSION=
570PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000571PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000572PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000573pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000574if test "$with_python" != "no" ; then
575 if test -x "$with_python/bin/python"
576 then
577 echo Found python in $with_python/bin/python
578 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000579 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000580 if test -x "$with_python"
581 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000582 echo Found python in $with_python
583 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000584 else
William M. Bracka73f45b2005-01-11 02:21:33 +0000585 AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000586 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000587 fi
588 if test "$PYTHON" != ""
589 then
590 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
591 echo Found Python version $PYTHON_VERSION
592 fi
593 if test "$PYTHON_VERSION" != ""
594 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000595 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
596 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000597 then
598 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000599 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000600 else
601 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
602 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000603 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000604 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000605 else
606 if test -r /usr/include/python$PYTHON_VERSION/Python.h
607 then
608 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000609 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000610 else
611 echo could not find python$PYTHON_VERSION/Python.h
612 fi
613 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000614 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000615 then
616 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
617 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000618 fi
619 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000620 if test "$with_python" != ""
621 then
622 pythondir='$(PYTHON_SITE_PACKAGES)'
623 else
624 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
625 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000626fi
627AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000628if test "$PYTHON_INCLUDES" != ""
629then
630 PYTHON_SUBDIR=python
631else
632 PYTHON_SUBDIR=
633fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000634AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000635AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000636
Daniel Veillardce1648b2005-01-04 15:10:22 +0000637dnl check for dso support
638WITH_MODULES=0
639MODULE_EXTENSION=".so"
640TEST_MODULES=
641
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000642if test "$with_modules" != "no" ; then
Daniel Veillardce1648b2005-01-04 15:10:22 +0000643AC_CHECK_LIB(dld, shl_load, [
644 WITH_MODULES=1
645 MODULE_PLATFORM_LIBS="-ldld"
646 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
647])
648
649AC_CHECK_LIB(dl, dlopen, [
650 WITH_MODULES=1
651 MODULE_PLATFORM_LIBS="-ldl"
652 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
653])
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000654fi
Daniel Veillardce1648b2005-01-04 15:10:22 +0000655
656if test "${WITH_MODULES}" = "1"; then
657 TEST_MODULES="ModuleTests"
658fi
659
660AC_SUBST(WITH_MODULES)
661AC_SUBST(MODULE_PLATFORM_LIBS)
662AC_SUBST(MODULE_EXTENSION)
663AC_SUBST(TEST_MODULES)
664
Daniel Veillard437b87b2000-01-03 17:30:46 +0000665dnl
666dnl Tester makes use of readline if present
667dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000668
Daniel Veillard361d8452000-04-03 19:48:13 +0000669dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000670dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000671dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000672dnl
William M. Brack871611b2003-10-18 04:53:14 +0000673if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000674 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000675 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
William M. Brack4119d1c2004-06-24 02:24:44 +0000676 [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000677 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000678 if test "$with_minimum" != "yes"
679 then
680 if test "${with_mem_debug}" = "" ; then
681 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000682 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000683 fi
684 if test "${with_docbook}" = "" ; then
685 with_docbook="yes"
686 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000687 fi
Daniel Veillardeff45a92004-10-29 12:10:55 +0000688 if test "${CC}" = "gcc" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000689 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 +0000690 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000691 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000692dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000693else
694 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000695fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000696AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000697
698dnl
699dnl Check for trio string functions
700dnl
701
702if test "${NEED_TRIO}" = "1" ; then
703 echo Adding trio library for string functions
704 WITH_TRIO=1
705else
706 WITH_TRIO=0
707fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000708AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000709AC_SUBST(WITH_TRIO)
710
Daniel Veillardf6eea272001-01-18 12:17:12 +0000711dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000712dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000713dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000714echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000715
William M. Brack21e4ef22005-01-02 09:53:13 +0000716dnl
717dnl Thread-related stuff
718dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000719THREAD_LIBS=""
720WITH_THREADS=0
721THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000722TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000723THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000724
Daniel Veillard84942712003-04-18 14:40:05 +0000725if test "$with_threads" = "no" ; then
726 echo Disabling multithreaded support
727else
Daniel Veillardb8478642001-10-12 17:29:10 +0000728 echo Enabling multithreaded support
729
730 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000731 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000732 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000733 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
734 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000735 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000736 case $host_os in
737 *mingw32*) WITH_THREADS="1"
738 THREADS_W32="Win32"
739 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
740 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000741 *cygwin*) THREAD_LIBS=""
742 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000743 *beos*) WITH_THREADS="1"
744 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
745 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000746 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000747 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000748 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
749 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000750 fi
751fi
William M. Brack306e33c2004-06-12 01:01:22 +0000752if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000753 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000754fi
755
Daniel Veillardb8478642001-10-12 17:29:10 +0000756AC_SUBST(THREAD_LIBS)
757AC_SUBST(WITH_THREADS)
758AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000759AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000760AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000761
William M. Brack21e4ef22005-01-02 09:53:13 +0000762dnl
763dnl xmllint shell history
764dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000765if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000766 echo Enabling xmllint shell history
767 dnl check for terminal library. this is a very cool solution
768 dnl from octave's configure.in
769 unset tcap
770 for termlib in ncurses curses termcap terminfo termlib; do
771 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
772 test -n "$tcap" && break
773 done
774
775 AC_CHECK_HEADER(readline/history.h,
776 AC_CHECK_LIB(history, append_history,[
777 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000778 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000779 AC_CHECK_HEADER(readline/readline.h,
780 AC_CHECK_LIB(readline, readline,[
781 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000782 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000783 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
784 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
785 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000786 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000787fi
788
William M. Brack21e4ef22005-01-02 09:53:13 +0000789dnl
790dnl Tree functions
791dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000792if test "$with_tree" = "no" ; then
793 echo Disabling DOM like tree manipulation APIs
794 WITH_TREE=0
795else
796 WITH_TREE=1
797fi
798AC_SUBST(WITH_TREE)
799
Daniel Veillard361d8452000-04-03 19:48:13 +0000800if test "$with_ftp" = "no" ; then
801 echo Disabling FTP support
802 WITH_FTP=0
803 FTP_OBJ=
804else
805 WITH_FTP=1
806 FTP_OBJ=nanoftp.o
807fi
808AC_SUBST(WITH_FTP)
809AC_SUBST(FTP_OBJ)
810
Daniel Veillard361d8452000-04-03 19:48:13 +0000811if test "$with_http" = "no" ; then
812 echo Disabling HTTP support
813 WITH_HTTP=0
814 HTTP_OBJ=
815else
816 WITH_HTTP=1
817 HTTP_OBJ=nanohttp.o
818fi
819AC_SUBST(WITH_HTTP)
820AC_SUBST(HTTP_OBJ)
821
Daniel Veillard4432df22003-09-28 18:58:27 +0000822if test "$with_legacy" = "no" ; then
823 echo Disabling deprecated APIs
824 WITH_LEGACY=0
825else
826 WITH_LEGACY=1
827fi
828AC_SUBST(WITH_LEGACY)
829
Daniel Veillard81273902003-09-30 00:43:48 +0000830if test "$with_reader" = "no" ; then
831 echo Disabling the xmlReader parsing interface
832 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000833 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000834else
835 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000836 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +0000837 if test "$with_push" = "no" ; then
838 echo xmlReader requires Push interface - enabling it
839 with_push=yes
840 fi
Daniel Veillard81273902003-09-30 00:43:48 +0000841fi
842AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000843AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000844
William M. Brack21e4ef22005-01-02 09:53:13 +0000845if test "$with_writer" = "no" ; then
846 echo Disabling the xmlWriter saving interface
847 WITH_WRITER=0
848# WRITER_TEST=
849else
850 WITH_WRITER=1
851# WRITER_TEST=Writertests
852 if test "$with_push" = "no" ; then
853 echo xmlWriter requires Push interface - enabling it
854 with_push=yes
855 fi
856 if test "$with_output" = "no" ; then
857 echo xmlWriter requires Output interface - enabling it
858 with_output=yes
859 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000860fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000861AC_SUBST(WITH_WRITER)
862#AC_SUBST(WRITER_TEST)
863
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000864if test "$with_pattern" = "no" ; then
865 echo Disabling the xmlPattern parsing interface
866 WITH_PATTERN=0
867 PATTERN_TEST=
868else
869 WITH_PATTERN=1
870 PATTERN_TEST=Patterntests
871fi
872AC_SUBST(WITH_PATTERN)
873AC_SUBST(PATTERN_TEST)
874
Daniel Veillard81273902003-09-30 00:43:48 +0000875if test "$with_sax1" = "no" ; then
876 echo Disabling the older SAX1 interface
877 WITH_SAX1=0
878 TEST_SAX=
879else
880 WITH_SAX1=1
881 TEST_SAX=SAXtests
882fi
883AC_SUBST(WITH_SAX1)
884AC_SUBST(TEST_SAX)
885
Daniel Veillard73b013f2003-09-30 12:36:01 +0000886if test "$with_push" = "no" ; then
887 echo Disabling the PUSH parser interfaces
888 WITH_PUSH=0
889 TEST_PUSH=
890else
891 WITH_PUSH=1
892 TEST_PUSH="XMLPushtests"
893fi
894AC_SUBST(WITH_PUSH)
895AC_SUBST(TEST_PUSH)
896
Daniel Veillard73b013f2003-09-30 12:36:01 +0000897if test "$with_html" = "no" ; then
898 echo Disabling HTML support
899 WITH_HTML=0
900 HTML_OBJ=
901 TEST_HTML=
902else
903 WITH_HTML=1
904 HTML_OBJ="HTMLparser.o HTMLtree.o"
905 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000906 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000907 TEST_PHTML=HTMLPushtests
908 else
909 TEST_PHTML=
910 fi
911fi
912AC_SUBST(WITH_HTML)
913AC_SUBST(HTML_OBJ)
914AC_SUBST(TEST_HTML)
915AC_SUBST(TEST_PHTML)
916
Daniel Veillard73b013f2003-09-30 12:36:01 +0000917if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000918 echo Disabling DTD validation support
919 WITH_VALID=0
920 TEST_VALID=
921 TEST_VTIME=
922else
923 WITH_VALID=1
924 TEST_VALID=Validtests
925 TEST_VTIME=VTimingtests
926fi
927AC_SUBST(WITH_VALID)
928AC_SUBST(TEST_VALID)
929AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000930
Daniel Veillarda7374592001-05-10 14:17:55 +0000931if test "$with_catalog" = "no" ; then
932 echo Disabling Catalog support
933 WITH_CATALOG=0
934 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000935 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000936else
937 WITH_CATALOG=1
938 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000939 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000940fi
941AC_SUBST(WITH_CATALOG)
942AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000943AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000944
Daniel Veillardb59076b2001-04-29 17:04:07 +0000945if test "$with_docbook" = "no" ; then
946 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000947 WITH_DOCB=0
948 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000949else
950 WITH_DOCB=1
951 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000952fi
953AC_SUBST(WITH_DOCB)
954AC_SUBST(DOCB_OBJ)
955
956
William M. Brack21e4ef22005-01-02 09:53:13 +0000957if test "$with_xptr" = "no" ; then
958 echo Disabling XPointer support
959 WITH_XPTR=0
960 XPTR_OBJ=
961 TEST_XPTR=
962else
963 WITH_XPTR=1
964 XPTR_OBJ=xpointer.o
965 TEST_XPTR=XPtrtests
966 if test "$with_xpath" = "no" ; then
967 echo XPointer requires XPath support - enabling it
968 with_xpath=yes
969 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000970fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000971AC_SUBST(WITH_XPTR)
972AC_SUBST(XPTR_OBJ)
973AC_SUBST(TEST_XPTR)
974
975if test "$with_c14n" = "no" ; then
976 echo Disabling C14N support
977 WITH_C14N=0
978 C14N_OBJ=
979 TEST_C14N=
980else
981 WITH_C14N=1
982 C14N_OBJ="c14n.c"
983 TEST_C14N=C14Ntests
984 if test "$with_xpath" = "no" ; then
985 echo C14N requires XPath support - enabling it
986 with_xpath=yes
987 fi
988fi
989AC_SUBST(WITH_C14N)
990AC_SUBST(C14N_OBJ)
991AC_SUBST(TEST_C14N)
992
993if test "$with_xinclude" = "no" ; then
994 echo Disabling XInclude support
995 WITH_XINCLUDE=0
996 XINCLUDE_OBJ=
997 with_xinclude="no"
998 TEST_XINCLUDE=
999else
1000 WITH_XINCLUDE=1
1001 XINCLUDE_OBJ=xinclude.o
1002 TEST_XINCLUDE=XIncludetests
1003 if test "$with_xpath" = "no" ; then
1004 echo XInclude requires XPath support - enabling it
1005 with_xpath=yes
1006 fi
1007fi
1008AC_SUBST(WITH_XINCLUDE)
1009AC_SUBST(XINCLUDE_OBJ)
1010AC_SUBST(TEST_XINCLUDE)
1011
Daniel Veillard361d8452000-04-03 19:48:13 +00001012if test "$with_xpath" = "no" ; then
1013 echo Disabling XPATH support
1014 WITH_XPATH=0
1015 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001016 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001017else
1018 WITH_XPATH=1
1019 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001020 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001021fi
1022AC_SUBST(WITH_XPATH)
1023AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001024AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001025
William M. Brack21e4ef22005-01-02 09:53:13 +00001026dnl
1027dnl output functions
1028dnl
1029if test "$with_output" = "no" ; then
1030 echo Disabling serialization/saving support
1031 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001032else
William M. Brack21e4ef22005-01-02 09:53:13 +00001033 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001034fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001035AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001036
Daniel Veillard6e90d192001-07-03 16:37:49 +00001037WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001038if test "$with_iconv" = "no" ; then
1039 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001040else
Daniel Veillard220346d2001-12-07 11:33:54 +00001041 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001042 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001043 # Export this since our headers include iconv.h
1044 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001045 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001046 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001047
1048 AC_CHECK_HEADER(iconv.h,
1049 AC_MSG_CHECKING(for iconv)
1050 AC_TRY_LINK([#include <stdlib.h>
1051#include <iconv.h>],[
1052iconv_t cd = iconv_open ("","");
1053iconv (cd, NULL, NULL, NULL, NULL);],[
1054 AC_MSG_RESULT(yes)
1055 WITH_ICONV=1],[
1056 AC_MSG_RESULT(no)
1057 AC_MSG_CHECKING(for iconv in -liconv)
1058
1059 _ldflags="${LDFLAGS}"
1060 _libs="${LIBS}"
1061 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1062 LIBS="${LIBS} -liconv"
1063
1064 AC_TRY_LINK([#include <stdlib.h>
1065#include <iconv.h>],[
1066iconv_t cd = iconv_open ("","");
1067iconv (cd, NULL, NULL, NULL, NULL);],[
1068 AC_MSG_RESULT(yes)
1069 WITH_ICONV=1
1070 ICONV_LIBS="${ICONV_LIBS} -liconv"
1071 LIBS="${_libs}"
1072 LDFLAGS="${_ldflags}"],[
1073 AC_MSG_RESULT(no)
1074 LIBS="${_libs}"
1075 LDFLAGS="${_ldflags}"])]))
1076fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001077case "$host" in
1078 *mingw*) M_LIBS=""
1079 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001080 *beos*) M_LIBS=""
1081 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001082 *) M_LIBS="-lm"
1083 ;;
1084esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001085XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001086XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001087AC_SUBST(WITH_ICONV)
1088
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001089WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001090if test "$WITH_ICONV" != "1" ; then
1091if test "$with_iso8859x" = "no" ; then
1092 echo Disabling ISO8859X support
1093 WITH_ISO8859X=0
1094fi
1095fi
1096AC_SUBST(WITH_ISO8859X)
1097
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001098if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001099 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001100 WITH_SCHEMAS=0
1101 TEST_SCHEMAS=
1102else
Daniel Veillard71531f32003-02-05 13:19:53 +00001103 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001104 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001105 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001106 if test "$PYTHON_INCLUDES" != "" ; then
1107 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1108 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001109 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001110fi
1111AC_SUBST(WITH_SCHEMAS)
1112AC_SUBST(TEST_SCHEMAS)
1113
Daniel Veillard23e73572002-09-19 19:56:43 +00001114if test "$with_regexps" = "no" ; then
1115 echo Disabling Regexps support
1116 WITH_REGEXPS=0
1117 TEST_REGEXPS=
1118else
1119 WITH_REGEXPS=1
1120 TEST_REGEXPS="Regexptests Automatatests"
1121fi
1122AC_SUBST(WITH_REGEXPS)
1123AC_SUBST(TEST_REGEXPS)
1124
Daniel Veillard361d8452000-04-03 19:48:13 +00001125if test "$with_debug" = "no" ; then
1126 echo Disabling DEBUG support
1127 WITH_DEBUG=0
1128 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001129 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001130else
1131 WITH_DEBUG=1
1132 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001133 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001134fi
1135AC_SUBST(WITH_DEBUG)
1136AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001137AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001138
Daniel Veillard361d8452000-04-03 19:48:13 +00001139if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001140 if test "$with_thread_alloc" = "yes" ; then
1141 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1142 WITH_MEM_DEBUG=0
1143 else
1144 echo Enabling memory debug support
1145 WITH_MEM_DEBUG=1
1146 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001147else
1148 WITH_MEM_DEBUG=0
1149fi
1150AC_SUBST(WITH_MEM_DEBUG)
1151
Daniel Veillard22cdb842004-10-04 14:09:17 +00001152if test "$with_run_debug" = "yes" ; then
1153 echo Enabling runtime debug support
1154 WITH_RUN_DEBUG=1
1155else
1156 WITH_RUN_DEBUG=0
1157fi
1158AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001159
1160WIN32_EXTRA_LIBADD=
1161WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001162CYGWIN_EXTRA_LDFLAGS=
1163CYGWIN_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001164case "$host" in
1165 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001166 CPPFLAGS="$CPPFLAGS -DWIN32"
1167 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001168 WIN32_EXTRA_LDFLAGS="-no-undefined"
1169 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1170 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1171 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1172 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001173 *-*-cygwin*)
1174 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001175 if test "${PYTHON}" != ""
1176 then
1177 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1178 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001179 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001180esac
1181AC_SUBST(WIN32_EXTRA_LIBADD)
1182AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001183AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1184AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001185
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001186AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001187AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001188AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001189
Daniel Veillardb05deb71999-08-10 19:04:08 +00001190AC_SUBST(XML_LIBDIR)
1191AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001192AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001193AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001194AC_SUBST(XML_INCLUDEDIR)
1195AC_SUBST(HTML_DIR)
1196AC_SUBST(HAVE_ISNAN)
1197AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001198AC_SUBST(PYTHON)
1199AC_SUBST(PYTHON_VERSION)
1200AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001201AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001202
Daniel Veillardb05deb71999-08-10 19:04:08 +00001203AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001204AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001205
Daniel Veillard9715c172002-11-25 16:33:40 +00001206dnl for the spec file
1207RELDATE=`date +'%a %b %e %Y'`
1208AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001209AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001210
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001211rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001212ln -s Copyright COPYING
1213
Daniel Veillarde4177a52004-01-08 16:43:57 +00001214# keep on one line for cygwin c.f. #130896
Daniel Veillardb1da40c2004-09-06 11:57:44 +00001215AC_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 +00001216
Daniel Veillard06d25242004-02-25 13:01:42 +00001217chmod +x xml2-config python/setup.py