blob: 65824f3aad42d6691d71c6e1c7a05c0d8cca8d8d [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 Veillard15724252008-08-30 15:01:04 +00007LIBXML_MINOR_VERSION=7
8LIBXML_MICRO_VERSION=0
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
Daniel Veillard9cb1b642007-01-03 15:07:44 +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
Daniel Veillard9cb1b642007-01-03 15:07:44 +000022else if test -d .svn ; then
23 extra=`svn info | grep Revision | sed 's+Revision: ++'`
24 echo extra=$extra
25 if test "$extra" != ""
26 then
27 LIBXML_VERSION_EXTRA="-SVN$extra"
28 fi
29fi
William M. Brackf4025492004-08-18 21:08:46 +000030fi
Daniel Veillard14fff061999-06-22 21:49:07 +000031AC_SUBST(LIBXML_MAJOR_VERSION)
32AC_SUBST(LIBXML_MINOR_VERSION)
33AC_SUBST(LIBXML_MICRO_VERSION)
34AC_SUBST(LIBXML_VERSION)
35AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000036AC_SUBST(LIBXML_VERSION_NUMBER)
William M. Brackf4025492004-08-18 21:08:46 +000037AC_SUBST(LIBXML_VERSION_EXTRA)
Daniel Veillard14fff061999-06-22 21:49:07 +000038
Daniel Veillard361d8452000-04-03 19:48:13 +000039VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000040
Daniel Veillardedfb29b2000-03-14 19:59:05 +000041AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000042
Daniel Veillard01791d51998-07-24 19:24:09 +000043dnl Checks for programs.
44AC_PROG_CC
45AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000046AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000047AC_PATH_PROG(RM, rm, /bin/rm)
48AC_PATH_PROG(MV, mv, /bin/mv)
49AC_PATH_PROG(TAR, tar, /bin/tar)
William M. Brack1826d0a2004-07-21 09:03:57 +000050AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard33a2de92006-10-11 08:33:22 +000051AC_PATH_PROG(WGET, wget, /usr/bin/wget)
Daniel Veillard8b817da2004-09-30 09:19:33 +000052AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
Daniel Veillard06500c82004-09-07 09:12:44 +000053AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
Daniel Veillard01791d51998-07-24 19:24:09 +000054
Daniel Veillard03109292000-08-14 14:58:22 +000055dnl Make sure we have an ANSI compiler
56AM_C_PROTOTYPES
57test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
58
Daniel Veillard6984e6d2003-12-09 14:20:17 +000059AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000060AM_PROG_LIBTOOL
61
Daniel Veillard4432df22003-09-28 18:58:27 +000062dnl
William M. Brack21e4ef22005-01-02 09:53:13 +000063dnl We process the AC_ARG_WITH first so that later we can modify
64dnl some of them to try to prevent impossible combinations. This
65dnl also allows up so alphabetize the choices
Daniel Veillard4432df22003-09-28 18:58:27 +000066dnl
Daniel Veillard4432df22003-09-28 18:58:27 +000067
William M. Brack21e4ef22005-01-02 09:53:13 +000068dnl
69dnl zlib option might change flags, so we save them initially
70dnl
Owen Taylor3473f882001-02-23 17:55:21 +000071_cppflags="${CPPFLAGS}"
72_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000073
William M. Brack21e4ef22005-01-02 09:53:13 +000074AC_ARG_WITH(c14n,
75[ --with-c14n add the Canonicalization support (on)])
76AC_ARG_WITH(catalog,
77[ --with-catalog add the Catalog support (on)])
78AC_ARG_WITH(debug,
79[ --with-debug add the debugging module (on)])
80AC_ARG_WITH(docbook,
81[ --with-docbook add Docbook SGML support (on)])
82AC_ARG_WITH(fexceptions,
83[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
84AC_ARG_WITH(ftp,
85[ --with-ftp add the FTP support (on)])
86AC_ARG_WITH(history,
87[ --with-history add history support to xmllint shell(off)])
88AC_ARG_WITH(html,
89[ --with-html add the HTML support (on)])
90dnl Specific dir for HTML output ?
91AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
92 [path to base html directory, default $datadir/doc/html]),
93 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
Daniel Veillard259ff742001-10-06 13:49:59 +000094
William M. Brack21e4ef22005-01-02 09:53:13 +000095AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
96 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
97 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
98 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
99AC_SUBST(HTML_DIR)
100AC_ARG_WITH(http,
101[ --with-http add the HTTP support (on)])
102AC_ARG_WITH(iconv,
103[ --with-iconv[[=DIR]] add ICONV support (on)])
104AC_ARG_WITH(iso8859x,
105[ --with-iso8859x add ISO8859X support if no iconv (on)])
106AC_ARG_WITH(legacy,
107[ --with-legacy add deprecated APIs for compatibility (on)])
108AC_ARG_WITH(mem_debug,
109[ --with-mem-debug add the memory debugging module (off)])
110AC_ARG_WITH(minimum,
111[ --with-minimum build a minimally sized library (off)])
112AC_ARG_WITH(output,
113[ --with-output add the serialization support (on)])
114AC_ARG_WITH(pattern,
115[ --with-pattern add the xmlPattern selection interface (on)])
116AC_ARG_WITH(push,
117[ --with-push add the PUSH parser interfaces (on)])
118AC_ARG_WITH(python,
119[ --with-python[[=DIR]] build Python bindings if found])
120AC_ARG_WITH(reader,
121[ --with-reader add the xmlReader parsing interface (on)])
122AC_ARG_WITH(readline,
123[ --with-readline=DIR use readline in DIR],[
124 if test "$withval" != "no" -a "$withval" != "yes"; then
125 RDL_DIR=$withval
126 CPPFLAGS="${CPPFLAGS} -I$withval/include"
127 LDFLAGS="${LDFLAGS} -L$withval/lib"
128 fi
129])
130AC_ARG_WITH(regexps,
131[ --with-regexps add Regular Expressions support (on)])
132AC_ARG_WITH(run_debug,
133[ --with-run-debug add the runtime debugging module (off)])
134AC_ARG_WITH(sax1,
135[ --with-sax1 add the older SAX1 interface (on)])
136AC_ARG_WITH(schemas,
Daniel Veillard39e5c892005-07-03 22:48:50 +0000137[ --with-schemas add Relax-NG and Schemas support (on)])
Daniel Veillarded6c5492005-07-23 15:00:22 +0000138AC_ARG_WITH(schematron,
139[ --with-schematron add Schematron support (on)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000140AC_ARG_WITH(threads,
141[ --with-threads add multithread support(on)])
142AC_ARG_WITH(thread-alloc,
143[ --with-thread-alloc add per-thread memory(off)])
144AC_ARG_WITH(tree,
145[ --with-tree add the DOM like tree manipulation APIs (on)])
146AC_ARG_WITH(valid,
147[ --with-valid add the DTD validation support (on)])
148AC_ARG_WITH(writer,
149[ --with-writer add the xmlWriter saving interface (on)])
150AC_ARG_WITH(xinclude,
151[ --with-xinclude add the XInclude support (on)])
152AC_ARG_WITH(xpath,
153[ --with-xpath add the XPATH support (on)])
154AC_ARG_WITH(xptr,
155[ --with-xptr add the XPointer support (on)])
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000156AC_ARG_WITH(modules,
157[ --with-modules add the dynamic modules support (on)])
Owen Taylor3473f882001-02-23 17:55:21 +0000158AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +0000159[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +0000160 if test "$withval" != "no" -a "$withval" != "yes"; then
161 Z_DIR=$withval
162 CPPFLAGS="${CPPFLAGS} -I$withval/include"
163 LDFLAGS="${LDFLAGS} -L$withval/lib"
164 fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000165])
Daniel Veillardbfa5cf12008-08-27 15:33:28 +0000166AC_ARG_WITH(coverage,
167[ --with-coverage build for code coverage with GCC (off)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000168
169dnl
Daniel Veillard39e5c892005-07-03 22:48:50 +0000170dnl hard dependancies on options
171dnl
172if test "$with_schemas" = "yes"
173then
174 with_pattern=yes
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000175 with_regexps=yes
Daniel Veillard39e5c892005-07-03 22:48:50 +0000176fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000177if test "$with_schematron" = "yes"
178then
179 with_pattern=yes
180 with_xpath=yes
181fi
Daniel Veillard39e5c892005-07-03 22:48:50 +0000182if test "$with_reader" = "yes"
183then
184 with_push=yes
185fi
186if test "$with_xptr" = "yes"
187then
188 with_xpath=yes
189fi
190dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000191dnl option to build a minimal libxml2 library
192dnl
193if test "$with_minimum" = "yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000194then
William M. Brack21e4ef22005-01-02 09:53:13 +0000195 echo "Configuring for a minimal library"
196 if test "$with_c14n" = ""
197 then
198 with_c14n=no
199 fi
200 if test "$with_catalog" = ""
201 then
202 with_catalog=no
203 fi
204 echo So far so good!
205 if test "$with_debug" = ""
206 then
207 with_debug=no
208 fi
209 if test "$with_docbook" = ""
210 then
211 with_docbook=no
212 fi
213 if test "$with_fexceptions" = ""
214 then
215 with_fexceptions=no
216 fi
217 if test "$with_ftp" = ""
218 then
219 with_ftp=no
220 fi
221 if test "$with_history" = ""
222 then
223 with_history=no
224 fi
225 if test "$with_html" = ""
226 then
227 with_html=no
228 fi
229 if test "$with_http" = ""
230 then
231 with_http=no
232 fi
233 if test "$with_iconv" = ""
234 then
235 with_iconv=no
236 fi
237 if test "$with_iso8859x" = ""
238 then
239 with_iso8859x=no
240 fi
241 if test "$with_legacy" = ""
242 then
243 with_legacy=no
244 fi
245 if test "$with_mem_debug" = ""
246 then
247 with_mem_debug=no
248 fi
249 if test "$with_output" = ""
250 then
251 with_output=no
252 fi
253 if test "$with_pattern" = ""
254 then
255 with_pattern=no
256 fi
257 if test "$with_push" = ""
258 then
259 with_push=no
260 fi
261 if test "$with_python" = ""
262 then
263 with_python=no
264 fi
265 if test "$with_reader" = ""
266 then
267 with_reader=no
268 fi
269 if test "$with_readline" = ""
270 then
271 with_readline=no
272 fi
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000273 if test "$with_regexps" = ""
William M. Brack21e4ef22005-01-02 09:53:13 +0000274 then
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000275 with_regexps=no
William M. Brack21e4ef22005-01-02 09:53:13 +0000276 fi
277 if test "$with_run_debug" = ""
278 then
279 with_run_debug=no
280 fi
281 if test "$with_sax1" = ""
282 then
283 with_sax1=no
284 fi
285 if test "$with_schemas" = ""
286 then
287 with_schemas=no
288 fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000289 if test "$with_schematron" = ""
290 then
291 with_schematron=no
292 fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000293 if test "$with_threads" = ""
294 then
295 with_threads=no
296 fi
297 if test "$with_thread_alloc" = ""
298 then
299 with_thread_alloc=no
300 fi
301 if test "$with_tree" = ""
302 then
303 with_tree=no
304 fi
305 if test "$with_valid" = ""
306 then
307 with_valid=no
308 fi
309 if test "$with_writer" = ""
310 then
311 with_writer=no
312 fi
313 if test "$with_xinclude" = ""
314 then
315 with_xinclude=no
316 fi
317 if test "$with_xpath" = ""
318 then
319 with_xpath=no
320 fi
321 if test "$with_xptr" = ""
322 then
323 with_xptr=no
324 fi
325 if test "$with_zlib" = ""
326 then
327 with_zlib=no
328 fi
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000329 if test "$with_modules" = ""
330 then
331 with_modules=no
332 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000333fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000334
335echo Checking zlib
336
337dnl Checks for zlib library.
338
Daniel Veillard75acfee2006-07-13 06:29:56 +0000339WITH_ZLIB=0
Daniel Veillard259ff742001-10-06 13:49:59 +0000340if test "$with_zlib" = "no"; then
341 echo "Disabling compression support"
342else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000343 AC_CHECK_HEADERS(zlib.h,
344 AC_CHECK_LIB(z, gzread,[
Daniel Veillard75acfee2006-07-13 06:29:56 +0000345 AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
346 WITH_ZLIB=1
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000347 if test "x${Z_DIR}" != "x"; then
348 Z_CFLAGS="-I${Z_DIR}/include"
349 Z_LIBS="-L${Z_DIR}/lib -lz"
350 [case ${host} in
351 *-*-solaris*)
352 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
353 ;;
354 esac]
355 else
356 Z_LIBS="-lz"
357 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +0000358fi
Owen Taylor3473f882001-02-23 17:55:21 +0000359
Owen Taylor3473f882001-02-23 17:55:21 +0000360AC_SUBST(Z_CFLAGS)
361AC_SUBST(Z_LIBS)
Daniel Veillard75acfee2006-07-13 06:29:56 +0000362AC_SUBST(WITH_ZLIB)
Owen Taylor3473f882001-02-23 17:55:21 +0000363
364CPPFLAGS=${_cppflags}
365LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000366
William M. Brack21e4ef22005-01-02 09:53:13 +0000367echo Checking headers
368
Daniel Veillard01791d51998-07-24 19:24:09 +0000369dnl Checks for header files.
370AC_HEADER_DIRENT
371AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000372AC_CHECK_HEADERS([fcntl.h])
373AC_CHECK_HEADERS([unistd.h])
374AC_CHECK_HEADERS([ctype.h])
375AC_CHECK_HEADERS([dirent.h])
376AC_CHECK_HEADERS([errno.h])
377AC_CHECK_HEADERS([malloc.h])
378AC_CHECK_HEADERS([stdarg.h])
379AC_CHECK_HEADERS([sys/stat.h])
380AC_CHECK_HEADERS([sys/types.h])
381AC_CHECK_HEADERS([time.h])
382AC_CHECK_HEADERS([ansidecl.h])
383AC_CHECK_HEADERS([ieeefp.h])
384AC_CHECK_HEADERS([nan.h])
385AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000386AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000387AC_CHECK_HEADERS([fp_class.h])
388AC_CHECK_HEADERS([float.h])
389AC_CHECK_HEADERS([stdlib.h])
390AC_CHECK_HEADERS([sys/socket.h], [], [],
391[#if HAVE_SYS_TYPES_H
392# include <sys/types.h>
393# endif
394])
395AC_CHECK_HEADERS([netinet/in.h], [], [],
396[#if HAVE_SYS_TYPES_H
397# include <sys/types.h>
398# endif
399])
400AC_CHECK_HEADERS([arpa/inet.h], [], [],
401[#if HAVE_SYS_TYPES_H
402# include <sys/types.h>
403# endif
404#if HAVE_ARPA_INET_H
405# include <arpa/inet.h>
406# endif
407])
408AC_CHECK_HEADERS([netdb.h])
409AC_CHECK_HEADERS([sys/time.h])
410AC_CHECK_HEADERS([sys/select.h])
411AC_CHECK_HEADERS([sys/mman.h])
412AC_CHECK_HEADERS([sys/timeb.h])
413AC_CHECK_HEADERS([signal.h])
414AC_CHECK_HEADERS([arpa/nameser.h], [], [],
415[#if HAVE_SYS_TYPES_H
416# include <sys/types.h>
417# endif
418])
419AC_CHECK_HEADERS([resolv.h], [], [],
420[#if HAVE_SYS_TYPES_H
421# include <sys/types.h>
422# endif
423#if HAVE_NETINET_IN_H
424# include <netinet/in.h>
425# endif
426#if HAVE_ARPA_NAMESER_H
427# include <arpa/nameser.h>
428# endif
429])
Daniel Veillarddcd93902005-01-13 11:25:15 +0000430AC_CHECK_HEADERS([dl.h])
431AC_CHECK_HEADERS([dlfcn.h])
Daniel Veillard01791d51998-07-24 19:24:09 +0000432
Daniel Veillardfc979062004-03-04 22:07:16 +0000433
William M. Brack21e4ef22005-01-02 09:53:13 +0000434echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000435
Daniel Veillard01791d51998-07-24 19:24:09 +0000436dnl Checks for library functions.
437AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000438AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000439AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000440AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000441AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000442
Daniel Veillard92ad2102001-03-27 12:47:33 +0000443dnl Checking the standard string functions availability
444AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
445 NEED_TRIO=1)
446
William M. Brackf4caa5e2005-10-20 09:04:05 +0000447dnl Checking for va_copy availability
448AC_MSG_CHECKING([for va_copy])
449AC_TRY_LINK([#include <stdarg.h>
450va_list ap1,ap2;], [va_copy(ap1,ap2);],
451have_va_copy=yes,
452have_va_copy=no)
453AC_MSG_RESULT($have_va_copy)
454if test x"$have_va_copy" = x"yes"; then
455 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
456else
457 AC_MSG_CHECKING([for __va_copy])
458 AC_TRY_LINK([#include <stdarg.h>
459 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
460 have___va_copy=yes,
461 have___va_copy=no)
462 AC_MSG_RESULT($have___va_copy)
463 if test x"$have___va_copy" = x"yes"; then
464 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
465 fi
466fi
467
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000468dnl Checks for inet libraries:
Daniel Veillardd4e39ae2005-10-28 15:59:14 +0000469AC_SEARCH_LIBS(gethostent, [nsl])
470AC_SEARCH_LIBS(setsockopt, [socket net])
471AC_SEARCH_LIBS(connect, [inet])
Daniel Veillardb05deb71999-08-10 19:04:08 +0000472
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000473dnl Determine what socket length (socklen_t) data type is
474AC_MSG_CHECKING([for type of socket length (socklen_t)])
475AC_TRY_COMPILE2([
476#include <stddef.h>
477#include <sys/types.h>
478#include <sys/socket.h>],[
479(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
480 AC_MSG_RESULT(socklen_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000481 XML_SOCKLEN_T=socklen_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000482 AC_TRY_COMPILE2([
483#include <stddef.h>
484#include <sys/types.h>
485#include <sys/socket.h>],[
486(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
487 AC_MSG_RESULT(size_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000488 XML_SOCKLEN_T=size_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000489 AC_TRY_COMPILE2([
490#include <stddef.h>
491#include <sys/types.h>
492#include <sys/socket.h>],[
493(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
494 AC_MSG_RESULT(int *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000495 XML_SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000496 AC_MSG_WARN(could not determine)
Daniel Veillardc284c642005-03-31 10:24:24 +0000497 XML_SOCKLEN_T="int"])])])
498AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000499
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000500dnl ***********************Checking for availability of IPv6*******************
501
502AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000503AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000504if test "$with_minimum" = "yes"
505then
506 enable_ipv6=no
507fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000508if test $enable_ipv6 = yes; then
509 have_ipv6=no
510 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000511 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000512 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000513 ], [
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000514 struct sockaddr_storage ss;
515 socket(AF_INET6, SOCK_STREAM, 0)
516 ],
517 have_ipv6=yes,
518 have_ipv6=no
519 )
520 AC_MSG_RESULT($have_ipv6)
521
William M. Brack476cd962003-08-13 11:09:42 +0000522 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000523 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000524 have_broken_ss_family=no
525
526 dnl *********************************************************************
527 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
528 dnl a ss_family member, but rather __ss_family. Let's detect that
William M. Brack7d8b36b2005-06-25 07:30:50 +0000529 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
530 dnl platforms. However, we should only do this if ss_family is not
531 dnl present.
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000532 dnl ********************************************************************
William M. Brack7d8b36b2005-06-25 07:30:50 +0000533 AC_MSG_CHECKING([struct sockaddr::ss_family])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000534 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000535 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000536 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000537 ], [
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000538 struct sockaddr_storage ss ;
William M. Brack7d8b36b2005-06-25 07:30:50 +0000539 ss.ss_family = 0 ;
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000540 ],
William M. Brack7d8b36b2005-06-25 07:30:50 +0000541 have_ss_family=yes,
542 have_ss_family=no
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000543 )
William M. Brack7d8b36b2005-06-25 07:30:50 +0000544 AC_MSG_RESULT($have_ss_family)
545 if test x$have_ss_family = xno ; then
546 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
547 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000548 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000549 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000550 ], [
William M. Brack7d8b36b2005-06-25 07:30:50 +0000551 struct sockaddr_storage ss ;
552 ss.__ss_family = 0 ;
553 ],
554 have_broken_ss_family=yes,
555 have_broken_ss_family=no
556 )
557 AC_MSG_RESULT($have_broken_ss_family)
558 if test x$have_broken_ss_family = xyes ; then
559 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
560 [Whether struct sockaddr::__ss_family exists])
561 AC_DEFINE(ss_family, __ss_family,
562 [ss_family is not defined here, use __ss_family instead])
563 else
564 AC_MSG_WARN(ss_family and __ss_family not found)
565 fi
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000566 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000567
568 have_getaddrinfo=no
569 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
570 if test $have_getaddrinfo != yes; then
571 for lib in bsd socket inet; do
572 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
573 done
574 fi
575
William M. Brack476cd962003-08-13 11:09:42 +0000576 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000577 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000578 fi
579 fi
580fi
581
582dnl ******************************End IPv6 checks******************************
583
Daniel Veillardb05deb71999-08-10 19:04:08 +0000584dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000585AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000586 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000587
Daniel Veillardc790bf42003-10-11 10:50:10 +0000588AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
589 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000590
591XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000592XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000593
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000594dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000595dnl Extra flags
596dnl
597XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000598RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000599
600dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000601dnl Workaround for native compilers
602dnl HP : http://bugs.gnome.org/db/31/3163.html
603dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000604dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000605if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000606 case "${host}" in
Daniel Veillard6a0baa02005-12-10 11:11:12 +0000607 hppa*-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000608 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000609 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000610 *-dec-osf* )
611 CFLAGS="${CFLAGS} -ieee"
612 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000613 alpha*-*-linux* )
614 CFLAGS="${CFLAGS} -ieee"
615 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000616 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000617else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000618 if test "$with_fexceptions" = "yes"
619 then
620 #
621 # Not activated by default because this inflates the code size
622 # Used to allow propagation of C++ exceptions through the library
623 #
624 CFLAGS="${CFLAGS} -fexceptions"
625 fi
626
Daniel Veillard05f97352004-10-31 15:35:32 +0000627 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 +0000628 case "${host}" in
629 alpha*-*-linux* )
630 CFLAGS="${CFLAGS} -mieee"
631 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000632 alpha*-*-osf* )
633 CFLAGS="${CFLAGS} -mieee"
634 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000635 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000636fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000637case ${host} in
638 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000639 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
640 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000641 hppa*-hp-mpeix)
642 NEED_TRIO=1
643 ;;
Daniel Veillard4188ddf2006-01-19 08:58:42 +0000644 *-*-mingw* | *-*-cygwin* | *-*-msvc* )
645 # If the host is Windows, and shared libraries are disabled, we
646 # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
647 # work properly (without it, xmlexports.h would force the use of
648 # DLL imports, which obviously aren't present in a static
649 # library).
650 if test "x$enable_shared" = "xno"; then
651 XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
652 CFLAGS="$CFLAGS -DLIBXML_STATIC"
653 fi
654 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000655esac
656
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000657
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000658dnl
659dnl check for python
660dnl
661
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000662PYTHON_VERSION=
663PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000664PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000665PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000666pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000667if test "$with_python" != "no" ; then
668 if test -x "$with_python/bin/python"
669 then
670 echo Found python in $with_python/bin/python
671 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000672 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000673 if test -x "$with_python"
674 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000675 echo Found python in $with_python
676 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000677 else
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000678 if test -x "$PYTHON"
679 then
680 echo Found python in environment PYTHON=$PYTHON
Daniel Veillard8492ba12006-04-25 12:52:12 +0000681 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000682 else
Daniel Veillardc2f70562005-09-01 12:45:26 +0000683 AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000684 fi
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000685 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000686 fi
687 if test "$PYTHON" != ""
688 then
689 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
690 echo Found Python version $PYTHON_VERSION
691 fi
692 if test "$PYTHON_VERSION" != ""
693 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000694 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
695 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000696 then
697 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000698 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000699 else
700 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
701 then
Daniel Veillard8492ba12006-04-25 12:52:12 +0000702 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000703 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000704 else
705 if test -r /usr/include/python$PYTHON_VERSION/Python.h
706 then
707 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000708 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000709 else
710 echo could not find python$PYTHON_VERSION/Python.h
711 fi
712 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000713 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000714 then
715 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
716 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000717 fi
718 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000719 if test "$with_python" != ""
720 then
Daniel Veillardd7d07482006-05-03 13:15:44 +0000721 pythondir='$(PYTHON_SITE_PACKAGES)'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000722 else
Daniel Veillardb2f8f1d2006-04-28 16:30:48 +0000723 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000724 fi
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000725else
726 PYTHON=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000727fi
728AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000729if test "$PYTHON_INCLUDES" != ""
730then
731 PYTHON_SUBDIR=python
732else
733 PYTHON_SUBDIR=
734fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000735AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000736AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000737
Daniel Veillardce1648b2005-01-04 15:10:22 +0000738dnl check for dso support
739WITH_MODULES=0
Daniel Veillardce1648b2005-01-04 15:10:22 +0000740TEST_MODULES=
741
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000742if test "$with_modules" != "no" ; then
Daniel Veillard9202b672005-07-14 09:31:14 +0000743 case "$host" in
744 *-*-cygwin*)
745 MODULE_EXTENSION=".dll"
746 AC_CHECK_LIB(cygwin, dlopen, [
747 WITH_MODULES=1
748 MODULE_PLATFORM_LIBS=
749 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
750 ])
751 ;;
752 *)
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000753 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
754 AC_CHECK_LIB(dld, shl_load, [
755 MODULE_PLATFORM_LIBS="-ldld"
756 libxml_have_shl_load=yes], [
757 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
758 AC_CHECK_LIB(dl, dlopen, [
759 MODULE_PLATFORM_LIBS="-ldl"
760 libxml_have_dlopen=yes])])])])
761
762 if test "${libxml_have_shl_load}" = "yes"; then
763 MODULE_EXTENSION=".sl"
Daniel Veillard9202b672005-07-14 09:31:14 +0000764 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000765 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000766 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000767
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000768 if test "${libxml_have_dlopen}" = "yes"; then
769 case "${host}" in
770 *-*-hpux* )
771 MODULE_EXTENSION=".sl"
772 ;;
773 * )
774 MODULE_EXTENSION=".so"
775 ;;
776 esac
777
Daniel Veillard9202b672005-07-14 09:31:14 +0000778 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000779 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000780 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000781 ;;
782 esac
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000783fi
Daniel Veillardce1648b2005-01-04 15:10:22 +0000784
785if test "${WITH_MODULES}" = "1"; then
786 TEST_MODULES="ModuleTests"
787fi
788
789AC_SUBST(WITH_MODULES)
790AC_SUBST(MODULE_PLATFORM_LIBS)
791AC_SUBST(MODULE_EXTENSION)
792AC_SUBST(TEST_MODULES)
793
Daniel Veillard437b87b2000-01-03 17:30:46 +0000794dnl
795dnl Tester makes use of readline if present
796dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000797
Daniel Veillard361d8452000-04-03 19:48:13 +0000798dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000799dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000800dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000801dnl
William M. Brack871611b2003-10-18 04:53:14 +0000802if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000803 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Brack7f28a012007-01-11 23:42:10 +0000804 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000805 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000806 if test "$with_minimum" != "yes"
807 then
808 if test "${with_mem_debug}" = "" ; then
Daniel Veillard379a3b72005-08-12 10:18:14 +0000809 echo Activating memory debugging
Daniel Veillard4432df22003-09-28 18:58:27 +0000810 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000811 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000812 fi
813 if test "${with_docbook}" = "" ; then
814 with_docbook="yes"
815 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000816 fi
Daniel Veillard3854c572005-08-25 10:17:45 +0000817 if test "${GCC}" = "yes" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000818 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 +0000819 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000820 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000821dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000822else
823 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000824fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000825AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000826
827dnl
828dnl Check for trio string functions
829dnl
830
831if test "${NEED_TRIO}" = "1" ; then
832 echo Adding trio library for string functions
833 WITH_TRIO=1
834else
835 WITH_TRIO=0
836fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000837AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000838AC_SUBST(WITH_TRIO)
839
Daniel Veillardf6eea272001-01-18 12:17:12 +0000840dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000841dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000842dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000843echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000844
William M. Brack21e4ef22005-01-02 09:53:13 +0000845dnl
846dnl Thread-related stuff
847dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000848THREAD_LIBS=""
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000849BASE_THREAD_LIBS=""
Daniel Veillardb8478642001-10-12 17:29:10 +0000850WITH_THREADS=0
851THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000852TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000853THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000854
Daniel Veillard84942712003-04-18 14:40:05 +0000855if test "$with_threads" = "no" ; then
856 echo Disabling multithreaded support
857else
Daniel Veillardb8478642001-10-12 17:29:10 +0000858 echo Enabling multithreaded support
859
860 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000861 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000862 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000863 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
864 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000865 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000866 case $host_os in
867 *mingw32*) WITH_THREADS="1"
868 THREADS_W32="Win32"
869 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
870 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000871 *cygwin*) THREAD_LIBS=""
872 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000873 *beos*) WITH_THREADS="1"
874 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
875 ;;
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000876 *linux*)
Daniel Veillard32a461f2005-08-25 21:48:54 +0000877 if test "${GCC}" = "yes" ; then
878 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
879 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
880 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
881 if test "${THREAD_LIBS}" = "-lpthread" ; then
882 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
883 then
884 THREAD_LIBS=""
885 BASE_THREAD_LIBS="-lpthread"
886 else
887 if expr ${GCC_MAJOR} \> 3 > /dev/null
888 then
889 THREAD_LIBS=""
890 BASE_THREAD_LIBS="-lpthread"
891 else
892 echo old GCC disabling weak symbols for pthread
893 fi
894 fi
895 fi
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000896 fi
897 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000898 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000899 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000900 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
901 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000902 fi
903fi
William M. Brack306e33c2004-06-12 01:01:22 +0000904if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000905 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000906fi
907
Daniel Veillardb8478642001-10-12 17:29:10 +0000908AC_SUBST(THREAD_LIBS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000909AC_SUBST(BASE_THREAD_LIBS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000910AC_SUBST(WITH_THREADS)
911AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000912AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000913AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000914
William M. Brack21e4ef22005-01-02 09:53:13 +0000915dnl
916dnl xmllint shell history
917dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000918if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000919 echo Enabling xmllint shell history
920 dnl check for terminal library. this is a very cool solution
921 dnl from octave's configure.in
922 unset tcap
923 for termlib in ncurses curses termcap terminfo termlib; do
924 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
925 test -n "$tcap" && break
926 done
927
928 AC_CHECK_HEADER(readline/history.h,
929 AC_CHECK_LIB(history, append_history,[
930 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000931 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000932 AC_CHECK_HEADER(readline/readline.h,
933 AC_CHECK_LIB(readline, readline,[
934 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000935 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000936 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
937 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
938 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000939 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000940fi
941
William M. Brack21e4ef22005-01-02 09:53:13 +0000942dnl
943dnl Tree functions
944dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000945if test "$with_tree" = "no" ; then
946 echo Disabling DOM like tree manipulation APIs
947 WITH_TREE=0
948else
949 WITH_TREE=1
950fi
951AC_SUBST(WITH_TREE)
952
Daniel Veillard361d8452000-04-03 19:48:13 +0000953if test "$with_ftp" = "no" ; then
954 echo Disabling FTP support
955 WITH_FTP=0
956 FTP_OBJ=
957else
958 WITH_FTP=1
959 FTP_OBJ=nanoftp.o
960fi
961AC_SUBST(WITH_FTP)
962AC_SUBST(FTP_OBJ)
963
Daniel Veillard361d8452000-04-03 19:48:13 +0000964if test "$with_http" = "no" ; then
965 echo Disabling HTTP support
966 WITH_HTTP=0
967 HTTP_OBJ=
968else
969 WITH_HTTP=1
970 HTTP_OBJ=nanohttp.o
971fi
972AC_SUBST(WITH_HTTP)
973AC_SUBST(HTTP_OBJ)
974
Daniel Veillard4432df22003-09-28 18:58:27 +0000975if test "$with_legacy" = "no" ; then
976 echo Disabling deprecated APIs
977 WITH_LEGACY=0
978else
979 WITH_LEGACY=1
980fi
981AC_SUBST(WITH_LEGACY)
982
Daniel Veillard81273902003-09-30 00:43:48 +0000983if test "$with_reader" = "no" ; then
984 echo Disabling the xmlReader parsing interface
985 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000986 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000987else
988 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000989 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +0000990 if test "$with_push" = "no" ; then
991 echo xmlReader requires Push interface - enabling it
992 with_push=yes
993 fi
Daniel Veillard81273902003-09-30 00:43:48 +0000994fi
995AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000996AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000997
William M. Brack21e4ef22005-01-02 09:53:13 +0000998if test "$with_writer" = "no" ; then
999 echo Disabling the xmlWriter saving interface
1000 WITH_WRITER=0
1001# WRITER_TEST=
1002else
1003 WITH_WRITER=1
1004# WRITER_TEST=Writertests
1005 if test "$with_push" = "no" ; then
1006 echo xmlWriter requires Push interface - enabling it
1007 with_push=yes
1008 fi
1009 if test "$with_output" = "no" ; then
1010 echo xmlWriter requires Output interface - enabling it
1011 with_output=yes
1012 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001013fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001014AC_SUBST(WITH_WRITER)
1015#AC_SUBST(WRITER_TEST)
1016
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001017if test "$with_pattern" = "no" ; then
1018 echo Disabling the xmlPattern parsing interface
1019 WITH_PATTERN=0
Daniel Veillardf9d16912005-01-30 22:36:30 +00001020 TEST_PATTERN=
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001021else
1022 WITH_PATTERN=1
Daniel Veillardf9d16912005-01-30 22:36:30 +00001023 TEST_PATTERN=Patterntests
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001024fi
1025AC_SUBST(WITH_PATTERN)
Daniel Veillardf9d16912005-01-30 22:36:30 +00001026AC_SUBST(TEST_PATTERN)
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001027
Daniel Veillard81273902003-09-30 00:43:48 +00001028if test "$with_sax1" = "no" ; then
1029 echo Disabling the older SAX1 interface
1030 WITH_SAX1=0
1031 TEST_SAX=
1032else
1033 WITH_SAX1=1
1034 TEST_SAX=SAXtests
1035fi
1036AC_SUBST(WITH_SAX1)
1037AC_SUBST(TEST_SAX)
1038
Daniel Veillard73b013f2003-09-30 12:36:01 +00001039if test "$with_push" = "no" ; then
1040 echo Disabling the PUSH parser interfaces
1041 WITH_PUSH=0
1042 TEST_PUSH=
1043else
1044 WITH_PUSH=1
1045 TEST_PUSH="XMLPushtests"
1046fi
1047AC_SUBST(WITH_PUSH)
1048AC_SUBST(TEST_PUSH)
1049
Daniel Veillard73b013f2003-09-30 12:36:01 +00001050if test "$with_html" = "no" ; then
1051 echo Disabling HTML support
1052 WITH_HTML=0
1053 HTML_OBJ=
1054 TEST_HTML=
1055else
1056 WITH_HTML=1
1057 HTML_OBJ="HTMLparser.o HTMLtree.o"
1058 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +00001059 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +00001060 TEST_PHTML=HTMLPushtests
1061 else
1062 TEST_PHTML=
1063 fi
1064fi
1065AC_SUBST(WITH_HTML)
1066AC_SUBST(HTML_OBJ)
1067AC_SUBST(TEST_HTML)
1068AC_SUBST(TEST_PHTML)
1069
Daniel Veillard73b013f2003-09-30 12:36:01 +00001070if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +00001071 echo Disabling DTD validation support
1072 WITH_VALID=0
1073 TEST_VALID=
1074 TEST_VTIME=
1075else
1076 WITH_VALID=1
1077 TEST_VALID=Validtests
1078 TEST_VTIME=VTimingtests
1079fi
1080AC_SUBST(WITH_VALID)
1081AC_SUBST(TEST_VALID)
1082AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +00001083
Daniel Veillarda7374592001-05-10 14:17:55 +00001084if test "$with_catalog" = "no" ; then
1085 echo Disabling Catalog support
1086 WITH_CATALOG=0
1087 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001088 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +00001089else
1090 WITH_CATALOG=1
1091 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +00001092 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +00001093fi
1094AC_SUBST(WITH_CATALOG)
1095AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001096AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +00001097
Daniel Veillardb59076b2001-04-29 17:04:07 +00001098if test "$with_docbook" = "no" ; then
1099 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +00001100 WITH_DOCB=0
1101 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +00001102else
1103 WITH_DOCB=1
1104 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +00001105fi
1106AC_SUBST(WITH_DOCB)
1107AC_SUBST(DOCB_OBJ)
1108
1109
William M. Brack21e4ef22005-01-02 09:53:13 +00001110if test "$with_xptr" = "no" ; then
1111 echo Disabling XPointer support
1112 WITH_XPTR=0
1113 XPTR_OBJ=
1114 TEST_XPTR=
1115else
1116 WITH_XPTR=1
1117 XPTR_OBJ=xpointer.o
1118 TEST_XPTR=XPtrtests
1119 if test "$with_xpath" = "no" ; then
1120 echo XPointer requires XPath support - enabling it
1121 with_xpath=yes
1122 fi
Daniel Veillard4432df22003-09-28 18:58:27 +00001123fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001124AC_SUBST(WITH_XPTR)
1125AC_SUBST(XPTR_OBJ)
1126AC_SUBST(TEST_XPTR)
1127
1128if test "$with_c14n" = "no" ; then
1129 echo Disabling C14N support
1130 WITH_C14N=0
1131 C14N_OBJ=
1132 TEST_C14N=
1133else
1134 WITH_C14N=1
1135 C14N_OBJ="c14n.c"
1136 TEST_C14N=C14Ntests
1137 if test "$with_xpath" = "no" ; then
1138 echo C14N requires XPath support - enabling it
1139 with_xpath=yes
1140 fi
1141fi
1142AC_SUBST(WITH_C14N)
1143AC_SUBST(C14N_OBJ)
1144AC_SUBST(TEST_C14N)
1145
1146if test "$with_xinclude" = "no" ; then
1147 echo Disabling XInclude support
1148 WITH_XINCLUDE=0
1149 XINCLUDE_OBJ=
1150 with_xinclude="no"
1151 TEST_XINCLUDE=
1152else
1153 WITH_XINCLUDE=1
1154 XINCLUDE_OBJ=xinclude.o
1155 TEST_XINCLUDE=XIncludetests
1156 if test "$with_xpath" = "no" ; then
1157 echo XInclude requires XPath support - enabling it
1158 with_xpath=yes
1159 fi
1160fi
1161AC_SUBST(WITH_XINCLUDE)
1162AC_SUBST(XINCLUDE_OBJ)
1163AC_SUBST(TEST_XINCLUDE)
1164
Daniel Veillard361d8452000-04-03 19:48:13 +00001165if test "$with_xpath" = "no" ; then
1166 echo Disabling XPATH support
1167 WITH_XPATH=0
1168 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001169 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001170else
1171 WITH_XPATH=1
1172 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001173 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001174fi
1175AC_SUBST(WITH_XPATH)
1176AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001177AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001178
William M. Brack21e4ef22005-01-02 09:53:13 +00001179dnl
1180dnl output functions
1181dnl
1182if test "$with_output" = "no" ; then
1183 echo Disabling serialization/saving support
1184 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001185else
William M. Brack21e4ef22005-01-02 09:53:13 +00001186 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001187fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001188AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001189
Daniel Veillard6e90d192001-07-03 16:37:49 +00001190WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001191if test "$with_iconv" = "no" ; then
1192 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001193else
Daniel Veillard220346d2001-12-07 11:33:54 +00001194 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001195 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001196 # Export this since our headers include iconv.h
1197 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001198 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001199 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001200
1201 AC_CHECK_HEADER(iconv.h,
1202 AC_MSG_CHECKING(for iconv)
1203 AC_TRY_LINK([#include <stdlib.h>
1204#include <iconv.h>],[
1205iconv_t cd = iconv_open ("","");
1206iconv (cd, NULL, NULL, NULL, NULL);],[
1207 AC_MSG_RESULT(yes)
1208 WITH_ICONV=1],[
1209 AC_MSG_RESULT(no)
1210 AC_MSG_CHECKING(for iconv in -liconv)
1211
1212 _ldflags="${LDFLAGS}"
1213 _libs="${LIBS}"
1214 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1215 LIBS="${LIBS} -liconv"
1216
1217 AC_TRY_LINK([#include <stdlib.h>
1218#include <iconv.h>],[
1219iconv_t cd = iconv_open ("","");
1220iconv (cd, NULL, NULL, NULL, NULL);],[
1221 AC_MSG_RESULT(yes)
1222 WITH_ICONV=1
1223 ICONV_LIBS="${ICONV_LIBS} -liconv"
1224 LIBS="${_libs}"
1225 LDFLAGS="${_ldflags}"],[
1226 AC_MSG_RESULT(no)
1227 LIBS="${_libs}"
1228 LDFLAGS="${_ldflags}"])]))
Daniel Veillard8e1a46d2008-02-15 07:47:26 +00001229
1230 if test "$WITH_ICONV" = "1" ; then
1231 AC_MSG_CHECKING([for iconv declaration])
1232 AC_CACHE_VAL(xml_cv_iconv_arg2, [
1233 AC_TRY_COMPILE([#include <stdlib.h>
1234#include <iconv.h>
1235extern
1236#ifdef __cplusplus
1237"C"
1238#endif
1239#if defined(__STDC__) || defined(__cplusplus)
1240size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1241#else
1242size_t iconv();
1243#endif
1244], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
1245
1246 xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
1247 AC_MSG_RESULT([${xml_xxx:-
1248 }$xml_cv_iconv_decl])
1249 AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
1250 [Define as const if the declaration of iconv() needs const.])
1251 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001252fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001253case "$host" in
1254 *mingw*) M_LIBS=""
1255 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001256 *beos*) M_LIBS=""
1257 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001258 *) M_LIBS="-lm"
1259 ;;
1260esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001261XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001262XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001263AC_SUBST(WITH_ICONV)
1264
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001265WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001266if test "$WITH_ICONV" != "1" ; then
1267if test "$with_iso8859x" = "no" ; then
1268 echo Disabling ISO8859X support
1269 WITH_ISO8859X=0
1270fi
1271fi
1272AC_SUBST(WITH_ISO8859X)
1273
Daniel Veillarded6c5492005-07-23 15:00:22 +00001274if test "$with_schematron" = "no" ; then
1275 echo "Disabling Schematron support"
1276 WITH_SCHEMATRON=0
1277 TEST_SCHEMATRON=
1278else
1279 echo "Enabled Schematron support"
1280 WITH_SCHEMATRON=1
1281 TEST_SCHEMATRON="Schematrontests"
1282 with_xpath=yes
1283 with_pattern=yes
1284fi
1285AC_SUBST(WITH_SCHEMATRON)
1286AC_SUBST(TEST_SCHEMATRON)
1287
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001288if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001289 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001290 WITH_SCHEMAS=0
1291 TEST_SCHEMAS=
1292else
Daniel Veillard71531f32003-02-05 13:19:53 +00001293 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001294 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001295 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001296 if test "$PYTHON_INCLUDES" != "" ; then
1297 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1298 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001299 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001300fi
1301AC_SUBST(WITH_SCHEMAS)
1302AC_SUBST(TEST_SCHEMAS)
1303
Daniel Veillard23e73572002-09-19 19:56:43 +00001304if test "$with_regexps" = "no" ; then
1305 echo Disabling Regexps support
1306 WITH_REGEXPS=0
1307 TEST_REGEXPS=
1308else
1309 WITH_REGEXPS=1
1310 TEST_REGEXPS="Regexptests Automatatests"
1311fi
1312AC_SUBST(WITH_REGEXPS)
1313AC_SUBST(TEST_REGEXPS)
1314
Daniel Veillard361d8452000-04-03 19:48:13 +00001315if test "$with_debug" = "no" ; then
1316 echo Disabling DEBUG support
1317 WITH_DEBUG=0
1318 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001319 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001320else
1321 WITH_DEBUG=1
1322 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001323 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001324fi
1325AC_SUBST(WITH_DEBUG)
1326AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001327AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001328
Daniel Veillard361d8452000-04-03 19:48:13 +00001329if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001330 if test "$with_thread_alloc" = "yes" ; then
1331 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1332 WITH_MEM_DEBUG=0
1333 else
1334 echo Enabling memory debug support
1335 WITH_MEM_DEBUG=1
1336 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001337else
1338 WITH_MEM_DEBUG=0
1339fi
1340AC_SUBST(WITH_MEM_DEBUG)
1341
Daniel Veillard22cdb842004-10-04 14:09:17 +00001342if test "$with_run_debug" = "yes" ; then
1343 echo Enabling runtime debug support
1344 WITH_RUN_DEBUG=1
1345else
1346 WITH_RUN_DEBUG=0
1347fi
1348AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001349
1350WIN32_EXTRA_LIBADD=
1351WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001352CYGWIN_EXTRA_LDFLAGS=
1353CYGWIN_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001354case "$host" in
1355 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001356 CPPFLAGS="$CPPFLAGS -DWIN32"
1357 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001358 WIN32_EXTRA_LDFLAGS="-no-undefined"
1359 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1360 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1361 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1362 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001363 *-*-cygwin*)
1364 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001365 if test "${PYTHON}" != ""
1366 then
1367 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1368 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001369 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001370esac
1371AC_SUBST(WIN32_EXTRA_LIBADD)
1372AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001373AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1374AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001375
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001376if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
1377then
1378 echo Enabling code coverage for GCC
1379 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
1380 LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
1381else
1382 echo Disabling code coverage for GCC
1383fi
1384
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001385AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001386AC_SUBST(CFLAGS)
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001387AC_SUBST(LDFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001388AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001389
Daniel Veillardb05deb71999-08-10 19:04:08 +00001390AC_SUBST(XML_LIBDIR)
1391AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001392AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001393AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001394AC_SUBST(XML_INCLUDEDIR)
1395AC_SUBST(HTML_DIR)
1396AC_SUBST(HAVE_ISNAN)
1397AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001398AC_SUBST(PYTHON)
1399AC_SUBST(PYTHON_VERSION)
1400AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001401AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001402
Daniel Veillardb05deb71999-08-10 19:04:08 +00001403AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001404AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001405
Daniel Veillard9715c172002-11-25 16:33:40 +00001406dnl for the spec file
1407RELDATE=`date +'%a %b %e %Y'`
1408AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001409AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001410
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001411rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001412ln -s Copyright COPYING
1413
Daniel Veillarde4177a52004-01-08 16:43:57 +00001414# keep on one line for cygwin c.f. #130896
Daniel Veillard99b78502005-09-11 22:04:08 +00001415AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/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 +00001416
Daniel Veillard06d25242004-02-25 13:01:42 +00001417chmod +x xml2-config python/setup.py
Daniel Veillard67952602006-01-05 15:29:44 +00001418echo Done configuring