blob: f4e696f6c76d9ffc454ccb8954f685f642566ed5 [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 Veillardc8338f12006-10-25 16:06:29 +00008LIBXML_MICRO_VERSION=27
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])
William M. Brack21e4ef22005-01-02 09:53:13 +0000166
167dnl
Daniel Veillard39e5c892005-07-03 22:48:50 +0000168dnl hard dependancies on options
169dnl
170if test "$with_schemas" = "yes"
171then
172 with_pattern=yes
173 with_regexp=yes
174fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000175if test "$with_schematron" = "yes"
176then
177 with_pattern=yes
178 with_xpath=yes
179fi
Daniel Veillard39e5c892005-07-03 22:48:50 +0000180if test "$with_reader" = "yes"
181then
182 with_push=yes
183fi
184if test "$with_xptr" = "yes"
185then
186 with_xpath=yes
187fi
188dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000189dnl option to build a minimal libxml2 library
190dnl
191if test "$with_minimum" = "yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000192then
William M. Brack21e4ef22005-01-02 09:53:13 +0000193 echo "Configuring for a minimal library"
194 if test "$with_c14n" = ""
195 then
196 with_c14n=no
197 fi
198 if test "$with_catalog" = ""
199 then
200 with_catalog=no
201 fi
202 echo So far so good!
203 if test "$with_debug" = ""
204 then
205 with_debug=no
206 fi
207 if test "$with_docbook" = ""
208 then
209 with_docbook=no
210 fi
211 if test "$with_fexceptions" = ""
212 then
213 with_fexceptions=no
214 fi
215 if test "$with_ftp" = ""
216 then
217 with_ftp=no
218 fi
219 if test "$with_history" = ""
220 then
221 with_history=no
222 fi
223 if test "$with_html" = ""
224 then
225 with_html=no
226 fi
227 if test "$with_http" = ""
228 then
229 with_http=no
230 fi
231 if test "$with_iconv" = ""
232 then
233 with_iconv=no
234 fi
235 if test "$with_iso8859x" = ""
236 then
237 with_iso8859x=no
238 fi
239 if test "$with_legacy" = ""
240 then
241 with_legacy=no
242 fi
243 if test "$with_mem_debug" = ""
244 then
245 with_mem_debug=no
246 fi
247 if test "$with_output" = ""
248 then
249 with_output=no
250 fi
251 if test "$with_pattern" = ""
252 then
253 with_pattern=no
254 fi
255 if test "$with_push" = ""
256 then
257 with_push=no
258 fi
259 if test "$with_python" = ""
260 then
261 with_python=no
262 fi
263 if test "$with_reader" = ""
264 then
265 with_reader=no
266 fi
267 if test "$with_readline" = ""
268 then
269 with_readline=no
270 fi
271 if test "$with_regexp" = ""
272 then
273 with_regexp=no
274 fi
275 if test "$with_run_debug" = ""
276 then
277 with_run_debug=no
278 fi
279 if test "$with_sax1" = ""
280 then
281 with_sax1=no
282 fi
283 if test "$with_schemas" = ""
284 then
285 with_schemas=no
286 fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000287 if test "$with_schematron" = ""
288 then
289 with_schematron=no
290 fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000291 if test "$with_threads" = ""
292 then
293 with_threads=no
294 fi
295 if test "$with_thread_alloc" = ""
296 then
297 with_thread_alloc=no
298 fi
299 if test "$with_tree" = ""
300 then
301 with_tree=no
302 fi
303 if test "$with_valid" = ""
304 then
305 with_valid=no
306 fi
307 if test "$with_writer" = ""
308 then
309 with_writer=no
310 fi
311 if test "$with_xinclude" = ""
312 then
313 with_xinclude=no
314 fi
315 if test "$with_xpath" = ""
316 then
317 with_xpath=no
318 fi
319 if test "$with_xptr" = ""
320 then
321 with_xptr=no
322 fi
323 if test "$with_zlib" = ""
324 then
325 with_zlib=no
326 fi
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000327 if test "$with_modules" = ""
328 then
329 with_modules=no
330 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000331fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000332
333echo Checking zlib
334
335dnl Checks for zlib library.
336
Daniel Veillard75acfee2006-07-13 06:29:56 +0000337WITH_ZLIB=0
Daniel Veillard259ff742001-10-06 13:49:59 +0000338if test "$with_zlib" = "no"; then
339 echo "Disabling compression support"
340else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000341 AC_CHECK_HEADERS(zlib.h,
342 AC_CHECK_LIB(z, gzread,[
Daniel Veillard75acfee2006-07-13 06:29:56 +0000343 AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
344 WITH_ZLIB=1
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000345 if test "x${Z_DIR}" != "x"; then
346 Z_CFLAGS="-I${Z_DIR}/include"
347 Z_LIBS="-L${Z_DIR}/lib -lz"
348 [case ${host} in
349 *-*-solaris*)
350 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
351 ;;
352 esac]
353 else
354 Z_LIBS="-lz"
355 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +0000356fi
Owen Taylor3473f882001-02-23 17:55:21 +0000357
Owen Taylor3473f882001-02-23 17:55:21 +0000358AC_SUBST(Z_CFLAGS)
359AC_SUBST(Z_LIBS)
Daniel Veillard75acfee2006-07-13 06:29:56 +0000360AC_SUBST(WITH_ZLIB)
Owen Taylor3473f882001-02-23 17:55:21 +0000361
362CPPFLAGS=${_cppflags}
363LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000364
William M. Brack21e4ef22005-01-02 09:53:13 +0000365echo Checking headers
366
Daniel Veillard01791d51998-07-24 19:24:09 +0000367dnl Checks for header files.
368AC_HEADER_DIRENT
369AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000370AC_CHECK_HEADERS([fcntl.h])
371AC_CHECK_HEADERS([unistd.h])
372AC_CHECK_HEADERS([ctype.h])
373AC_CHECK_HEADERS([dirent.h])
374AC_CHECK_HEADERS([errno.h])
375AC_CHECK_HEADERS([malloc.h])
376AC_CHECK_HEADERS([stdarg.h])
377AC_CHECK_HEADERS([sys/stat.h])
378AC_CHECK_HEADERS([sys/types.h])
379AC_CHECK_HEADERS([time.h])
380AC_CHECK_HEADERS([ansidecl.h])
381AC_CHECK_HEADERS([ieeefp.h])
382AC_CHECK_HEADERS([nan.h])
383AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000384AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000385AC_CHECK_HEADERS([fp_class.h])
386AC_CHECK_HEADERS([float.h])
387AC_CHECK_HEADERS([stdlib.h])
388AC_CHECK_HEADERS([sys/socket.h], [], [],
389[#if HAVE_SYS_TYPES_H
390# include <sys/types.h>
391# endif
392])
393AC_CHECK_HEADERS([netinet/in.h], [], [],
394[#if HAVE_SYS_TYPES_H
395# include <sys/types.h>
396# endif
397])
398AC_CHECK_HEADERS([arpa/inet.h], [], [],
399[#if HAVE_SYS_TYPES_H
400# include <sys/types.h>
401# endif
402#if HAVE_ARPA_INET_H
403# include <arpa/inet.h>
404# endif
405])
406AC_CHECK_HEADERS([netdb.h])
407AC_CHECK_HEADERS([sys/time.h])
408AC_CHECK_HEADERS([sys/select.h])
409AC_CHECK_HEADERS([sys/mman.h])
410AC_CHECK_HEADERS([sys/timeb.h])
411AC_CHECK_HEADERS([signal.h])
412AC_CHECK_HEADERS([arpa/nameser.h], [], [],
413[#if HAVE_SYS_TYPES_H
414# include <sys/types.h>
415# endif
416])
417AC_CHECK_HEADERS([resolv.h], [], [],
418[#if HAVE_SYS_TYPES_H
419# include <sys/types.h>
420# endif
421#if HAVE_NETINET_IN_H
422# include <netinet/in.h>
423# endif
424#if HAVE_ARPA_NAMESER_H
425# include <arpa/nameser.h>
426# endif
427])
Daniel Veillarddcd93902005-01-13 11:25:15 +0000428AC_CHECK_HEADERS([dl.h])
429AC_CHECK_HEADERS([dlfcn.h])
Daniel Veillard01791d51998-07-24 19:24:09 +0000430
Daniel Veillardfc979062004-03-04 22:07:16 +0000431
William M. Brack21e4ef22005-01-02 09:53:13 +0000432echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000433
Daniel Veillard01791d51998-07-24 19:24:09 +0000434dnl Checks for library functions.
435AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000436AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000437AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000438AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000439AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000440
Daniel Veillard92ad2102001-03-27 12:47:33 +0000441dnl Checking the standard string functions availability
442AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
443 NEED_TRIO=1)
444
William M. Brackf4caa5e2005-10-20 09:04:05 +0000445dnl Checking for va_copy availability
446AC_MSG_CHECKING([for va_copy])
447AC_TRY_LINK([#include <stdarg.h>
448va_list ap1,ap2;], [va_copy(ap1,ap2);],
449have_va_copy=yes,
450have_va_copy=no)
451AC_MSG_RESULT($have_va_copy)
452if test x"$have_va_copy" = x"yes"; then
453 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
454else
455 AC_MSG_CHECKING([for __va_copy])
456 AC_TRY_LINK([#include <stdarg.h>
457 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
458 have___va_copy=yes,
459 have___va_copy=no)
460 AC_MSG_RESULT($have___va_copy)
461 if test x"$have___va_copy" = x"yes"; then
462 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
463 fi
464fi
465
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000466dnl Checks for inet libraries:
Daniel Veillardd4e39ae2005-10-28 15:59:14 +0000467AC_SEARCH_LIBS(gethostent, [nsl])
468AC_SEARCH_LIBS(setsockopt, [socket net])
469AC_SEARCH_LIBS(connect, [inet])
Daniel Veillardb05deb71999-08-10 19:04:08 +0000470
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000471dnl Determine what socket length (socklen_t) data type is
472AC_MSG_CHECKING([for type of socket length (socklen_t)])
473AC_TRY_COMPILE2([
474#include <stddef.h>
475#include <sys/types.h>
476#include <sys/socket.h>],[
477(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
478 AC_MSG_RESULT(socklen_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000479 XML_SOCKLEN_T=socklen_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000480 AC_TRY_COMPILE2([
481#include <stddef.h>
482#include <sys/types.h>
483#include <sys/socket.h>],[
484(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
485 AC_MSG_RESULT(size_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000486 XML_SOCKLEN_T=size_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000487 AC_TRY_COMPILE2([
488#include <stddef.h>
489#include <sys/types.h>
490#include <sys/socket.h>],[
491(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
492 AC_MSG_RESULT(int *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000493 XML_SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000494 AC_MSG_WARN(could not determine)
Daniel Veillardc284c642005-03-31 10:24:24 +0000495 XML_SOCKLEN_T="int"])])])
496AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000497
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000498dnl ***********************Checking for availability of IPv6*******************
499
500AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000501AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000502if test "$with_minimum" = "yes"
503then
504 enable_ipv6=no
505fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000506if test $enable_ipv6 = yes; then
507 have_ipv6=no
508 AC_TRY_COMPILE([
509 #include <sys/socket.h>
510 #include <sys/types.h>], [
511 struct sockaddr_storage ss;
512 socket(AF_INET6, SOCK_STREAM, 0)
513 ],
514 have_ipv6=yes,
515 have_ipv6=no
516 )
517 AC_MSG_RESULT($have_ipv6)
518
William M. Brack476cd962003-08-13 11:09:42 +0000519 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000520 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000521 have_broken_ss_family=no
522
523 dnl *********************************************************************
524 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
525 dnl a ss_family member, but rather __ss_family. Let's detect that
William M. Brack7d8b36b2005-06-25 07:30:50 +0000526 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
527 dnl platforms. However, we should only do this if ss_family is not
528 dnl present.
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000529 dnl ********************************************************************
William M. Brack7d8b36b2005-06-25 07:30:50 +0000530 AC_MSG_CHECKING([struct sockaddr::ss_family])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000531 AC_TRY_COMPILE([
532 #include <sys/socket.h>
533 #include <sys/types.h>], [
534 struct sockaddr_storage ss ;
William M. Brack7d8b36b2005-06-25 07:30:50 +0000535 ss.ss_family = 0 ;
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000536 ],
William M. Brack7d8b36b2005-06-25 07:30:50 +0000537 have_ss_family=yes,
538 have_ss_family=no
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000539 )
William M. Brack7d8b36b2005-06-25 07:30:50 +0000540 AC_MSG_RESULT($have_ss_family)
541 if test x$have_ss_family = xno ; then
542 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
543 AC_TRY_COMPILE([
544 #include <sys/socket.h>
545 #include <sys/types.h>], [
546 struct sockaddr_storage ss ;
547 ss.__ss_family = 0 ;
548 ],
549 have_broken_ss_family=yes,
550 have_broken_ss_family=no
551 )
552 AC_MSG_RESULT($have_broken_ss_family)
553 if test x$have_broken_ss_family = xyes ; then
554 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
555 [Whether struct sockaddr::__ss_family exists])
556 AC_DEFINE(ss_family, __ss_family,
557 [ss_family is not defined here, use __ss_family instead])
558 else
559 AC_MSG_WARN(ss_family and __ss_family not found)
560 fi
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000561 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000562
563 have_getaddrinfo=no
564 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
565 if test $have_getaddrinfo != yes; then
566 for lib in bsd socket inet; do
567 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
568 done
569 fi
570
William M. Brack476cd962003-08-13 11:09:42 +0000571 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000572 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000573 fi
574 fi
575fi
576
577dnl ******************************End IPv6 checks******************************
578
Daniel Veillardb05deb71999-08-10 19:04:08 +0000579dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000580AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000581 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000582
Daniel Veillardc790bf42003-10-11 10:50:10 +0000583AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
584 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000585
586XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000587XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000588
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000589dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000590dnl Extra flags
591dnl
592XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000593RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000594
595dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000596dnl Workaround for native compilers
597dnl HP : http://bugs.gnome.org/db/31/3163.html
598dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000599dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000600if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000601 case "${host}" in
Daniel Veillard6a0baa02005-12-10 11:11:12 +0000602 hppa*-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000603 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000604 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000605 *-dec-osf* )
606 CFLAGS="${CFLAGS} -ieee"
607 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000608 alpha*-*-linux* )
609 CFLAGS="${CFLAGS} -ieee"
610 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000611 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000612else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000613 if test "$with_fexceptions" = "yes"
614 then
615 #
616 # Not activated by default because this inflates the code size
617 # Used to allow propagation of C++ exceptions through the library
618 #
619 CFLAGS="${CFLAGS} -fexceptions"
620 fi
621
Daniel Veillard05f97352004-10-31 15:35:32 +0000622 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 +0000623 case "${host}" in
624 alpha*-*-linux* )
625 CFLAGS="${CFLAGS} -mieee"
626 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000627 alpha*-*-osf* )
628 CFLAGS="${CFLAGS} -mieee"
629 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000630 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000631fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000632case ${host} in
633 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000634 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
635 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000636 hppa*-hp-mpeix)
637 NEED_TRIO=1
638 ;;
Daniel Veillard4188ddf2006-01-19 08:58:42 +0000639 *-*-mingw* | *-*-cygwin* | *-*-msvc* )
640 # If the host is Windows, and shared libraries are disabled, we
641 # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
642 # work properly (without it, xmlexports.h would force the use of
643 # DLL imports, which obviously aren't present in a static
644 # library).
645 if test "x$enable_shared" = "xno"; then
646 XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
647 CFLAGS="$CFLAGS -DLIBXML_STATIC"
648 fi
649 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000650esac
651
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000652
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000653dnl
654dnl check for python
655dnl
656
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000657PYTHON_VERSION=
658PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000659PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000660PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000661pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000662if test "$with_python" != "no" ; then
663 if test -x "$with_python/bin/python"
664 then
665 echo Found python in $with_python/bin/python
666 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000667 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000668 if test -x "$with_python"
669 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000670 echo Found python in $with_python
671 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000672 else
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000673 if test -x "$PYTHON"
674 then
675 echo Found python in environment PYTHON=$PYTHON
Daniel Veillard8492ba12006-04-25 12:52:12 +0000676 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000677 else
Daniel Veillardc2f70562005-09-01 12:45:26 +0000678 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 +0000679 fi
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000680 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000681 fi
682 if test "$PYTHON" != ""
683 then
684 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
685 echo Found Python version $PYTHON_VERSION
686 fi
687 if test "$PYTHON_VERSION" != ""
688 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000689 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
690 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000691 then
692 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000693 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000694 else
695 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
696 then
Daniel Veillard8492ba12006-04-25 12:52:12 +0000697 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000698 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000699 else
700 if test -r /usr/include/python$PYTHON_VERSION/Python.h
701 then
702 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000703 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000704 else
705 echo could not find python$PYTHON_VERSION/Python.h
706 fi
707 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000708 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000709 then
710 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
711 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000712 fi
713 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000714 if test "$with_python" != ""
715 then
Daniel Veillardd7d07482006-05-03 13:15:44 +0000716 pythondir='$(PYTHON_SITE_PACKAGES)'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000717 else
Daniel Veillardb2f8f1d2006-04-28 16:30:48 +0000718 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000719 fi
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000720else
721 PYTHON=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000722fi
723AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000724if test "$PYTHON_INCLUDES" != ""
725then
726 PYTHON_SUBDIR=python
727else
728 PYTHON_SUBDIR=
729fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000730AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000731AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000732
Daniel Veillardce1648b2005-01-04 15:10:22 +0000733dnl check for dso support
734WITH_MODULES=0
Daniel Veillardce1648b2005-01-04 15:10:22 +0000735TEST_MODULES=
736
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000737if test "$with_modules" != "no" ; then
Daniel Veillard9202b672005-07-14 09:31:14 +0000738 case "$host" in
739 *-*-cygwin*)
740 MODULE_EXTENSION=".dll"
741 AC_CHECK_LIB(cygwin, dlopen, [
742 WITH_MODULES=1
743 MODULE_PLATFORM_LIBS=
744 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
745 ])
746 ;;
747 *)
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000748 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
749 AC_CHECK_LIB(dld, shl_load, [
750 MODULE_PLATFORM_LIBS="-ldld"
751 libxml_have_shl_load=yes], [
752 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
753 AC_CHECK_LIB(dl, dlopen, [
754 MODULE_PLATFORM_LIBS="-ldl"
755 libxml_have_dlopen=yes])])])])
756
757 if test "${libxml_have_shl_load}" = "yes"; then
758 MODULE_EXTENSION=".sl"
Daniel Veillard9202b672005-07-14 09:31:14 +0000759 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000760 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000761 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000762
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000763 if test "${libxml_have_dlopen}" = "yes"; then
764 case "${host}" in
765 *-*-hpux* )
766 MODULE_EXTENSION=".sl"
767 ;;
768 * )
769 MODULE_EXTENSION=".so"
770 ;;
771 esac
772
Daniel Veillard9202b672005-07-14 09:31:14 +0000773 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000774 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000775 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000776 ;;
777 esac
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000778fi
Daniel Veillardce1648b2005-01-04 15:10:22 +0000779
780if test "${WITH_MODULES}" = "1"; then
781 TEST_MODULES="ModuleTests"
782fi
783
784AC_SUBST(WITH_MODULES)
785AC_SUBST(MODULE_PLATFORM_LIBS)
786AC_SUBST(MODULE_EXTENSION)
787AC_SUBST(TEST_MODULES)
788
Daniel Veillard437b87b2000-01-03 17:30:46 +0000789dnl
790dnl Tester makes use of readline if present
791dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000792
Daniel Veillard361d8452000-04-03 19:48:13 +0000793dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000794dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000795dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000796dnl
William M. Brack871611b2003-10-18 04:53:14 +0000797if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000798 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000799 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
William M. Brack4119d1c2004-06-24 02:24:44 +0000800 [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000801 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000802 if test "$with_minimum" != "yes"
803 then
804 if test "${with_mem_debug}" = "" ; then
Daniel Veillard379a3b72005-08-12 10:18:14 +0000805 echo Activating memory debugging
Daniel Veillard4432df22003-09-28 18:58:27 +0000806 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000807 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000808 fi
809 if test "${with_docbook}" = "" ; then
810 with_docbook="yes"
811 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000812 fi
Daniel Veillard3854c572005-08-25 10:17:45 +0000813 if test "${GCC}" = "yes" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000814 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 +0000815 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000816 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000817dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000818else
819 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000820fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000821AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000822
823dnl
824dnl Check for trio string functions
825dnl
826
827if test "${NEED_TRIO}" = "1" ; then
828 echo Adding trio library for string functions
829 WITH_TRIO=1
830else
831 WITH_TRIO=0
832fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000833AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000834AC_SUBST(WITH_TRIO)
835
Daniel Veillardf6eea272001-01-18 12:17:12 +0000836dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000837dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000838dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000839echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000840
William M. Brack21e4ef22005-01-02 09:53:13 +0000841dnl
842dnl Thread-related stuff
843dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000844THREAD_LIBS=""
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000845BASE_THREAD_LIBS=""
Daniel Veillardb8478642001-10-12 17:29:10 +0000846WITH_THREADS=0
847THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000848TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000849THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000850
Daniel Veillard84942712003-04-18 14:40:05 +0000851if test "$with_threads" = "no" ; then
852 echo Disabling multithreaded support
853else
Daniel Veillardb8478642001-10-12 17:29:10 +0000854 echo Enabling multithreaded support
855
856 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000857 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000858 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000859 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
860 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000861 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000862 case $host_os in
863 *mingw32*) WITH_THREADS="1"
864 THREADS_W32="Win32"
865 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
866 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000867 *cygwin*) THREAD_LIBS=""
868 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000869 *beos*) WITH_THREADS="1"
870 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
871 ;;
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000872 *linux*)
Daniel Veillard32a461f2005-08-25 21:48:54 +0000873 if test "${GCC}" = "yes" ; then
874 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
875 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
876 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
877 if test "${THREAD_LIBS}" = "-lpthread" ; then
878 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
879 then
880 THREAD_LIBS=""
881 BASE_THREAD_LIBS="-lpthread"
882 else
883 if expr ${GCC_MAJOR} \> 3 > /dev/null
884 then
885 THREAD_LIBS=""
886 BASE_THREAD_LIBS="-lpthread"
887 else
888 echo old GCC disabling weak symbols for pthread
889 fi
890 fi
891 fi
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000892 fi
893 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000894 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000895 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000896 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
897 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000898 fi
899fi
William M. Brack306e33c2004-06-12 01:01:22 +0000900if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000901 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000902fi
903
Daniel Veillardb8478642001-10-12 17:29:10 +0000904AC_SUBST(THREAD_LIBS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000905AC_SUBST(BASE_THREAD_LIBS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000906AC_SUBST(WITH_THREADS)
907AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000908AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000909AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000910
William M. Brack21e4ef22005-01-02 09:53:13 +0000911dnl
912dnl xmllint shell history
913dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000914if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000915 echo Enabling xmllint shell history
916 dnl check for terminal library. this is a very cool solution
917 dnl from octave's configure.in
918 unset tcap
919 for termlib in ncurses curses termcap terminfo termlib; do
920 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
921 test -n "$tcap" && break
922 done
923
924 AC_CHECK_HEADER(readline/history.h,
925 AC_CHECK_LIB(history, append_history,[
926 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000927 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000928 AC_CHECK_HEADER(readline/readline.h,
929 AC_CHECK_LIB(readline, readline,[
930 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000931 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000932 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
933 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
934 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000935 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000936fi
937
William M. Brack21e4ef22005-01-02 09:53:13 +0000938dnl
939dnl Tree functions
940dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000941if test "$with_tree" = "no" ; then
942 echo Disabling DOM like tree manipulation APIs
943 WITH_TREE=0
944else
945 WITH_TREE=1
946fi
947AC_SUBST(WITH_TREE)
948
Daniel Veillard361d8452000-04-03 19:48:13 +0000949if test "$with_ftp" = "no" ; then
950 echo Disabling FTP support
951 WITH_FTP=0
952 FTP_OBJ=
953else
954 WITH_FTP=1
955 FTP_OBJ=nanoftp.o
956fi
957AC_SUBST(WITH_FTP)
958AC_SUBST(FTP_OBJ)
959
Daniel Veillard361d8452000-04-03 19:48:13 +0000960if test "$with_http" = "no" ; then
961 echo Disabling HTTP support
962 WITH_HTTP=0
963 HTTP_OBJ=
964else
965 WITH_HTTP=1
966 HTTP_OBJ=nanohttp.o
967fi
968AC_SUBST(WITH_HTTP)
969AC_SUBST(HTTP_OBJ)
970
Daniel Veillard4432df22003-09-28 18:58:27 +0000971if test "$with_legacy" = "no" ; then
972 echo Disabling deprecated APIs
973 WITH_LEGACY=0
974else
975 WITH_LEGACY=1
976fi
977AC_SUBST(WITH_LEGACY)
978
Daniel Veillard81273902003-09-30 00:43:48 +0000979if test "$with_reader" = "no" ; then
980 echo Disabling the xmlReader parsing interface
981 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000982 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000983else
984 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000985 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +0000986 if test "$with_push" = "no" ; then
987 echo xmlReader requires Push interface - enabling it
988 with_push=yes
989 fi
Daniel Veillard81273902003-09-30 00:43:48 +0000990fi
991AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000992AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000993
William M. Brack21e4ef22005-01-02 09:53:13 +0000994if test "$with_writer" = "no" ; then
995 echo Disabling the xmlWriter saving interface
996 WITH_WRITER=0
997# WRITER_TEST=
998else
999 WITH_WRITER=1
1000# WRITER_TEST=Writertests
1001 if test "$with_push" = "no" ; then
1002 echo xmlWriter requires Push interface - enabling it
1003 with_push=yes
1004 fi
1005 if test "$with_output" = "no" ; then
1006 echo xmlWriter requires Output interface - enabling it
1007 with_output=yes
1008 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001009fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001010AC_SUBST(WITH_WRITER)
1011#AC_SUBST(WRITER_TEST)
1012
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001013if test "$with_pattern" = "no" ; then
1014 echo Disabling the xmlPattern parsing interface
1015 WITH_PATTERN=0
Daniel Veillardf9d16912005-01-30 22:36:30 +00001016 TEST_PATTERN=
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001017else
1018 WITH_PATTERN=1
Daniel Veillardf9d16912005-01-30 22:36:30 +00001019 TEST_PATTERN=Patterntests
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001020fi
1021AC_SUBST(WITH_PATTERN)
Daniel Veillardf9d16912005-01-30 22:36:30 +00001022AC_SUBST(TEST_PATTERN)
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001023
Daniel Veillard81273902003-09-30 00:43:48 +00001024if test "$with_sax1" = "no" ; then
1025 echo Disabling the older SAX1 interface
1026 WITH_SAX1=0
1027 TEST_SAX=
1028else
1029 WITH_SAX1=1
1030 TEST_SAX=SAXtests
1031fi
1032AC_SUBST(WITH_SAX1)
1033AC_SUBST(TEST_SAX)
1034
Daniel Veillard73b013f2003-09-30 12:36:01 +00001035if test "$with_push" = "no" ; then
1036 echo Disabling the PUSH parser interfaces
1037 WITH_PUSH=0
1038 TEST_PUSH=
1039else
1040 WITH_PUSH=1
1041 TEST_PUSH="XMLPushtests"
1042fi
1043AC_SUBST(WITH_PUSH)
1044AC_SUBST(TEST_PUSH)
1045
Daniel Veillard73b013f2003-09-30 12:36:01 +00001046if test "$with_html" = "no" ; then
1047 echo Disabling HTML support
1048 WITH_HTML=0
1049 HTML_OBJ=
1050 TEST_HTML=
1051else
1052 WITH_HTML=1
1053 HTML_OBJ="HTMLparser.o HTMLtree.o"
1054 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +00001055 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +00001056 TEST_PHTML=HTMLPushtests
1057 else
1058 TEST_PHTML=
1059 fi
1060fi
1061AC_SUBST(WITH_HTML)
1062AC_SUBST(HTML_OBJ)
1063AC_SUBST(TEST_HTML)
1064AC_SUBST(TEST_PHTML)
1065
Daniel Veillard73b013f2003-09-30 12:36:01 +00001066if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +00001067 echo Disabling DTD validation support
1068 WITH_VALID=0
1069 TEST_VALID=
1070 TEST_VTIME=
1071else
1072 WITH_VALID=1
1073 TEST_VALID=Validtests
1074 TEST_VTIME=VTimingtests
1075fi
1076AC_SUBST(WITH_VALID)
1077AC_SUBST(TEST_VALID)
1078AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +00001079
Daniel Veillarda7374592001-05-10 14:17:55 +00001080if test "$with_catalog" = "no" ; then
1081 echo Disabling Catalog support
1082 WITH_CATALOG=0
1083 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001084 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +00001085else
1086 WITH_CATALOG=1
1087 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +00001088 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +00001089fi
1090AC_SUBST(WITH_CATALOG)
1091AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001092AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +00001093
Daniel Veillardb59076b2001-04-29 17:04:07 +00001094if test "$with_docbook" = "no" ; then
1095 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +00001096 WITH_DOCB=0
1097 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +00001098else
1099 WITH_DOCB=1
1100 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +00001101fi
1102AC_SUBST(WITH_DOCB)
1103AC_SUBST(DOCB_OBJ)
1104
1105
William M. Brack21e4ef22005-01-02 09:53:13 +00001106if test "$with_xptr" = "no" ; then
1107 echo Disabling XPointer support
1108 WITH_XPTR=0
1109 XPTR_OBJ=
1110 TEST_XPTR=
1111else
1112 WITH_XPTR=1
1113 XPTR_OBJ=xpointer.o
1114 TEST_XPTR=XPtrtests
1115 if test "$with_xpath" = "no" ; then
1116 echo XPointer requires XPath support - enabling it
1117 with_xpath=yes
1118 fi
Daniel Veillard4432df22003-09-28 18:58:27 +00001119fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001120AC_SUBST(WITH_XPTR)
1121AC_SUBST(XPTR_OBJ)
1122AC_SUBST(TEST_XPTR)
1123
1124if test "$with_c14n" = "no" ; then
1125 echo Disabling C14N support
1126 WITH_C14N=0
1127 C14N_OBJ=
1128 TEST_C14N=
1129else
1130 WITH_C14N=1
1131 C14N_OBJ="c14n.c"
1132 TEST_C14N=C14Ntests
1133 if test "$with_xpath" = "no" ; then
1134 echo C14N requires XPath support - enabling it
1135 with_xpath=yes
1136 fi
1137fi
1138AC_SUBST(WITH_C14N)
1139AC_SUBST(C14N_OBJ)
1140AC_SUBST(TEST_C14N)
1141
1142if test "$with_xinclude" = "no" ; then
1143 echo Disabling XInclude support
1144 WITH_XINCLUDE=0
1145 XINCLUDE_OBJ=
1146 with_xinclude="no"
1147 TEST_XINCLUDE=
1148else
1149 WITH_XINCLUDE=1
1150 XINCLUDE_OBJ=xinclude.o
1151 TEST_XINCLUDE=XIncludetests
1152 if test "$with_xpath" = "no" ; then
1153 echo XInclude requires XPath support - enabling it
1154 with_xpath=yes
1155 fi
1156fi
1157AC_SUBST(WITH_XINCLUDE)
1158AC_SUBST(XINCLUDE_OBJ)
1159AC_SUBST(TEST_XINCLUDE)
1160
Daniel Veillard361d8452000-04-03 19:48:13 +00001161if test "$with_xpath" = "no" ; then
1162 echo Disabling XPATH support
1163 WITH_XPATH=0
1164 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001165 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001166else
1167 WITH_XPATH=1
1168 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001169 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001170fi
1171AC_SUBST(WITH_XPATH)
1172AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001173AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001174
William M. Brack21e4ef22005-01-02 09:53:13 +00001175dnl
1176dnl output functions
1177dnl
1178if test "$with_output" = "no" ; then
1179 echo Disabling serialization/saving support
1180 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001181else
William M. Brack21e4ef22005-01-02 09:53:13 +00001182 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001183fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001184AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001185
Daniel Veillard6e90d192001-07-03 16:37:49 +00001186WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001187if test "$with_iconv" = "no" ; then
1188 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001189else
Daniel Veillard220346d2001-12-07 11:33:54 +00001190 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001191 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001192 # Export this since our headers include iconv.h
1193 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001194 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001195 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001196
1197 AC_CHECK_HEADER(iconv.h,
1198 AC_MSG_CHECKING(for iconv)
1199 AC_TRY_LINK([#include <stdlib.h>
1200#include <iconv.h>],[
1201iconv_t cd = iconv_open ("","");
1202iconv (cd, NULL, NULL, NULL, NULL);],[
1203 AC_MSG_RESULT(yes)
1204 WITH_ICONV=1],[
1205 AC_MSG_RESULT(no)
1206 AC_MSG_CHECKING(for iconv in -liconv)
1207
1208 _ldflags="${LDFLAGS}"
1209 _libs="${LIBS}"
1210 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1211 LIBS="${LIBS} -liconv"
1212
1213 AC_TRY_LINK([#include <stdlib.h>
1214#include <iconv.h>],[
1215iconv_t cd = iconv_open ("","");
1216iconv (cd, NULL, NULL, NULL, NULL);],[
1217 AC_MSG_RESULT(yes)
1218 WITH_ICONV=1
1219 ICONV_LIBS="${ICONV_LIBS} -liconv"
1220 LIBS="${_libs}"
1221 LDFLAGS="${_ldflags}"],[
1222 AC_MSG_RESULT(no)
1223 LIBS="${_libs}"
1224 LDFLAGS="${_ldflags}"])]))
1225fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001226case "$host" in
1227 *mingw*) M_LIBS=""
1228 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001229 *beos*) M_LIBS=""
1230 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001231 *) M_LIBS="-lm"
1232 ;;
1233esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001234XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001235XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001236AC_SUBST(WITH_ICONV)
1237
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001238WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001239if test "$WITH_ICONV" != "1" ; then
1240if test "$with_iso8859x" = "no" ; then
1241 echo Disabling ISO8859X support
1242 WITH_ISO8859X=0
1243fi
1244fi
1245AC_SUBST(WITH_ISO8859X)
1246
Daniel Veillarded6c5492005-07-23 15:00:22 +00001247if test "$with_schematron" = "no" ; then
1248 echo "Disabling Schematron support"
1249 WITH_SCHEMATRON=0
1250 TEST_SCHEMATRON=
1251else
1252 echo "Enabled Schematron support"
1253 WITH_SCHEMATRON=1
1254 TEST_SCHEMATRON="Schematrontests"
1255 with_xpath=yes
1256 with_pattern=yes
1257fi
1258AC_SUBST(WITH_SCHEMATRON)
1259AC_SUBST(TEST_SCHEMATRON)
1260
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001261if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001262 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001263 WITH_SCHEMAS=0
1264 TEST_SCHEMAS=
1265else
Daniel Veillard71531f32003-02-05 13:19:53 +00001266 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001267 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001268 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001269 if test "$PYTHON_INCLUDES" != "" ; then
1270 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1271 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001272 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001273fi
1274AC_SUBST(WITH_SCHEMAS)
1275AC_SUBST(TEST_SCHEMAS)
1276
Daniel Veillard23e73572002-09-19 19:56:43 +00001277if test "$with_regexps" = "no" ; then
1278 echo Disabling Regexps support
1279 WITH_REGEXPS=0
1280 TEST_REGEXPS=
1281else
1282 WITH_REGEXPS=1
1283 TEST_REGEXPS="Regexptests Automatatests"
1284fi
1285AC_SUBST(WITH_REGEXPS)
1286AC_SUBST(TEST_REGEXPS)
1287
Daniel Veillard361d8452000-04-03 19:48:13 +00001288if test "$with_debug" = "no" ; then
1289 echo Disabling DEBUG support
1290 WITH_DEBUG=0
1291 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001292 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001293else
1294 WITH_DEBUG=1
1295 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001296 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001297fi
1298AC_SUBST(WITH_DEBUG)
1299AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001300AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001301
Daniel Veillard361d8452000-04-03 19:48:13 +00001302if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001303 if test "$with_thread_alloc" = "yes" ; then
1304 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1305 WITH_MEM_DEBUG=0
1306 else
1307 echo Enabling memory debug support
1308 WITH_MEM_DEBUG=1
1309 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001310else
1311 WITH_MEM_DEBUG=0
1312fi
1313AC_SUBST(WITH_MEM_DEBUG)
1314
Daniel Veillard22cdb842004-10-04 14:09:17 +00001315if test "$with_run_debug" = "yes" ; then
1316 echo Enabling runtime debug support
1317 WITH_RUN_DEBUG=1
1318else
1319 WITH_RUN_DEBUG=0
1320fi
1321AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001322
1323WIN32_EXTRA_LIBADD=
1324WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001325CYGWIN_EXTRA_LDFLAGS=
1326CYGWIN_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001327case "$host" in
1328 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001329 CPPFLAGS="$CPPFLAGS -DWIN32"
1330 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001331 WIN32_EXTRA_LDFLAGS="-no-undefined"
1332 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1333 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1334 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1335 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001336 *-*-cygwin*)
1337 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001338 if test "${PYTHON}" != ""
1339 then
1340 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1341 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001342 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001343esac
1344AC_SUBST(WIN32_EXTRA_LIBADD)
1345AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001346AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1347AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001348
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001349AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001350AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001351AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001352
Daniel Veillardb05deb71999-08-10 19:04:08 +00001353AC_SUBST(XML_LIBDIR)
1354AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001355AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001356AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001357AC_SUBST(XML_INCLUDEDIR)
1358AC_SUBST(HTML_DIR)
1359AC_SUBST(HAVE_ISNAN)
1360AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001361AC_SUBST(PYTHON)
1362AC_SUBST(PYTHON_VERSION)
1363AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001364AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001365
Daniel Veillardb05deb71999-08-10 19:04:08 +00001366AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001367AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001368
Daniel Veillard9715c172002-11-25 16:33:40 +00001369dnl for the spec file
1370RELDATE=`date +'%a %b %e %Y'`
1371AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001372AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001373
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001374rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001375ln -s Copyright COPYING
1376
Daniel Veillarde4177a52004-01-08 16:43:57 +00001377# keep on one line for cygwin c.f. #130896
Daniel Veillard99b78502005-09-11 22:04:08 +00001378AC_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 +00001379
Daniel Veillard06d25242004-02-25 13:01:42 +00001380chmod +x xml2-config python/setup.py
Daniel Veillard67952602006-01-05 15:29:44 +00001381echo Done configuring