blob: 04f363fb905c85fc48e08ee7505dd87f3af433d5 [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
Daniel Veillard7f4547c2008-10-03 07:58:23 +00008LIBXML_MICRO_VERSION=2
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])
Daniel Veillard7f4547c2008-10-03 07:58:23 +0000381AC_CHECK_HEADERS([stdint.h])
382AC_CHECK_HEADERS([inttypes.h.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000383AC_CHECK_HEADERS([time.h])
384AC_CHECK_HEADERS([ansidecl.h])
385AC_CHECK_HEADERS([ieeefp.h])
386AC_CHECK_HEADERS([nan.h])
387AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000388AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000389AC_CHECK_HEADERS([fp_class.h])
390AC_CHECK_HEADERS([float.h])
391AC_CHECK_HEADERS([stdlib.h])
392AC_CHECK_HEADERS([sys/socket.h], [], [],
393[#if HAVE_SYS_TYPES_H
394# include <sys/types.h>
395# endif
396])
397AC_CHECK_HEADERS([netinet/in.h], [], [],
398[#if HAVE_SYS_TYPES_H
399# include <sys/types.h>
400# endif
401])
402AC_CHECK_HEADERS([arpa/inet.h], [], [],
403[#if HAVE_SYS_TYPES_H
404# include <sys/types.h>
405# endif
406#if HAVE_ARPA_INET_H
407# include <arpa/inet.h>
408# endif
409])
410AC_CHECK_HEADERS([netdb.h])
411AC_CHECK_HEADERS([sys/time.h])
412AC_CHECK_HEADERS([sys/select.h])
413AC_CHECK_HEADERS([sys/mman.h])
414AC_CHECK_HEADERS([sys/timeb.h])
415AC_CHECK_HEADERS([signal.h])
416AC_CHECK_HEADERS([arpa/nameser.h], [], [],
417[#if HAVE_SYS_TYPES_H
418# include <sys/types.h>
419# endif
420])
421AC_CHECK_HEADERS([resolv.h], [], [],
422[#if HAVE_SYS_TYPES_H
423# include <sys/types.h>
424# endif
425#if HAVE_NETINET_IN_H
426# include <netinet/in.h>
427# endif
428#if HAVE_ARPA_NAMESER_H
429# include <arpa/nameser.h>
430# endif
431])
Daniel Veillarddcd93902005-01-13 11:25:15 +0000432AC_CHECK_HEADERS([dl.h])
433AC_CHECK_HEADERS([dlfcn.h])
Daniel Veillard01791d51998-07-24 19:24:09 +0000434
Daniel Veillardfc979062004-03-04 22:07:16 +0000435
William M. Brack21e4ef22005-01-02 09:53:13 +0000436echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000437
Daniel Veillard01791d51998-07-24 19:24:09 +0000438dnl Checks for library functions.
439AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000440AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000441AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000442AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000443AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000444
Daniel Veillard92ad2102001-03-27 12:47:33 +0000445dnl Checking the standard string functions availability
446AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
447 NEED_TRIO=1)
448
William M. Brackf4caa5e2005-10-20 09:04:05 +0000449dnl Checking for va_copy availability
450AC_MSG_CHECKING([for va_copy])
451AC_TRY_LINK([#include <stdarg.h>
452va_list ap1,ap2;], [va_copy(ap1,ap2);],
453have_va_copy=yes,
454have_va_copy=no)
455AC_MSG_RESULT($have_va_copy)
456if test x"$have_va_copy" = x"yes"; then
457 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
458else
459 AC_MSG_CHECKING([for __va_copy])
460 AC_TRY_LINK([#include <stdarg.h>
461 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
462 have___va_copy=yes,
463 have___va_copy=no)
464 AC_MSG_RESULT($have___va_copy)
465 if test x"$have___va_copy" = x"yes"; then
466 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
467 fi
468fi
469
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000470dnl Checks for inet libraries:
Daniel Veillardd4e39ae2005-10-28 15:59:14 +0000471AC_SEARCH_LIBS(gethostent, [nsl])
472AC_SEARCH_LIBS(setsockopt, [socket net])
473AC_SEARCH_LIBS(connect, [inet])
Daniel Veillardb05deb71999-08-10 19:04:08 +0000474
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000475dnl Determine what socket length (socklen_t) data type is
476AC_MSG_CHECKING([for type of socket length (socklen_t)])
477AC_TRY_COMPILE2([
478#include <stddef.h>
479#include <sys/types.h>
480#include <sys/socket.h>],[
481(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
482 AC_MSG_RESULT(socklen_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000483 XML_SOCKLEN_T=socklen_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000484 AC_TRY_COMPILE2([
485#include <stddef.h>
486#include <sys/types.h>
487#include <sys/socket.h>],[
488(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
489 AC_MSG_RESULT(size_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000490 XML_SOCKLEN_T=size_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000491 AC_TRY_COMPILE2([
492#include <stddef.h>
493#include <sys/types.h>
494#include <sys/socket.h>],[
495(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
496 AC_MSG_RESULT(int *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000497 XML_SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000498 AC_MSG_WARN(could not determine)
Daniel Veillardc284c642005-03-31 10:24:24 +0000499 XML_SOCKLEN_T="int"])])])
500AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000501
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000502dnl ***********************Checking for availability of IPv6*******************
503
504AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000505AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000506if test "$with_minimum" = "yes"
507then
508 enable_ipv6=no
509fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000510if test $enable_ipv6 = yes; then
511 have_ipv6=no
512 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000513 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000514 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000515 ], [
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000516 struct sockaddr_storage ss;
517 socket(AF_INET6, SOCK_STREAM, 0)
518 ],
519 have_ipv6=yes,
520 have_ipv6=no
521 )
522 AC_MSG_RESULT($have_ipv6)
523
William M. Brack476cd962003-08-13 11:09:42 +0000524 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000525 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000526 have_broken_ss_family=no
527
528 dnl *********************************************************************
529 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
530 dnl a ss_family member, but rather __ss_family. Let's detect that
William M. Brack7d8b36b2005-06-25 07:30:50 +0000531 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
532 dnl platforms. However, we should only do this if ss_family is not
533 dnl present.
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000534 dnl ********************************************************************
William M. Brack7d8b36b2005-06-25 07:30:50 +0000535 AC_MSG_CHECKING([struct sockaddr::ss_family])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000536 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000537 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000538 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000539 ], [
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000540 struct sockaddr_storage ss ;
William M. Brack7d8b36b2005-06-25 07:30:50 +0000541 ss.ss_family = 0 ;
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000542 ],
William M. Brack7d8b36b2005-06-25 07:30:50 +0000543 have_ss_family=yes,
544 have_ss_family=no
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000545 )
William M. Brack7d8b36b2005-06-25 07:30:50 +0000546 AC_MSG_RESULT($have_ss_family)
547 if test x$have_ss_family = xno ; then
548 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
549 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000550 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000551 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000552 ], [
William M. Brack7d8b36b2005-06-25 07:30:50 +0000553 struct sockaddr_storage ss ;
554 ss.__ss_family = 0 ;
555 ],
556 have_broken_ss_family=yes,
557 have_broken_ss_family=no
558 )
559 AC_MSG_RESULT($have_broken_ss_family)
560 if test x$have_broken_ss_family = xyes ; then
561 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
562 [Whether struct sockaddr::__ss_family exists])
563 AC_DEFINE(ss_family, __ss_family,
564 [ss_family is not defined here, use __ss_family instead])
565 else
566 AC_MSG_WARN(ss_family and __ss_family not found)
567 fi
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000568 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000569
570 have_getaddrinfo=no
571 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
572 if test $have_getaddrinfo != yes; then
573 for lib in bsd socket inet; do
574 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
575 done
576 fi
577
William M. Brack476cd962003-08-13 11:09:42 +0000578 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000579 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000580 fi
581 fi
582fi
583
584dnl ******************************End IPv6 checks******************************
585
Daniel Veillardb05deb71999-08-10 19:04:08 +0000586dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000587AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000588 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000589
Daniel Veillardc790bf42003-10-11 10:50:10 +0000590AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
591 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000592
593XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000594XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000595
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000596dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000597dnl Extra flags
598dnl
599XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000600RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000601
602dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000603dnl Workaround for native compilers
604dnl HP : http://bugs.gnome.org/db/31/3163.html
605dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000606dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000607if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000608 case "${host}" in
Daniel Veillard6a0baa02005-12-10 11:11:12 +0000609 hppa*-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000610 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000611 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000612 *-dec-osf* )
613 CFLAGS="${CFLAGS} -ieee"
614 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000615 alpha*-*-linux* )
616 CFLAGS="${CFLAGS} -ieee"
617 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000618 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000619else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000620 if test "$with_fexceptions" = "yes"
621 then
622 #
623 # Not activated by default because this inflates the code size
624 # Used to allow propagation of C++ exceptions through the library
625 #
626 CFLAGS="${CFLAGS} -fexceptions"
627 fi
628
Daniel Veillard05f97352004-10-31 15:35:32 +0000629 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 +0000630 case "${host}" in
631 alpha*-*-linux* )
632 CFLAGS="${CFLAGS} -mieee"
633 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000634 alpha*-*-osf* )
635 CFLAGS="${CFLAGS} -mieee"
636 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000637 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000638fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000639case ${host} in
640 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000641 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
642 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000643 hppa*-hp-mpeix)
644 NEED_TRIO=1
645 ;;
Daniel Veillard4188ddf2006-01-19 08:58:42 +0000646 *-*-mingw* | *-*-cygwin* | *-*-msvc* )
647 # If the host is Windows, and shared libraries are disabled, we
648 # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
649 # work properly (without it, xmlexports.h would force the use of
650 # DLL imports, which obviously aren't present in a static
651 # library).
652 if test "x$enable_shared" = "xno"; then
653 XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
654 CFLAGS="$CFLAGS -DLIBXML_STATIC"
655 fi
656 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000657esac
658
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000659
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000660dnl
661dnl check for python
662dnl
663
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000664PYTHON_VERSION=
665PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000666PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000667PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000668pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000669if test "$with_python" != "no" ; then
670 if test -x "$with_python/bin/python"
671 then
672 echo Found python in $with_python/bin/python
673 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000674 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000675 if test -x "$with_python"
676 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000677 echo Found python in $with_python
678 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000679 else
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000680 if test -x "$PYTHON"
681 then
682 echo Found python in environment PYTHON=$PYTHON
Daniel Veillard8492ba12006-04-25 12:52:12 +0000683 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000684 else
Daniel Veillardc2f70562005-09-01 12:45:26 +0000685 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 +0000686 fi
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000687 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000688 fi
689 if test "$PYTHON" != ""
690 then
691 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
692 echo Found Python version $PYTHON_VERSION
693 fi
694 if test "$PYTHON_VERSION" != ""
695 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000696 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
697 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000698 then
699 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000700 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000701 else
702 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
703 then
Daniel Veillard8492ba12006-04-25 12:52:12 +0000704 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000705 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000706 else
707 if test -r /usr/include/python$PYTHON_VERSION/Python.h
708 then
709 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000710 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000711 else
712 echo could not find python$PYTHON_VERSION/Python.h
713 fi
714 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000715 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000716 then
717 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
718 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000719 fi
720 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000721 if test "$with_python" != ""
722 then
Daniel Veillardd7d07482006-05-03 13:15:44 +0000723 pythondir='$(PYTHON_SITE_PACKAGES)'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000724 else
Daniel Veillardb2f8f1d2006-04-28 16:30:48 +0000725 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000726 fi
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000727else
728 PYTHON=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000729fi
730AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000731if test "$PYTHON_INCLUDES" != ""
732then
733 PYTHON_SUBDIR=python
734else
735 PYTHON_SUBDIR=
736fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000737AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000738AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000739
Daniel Veillardce1648b2005-01-04 15:10:22 +0000740dnl check for dso support
741WITH_MODULES=0
Daniel Veillardce1648b2005-01-04 15:10:22 +0000742TEST_MODULES=
743
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000744if test "$with_modules" != "no" ; then
Daniel Veillard9202b672005-07-14 09:31:14 +0000745 case "$host" in
746 *-*-cygwin*)
747 MODULE_EXTENSION=".dll"
748 AC_CHECK_LIB(cygwin, dlopen, [
749 WITH_MODULES=1
750 MODULE_PLATFORM_LIBS=
751 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
752 ])
753 ;;
754 *)
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000755 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
756 AC_CHECK_LIB(dld, shl_load, [
757 MODULE_PLATFORM_LIBS="-ldld"
758 libxml_have_shl_load=yes], [
759 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
760 AC_CHECK_LIB(dl, dlopen, [
761 MODULE_PLATFORM_LIBS="-ldl"
762 libxml_have_dlopen=yes])])])])
763
764 if test "${libxml_have_shl_load}" = "yes"; then
765 MODULE_EXTENSION=".sl"
Daniel Veillard9202b672005-07-14 09:31:14 +0000766 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000767 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000768 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000769
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000770 if test "${libxml_have_dlopen}" = "yes"; then
771 case "${host}" in
772 *-*-hpux* )
773 MODULE_EXTENSION=".sl"
774 ;;
775 * )
776 MODULE_EXTENSION=".so"
777 ;;
778 esac
779
Daniel Veillard9202b672005-07-14 09:31:14 +0000780 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000781 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000782 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000783 ;;
784 esac
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000785fi
Daniel Veillardce1648b2005-01-04 15:10:22 +0000786
787if test "${WITH_MODULES}" = "1"; then
788 TEST_MODULES="ModuleTests"
789fi
790
791AC_SUBST(WITH_MODULES)
792AC_SUBST(MODULE_PLATFORM_LIBS)
793AC_SUBST(MODULE_EXTENSION)
794AC_SUBST(TEST_MODULES)
795
Daniel Veillard437b87b2000-01-03 17:30:46 +0000796dnl
797dnl Tester makes use of readline if present
798dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000799
Daniel Veillard361d8452000-04-03 19:48:13 +0000800dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000801dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000802dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000803dnl
William M. Brack871611b2003-10-18 04:53:14 +0000804if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000805 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Brack7f28a012007-01-11 23:42:10 +0000806 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000807 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000808 if test "$with_minimum" != "yes"
809 then
810 if test "${with_mem_debug}" = "" ; then
Daniel Veillard379a3b72005-08-12 10:18:14 +0000811 echo Activating memory debugging
Daniel Veillard4432df22003-09-28 18:58:27 +0000812 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000813 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000814 fi
815 if test "${with_docbook}" = "" ; then
816 with_docbook="yes"
817 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000818 fi
Daniel Veillard3854c572005-08-25 10:17:45 +0000819 if test "${GCC}" = "yes" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000820 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 +0000821 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000822 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000823dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000824else
825 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000826fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000827AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000828
829dnl
830dnl Check for trio string functions
831dnl
832
833if test "${NEED_TRIO}" = "1" ; then
834 echo Adding trio library for string functions
835 WITH_TRIO=1
836else
837 WITH_TRIO=0
838fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000839AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000840AC_SUBST(WITH_TRIO)
841
Daniel Veillardf6eea272001-01-18 12:17:12 +0000842dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000843dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000844dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000845echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000846
William M. Brack21e4ef22005-01-02 09:53:13 +0000847dnl
848dnl Thread-related stuff
849dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000850THREAD_LIBS=""
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000851BASE_THREAD_LIBS=""
Daniel Veillardb8478642001-10-12 17:29:10 +0000852WITH_THREADS=0
853THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000854TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000855THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000856
Daniel Veillard84942712003-04-18 14:40:05 +0000857if test "$with_threads" = "no" ; then
858 echo Disabling multithreaded support
859else
Daniel Veillardb8478642001-10-12 17:29:10 +0000860 echo Enabling multithreaded support
861
862 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000863 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000864 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000865 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
866 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000867 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000868 case $host_os in
869 *mingw32*) WITH_THREADS="1"
870 THREADS_W32="Win32"
871 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
872 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000873 *cygwin*) THREAD_LIBS=""
874 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000875 *beos*) WITH_THREADS="1"
876 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
877 ;;
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000878 *linux*)
Daniel Veillard32a461f2005-08-25 21:48:54 +0000879 if test "${GCC}" = "yes" ; then
880 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
881 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
882 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
883 if test "${THREAD_LIBS}" = "-lpthread" ; then
884 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
885 then
886 THREAD_LIBS=""
887 BASE_THREAD_LIBS="-lpthread"
888 else
889 if expr ${GCC_MAJOR} \> 3 > /dev/null
890 then
891 THREAD_LIBS=""
892 BASE_THREAD_LIBS="-lpthread"
893 else
894 echo old GCC disabling weak symbols for pthread
895 fi
896 fi
897 fi
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000898 fi
899 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000900 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000901 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000902 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
903 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000904 fi
905fi
William M. Brack306e33c2004-06-12 01:01:22 +0000906if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000907 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000908fi
909
Daniel Veillardb8478642001-10-12 17:29:10 +0000910AC_SUBST(THREAD_LIBS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000911AC_SUBST(BASE_THREAD_LIBS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000912AC_SUBST(WITH_THREADS)
913AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000914AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000915AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000916
William M. Brack21e4ef22005-01-02 09:53:13 +0000917dnl
918dnl xmllint shell history
919dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000920if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000921 echo Enabling xmllint shell history
922 dnl check for terminal library. this is a very cool solution
923 dnl from octave's configure.in
924 unset tcap
925 for termlib in ncurses curses termcap terminfo termlib; do
926 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
927 test -n "$tcap" && break
928 done
929
930 AC_CHECK_HEADER(readline/history.h,
931 AC_CHECK_LIB(history, append_history,[
932 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000933 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000934 AC_CHECK_HEADER(readline/readline.h,
935 AC_CHECK_LIB(readline, readline,[
936 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000937 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000938 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
939 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
940 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000941 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000942fi
943
William M. Brack21e4ef22005-01-02 09:53:13 +0000944dnl
945dnl Tree functions
946dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000947if test "$with_tree" = "no" ; then
948 echo Disabling DOM like tree manipulation APIs
949 WITH_TREE=0
950else
951 WITH_TREE=1
952fi
953AC_SUBST(WITH_TREE)
954
Daniel Veillard361d8452000-04-03 19:48:13 +0000955if test "$with_ftp" = "no" ; then
956 echo Disabling FTP support
957 WITH_FTP=0
958 FTP_OBJ=
959else
960 WITH_FTP=1
961 FTP_OBJ=nanoftp.o
962fi
963AC_SUBST(WITH_FTP)
964AC_SUBST(FTP_OBJ)
965
Daniel Veillard361d8452000-04-03 19:48:13 +0000966if test "$with_http" = "no" ; then
967 echo Disabling HTTP support
968 WITH_HTTP=0
969 HTTP_OBJ=
970else
971 WITH_HTTP=1
972 HTTP_OBJ=nanohttp.o
973fi
974AC_SUBST(WITH_HTTP)
975AC_SUBST(HTTP_OBJ)
976
Daniel Veillard4432df22003-09-28 18:58:27 +0000977if test "$with_legacy" = "no" ; then
978 echo Disabling deprecated APIs
979 WITH_LEGACY=0
980else
981 WITH_LEGACY=1
982fi
983AC_SUBST(WITH_LEGACY)
984
Daniel Veillard81273902003-09-30 00:43:48 +0000985if test "$with_reader" = "no" ; then
986 echo Disabling the xmlReader parsing interface
987 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000988 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000989else
990 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000991 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +0000992 if test "$with_push" = "no" ; then
993 echo xmlReader requires Push interface - enabling it
994 with_push=yes
995 fi
Daniel Veillard81273902003-09-30 00:43:48 +0000996fi
997AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000998AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000999
William M. Brack21e4ef22005-01-02 09:53:13 +00001000if test "$with_writer" = "no" ; then
1001 echo Disabling the xmlWriter saving interface
1002 WITH_WRITER=0
1003# WRITER_TEST=
1004else
1005 WITH_WRITER=1
1006# WRITER_TEST=Writertests
1007 if test "$with_push" = "no" ; then
1008 echo xmlWriter requires Push interface - enabling it
1009 with_push=yes
1010 fi
1011 if test "$with_output" = "no" ; then
1012 echo xmlWriter requires Output interface - enabling it
1013 with_output=yes
1014 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001015fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001016AC_SUBST(WITH_WRITER)
1017#AC_SUBST(WRITER_TEST)
1018
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001019if test "$with_pattern" = "no" ; then
1020 echo Disabling the xmlPattern parsing interface
1021 WITH_PATTERN=0
Daniel Veillardf9d16912005-01-30 22:36:30 +00001022 TEST_PATTERN=
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001023else
1024 WITH_PATTERN=1
Daniel Veillardf9d16912005-01-30 22:36:30 +00001025 TEST_PATTERN=Patterntests
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001026fi
1027AC_SUBST(WITH_PATTERN)
Daniel Veillardf9d16912005-01-30 22:36:30 +00001028AC_SUBST(TEST_PATTERN)
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001029
Daniel Veillard81273902003-09-30 00:43:48 +00001030if test "$with_sax1" = "no" ; then
1031 echo Disabling the older SAX1 interface
1032 WITH_SAX1=0
1033 TEST_SAX=
1034else
1035 WITH_SAX1=1
1036 TEST_SAX=SAXtests
1037fi
1038AC_SUBST(WITH_SAX1)
1039AC_SUBST(TEST_SAX)
1040
Daniel Veillard73b013f2003-09-30 12:36:01 +00001041if test "$with_push" = "no" ; then
1042 echo Disabling the PUSH parser interfaces
1043 WITH_PUSH=0
1044 TEST_PUSH=
1045else
1046 WITH_PUSH=1
1047 TEST_PUSH="XMLPushtests"
1048fi
1049AC_SUBST(WITH_PUSH)
1050AC_SUBST(TEST_PUSH)
1051
Daniel Veillard73b013f2003-09-30 12:36:01 +00001052if test "$with_html" = "no" ; then
1053 echo Disabling HTML support
1054 WITH_HTML=0
1055 HTML_OBJ=
1056 TEST_HTML=
1057else
1058 WITH_HTML=1
1059 HTML_OBJ="HTMLparser.o HTMLtree.o"
1060 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +00001061 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +00001062 TEST_PHTML=HTMLPushtests
1063 else
1064 TEST_PHTML=
1065 fi
1066fi
1067AC_SUBST(WITH_HTML)
1068AC_SUBST(HTML_OBJ)
1069AC_SUBST(TEST_HTML)
1070AC_SUBST(TEST_PHTML)
1071
Daniel Veillard73b013f2003-09-30 12:36:01 +00001072if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +00001073 echo Disabling DTD validation support
1074 WITH_VALID=0
1075 TEST_VALID=
1076 TEST_VTIME=
1077else
1078 WITH_VALID=1
1079 TEST_VALID=Validtests
1080 TEST_VTIME=VTimingtests
1081fi
1082AC_SUBST(WITH_VALID)
1083AC_SUBST(TEST_VALID)
1084AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +00001085
Daniel Veillarda7374592001-05-10 14:17:55 +00001086if test "$with_catalog" = "no" ; then
1087 echo Disabling Catalog support
1088 WITH_CATALOG=0
1089 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001090 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +00001091else
1092 WITH_CATALOG=1
1093 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +00001094 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +00001095fi
1096AC_SUBST(WITH_CATALOG)
1097AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001098AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +00001099
Daniel Veillardb59076b2001-04-29 17:04:07 +00001100if test "$with_docbook" = "no" ; then
1101 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +00001102 WITH_DOCB=0
1103 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +00001104else
1105 WITH_DOCB=1
1106 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +00001107fi
1108AC_SUBST(WITH_DOCB)
1109AC_SUBST(DOCB_OBJ)
1110
1111
William M. Brack21e4ef22005-01-02 09:53:13 +00001112if test "$with_xptr" = "no" ; then
1113 echo Disabling XPointer support
1114 WITH_XPTR=0
1115 XPTR_OBJ=
1116 TEST_XPTR=
1117else
1118 WITH_XPTR=1
1119 XPTR_OBJ=xpointer.o
1120 TEST_XPTR=XPtrtests
1121 if test "$with_xpath" = "no" ; then
1122 echo XPointer requires XPath support - enabling it
1123 with_xpath=yes
1124 fi
Daniel Veillard4432df22003-09-28 18:58:27 +00001125fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001126AC_SUBST(WITH_XPTR)
1127AC_SUBST(XPTR_OBJ)
1128AC_SUBST(TEST_XPTR)
1129
1130if test "$with_c14n" = "no" ; then
1131 echo Disabling C14N support
1132 WITH_C14N=0
1133 C14N_OBJ=
1134 TEST_C14N=
1135else
1136 WITH_C14N=1
1137 C14N_OBJ="c14n.c"
1138 TEST_C14N=C14Ntests
1139 if test "$with_xpath" = "no" ; then
1140 echo C14N requires XPath support - enabling it
1141 with_xpath=yes
1142 fi
1143fi
1144AC_SUBST(WITH_C14N)
1145AC_SUBST(C14N_OBJ)
1146AC_SUBST(TEST_C14N)
1147
1148if test "$with_xinclude" = "no" ; then
1149 echo Disabling XInclude support
1150 WITH_XINCLUDE=0
1151 XINCLUDE_OBJ=
1152 with_xinclude="no"
1153 TEST_XINCLUDE=
1154else
1155 WITH_XINCLUDE=1
1156 XINCLUDE_OBJ=xinclude.o
1157 TEST_XINCLUDE=XIncludetests
1158 if test "$with_xpath" = "no" ; then
1159 echo XInclude requires XPath support - enabling it
1160 with_xpath=yes
1161 fi
1162fi
1163AC_SUBST(WITH_XINCLUDE)
1164AC_SUBST(XINCLUDE_OBJ)
1165AC_SUBST(TEST_XINCLUDE)
1166
Daniel Veillard361d8452000-04-03 19:48:13 +00001167if test "$with_xpath" = "no" ; then
1168 echo Disabling XPATH support
1169 WITH_XPATH=0
1170 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001171 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001172else
1173 WITH_XPATH=1
1174 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001175 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001176fi
1177AC_SUBST(WITH_XPATH)
1178AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001179AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001180
William M. Brack21e4ef22005-01-02 09:53:13 +00001181dnl
1182dnl output functions
1183dnl
1184if test "$with_output" = "no" ; then
1185 echo Disabling serialization/saving support
1186 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001187else
William M. Brack21e4ef22005-01-02 09:53:13 +00001188 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001189fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001190AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001191
Daniel Veillard6e90d192001-07-03 16:37:49 +00001192WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001193if test "$with_iconv" = "no" ; then
1194 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001195else
Daniel Veillard220346d2001-12-07 11:33:54 +00001196 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001197 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001198 # Export this since our headers include iconv.h
1199 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001200 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001201 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001202
1203 AC_CHECK_HEADER(iconv.h,
1204 AC_MSG_CHECKING(for iconv)
1205 AC_TRY_LINK([#include <stdlib.h>
1206#include <iconv.h>],[
1207iconv_t cd = iconv_open ("","");
1208iconv (cd, NULL, NULL, NULL, NULL);],[
1209 AC_MSG_RESULT(yes)
1210 WITH_ICONV=1],[
1211 AC_MSG_RESULT(no)
1212 AC_MSG_CHECKING(for iconv in -liconv)
1213
1214 _ldflags="${LDFLAGS}"
1215 _libs="${LIBS}"
1216 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1217 LIBS="${LIBS} -liconv"
1218
1219 AC_TRY_LINK([#include <stdlib.h>
1220#include <iconv.h>],[
1221iconv_t cd = iconv_open ("","");
1222iconv (cd, NULL, NULL, NULL, NULL);],[
1223 AC_MSG_RESULT(yes)
1224 WITH_ICONV=1
1225 ICONV_LIBS="${ICONV_LIBS} -liconv"
1226 LIBS="${_libs}"
1227 LDFLAGS="${_ldflags}"],[
1228 AC_MSG_RESULT(no)
1229 LIBS="${_libs}"
1230 LDFLAGS="${_ldflags}"])]))
Daniel Veillard8e1a46d2008-02-15 07:47:26 +00001231
1232 if test "$WITH_ICONV" = "1" ; then
1233 AC_MSG_CHECKING([for iconv declaration])
1234 AC_CACHE_VAL(xml_cv_iconv_arg2, [
1235 AC_TRY_COMPILE([#include <stdlib.h>
1236#include <iconv.h>
1237extern
1238#ifdef __cplusplus
1239"C"
1240#endif
1241#if defined(__STDC__) || defined(__cplusplus)
1242size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1243#else
1244size_t iconv();
1245#endif
1246], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
1247
1248 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);"
1249 AC_MSG_RESULT([${xml_xxx:-
1250 }$xml_cv_iconv_decl])
1251 AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
1252 [Define as const if the declaration of iconv() needs const.])
1253 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001254fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001255case "$host" in
1256 *mingw*) M_LIBS=""
1257 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001258 *beos*) M_LIBS=""
1259 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001260 *) M_LIBS="-lm"
1261 ;;
1262esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001263XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001264XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001265AC_SUBST(WITH_ICONV)
1266
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001267WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001268if test "$WITH_ICONV" != "1" ; then
1269if test "$with_iso8859x" = "no" ; then
1270 echo Disabling ISO8859X support
1271 WITH_ISO8859X=0
1272fi
1273fi
1274AC_SUBST(WITH_ISO8859X)
1275
Daniel Veillarded6c5492005-07-23 15:00:22 +00001276if test "$with_schematron" = "no" ; then
1277 echo "Disabling Schematron support"
1278 WITH_SCHEMATRON=0
1279 TEST_SCHEMATRON=
1280else
1281 echo "Enabled Schematron support"
1282 WITH_SCHEMATRON=1
1283 TEST_SCHEMATRON="Schematrontests"
1284 with_xpath=yes
1285 with_pattern=yes
1286fi
1287AC_SUBST(WITH_SCHEMATRON)
1288AC_SUBST(TEST_SCHEMATRON)
1289
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001290if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001291 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001292 WITH_SCHEMAS=0
1293 TEST_SCHEMAS=
1294else
Daniel Veillard71531f32003-02-05 13:19:53 +00001295 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001296 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001297 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001298 if test "$PYTHON_INCLUDES" != "" ; then
1299 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1300 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001301 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001302fi
1303AC_SUBST(WITH_SCHEMAS)
1304AC_SUBST(TEST_SCHEMAS)
1305
Daniel Veillard23e73572002-09-19 19:56:43 +00001306if test "$with_regexps" = "no" ; then
1307 echo Disabling Regexps support
1308 WITH_REGEXPS=0
1309 TEST_REGEXPS=
1310else
1311 WITH_REGEXPS=1
1312 TEST_REGEXPS="Regexptests Automatatests"
1313fi
1314AC_SUBST(WITH_REGEXPS)
1315AC_SUBST(TEST_REGEXPS)
1316
Daniel Veillard361d8452000-04-03 19:48:13 +00001317if test "$with_debug" = "no" ; then
1318 echo Disabling DEBUG support
1319 WITH_DEBUG=0
1320 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001321 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001322else
1323 WITH_DEBUG=1
1324 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001325 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001326fi
1327AC_SUBST(WITH_DEBUG)
1328AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001329AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001330
Daniel Veillard361d8452000-04-03 19:48:13 +00001331if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001332 if test "$with_thread_alloc" = "yes" ; then
1333 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1334 WITH_MEM_DEBUG=0
1335 else
1336 echo Enabling memory debug support
1337 WITH_MEM_DEBUG=1
1338 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001339else
1340 WITH_MEM_DEBUG=0
1341fi
1342AC_SUBST(WITH_MEM_DEBUG)
1343
Daniel Veillard22cdb842004-10-04 14:09:17 +00001344if test "$with_run_debug" = "yes" ; then
1345 echo Enabling runtime debug support
1346 WITH_RUN_DEBUG=1
1347else
1348 WITH_RUN_DEBUG=0
1349fi
1350AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001351
1352WIN32_EXTRA_LIBADD=
1353WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001354CYGWIN_EXTRA_LDFLAGS=
1355CYGWIN_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001356case "$host" in
1357 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001358 CPPFLAGS="$CPPFLAGS -DWIN32"
1359 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001360 WIN32_EXTRA_LDFLAGS="-no-undefined"
1361 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1362 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1363 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1364 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001365 *-*-cygwin*)
1366 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001367 if test "${PYTHON}" != ""
1368 then
1369 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1370 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001371 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001372esac
1373AC_SUBST(WIN32_EXTRA_LIBADD)
1374AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001375AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1376AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001377
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001378if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
1379then
1380 echo Enabling code coverage for GCC
1381 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
1382 LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
1383else
1384 echo Disabling code coverage for GCC
1385fi
1386
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001387AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001388AC_SUBST(CFLAGS)
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001389AC_SUBST(LDFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001390AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001391
Daniel Veillardb05deb71999-08-10 19:04:08 +00001392AC_SUBST(XML_LIBDIR)
1393AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001394AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001395AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001396AC_SUBST(XML_INCLUDEDIR)
1397AC_SUBST(HTML_DIR)
1398AC_SUBST(HAVE_ISNAN)
1399AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001400AC_SUBST(PYTHON)
1401AC_SUBST(PYTHON_VERSION)
1402AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001403AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001404
Daniel Veillardb05deb71999-08-10 19:04:08 +00001405AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001406AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001407
Daniel Veillard9715c172002-11-25 16:33:40 +00001408dnl for the spec file
1409RELDATE=`date +'%a %b %e %Y'`
1410AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001411AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001412
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001413rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001414ln -s Copyright COPYING
1415
Daniel Veillarde4177a52004-01-08 16:43:57 +00001416# keep on one line for cygwin c.f. #130896
Daniel Veillard99b78502005-09-11 22:04:08 +00001417AC_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 +00001418
Daniel Veillard06d25242004-02-25 13:01:42 +00001419chmod +x xml2-config python/setup.py
Daniel Veillard67952602006-01-05 15:29:44 +00001420echo Done configuring