blob: cb9e0b1df1a769230bf67f4da6748d6e4df543b7 [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
Owen Taylor3473f882001-02-23 17:55:21 +00002AC_INIT(entities.c)
Daniel Veillard01791d51998-07-24 19:24:09 +00003AM_CONFIG_HEADER(config.h)
Daniel Veillardd2ade932000-09-30 14:39:55 +00004AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00005
Daniel Veillardcf461992000-03-14 18:30:20 +00006LIBXML_MAJOR_VERSION=2
Daniel Veillard4fc52812003-09-01 20:33:13 +00007LIBXML_MINOR_VERSION=6
Daniel Veillardb2f8f1d2006-04-28 16:30:48 +00008LIBXML_MICRO_VERSION=24
Daniel Veillard3e35f8e2003-10-21 00:05:38 +00009LIBXML_MICRO_VERSION_SUFFIX=
Daniel Veillard4fc52812003-09-01 20:33:13 +000010LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
Daniel Veillard14fff061999-06-22 21:49:07 +000011LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
12
Daniel Veillard361d8452000-04-03 19:48:13 +000013LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
14
William M. Brackf4025492004-08-18 21:08:46 +000015if test -f CVS/Entries; then
Daniel Veillarddab93ea2004-08-20 16:47:10 +000016 extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
17 echo extra=$extra
18 if test "$extra" != ""
19 then
20 LIBXML_VERSION_EXTRA="-CVS$extra"
21 fi
William M. Brackf4025492004-08-18 21:08:46 +000022fi
Daniel Veillard14fff061999-06-22 21:49:07 +000023AC_SUBST(LIBXML_MAJOR_VERSION)
24AC_SUBST(LIBXML_MINOR_VERSION)
25AC_SUBST(LIBXML_MICRO_VERSION)
26AC_SUBST(LIBXML_VERSION)
27AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000028AC_SUBST(LIBXML_VERSION_NUMBER)
William M. Brackf4025492004-08-18 21:08:46 +000029AC_SUBST(LIBXML_VERSION_EXTRA)
Daniel Veillard14fff061999-06-22 21:49:07 +000030
Daniel Veillard361d8452000-04-03 19:48:13 +000031VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000032
Daniel Veillardedfb29b2000-03-14 19:59:05 +000033AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000034
Daniel Veillard01791d51998-07-24 19:24:09 +000035dnl Checks for programs.
36AC_PROG_CC
37AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000038AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000039AC_PATH_PROG(RM, rm, /bin/rm)
40AC_PATH_PROG(MV, mv, /bin/mv)
41AC_PATH_PROG(TAR, tar, /bin/tar)
William M. Brack1826d0a2004-07-21 09:03:57 +000042AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard8b817da2004-09-30 09:19:33 +000043AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
Daniel Veillard06500c82004-09-07 09:12:44 +000044AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
Daniel Veillard01791d51998-07-24 19:24:09 +000045
Daniel Veillard03109292000-08-14 14:58:22 +000046dnl Make sure we have an ANSI compiler
47AM_C_PROTOTYPES
48test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
49
Daniel Veillard6984e6d2003-12-09 14:20:17 +000050AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000051AM_PROG_LIBTOOL
52
Daniel Veillard4432df22003-09-28 18:58:27 +000053dnl
William M. Brack21e4ef22005-01-02 09:53:13 +000054dnl We process the AC_ARG_WITH first so that later we can modify
55dnl some of them to try to prevent impossible combinations. This
56dnl also allows up so alphabetize the choices
Daniel Veillard4432df22003-09-28 18:58:27 +000057dnl
Daniel Veillard4432df22003-09-28 18:58:27 +000058
William M. Brack21e4ef22005-01-02 09:53:13 +000059dnl
60dnl zlib option might change flags, so we save them initially
61dnl
Owen Taylor3473f882001-02-23 17:55:21 +000062_cppflags="${CPPFLAGS}"
63_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000064
William M. Brack21e4ef22005-01-02 09:53:13 +000065AC_ARG_WITH(c14n,
66[ --with-c14n add the Canonicalization support (on)])
67AC_ARG_WITH(catalog,
68[ --with-catalog add the Catalog support (on)])
69AC_ARG_WITH(debug,
70[ --with-debug add the debugging module (on)])
71AC_ARG_WITH(docbook,
72[ --with-docbook add Docbook SGML support (on)])
73AC_ARG_WITH(fexceptions,
74[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
75AC_ARG_WITH(ftp,
76[ --with-ftp add the FTP support (on)])
77AC_ARG_WITH(history,
78[ --with-history add history support to xmllint shell(off)])
79AC_ARG_WITH(html,
80[ --with-html add the HTML support (on)])
81dnl Specific dir for HTML output ?
82AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
83 [path to base html directory, default $datadir/doc/html]),
84 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
Daniel Veillard259ff742001-10-06 13:49:59 +000085
William M. Brack21e4ef22005-01-02 09:53:13 +000086AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
87 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
88 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
89 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
90AC_SUBST(HTML_DIR)
91AC_ARG_WITH(http,
92[ --with-http add the HTTP support (on)])
93AC_ARG_WITH(iconv,
94[ --with-iconv[[=DIR]] add ICONV support (on)])
95AC_ARG_WITH(iso8859x,
96[ --with-iso8859x add ISO8859X support if no iconv (on)])
97AC_ARG_WITH(legacy,
98[ --with-legacy add deprecated APIs for compatibility (on)])
99AC_ARG_WITH(mem_debug,
100[ --with-mem-debug add the memory debugging module (off)])
101AC_ARG_WITH(minimum,
102[ --with-minimum build a minimally sized library (off)])
103AC_ARG_WITH(output,
104[ --with-output add the serialization support (on)])
105AC_ARG_WITH(pattern,
106[ --with-pattern add the xmlPattern selection interface (on)])
107AC_ARG_WITH(push,
108[ --with-push add the PUSH parser interfaces (on)])
109AC_ARG_WITH(python,
110[ --with-python[[=DIR]] build Python bindings if found])
111AC_ARG_WITH(reader,
112[ --with-reader add the xmlReader parsing interface (on)])
113AC_ARG_WITH(readline,
114[ --with-readline=DIR use readline in DIR],[
115 if test "$withval" != "no" -a "$withval" != "yes"; then
116 RDL_DIR=$withval
117 CPPFLAGS="${CPPFLAGS} -I$withval/include"
118 LDFLAGS="${LDFLAGS} -L$withval/lib"
119 fi
120])
121AC_ARG_WITH(regexps,
122[ --with-regexps add Regular Expressions support (on)])
123AC_ARG_WITH(run_debug,
124[ --with-run-debug add the runtime debugging module (off)])
125AC_ARG_WITH(sax1,
126[ --with-sax1 add the older SAX1 interface (on)])
127AC_ARG_WITH(schemas,
Daniel Veillard39e5c892005-07-03 22:48:50 +0000128[ --with-schemas add Relax-NG and Schemas support (on)])
Daniel Veillarded6c5492005-07-23 15:00:22 +0000129AC_ARG_WITH(schematron,
130[ --with-schematron add Schematron support (on)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000131AC_ARG_WITH(threads,
132[ --with-threads add multithread support(on)])
133AC_ARG_WITH(thread-alloc,
134[ --with-thread-alloc add per-thread memory(off)])
135AC_ARG_WITH(tree,
136[ --with-tree add the DOM like tree manipulation APIs (on)])
137AC_ARG_WITH(valid,
138[ --with-valid add the DTD validation support (on)])
139AC_ARG_WITH(writer,
140[ --with-writer add the xmlWriter saving interface (on)])
141AC_ARG_WITH(xinclude,
142[ --with-xinclude add the XInclude support (on)])
143AC_ARG_WITH(xpath,
144[ --with-xpath add the XPATH support (on)])
145AC_ARG_WITH(xptr,
146[ --with-xptr add the XPointer support (on)])
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000147AC_ARG_WITH(modules,
148[ --with-modules add the dynamic modules support (on)])
Owen Taylor3473f882001-02-23 17:55:21 +0000149AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +0000150[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +0000151 if test "$withval" != "no" -a "$withval" != "yes"; then
152 Z_DIR=$withval
153 CPPFLAGS="${CPPFLAGS} -I$withval/include"
154 LDFLAGS="${LDFLAGS} -L$withval/lib"
155 fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000156])
William M. Brack21e4ef22005-01-02 09:53:13 +0000157
158dnl
Daniel Veillard39e5c892005-07-03 22:48:50 +0000159dnl hard dependancies on options
160dnl
161if test "$with_schemas" = "yes"
162then
163 with_pattern=yes
164 with_regexp=yes
165fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000166if test "$with_schematron" = "yes"
167then
168 with_pattern=yes
169 with_xpath=yes
170fi
Daniel Veillard39e5c892005-07-03 22:48:50 +0000171if test "$with_reader" = "yes"
172then
173 with_push=yes
174fi
175if test "$with_xptr" = "yes"
176then
177 with_xpath=yes
178fi
179dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000180dnl option to build a minimal libxml2 library
181dnl
182if test "$with_minimum" = "yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000183then
William M. Brack21e4ef22005-01-02 09:53:13 +0000184 echo "Configuring for a minimal library"
185 if test "$with_c14n" = ""
186 then
187 with_c14n=no
188 fi
189 if test "$with_catalog" = ""
190 then
191 with_catalog=no
192 fi
193 echo So far so good!
194 if test "$with_debug" = ""
195 then
196 with_debug=no
197 fi
198 if test "$with_docbook" = ""
199 then
200 with_docbook=no
201 fi
202 if test "$with_fexceptions" = ""
203 then
204 with_fexceptions=no
205 fi
206 if test "$with_ftp" = ""
207 then
208 with_ftp=no
209 fi
210 if test "$with_history" = ""
211 then
212 with_history=no
213 fi
214 if test "$with_html" = ""
215 then
216 with_html=no
217 fi
218 if test "$with_http" = ""
219 then
220 with_http=no
221 fi
222 if test "$with_iconv" = ""
223 then
224 with_iconv=no
225 fi
226 if test "$with_iso8859x" = ""
227 then
228 with_iso8859x=no
229 fi
230 if test "$with_legacy" = ""
231 then
232 with_legacy=no
233 fi
234 if test "$with_mem_debug" = ""
235 then
236 with_mem_debug=no
237 fi
238 if test "$with_output" = ""
239 then
240 with_output=no
241 fi
242 if test "$with_pattern" = ""
243 then
244 with_pattern=no
245 fi
246 if test "$with_push" = ""
247 then
248 with_push=no
249 fi
250 if test "$with_python" = ""
251 then
252 with_python=no
253 fi
254 if test "$with_reader" = ""
255 then
256 with_reader=no
257 fi
258 if test "$with_readline" = ""
259 then
260 with_readline=no
261 fi
262 if test "$with_regexp" = ""
263 then
264 with_regexp=no
265 fi
266 if test "$with_run_debug" = ""
267 then
268 with_run_debug=no
269 fi
270 if test "$with_sax1" = ""
271 then
272 with_sax1=no
273 fi
274 if test "$with_schemas" = ""
275 then
276 with_schemas=no
277 fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000278 if test "$with_schematron" = ""
279 then
280 with_schematron=no
281 fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000282 if test "$with_threads" = ""
283 then
284 with_threads=no
285 fi
286 if test "$with_thread_alloc" = ""
287 then
288 with_thread_alloc=no
289 fi
290 if test "$with_tree" = ""
291 then
292 with_tree=no
293 fi
294 if test "$with_valid" = ""
295 then
296 with_valid=no
297 fi
298 if test "$with_writer" = ""
299 then
300 with_writer=no
301 fi
302 if test "$with_xinclude" = ""
303 then
304 with_xinclude=no
305 fi
306 if test "$with_xpath" = ""
307 then
308 with_xpath=no
309 fi
310 if test "$with_xptr" = ""
311 then
312 with_xptr=no
313 fi
314 if test "$with_zlib" = ""
315 then
316 with_zlib=no
317 fi
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000318 if test "$with_modules" = ""
319 then
320 with_modules=no
321 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000322fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000323
324echo Checking zlib
325
326dnl Checks for zlib library.
327
Daniel Veillard259ff742001-10-06 13:49:59 +0000328if test "$with_zlib" = "no"; then
329 echo "Disabling compression support"
330else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000331 AC_CHECK_HEADERS(zlib.h,
332 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +0000333 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000334 if test "x${Z_DIR}" != "x"; then
335 Z_CFLAGS="-I${Z_DIR}/include"
336 Z_LIBS="-L${Z_DIR}/lib -lz"
337 [case ${host} in
338 *-*-solaris*)
339 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
340 ;;
341 esac]
342 else
343 Z_LIBS="-lz"
344 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +0000345fi
Owen Taylor3473f882001-02-23 17:55:21 +0000346
Owen Taylor3473f882001-02-23 17:55:21 +0000347AC_SUBST(Z_CFLAGS)
348AC_SUBST(Z_LIBS)
349
350CPPFLAGS=${_cppflags}
351LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000352
William M. Brack21e4ef22005-01-02 09:53:13 +0000353echo Checking headers
354
Daniel Veillard01791d51998-07-24 19:24:09 +0000355dnl Checks for header files.
356AC_HEADER_DIRENT
357AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000358AC_CHECK_HEADERS([fcntl.h])
359AC_CHECK_HEADERS([unistd.h])
360AC_CHECK_HEADERS([ctype.h])
361AC_CHECK_HEADERS([dirent.h])
362AC_CHECK_HEADERS([errno.h])
363AC_CHECK_HEADERS([malloc.h])
364AC_CHECK_HEADERS([stdarg.h])
365AC_CHECK_HEADERS([sys/stat.h])
366AC_CHECK_HEADERS([sys/types.h])
367AC_CHECK_HEADERS([time.h])
368AC_CHECK_HEADERS([ansidecl.h])
369AC_CHECK_HEADERS([ieeefp.h])
370AC_CHECK_HEADERS([nan.h])
371AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000372AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000373AC_CHECK_HEADERS([fp_class.h])
374AC_CHECK_HEADERS([float.h])
375AC_CHECK_HEADERS([stdlib.h])
376AC_CHECK_HEADERS([sys/socket.h], [], [],
377[#if HAVE_SYS_TYPES_H
378# include <sys/types.h>
379# endif
380])
381AC_CHECK_HEADERS([netinet/in.h], [], [],
382[#if HAVE_SYS_TYPES_H
383# include <sys/types.h>
384# endif
385])
386AC_CHECK_HEADERS([arpa/inet.h], [], [],
387[#if HAVE_SYS_TYPES_H
388# include <sys/types.h>
389# endif
390#if HAVE_ARPA_INET_H
391# include <arpa/inet.h>
392# endif
393])
394AC_CHECK_HEADERS([netdb.h])
395AC_CHECK_HEADERS([sys/time.h])
396AC_CHECK_HEADERS([sys/select.h])
397AC_CHECK_HEADERS([sys/mman.h])
398AC_CHECK_HEADERS([sys/timeb.h])
399AC_CHECK_HEADERS([signal.h])
400AC_CHECK_HEADERS([arpa/nameser.h], [], [],
401[#if HAVE_SYS_TYPES_H
402# include <sys/types.h>
403# endif
404])
405AC_CHECK_HEADERS([resolv.h], [], [],
406[#if HAVE_SYS_TYPES_H
407# include <sys/types.h>
408# endif
409#if HAVE_NETINET_IN_H
410# include <netinet/in.h>
411# endif
412#if HAVE_ARPA_NAMESER_H
413# include <arpa/nameser.h>
414# endif
415])
Daniel Veillarddcd93902005-01-13 11:25:15 +0000416AC_CHECK_HEADERS([dl.h])
417AC_CHECK_HEADERS([dlfcn.h])
Daniel Veillard01791d51998-07-24 19:24:09 +0000418
Daniel Veillardfc979062004-03-04 22:07:16 +0000419
William M. Brack21e4ef22005-01-02 09:53:13 +0000420echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000421
Daniel Veillard01791d51998-07-24 19:24:09 +0000422dnl Checks for library functions.
423AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000424AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000425AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000426AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000427AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000428
Daniel Veillard92ad2102001-03-27 12:47:33 +0000429dnl Checking the standard string functions availability
430AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
431 NEED_TRIO=1)
432
William M. Brackf4caa5e2005-10-20 09:04:05 +0000433dnl Checking for va_copy availability
434AC_MSG_CHECKING([for va_copy])
435AC_TRY_LINK([#include <stdarg.h>
436va_list ap1,ap2;], [va_copy(ap1,ap2);],
437have_va_copy=yes,
438have_va_copy=no)
439AC_MSG_RESULT($have_va_copy)
440if test x"$have_va_copy" = x"yes"; then
441 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
442else
443 AC_MSG_CHECKING([for __va_copy])
444 AC_TRY_LINK([#include <stdarg.h>
445 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
446 have___va_copy=yes,
447 have___va_copy=no)
448 AC_MSG_RESULT($have___va_copy)
449 if test x"$have___va_copy" = x"yes"; then
450 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
451 fi
452fi
453
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000454dnl Checks for inet libraries:
Daniel Veillardd4e39ae2005-10-28 15:59:14 +0000455AC_SEARCH_LIBS(gethostent, [nsl])
456AC_SEARCH_LIBS(setsockopt, [socket net])
457AC_SEARCH_LIBS(connect, [inet])
Daniel Veillardb05deb71999-08-10 19:04:08 +0000458
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000459dnl Determine what socket length (socklen_t) data type is
460AC_MSG_CHECKING([for type of socket length (socklen_t)])
461AC_TRY_COMPILE2([
462#include <stddef.h>
463#include <sys/types.h>
464#include <sys/socket.h>],[
465(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
466 AC_MSG_RESULT(socklen_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000467 XML_SOCKLEN_T=socklen_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000468 AC_TRY_COMPILE2([
469#include <stddef.h>
470#include <sys/types.h>
471#include <sys/socket.h>],[
472(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
473 AC_MSG_RESULT(size_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000474 XML_SOCKLEN_T=size_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000475 AC_TRY_COMPILE2([
476#include <stddef.h>
477#include <sys/types.h>
478#include <sys/socket.h>],[
479(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
480 AC_MSG_RESULT(int *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000481 XML_SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000482 AC_MSG_WARN(could not determine)
Daniel Veillardc284c642005-03-31 10:24:24 +0000483 XML_SOCKLEN_T="int"])])])
484AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000485
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000486dnl ***********************Checking for availability of IPv6*******************
487
488AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000489AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000490if test "$with_minimum" = "yes"
491then
492 enable_ipv6=no
493fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000494if test $enable_ipv6 = yes; then
495 have_ipv6=no
496 AC_TRY_COMPILE([
497 #include <sys/socket.h>
498 #include <sys/types.h>], [
499 struct sockaddr_storage ss;
500 socket(AF_INET6, SOCK_STREAM, 0)
501 ],
502 have_ipv6=yes,
503 have_ipv6=no
504 )
505 AC_MSG_RESULT($have_ipv6)
506
William M. Brack476cd962003-08-13 11:09:42 +0000507 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000508 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000509 have_broken_ss_family=no
510
511 dnl *********************************************************************
512 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
513 dnl a ss_family member, but rather __ss_family. Let's detect that
William M. Brack7d8b36b2005-06-25 07:30:50 +0000514 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
515 dnl platforms. However, we should only do this if ss_family is not
516 dnl present.
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000517 dnl ********************************************************************
William M. Brack7d8b36b2005-06-25 07:30:50 +0000518 AC_MSG_CHECKING([struct sockaddr::ss_family])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000519 AC_TRY_COMPILE([
520 #include <sys/socket.h>
521 #include <sys/types.h>], [
522 struct sockaddr_storage ss ;
William M. Brack7d8b36b2005-06-25 07:30:50 +0000523 ss.ss_family = 0 ;
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000524 ],
William M. Brack7d8b36b2005-06-25 07:30:50 +0000525 have_ss_family=yes,
526 have_ss_family=no
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000527 )
William M. Brack7d8b36b2005-06-25 07:30:50 +0000528 AC_MSG_RESULT($have_ss_family)
529 if test x$have_ss_family = xno ; then
530 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
531 AC_TRY_COMPILE([
532 #include <sys/socket.h>
533 #include <sys/types.h>], [
534 struct sockaddr_storage ss ;
535 ss.__ss_family = 0 ;
536 ],
537 have_broken_ss_family=yes,
538 have_broken_ss_family=no
539 )
540 AC_MSG_RESULT($have_broken_ss_family)
541 if test x$have_broken_ss_family = xyes ; then
542 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
543 [Whether struct sockaddr::__ss_family exists])
544 AC_DEFINE(ss_family, __ss_family,
545 [ss_family is not defined here, use __ss_family instead])
546 else
547 AC_MSG_WARN(ss_family and __ss_family not found)
548 fi
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000549 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000550
551 have_getaddrinfo=no
552 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
553 if test $have_getaddrinfo != yes; then
554 for lib in bsd socket inet; do
555 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
556 done
557 fi
558
William M. Brack476cd962003-08-13 11:09:42 +0000559 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000560 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000561 fi
562 fi
563fi
564
565dnl ******************************End IPv6 checks******************************
566
Daniel Veillardb05deb71999-08-10 19:04:08 +0000567dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000568AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000569 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000570
Daniel Veillardc790bf42003-10-11 10:50:10 +0000571AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
572 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000573
574XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000575XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000576
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000577dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000578dnl Extra flags
579dnl
580XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000581RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000582
583dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000584dnl Workaround for native compilers
585dnl HP : http://bugs.gnome.org/db/31/3163.html
586dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000587dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000588if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000589 case "${host}" in
Daniel Veillard6a0baa02005-12-10 11:11:12 +0000590 hppa*-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000591 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000592 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000593 *-dec-osf* )
594 CFLAGS="${CFLAGS} -ieee"
595 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000596 alpha*-*-linux* )
597 CFLAGS="${CFLAGS} -ieee"
598 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000599 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000600else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000601 if test "$with_fexceptions" = "yes"
602 then
603 #
604 # Not activated by default because this inflates the code size
605 # Used to allow propagation of C++ exceptions through the library
606 #
607 CFLAGS="${CFLAGS} -fexceptions"
608 fi
609
Daniel Veillard05f97352004-10-31 15:35:32 +0000610 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 +0000611 case "${host}" in
612 alpha*-*-linux* )
613 CFLAGS="${CFLAGS} -mieee"
614 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000615 alpha*-*-osf* )
616 CFLAGS="${CFLAGS} -mieee"
617 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000618 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000619fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000620case ${host} in
621 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000622 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
623 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000624 hppa*-hp-mpeix)
625 NEED_TRIO=1
626 ;;
Daniel Veillard4188ddf2006-01-19 08:58:42 +0000627 *-*-mingw* | *-*-cygwin* | *-*-msvc* )
628 # If the host is Windows, and shared libraries are disabled, we
629 # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
630 # work properly (without it, xmlexports.h would force the use of
631 # DLL imports, which obviously aren't present in a static
632 # library).
633 if test "x$enable_shared" = "xno"; then
634 XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
635 CFLAGS="$CFLAGS -DLIBXML_STATIC"
636 fi
637 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000638esac
639
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000640
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000641dnl
642dnl check for python
643dnl
644
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000645PYTHON_VERSION=
646PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000647PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000648PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000649pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000650if test "$with_python" != "no" ; then
651 if test -x "$with_python/bin/python"
652 then
653 echo Found python in $with_python/bin/python
654 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000655 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000656 if test -x "$with_python"
657 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000658 echo Found python in $with_python
659 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000660 else
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000661 if test -x "$PYTHON"
662 then
663 echo Found python in environment PYTHON=$PYTHON
Daniel Veillard8492ba12006-04-25 12:52:12 +0000664 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000665 else
Daniel Veillardc2f70562005-09-01 12:45:26 +0000666 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 +0000667 fi
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000668 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000669 fi
670 if test "$PYTHON" != ""
671 then
672 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
673 echo Found Python version $PYTHON_VERSION
674 fi
675 if test "$PYTHON_VERSION" != ""
676 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000677 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
678 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000679 then
680 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000681 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000682 else
683 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
684 then
Daniel Veillard8492ba12006-04-25 12:52:12 +0000685 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000686 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000687 else
688 if test -r /usr/include/python$PYTHON_VERSION/Python.h
689 then
690 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000691 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000692 else
693 echo could not find python$PYTHON_VERSION/Python.h
694 fi
695 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000696 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000697 then
698 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
699 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000700 fi
701 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000702 if test "$with_python" != ""
703 then
Daniel Veillardd7d07482006-05-03 13:15:44 +0000704 pythondir='$(PYTHON_SITE_PACKAGES)'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000705 else
Daniel Veillardb2f8f1d2006-04-28 16:30:48 +0000706 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000707 fi
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000708else
709 PYTHON=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000710fi
711AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000712if test "$PYTHON_INCLUDES" != ""
713then
714 PYTHON_SUBDIR=python
715else
716 PYTHON_SUBDIR=
717fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000718AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000719AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000720
Daniel Veillardce1648b2005-01-04 15:10:22 +0000721dnl check for dso support
722WITH_MODULES=0
Daniel Veillardce1648b2005-01-04 15:10:22 +0000723TEST_MODULES=
724
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000725if test "$with_modules" != "no" ; then
Daniel Veillard9202b672005-07-14 09:31:14 +0000726 case "$host" in
727 *-*-cygwin*)
728 MODULE_EXTENSION=".dll"
729 AC_CHECK_LIB(cygwin, dlopen, [
730 WITH_MODULES=1
731 MODULE_PLATFORM_LIBS=
732 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
733 ])
734 ;;
735 *)
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000736 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
737 AC_CHECK_LIB(dld, shl_load, [
738 MODULE_PLATFORM_LIBS="-ldld"
739 libxml_have_shl_load=yes], [
740 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
741 AC_CHECK_LIB(dl, dlopen, [
742 MODULE_PLATFORM_LIBS="-ldl"
743 libxml_have_dlopen=yes])])])])
744
745 if test "${libxml_have_shl_load}" = "yes"; then
746 MODULE_EXTENSION=".sl"
Daniel Veillard9202b672005-07-14 09:31:14 +0000747 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000748 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000749 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000750
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000751 if test "${libxml_have_dlopen}" = "yes"; then
752 case "${host}" in
753 *-*-hpux* )
754 MODULE_EXTENSION=".sl"
755 ;;
756 * )
757 MODULE_EXTENSION=".so"
758 ;;
759 esac
760
Daniel Veillard9202b672005-07-14 09:31:14 +0000761 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000762 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000763 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000764 ;;
765 esac
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000766fi
Daniel Veillardce1648b2005-01-04 15:10:22 +0000767
768if test "${WITH_MODULES}" = "1"; then
769 TEST_MODULES="ModuleTests"
770fi
771
772AC_SUBST(WITH_MODULES)
773AC_SUBST(MODULE_PLATFORM_LIBS)
774AC_SUBST(MODULE_EXTENSION)
775AC_SUBST(TEST_MODULES)
776
Daniel Veillard437b87b2000-01-03 17:30:46 +0000777dnl
778dnl Tester makes use of readline if present
779dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000780
Daniel Veillard361d8452000-04-03 19:48:13 +0000781dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000782dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000783dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000784dnl
William M. Brack871611b2003-10-18 04:53:14 +0000785if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000786 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000787 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
William M. Brack4119d1c2004-06-24 02:24:44 +0000788 [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000789 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000790 if test "$with_minimum" != "yes"
791 then
792 if test "${with_mem_debug}" = "" ; then
Daniel Veillard379a3b72005-08-12 10:18:14 +0000793 echo Activating memory debugging
Daniel Veillard4432df22003-09-28 18:58:27 +0000794 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000795 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000796 fi
797 if test "${with_docbook}" = "" ; then
798 with_docbook="yes"
799 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000800 fi
Daniel Veillard3854c572005-08-25 10:17:45 +0000801 if test "${GCC}" = "yes" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000802 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 +0000803 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000804 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000805dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000806else
807 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000808fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000809AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000810
811dnl
812dnl Check for trio string functions
813dnl
814
815if test "${NEED_TRIO}" = "1" ; then
816 echo Adding trio library for string functions
817 WITH_TRIO=1
818else
819 WITH_TRIO=0
820fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000821AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000822AC_SUBST(WITH_TRIO)
823
Daniel Veillardf6eea272001-01-18 12:17:12 +0000824dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000825dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000826dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000827echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000828
William M. Brack21e4ef22005-01-02 09:53:13 +0000829dnl
830dnl Thread-related stuff
831dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000832THREAD_LIBS=""
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000833BASE_THREAD_LIBS=""
Daniel Veillardb8478642001-10-12 17:29:10 +0000834WITH_THREADS=0
835THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000836TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000837THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000838
Daniel Veillard84942712003-04-18 14:40:05 +0000839if test "$with_threads" = "no" ; then
840 echo Disabling multithreaded support
841else
Daniel Veillardb8478642001-10-12 17:29:10 +0000842 echo Enabling multithreaded support
843
844 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000845 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000846 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000847 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
848 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000849 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000850 case $host_os in
851 *mingw32*) WITH_THREADS="1"
852 THREADS_W32="Win32"
853 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
854 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000855 *cygwin*) THREAD_LIBS=""
856 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000857 *beos*) WITH_THREADS="1"
858 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
859 ;;
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000860 *linux*)
Daniel Veillard32a461f2005-08-25 21:48:54 +0000861 if test "${GCC}" = "yes" ; then
862 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
863 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
864 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
865 if test "${THREAD_LIBS}" = "-lpthread" ; then
866 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
867 then
868 THREAD_LIBS=""
869 BASE_THREAD_LIBS="-lpthread"
870 else
871 if expr ${GCC_MAJOR} \> 3 > /dev/null
872 then
873 THREAD_LIBS=""
874 BASE_THREAD_LIBS="-lpthread"
875 else
876 echo old GCC disabling weak symbols for pthread
877 fi
878 fi
879 fi
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000880 fi
881 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000882 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000883 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000884 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
885 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000886 fi
887fi
William M. Brack306e33c2004-06-12 01:01:22 +0000888if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000889 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000890fi
891
Daniel Veillardb8478642001-10-12 17:29:10 +0000892AC_SUBST(THREAD_LIBS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000893AC_SUBST(BASE_THREAD_LIBS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000894AC_SUBST(WITH_THREADS)
895AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000896AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000897AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000898
William M. Brack21e4ef22005-01-02 09:53:13 +0000899dnl
900dnl xmllint shell history
901dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000902if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000903 echo Enabling xmllint shell history
904 dnl check for terminal library. this is a very cool solution
905 dnl from octave's configure.in
906 unset tcap
907 for termlib in ncurses curses termcap terminfo termlib; do
908 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
909 test -n "$tcap" && break
910 done
911
912 AC_CHECK_HEADER(readline/history.h,
913 AC_CHECK_LIB(history, append_history,[
914 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000915 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000916 AC_CHECK_HEADER(readline/readline.h,
917 AC_CHECK_LIB(readline, readline,[
918 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000919 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000920 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
921 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
922 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000923 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000924fi
925
William M. Brack21e4ef22005-01-02 09:53:13 +0000926dnl
927dnl Tree functions
928dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000929if test "$with_tree" = "no" ; then
930 echo Disabling DOM like tree manipulation APIs
931 WITH_TREE=0
932else
933 WITH_TREE=1
934fi
935AC_SUBST(WITH_TREE)
936
Daniel Veillard361d8452000-04-03 19:48:13 +0000937if test "$with_ftp" = "no" ; then
938 echo Disabling FTP support
939 WITH_FTP=0
940 FTP_OBJ=
941else
942 WITH_FTP=1
943 FTP_OBJ=nanoftp.o
944fi
945AC_SUBST(WITH_FTP)
946AC_SUBST(FTP_OBJ)
947
Daniel Veillard361d8452000-04-03 19:48:13 +0000948if test "$with_http" = "no" ; then
949 echo Disabling HTTP support
950 WITH_HTTP=0
951 HTTP_OBJ=
952else
953 WITH_HTTP=1
954 HTTP_OBJ=nanohttp.o
955fi
956AC_SUBST(WITH_HTTP)
957AC_SUBST(HTTP_OBJ)
958
Daniel Veillard4432df22003-09-28 18:58:27 +0000959if test "$with_legacy" = "no" ; then
960 echo Disabling deprecated APIs
961 WITH_LEGACY=0
962else
963 WITH_LEGACY=1
964fi
965AC_SUBST(WITH_LEGACY)
966
Daniel Veillard81273902003-09-30 00:43:48 +0000967if test "$with_reader" = "no" ; then
968 echo Disabling the xmlReader parsing interface
969 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000970 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000971else
972 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000973 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +0000974 if test "$with_push" = "no" ; then
975 echo xmlReader requires Push interface - enabling it
976 with_push=yes
977 fi
Daniel Veillard81273902003-09-30 00:43:48 +0000978fi
979AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000980AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000981
William M. Brack21e4ef22005-01-02 09:53:13 +0000982if test "$with_writer" = "no" ; then
983 echo Disabling the xmlWriter saving interface
984 WITH_WRITER=0
985# WRITER_TEST=
986else
987 WITH_WRITER=1
988# WRITER_TEST=Writertests
989 if test "$with_push" = "no" ; then
990 echo xmlWriter requires Push interface - enabling it
991 with_push=yes
992 fi
993 if test "$with_output" = "no" ; then
994 echo xmlWriter requires Output interface - enabling it
995 with_output=yes
996 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000997fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000998AC_SUBST(WITH_WRITER)
999#AC_SUBST(WRITER_TEST)
1000
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001001if test "$with_pattern" = "no" ; then
1002 echo Disabling the xmlPattern parsing interface
1003 WITH_PATTERN=0
Daniel Veillardf9d16912005-01-30 22:36:30 +00001004 TEST_PATTERN=
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001005else
1006 WITH_PATTERN=1
Daniel Veillardf9d16912005-01-30 22:36:30 +00001007 TEST_PATTERN=Patterntests
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001008fi
1009AC_SUBST(WITH_PATTERN)
Daniel Veillardf9d16912005-01-30 22:36:30 +00001010AC_SUBST(TEST_PATTERN)
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001011
Daniel Veillard81273902003-09-30 00:43:48 +00001012if test "$with_sax1" = "no" ; then
1013 echo Disabling the older SAX1 interface
1014 WITH_SAX1=0
1015 TEST_SAX=
1016else
1017 WITH_SAX1=1
1018 TEST_SAX=SAXtests
1019fi
1020AC_SUBST(WITH_SAX1)
1021AC_SUBST(TEST_SAX)
1022
Daniel Veillard73b013f2003-09-30 12:36:01 +00001023if test "$with_push" = "no" ; then
1024 echo Disabling the PUSH parser interfaces
1025 WITH_PUSH=0
1026 TEST_PUSH=
1027else
1028 WITH_PUSH=1
1029 TEST_PUSH="XMLPushtests"
1030fi
1031AC_SUBST(WITH_PUSH)
1032AC_SUBST(TEST_PUSH)
1033
Daniel Veillard73b013f2003-09-30 12:36:01 +00001034if test "$with_html" = "no" ; then
1035 echo Disabling HTML support
1036 WITH_HTML=0
1037 HTML_OBJ=
1038 TEST_HTML=
1039else
1040 WITH_HTML=1
1041 HTML_OBJ="HTMLparser.o HTMLtree.o"
1042 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +00001043 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +00001044 TEST_PHTML=HTMLPushtests
1045 else
1046 TEST_PHTML=
1047 fi
1048fi
1049AC_SUBST(WITH_HTML)
1050AC_SUBST(HTML_OBJ)
1051AC_SUBST(TEST_HTML)
1052AC_SUBST(TEST_PHTML)
1053
Daniel Veillard73b013f2003-09-30 12:36:01 +00001054if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +00001055 echo Disabling DTD validation support
1056 WITH_VALID=0
1057 TEST_VALID=
1058 TEST_VTIME=
1059else
1060 WITH_VALID=1
1061 TEST_VALID=Validtests
1062 TEST_VTIME=VTimingtests
1063fi
1064AC_SUBST(WITH_VALID)
1065AC_SUBST(TEST_VALID)
1066AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +00001067
Daniel Veillarda7374592001-05-10 14:17:55 +00001068if test "$with_catalog" = "no" ; then
1069 echo Disabling Catalog support
1070 WITH_CATALOG=0
1071 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001072 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +00001073else
1074 WITH_CATALOG=1
1075 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +00001076 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +00001077fi
1078AC_SUBST(WITH_CATALOG)
1079AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001080AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +00001081
Daniel Veillardb59076b2001-04-29 17:04:07 +00001082if test "$with_docbook" = "no" ; then
1083 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +00001084 WITH_DOCB=0
1085 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +00001086else
1087 WITH_DOCB=1
1088 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +00001089fi
1090AC_SUBST(WITH_DOCB)
1091AC_SUBST(DOCB_OBJ)
1092
1093
William M. Brack21e4ef22005-01-02 09:53:13 +00001094if test "$with_xptr" = "no" ; then
1095 echo Disabling XPointer support
1096 WITH_XPTR=0
1097 XPTR_OBJ=
1098 TEST_XPTR=
1099else
1100 WITH_XPTR=1
1101 XPTR_OBJ=xpointer.o
1102 TEST_XPTR=XPtrtests
1103 if test "$with_xpath" = "no" ; then
1104 echo XPointer requires XPath support - enabling it
1105 with_xpath=yes
1106 fi
Daniel Veillard4432df22003-09-28 18:58:27 +00001107fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001108AC_SUBST(WITH_XPTR)
1109AC_SUBST(XPTR_OBJ)
1110AC_SUBST(TEST_XPTR)
1111
1112if test "$with_c14n" = "no" ; then
1113 echo Disabling C14N support
1114 WITH_C14N=0
1115 C14N_OBJ=
1116 TEST_C14N=
1117else
1118 WITH_C14N=1
1119 C14N_OBJ="c14n.c"
1120 TEST_C14N=C14Ntests
1121 if test "$with_xpath" = "no" ; then
1122 echo C14N requires XPath support - enabling it
1123 with_xpath=yes
1124 fi
1125fi
1126AC_SUBST(WITH_C14N)
1127AC_SUBST(C14N_OBJ)
1128AC_SUBST(TEST_C14N)
1129
1130if test "$with_xinclude" = "no" ; then
1131 echo Disabling XInclude support
1132 WITH_XINCLUDE=0
1133 XINCLUDE_OBJ=
1134 with_xinclude="no"
1135 TEST_XINCLUDE=
1136else
1137 WITH_XINCLUDE=1
1138 XINCLUDE_OBJ=xinclude.o
1139 TEST_XINCLUDE=XIncludetests
1140 if test "$with_xpath" = "no" ; then
1141 echo XInclude requires XPath support - enabling it
1142 with_xpath=yes
1143 fi
1144fi
1145AC_SUBST(WITH_XINCLUDE)
1146AC_SUBST(XINCLUDE_OBJ)
1147AC_SUBST(TEST_XINCLUDE)
1148
Daniel Veillard361d8452000-04-03 19:48:13 +00001149if test "$with_xpath" = "no" ; then
1150 echo Disabling XPATH support
1151 WITH_XPATH=0
1152 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001153 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001154else
1155 WITH_XPATH=1
1156 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001157 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001158fi
1159AC_SUBST(WITH_XPATH)
1160AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001161AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001162
William M. Brack21e4ef22005-01-02 09:53:13 +00001163dnl
1164dnl output functions
1165dnl
1166if test "$with_output" = "no" ; then
1167 echo Disabling serialization/saving support
1168 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001169else
William M. Brack21e4ef22005-01-02 09:53:13 +00001170 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001171fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001172AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001173
Daniel Veillard6e90d192001-07-03 16:37:49 +00001174WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001175if test "$with_iconv" = "no" ; then
1176 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001177else
Daniel Veillard220346d2001-12-07 11:33:54 +00001178 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001179 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001180 # Export this since our headers include iconv.h
1181 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001182 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001183 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001184
1185 AC_CHECK_HEADER(iconv.h,
1186 AC_MSG_CHECKING(for iconv)
1187 AC_TRY_LINK([#include <stdlib.h>
1188#include <iconv.h>],[
1189iconv_t cd = iconv_open ("","");
1190iconv (cd, NULL, NULL, NULL, NULL);],[
1191 AC_MSG_RESULT(yes)
1192 WITH_ICONV=1],[
1193 AC_MSG_RESULT(no)
1194 AC_MSG_CHECKING(for iconv in -liconv)
1195
1196 _ldflags="${LDFLAGS}"
1197 _libs="${LIBS}"
1198 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1199 LIBS="${LIBS} -liconv"
1200
1201 AC_TRY_LINK([#include <stdlib.h>
1202#include <iconv.h>],[
1203iconv_t cd = iconv_open ("","");
1204iconv (cd, NULL, NULL, NULL, NULL);],[
1205 AC_MSG_RESULT(yes)
1206 WITH_ICONV=1
1207 ICONV_LIBS="${ICONV_LIBS} -liconv"
1208 LIBS="${_libs}"
1209 LDFLAGS="${_ldflags}"],[
1210 AC_MSG_RESULT(no)
1211 LIBS="${_libs}"
1212 LDFLAGS="${_ldflags}"])]))
1213fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001214case "$host" in
1215 *mingw*) M_LIBS=""
1216 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001217 *beos*) M_LIBS=""
1218 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001219 *) M_LIBS="-lm"
1220 ;;
1221esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001222XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001223XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001224AC_SUBST(WITH_ICONV)
1225
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001226WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001227if test "$WITH_ICONV" != "1" ; then
1228if test "$with_iso8859x" = "no" ; then
1229 echo Disabling ISO8859X support
1230 WITH_ISO8859X=0
1231fi
1232fi
1233AC_SUBST(WITH_ISO8859X)
1234
Daniel Veillarded6c5492005-07-23 15:00:22 +00001235if test "$with_schematron" = "no" ; then
1236 echo "Disabling Schematron support"
1237 WITH_SCHEMATRON=0
1238 TEST_SCHEMATRON=
1239else
1240 echo "Enabled Schematron support"
1241 WITH_SCHEMATRON=1
1242 TEST_SCHEMATRON="Schematrontests"
1243 with_xpath=yes
1244 with_pattern=yes
1245fi
1246AC_SUBST(WITH_SCHEMATRON)
1247AC_SUBST(TEST_SCHEMATRON)
1248
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001249if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001250 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001251 WITH_SCHEMAS=0
1252 TEST_SCHEMAS=
1253else
Daniel Veillard71531f32003-02-05 13:19:53 +00001254 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001255 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001256 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001257 if test "$PYTHON_INCLUDES" != "" ; then
1258 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1259 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001260 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001261fi
1262AC_SUBST(WITH_SCHEMAS)
1263AC_SUBST(TEST_SCHEMAS)
1264
Daniel Veillard23e73572002-09-19 19:56:43 +00001265if test "$with_regexps" = "no" ; then
1266 echo Disabling Regexps support
1267 WITH_REGEXPS=0
1268 TEST_REGEXPS=
1269else
1270 WITH_REGEXPS=1
1271 TEST_REGEXPS="Regexptests Automatatests"
1272fi
1273AC_SUBST(WITH_REGEXPS)
1274AC_SUBST(TEST_REGEXPS)
1275
Daniel Veillard361d8452000-04-03 19:48:13 +00001276if test "$with_debug" = "no" ; then
1277 echo Disabling DEBUG support
1278 WITH_DEBUG=0
1279 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001280 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001281else
1282 WITH_DEBUG=1
1283 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001284 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001285fi
1286AC_SUBST(WITH_DEBUG)
1287AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001288AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001289
Daniel Veillard361d8452000-04-03 19:48:13 +00001290if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001291 if test "$with_thread_alloc" = "yes" ; then
1292 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1293 WITH_MEM_DEBUG=0
1294 else
1295 echo Enabling memory debug support
1296 WITH_MEM_DEBUG=1
1297 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001298else
1299 WITH_MEM_DEBUG=0
1300fi
1301AC_SUBST(WITH_MEM_DEBUG)
1302
Daniel Veillard22cdb842004-10-04 14:09:17 +00001303if test "$with_run_debug" = "yes" ; then
1304 echo Enabling runtime debug support
1305 WITH_RUN_DEBUG=1
1306else
1307 WITH_RUN_DEBUG=0
1308fi
1309AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001310
1311WIN32_EXTRA_LIBADD=
1312WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001313CYGWIN_EXTRA_LDFLAGS=
1314CYGWIN_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001315case "$host" in
1316 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001317 CPPFLAGS="$CPPFLAGS -DWIN32"
1318 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001319 WIN32_EXTRA_LDFLAGS="-no-undefined"
1320 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1321 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1322 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1323 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001324 *-*-cygwin*)
1325 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001326 if test "${PYTHON}" != ""
1327 then
1328 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1329 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001330 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001331esac
1332AC_SUBST(WIN32_EXTRA_LIBADD)
1333AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001334AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1335AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001336
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001337AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001338AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001339AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001340
Daniel Veillardb05deb71999-08-10 19:04:08 +00001341AC_SUBST(XML_LIBDIR)
1342AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001343AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001344AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001345AC_SUBST(XML_INCLUDEDIR)
1346AC_SUBST(HTML_DIR)
1347AC_SUBST(HAVE_ISNAN)
1348AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001349AC_SUBST(PYTHON)
1350AC_SUBST(PYTHON_VERSION)
1351AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001352AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001353
Daniel Veillardb05deb71999-08-10 19:04:08 +00001354AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001355AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001356
Daniel Veillard9715c172002-11-25 16:33:40 +00001357dnl for the spec file
1358RELDATE=`date +'%a %b %e %Y'`
1359AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001360AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001361
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001362rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001363ln -s Copyright COPYING
1364
Daniel Veillarde4177a52004-01-08 16:43:57 +00001365# keep on one line for cygwin c.f. #130896
Daniel Veillard99b78502005-09-11 22:04:08 +00001366AC_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 +00001367
Daniel Veillard06d25242004-02-25 13:01:42 +00001368chmod +x xml2-config python/setup.py
Daniel Veillard67952602006-01-05 15:29:44 +00001369echo Done configuring