blob: 81838608c0805b4fbc7210b203a14c6c0251a9fc [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
Adrian Bunk64b0d602010-11-04 09:43:31 +01002AC_PREREQ(2.59)
Owen Taylor3473f882001-02-23 17:55:21 +00003AC_INIT(entities.c)
Daniel Veillard01791d51998-07-24 19:24:09 +00004AM_CONFIG_HEADER(config.h)
Daniel Veillard3157e512010-03-09 11:32:46 +01005AC_CONFIG_MACRO_DIR([m4])
Daniel Veillardd2ade932000-09-30 14:39:55 +00006AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00007
Daniel Veillardcf461992000-03-14 18:30:20 +00008LIBXML_MAJOR_VERSION=2
Daniel Veillard15724252008-08-30 15:01:04 +00009LIBXML_MINOR_VERSION=7
Daniel Veillard4c2e7c62010-11-04 18:35:57 +010010LIBXML_MICRO_VERSION=8
Daniel Veillard3e35f8e2003-10-21 00:05:38 +000011LIBXML_MICRO_VERSION_SUFFIX=
Daniel Veillard4fc52812003-09-01 20:33:13 +000012LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
Daniel Veillard14fff061999-06-22 21:49:07 +000013LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
14
Daniel Veillard361d8452000-04-03 19:48:13 +000015LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
16
Daniel Veillard9cb1b642007-01-03 15:07:44 +000017if test -f CVS/Entries ; then
Daniel Veillarddab93ea2004-08-20 16:47:10 +000018 extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
19 echo extra=$extra
20 if test "$extra" != ""
21 then
22 LIBXML_VERSION_EXTRA="-CVS$extra"
23 fi
Daniel Veillard9cb1b642007-01-03 15:07:44 +000024else if test -d .svn ; then
25 extra=`svn info | grep Revision | sed 's+Revision: ++'`
26 echo extra=$extra
27 if test "$extra" != ""
28 then
29 LIBXML_VERSION_EXTRA="-SVN$extra"
30 fi
veillard97c7be62009-05-12 08:43:54 +020031else if test -d .git ; then
32 extra=`git describe | sed 's+LIBXML[[0-9.]]*-++'`
33 echo extra=$extra
34 if test "$extra" != ""
35 then
36 LIBXML_VERSION_EXTRA="-GIT$extra"
37 fi
38fi
Daniel Veillard9cb1b642007-01-03 15:07:44 +000039fi
William M. Brackf4025492004-08-18 21:08:46 +000040fi
Daniel Veillard14fff061999-06-22 21:49:07 +000041AC_SUBST(LIBXML_MAJOR_VERSION)
42AC_SUBST(LIBXML_MINOR_VERSION)
43AC_SUBST(LIBXML_MICRO_VERSION)
44AC_SUBST(LIBXML_VERSION)
45AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000046AC_SUBST(LIBXML_VERSION_NUMBER)
William M. Brackf4025492004-08-18 21:08:46 +000047AC_SUBST(LIBXML_VERSION_EXTRA)
Daniel Veillard14fff061999-06-22 21:49:07 +000048
Daniel Veillard361d8452000-04-03 19:48:13 +000049VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000050
Daniel Veillardedfb29b2000-03-14 19:59:05 +000051AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000052
Stefan Kostc9c939d2011-05-10 10:34:41 +030053# Support silent build rules, requires at least automake-1.11. Disable
54# by either passing --disable-silent-rules to configure or passing V=1
55# to make
56m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
57
Daniel Veillard01791d51998-07-24 19:24:09 +000058dnl Checks for programs.
59AC_PROG_CC
60AC_PROG_INSTALL
Adrian Bunk64b0d602010-11-04 09:43:31 +010061AC_PROG_MKDIR_P
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000062AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000063AC_PATH_PROG(RM, rm, /bin/rm)
64AC_PATH_PROG(MV, mv, /bin/mv)
65AC_PATH_PROG(TAR, tar, /bin/tar)
William M. Brack1826d0a2004-07-21 09:03:57 +000066AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard33a2de92006-10-11 08:33:22 +000067AC_PATH_PROG(WGET, wget, /usr/bin/wget)
Daniel Veillard8b817da2004-09-30 09:19:33 +000068AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
Daniel Veillard06500c82004-09-07 09:12:44 +000069AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
Daniel Veillard01791d51998-07-24 19:24:09 +000070
Daniel Veillard6984e6d2003-12-09 14:20:17 +000071AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000072AM_PROG_LIBTOOL
73
Daniel Veillard4432df22003-09-28 18:58:27 +000074dnl
Daniel Veillard8ed10722009-08-20 19:17:36 +020075dnl if the system support linker version scripts for symbol versioning
76dnl then add it
77dnl
78VERSION_SCRIPT_FLAGS=
Roumen Petrovf39adc22010-03-11 14:49:13 +010079# lt_cv_prog_gnu_ld is from libtool 2.+
80if test "$lt_cv_prog_gnu_ld" = yes; then
81 VERSION_SCRIPT_FLAGS=-Wl,--version-script=
82else
83 case $host in
84 *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
85 esac
86fi
Daniel Veillard8ed10722009-08-20 19:17:36 +020087AC_SUBST(VERSION_SCRIPT_FLAGS)
Daniel Veillard00819872010-11-04 21:53:14 +010088AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
Daniel Veillard8ed10722009-08-20 19:17:36 +020089
90dnl
William M. Brack21e4ef22005-01-02 09:53:13 +000091dnl We process the AC_ARG_WITH first so that later we can modify
92dnl some of them to try to prevent impossible combinations. This
93dnl also allows up so alphabetize the choices
Daniel Veillard4432df22003-09-28 18:58:27 +000094dnl
Daniel Veillard4432df22003-09-28 18:58:27 +000095
William M. Brack21e4ef22005-01-02 09:53:13 +000096dnl
97dnl zlib option might change flags, so we save them initially
98dnl
Owen Taylor3473f882001-02-23 17:55:21 +000099_cppflags="${CPPFLAGS}"
100_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +0000101
William M. Brack21e4ef22005-01-02 09:53:13 +0000102AC_ARG_WITH(c14n,
103[ --with-c14n add the Canonicalization support (on)])
104AC_ARG_WITH(catalog,
105[ --with-catalog add the Catalog support (on)])
106AC_ARG_WITH(debug,
107[ --with-debug add the debugging module (on)])
108AC_ARG_WITH(docbook,
109[ --with-docbook add Docbook SGML support (on)])
110AC_ARG_WITH(fexceptions,
111[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
112AC_ARG_WITH(ftp,
113[ --with-ftp add the FTP support (on)])
114AC_ARG_WITH(history,
115[ --with-history add history support to xmllint shell(off)])
116AC_ARG_WITH(html,
117[ --with-html add the HTML support (on)])
118dnl Specific dir for HTML output ?
119AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
120 [path to base html directory, default $datadir/doc/html]),
121 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
Daniel Veillard259ff742001-10-06 13:49:59 +0000122
William M. Brack21e4ef22005-01-02 09:53:13 +0000123AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
124 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
125 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
126 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
127AC_SUBST(HTML_DIR)
128AC_ARG_WITH(http,
129[ --with-http add the HTTP support (on)])
130AC_ARG_WITH(iconv,
131[ --with-iconv[[=DIR]] add ICONV support (on)])
Giuseppe Iuculano48f7dcb2010-11-04 17:42:42 +0100132AC_ARG_WITH(icu,
133[ --with-icu add ICU support (off)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000134AC_ARG_WITH(iso8859x,
135[ --with-iso8859x add ISO8859X support if no iconv (on)])
136AC_ARG_WITH(legacy,
137[ --with-legacy add deprecated APIs for compatibility (on)])
138AC_ARG_WITH(mem_debug,
139[ --with-mem-debug add the memory debugging module (off)])
140AC_ARG_WITH(minimum,
141[ --with-minimum build a minimally sized library (off)])
142AC_ARG_WITH(output,
143[ --with-output add the serialization support (on)])
144AC_ARG_WITH(pattern,
145[ --with-pattern add the xmlPattern selection interface (on)])
146AC_ARG_WITH(push,
147[ --with-push add the PUSH parser interfaces (on)])
148AC_ARG_WITH(python,
149[ --with-python[[=DIR]] build Python bindings if found])
150AC_ARG_WITH(reader,
151[ --with-reader add the xmlReader parsing interface (on)])
152AC_ARG_WITH(readline,
153[ --with-readline=DIR use readline in DIR],[
154 if test "$withval" != "no" -a "$withval" != "yes"; then
155 RDL_DIR=$withval
156 CPPFLAGS="${CPPFLAGS} -I$withval/include"
157 LDFLAGS="${LDFLAGS} -L$withval/lib"
158 fi
159])
160AC_ARG_WITH(regexps,
161[ --with-regexps add Regular Expressions support (on)])
162AC_ARG_WITH(run_debug,
163[ --with-run-debug add the runtime debugging module (off)])
164AC_ARG_WITH(sax1,
165[ --with-sax1 add the older SAX1 interface (on)])
166AC_ARG_WITH(schemas,
Daniel Veillard39e5c892005-07-03 22:48:50 +0000167[ --with-schemas add Relax-NG and Schemas support (on)])
Daniel Veillarded6c5492005-07-23 15:00:22 +0000168AC_ARG_WITH(schematron,
169[ --with-schematron add Schematron support (on)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000170AC_ARG_WITH(threads,
171[ --with-threads add multithread support(on)])
172AC_ARG_WITH(thread-alloc,
173[ --with-thread-alloc add per-thread memory(off)])
174AC_ARG_WITH(tree,
175[ --with-tree add the DOM like tree manipulation APIs (on)])
176AC_ARG_WITH(valid,
177[ --with-valid add the DTD validation support (on)])
178AC_ARG_WITH(writer,
179[ --with-writer add the xmlWriter saving interface (on)])
180AC_ARG_WITH(xinclude,
181[ --with-xinclude add the XInclude support (on)])
182AC_ARG_WITH(xpath,
183[ --with-xpath add the XPATH support (on)])
184AC_ARG_WITH(xptr,
185[ --with-xptr add the XPointer support (on)])
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000186AC_ARG_WITH(modules,
187[ --with-modules add the dynamic modules support (on)])
Owen Taylor3473f882001-02-23 17:55:21 +0000188AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +0000189[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +0000190 if test "$withval" != "no" -a "$withval" != "yes"; then
191 Z_DIR=$withval
192 CPPFLAGS="${CPPFLAGS} -I$withval/include"
193 LDFLAGS="${LDFLAGS} -L$withval/lib"
194 fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000195])
Anders F Bjorklundeae52612011-09-18 16:59:13 +0200196AC_ARG_WITH(lzma,
197[ --with-lzma[[=DIR]] use liblzma in DIR],[
198 if test "$withval" != "no" -a "$withval" != "yes"; then
199 LZMA_DIR=$withval
200 CPPFLAGS="${CPPFLAGS} -I$withval/include"
201 LDFLAGS="${LDFLAGS} -L$withval/lib"
202 fi
203])
Daniel Veillardbfa5cf12008-08-27 15:33:28 +0000204AC_ARG_WITH(coverage,
205[ --with-coverage build for code coverage with GCC (off)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000206
Daniel Veillardb40744e2008-10-17 13:26:44 +0000207AC_ARG_ENABLE(rebuild-docs,
208[ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=yes]]])
209AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"])
210
William M. Brack21e4ef22005-01-02 09:53:13 +0000211dnl
Daniel Veillard39e5c892005-07-03 22:48:50 +0000212dnl hard dependancies on options
213dnl
214if test "$with_schemas" = "yes"
215then
216 with_pattern=yes
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000217 with_regexps=yes
Daniel Veillard39e5c892005-07-03 22:48:50 +0000218fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000219if test "$with_schematron" = "yes"
220then
221 with_pattern=yes
222 with_xpath=yes
223fi
Daniel Veillard39e5c892005-07-03 22:48:50 +0000224if test "$with_reader" = "yes"
225then
226 with_push=yes
227fi
228if test "$with_xptr" = "yes"
229then
230 with_xpath=yes
231fi
232dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000233dnl option to build a minimal libxml2 library
234dnl
235if test "$with_minimum" = "yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000236then
William M. Brack21e4ef22005-01-02 09:53:13 +0000237 echo "Configuring for a minimal library"
238 if test "$with_c14n" = ""
239 then
240 with_c14n=no
241 fi
242 if test "$with_catalog" = ""
243 then
244 with_catalog=no
245 fi
246 echo So far so good!
247 if test "$with_debug" = ""
248 then
249 with_debug=no
250 fi
251 if test "$with_docbook" = ""
252 then
253 with_docbook=no
254 fi
255 if test "$with_fexceptions" = ""
256 then
257 with_fexceptions=no
258 fi
259 if test "$with_ftp" = ""
260 then
261 with_ftp=no
262 fi
263 if test "$with_history" = ""
264 then
265 with_history=no
266 fi
267 if test "$with_html" = ""
268 then
269 with_html=no
270 fi
271 if test "$with_http" = ""
272 then
273 with_http=no
274 fi
275 if test "$with_iconv" = ""
276 then
277 with_iconv=no
278 fi
279 if test "$with_iso8859x" = ""
280 then
281 with_iso8859x=no
282 fi
283 if test "$with_legacy" = ""
284 then
285 with_legacy=no
286 fi
287 if test "$with_mem_debug" = ""
288 then
289 with_mem_debug=no
290 fi
291 if test "$with_output" = ""
292 then
293 with_output=no
294 fi
295 if test "$with_pattern" = ""
296 then
297 with_pattern=no
298 fi
299 if test "$with_push" = ""
300 then
301 with_push=no
302 fi
303 if test "$with_python" = ""
304 then
305 with_python=no
306 fi
307 if test "$with_reader" = ""
308 then
309 with_reader=no
310 fi
311 if test "$with_readline" = ""
312 then
313 with_readline=no
314 fi
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000315 if test "$with_regexps" = ""
William M. Brack21e4ef22005-01-02 09:53:13 +0000316 then
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000317 with_regexps=no
William M. Brack21e4ef22005-01-02 09:53:13 +0000318 fi
319 if test "$with_run_debug" = ""
320 then
321 with_run_debug=no
322 fi
323 if test "$with_sax1" = ""
324 then
325 with_sax1=no
326 fi
327 if test "$with_schemas" = ""
328 then
329 with_schemas=no
330 fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000331 if test "$with_schematron" = ""
332 then
333 with_schematron=no
334 fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000335 if test "$with_threads" = ""
336 then
337 with_threads=no
338 fi
339 if test "$with_thread_alloc" = ""
340 then
341 with_thread_alloc=no
342 fi
343 if test "$with_tree" = ""
344 then
345 with_tree=no
346 fi
347 if test "$with_valid" = ""
348 then
349 with_valid=no
350 fi
351 if test "$with_writer" = ""
352 then
353 with_writer=no
354 fi
355 if test "$with_xinclude" = ""
356 then
357 with_xinclude=no
358 fi
359 if test "$with_xpath" = ""
360 then
361 with_xpath=no
362 fi
363 if test "$with_xptr" = ""
364 then
365 with_xptr=no
366 fi
367 if test "$with_zlib" = ""
368 then
369 with_zlib=no
370 fi
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000371 if test "$with_modules" = ""
372 then
373 with_modules=no
374 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000375fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000376
377echo Checking zlib
378
379dnl Checks for zlib library.
380
Daniel Veillard75acfee2006-07-13 06:29:56 +0000381WITH_ZLIB=0
Daniel Veillard259ff742001-10-06 13:49:59 +0000382if test "$with_zlib" = "no"; then
383 echo "Disabling compression support"
384else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000385 AC_CHECK_HEADERS(zlib.h,
386 AC_CHECK_LIB(z, gzread,[
Daniel Veillard75acfee2006-07-13 06:29:56 +0000387 AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
388 WITH_ZLIB=1
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000389 if test "x${Z_DIR}" != "x"; then
390 Z_CFLAGS="-I${Z_DIR}/include"
391 Z_LIBS="-L${Z_DIR}/lib -lz"
392 [case ${host} in
393 *-*-solaris*)
394 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
395 ;;
396 esac]
397 else
398 Z_LIBS="-lz"
399 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +0000400fi
Owen Taylor3473f882001-02-23 17:55:21 +0000401
Owen Taylor3473f882001-02-23 17:55:21 +0000402AC_SUBST(Z_CFLAGS)
403AC_SUBST(Z_LIBS)
Daniel Veillard75acfee2006-07-13 06:29:56 +0000404AC_SUBST(WITH_ZLIB)
Owen Taylor3473f882001-02-23 17:55:21 +0000405
Anders F Bjorklundeae52612011-09-18 16:59:13 +0200406echo Checking lzma
407
408dnl Checks for lzma library.
409
410WITH_LZMA=0
411if test "$with_lzma" = "no"; then
412 echo "Disabling compression support"
413else
414 AC_CHECK_HEADERS(lzma.h,
415 AC_CHECK_LIB(lzma, lzma_code,[
416 AC_DEFINE([HAVE_LIBLZMA], [1], [Have compression library])
417 WITH_LZMA=1
418 if test "x${LZMA_DIR}" != "x"; then
419 LZMA_CFLAGS="-I${LZMA_DIR}/include"
420 LZMA_LIBS="-L${LZMA_DIR}/lib -llzma"
421 else
422 LZMA_LIBS="-llzma"
423 fi]))
424fi
425
426AC_SUBST(LZMA_CFLAGS)
427AC_SUBST(LZMA_LIBS)
428AC_SUBST(WITH_LZMA)
429
Owen Taylor3473f882001-02-23 17:55:21 +0000430CPPFLAGS=${_cppflags}
431LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000432
William M. Brack21e4ef22005-01-02 09:53:13 +0000433echo Checking headers
434
Daniel Veillard01791d51998-07-24 19:24:09 +0000435dnl Checks for header files.
436AC_HEADER_DIRENT
437AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000438AC_CHECK_HEADERS([fcntl.h])
439AC_CHECK_HEADERS([unistd.h])
440AC_CHECK_HEADERS([ctype.h])
441AC_CHECK_HEADERS([dirent.h])
442AC_CHECK_HEADERS([errno.h])
443AC_CHECK_HEADERS([malloc.h])
444AC_CHECK_HEADERS([stdarg.h])
445AC_CHECK_HEADERS([sys/stat.h])
446AC_CHECK_HEADERS([sys/types.h])
Daniel Veillard7f4547c2008-10-03 07:58:23 +0000447AC_CHECK_HEADERS([stdint.h])
Daniel Mustielesbde9c352012-03-19 21:39:58 +0100448AC_CHECK_HEADERS([inttypes.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000449AC_CHECK_HEADERS([time.h])
450AC_CHECK_HEADERS([ansidecl.h])
451AC_CHECK_HEADERS([ieeefp.h])
452AC_CHECK_HEADERS([nan.h])
453AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000454AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000455AC_CHECK_HEADERS([fp_class.h])
456AC_CHECK_HEADERS([float.h])
457AC_CHECK_HEADERS([stdlib.h])
458AC_CHECK_HEADERS([sys/socket.h], [], [],
459[#if HAVE_SYS_TYPES_H
460# include <sys/types.h>
461# endif
462])
463AC_CHECK_HEADERS([netinet/in.h], [], [],
464[#if HAVE_SYS_TYPES_H
465# include <sys/types.h>
466# endif
467])
468AC_CHECK_HEADERS([arpa/inet.h], [], [],
469[#if HAVE_SYS_TYPES_H
470# include <sys/types.h>
471# endif
472#if HAVE_ARPA_INET_H
473# include <arpa/inet.h>
474# endif
475])
476AC_CHECK_HEADERS([netdb.h])
477AC_CHECK_HEADERS([sys/time.h])
478AC_CHECK_HEADERS([sys/select.h])
Raphael Prevost48b60c32009-08-23 13:11:01 +0200479AC_CHECK_HEADERS([poll.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000480AC_CHECK_HEADERS([sys/mman.h])
481AC_CHECK_HEADERS([sys/timeb.h])
482AC_CHECK_HEADERS([signal.h])
483AC_CHECK_HEADERS([arpa/nameser.h], [], [],
484[#if HAVE_SYS_TYPES_H
485# include <sys/types.h>
486# endif
487])
488AC_CHECK_HEADERS([resolv.h], [], [],
489[#if HAVE_SYS_TYPES_H
490# include <sys/types.h>
491# endif
492#if HAVE_NETINET_IN_H
493# include <netinet/in.h>
494# endif
495#if HAVE_ARPA_NAMESER_H
496# include <arpa/nameser.h>
497# endif
498])
Daniel Veillarddcd93902005-01-13 11:25:15 +0000499AC_CHECK_HEADERS([dl.h])
500AC_CHECK_HEADERS([dlfcn.h])
Daniel Veillard01791d51998-07-24 19:24:09 +0000501
Daniel Veillardfc979062004-03-04 22:07:16 +0000502
William M. Brack21e4ef22005-01-02 09:53:13 +0000503echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000504
Daniel Veillard01791d51998-07-24 19:24:09 +0000505dnl Checks for library functions.
506AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000507AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000508AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000509AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000510AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard8973d582012-02-04 19:07:44 +0800511AC_CHECK_FUNCS(rand srand time)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000512
Daniel Veillard92ad2102001-03-27 12:47:33 +0000513dnl Checking the standard string functions availability
514AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
515 NEED_TRIO=1)
516
William M. Brackf4caa5e2005-10-20 09:04:05 +0000517dnl Checking for va_copy availability
518AC_MSG_CHECKING([for va_copy])
519AC_TRY_LINK([#include <stdarg.h>
520va_list ap1,ap2;], [va_copy(ap1,ap2);],
521have_va_copy=yes,
522have_va_copy=no)
523AC_MSG_RESULT($have_va_copy)
524if test x"$have_va_copy" = x"yes"; then
525 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
526else
527 AC_MSG_CHECKING([for __va_copy])
528 AC_TRY_LINK([#include <stdarg.h>
529 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
530 have___va_copy=yes,
531 have___va_copy=no)
532 AC_MSG_RESULT($have___va_copy)
533 if test x"$have___va_copy" = x"yes"; then
534 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
535 fi
536fi
537
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000538dnl Checks for inet libraries:
Daniel Veillardd4e39ae2005-10-28 15:59:14 +0000539AC_SEARCH_LIBS(gethostent, [nsl])
Scott McCreary59f53082009-08-26 09:55:24 +0200540AC_SEARCH_LIBS(setsockopt, [socket net network])
Daniel Veillardd4e39ae2005-10-28 15:59:14 +0000541AC_SEARCH_LIBS(connect, [inet])
Daniel Veillardb05deb71999-08-10 19:04:08 +0000542
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000543dnl Determine what socket length (socklen_t) data type is
544AC_MSG_CHECKING([for type of socket length (socklen_t)])
545AC_TRY_COMPILE2([
546#include <stddef.h>
547#include <sys/types.h>
548#include <sys/socket.h>],[
549(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
550 AC_MSG_RESULT(socklen_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000551 XML_SOCKLEN_T=socklen_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000552 AC_TRY_COMPILE2([
553#include <stddef.h>
554#include <sys/types.h>
555#include <sys/socket.h>],[
556(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
557 AC_MSG_RESULT(size_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000558 XML_SOCKLEN_T=size_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000559 AC_TRY_COMPILE2([
560#include <stddef.h>
561#include <sys/types.h>
562#include <sys/socket.h>],[
563(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
564 AC_MSG_RESULT(int *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000565 XML_SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000566 AC_MSG_WARN(could not determine)
Daniel Veillardc284c642005-03-31 10:24:24 +0000567 XML_SOCKLEN_T="int"])])])
568AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000569
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000570dnl ***********************Checking for availability of IPv6*******************
571
572AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000573AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000574if test "$with_minimum" = "yes"
575then
576 enable_ipv6=no
577fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000578if test $enable_ipv6 = yes; then
579 have_ipv6=no
580 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000581 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000582 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000583 ], [
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000584 struct sockaddr_storage ss;
585 socket(AF_INET6, SOCK_STREAM, 0)
586 ],
587 have_ipv6=yes,
588 have_ipv6=no
589 )
590 AC_MSG_RESULT($have_ipv6)
591
William M. Brack476cd962003-08-13 11:09:42 +0000592 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000593 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000594 have_broken_ss_family=no
595
596 dnl *********************************************************************
597 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
598 dnl a ss_family member, but rather __ss_family. Let's detect that
William M. Brack7d8b36b2005-06-25 07:30:50 +0000599 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
600 dnl platforms. However, we should only do this if ss_family is not
601 dnl present.
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000602 dnl ********************************************************************
William M. Brack7d8b36b2005-06-25 07:30:50 +0000603 AC_MSG_CHECKING([struct sockaddr::ss_family])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000604 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000605 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000606 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000607 ], [
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000608 struct sockaddr_storage ss ;
William M. Brack7d8b36b2005-06-25 07:30:50 +0000609 ss.ss_family = 0 ;
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000610 ],
William M. Brack7d8b36b2005-06-25 07:30:50 +0000611 have_ss_family=yes,
612 have_ss_family=no
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000613 )
William M. Brack7d8b36b2005-06-25 07:30:50 +0000614 AC_MSG_RESULT($have_ss_family)
615 if test x$have_ss_family = xno ; then
616 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
617 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000618 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000619 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000620 ], [
William M. Brack7d8b36b2005-06-25 07:30:50 +0000621 struct sockaddr_storage ss ;
622 ss.__ss_family = 0 ;
623 ],
624 have_broken_ss_family=yes,
625 have_broken_ss_family=no
626 )
627 AC_MSG_RESULT($have_broken_ss_family)
628 if test x$have_broken_ss_family = xyes ; then
629 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
630 [Whether struct sockaddr::__ss_family exists])
631 AC_DEFINE(ss_family, __ss_family,
632 [ss_family is not defined here, use __ss_family instead])
633 else
634 AC_MSG_WARN(ss_family and __ss_family not found)
635 fi
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000636 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000637
638 have_getaddrinfo=no
639 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
640 if test $have_getaddrinfo != yes; then
641 for lib in bsd socket inet; do
642 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
643 done
644 fi
645
William M. Brack476cd962003-08-13 11:09:42 +0000646 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000647 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000648 fi
649 fi
650fi
651
652dnl ******************************End IPv6 checks******************************
653
Daniel Veillardb05deb71999-08-10 19:04:08 +0000654dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000655AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000656 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000657
Daniel Veillardc790bf42003-10-11 10:50:10 +0000658AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
659 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000660
661XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000662XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000663
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000664dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000665dnl Extra flags
666dnl
667XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000668RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000669
670dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000671dnl Workaround for native compilers
672dnl HP : http://bugs.gnome.org/db/31/3163.html
673dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000674dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000675if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000676 case "${host}" in
Daniel Veillard6a0baa02005-12-10 11:11:12 +0000677 hppa*-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000678 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000679 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000680 *-dec-osf* )
681 CFLAGS="${CFLAGS} -ieee"
682 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000683 alpha*-*-linux* )
684 CFLAGS="${CFLAGS} -ieee"
685 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000686 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000687else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000688 if test "$with_fexceptions" = "yes"
689 then
690 #
691 # Not activated by default because this inflates the code size
692 # Used to allow propagation of C++ exceptions through the library
693 #
694 CFLAGS="${CFLAGS} -fexceptions"
695 fi
Stefan Kost85deb482011-05-10 10:55:07 +0300696
697 # warnings we'd like to see
698 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"
699 # warnings we'd like to supress
700 CFLAGS="${CFLAGS} -Wno-long-long"
Daniel Veillard14839d52001-06-06 16:11:56 +0000701 case "${host}" in
702 alpha*-*-linux* )
703 CFLAGS="${CFLAGS} -mieee"
704 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000705 alpha*-*-osf* )
706 CFLAGS="${CFLAGS} -mieee"
707 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000708 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000709fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000710case ${host} in
711 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000712 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
713 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000714 hppa*-hp-mpeix)
715 NEED_TRIO=1
716 ;;
Daniel Veillard4188ddf2006-01-19 08:58:42 +0000717 *-*-mingw* | *-*-cygwin* | *-*-msvc* )
718 # If the host is Windows, and shared libraries are disabled, we
719 # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
720 # work properly (without it, xmlexports.h would force the use of
721 # DLL imports, which obviously aren't present in a static
722 # library).
723 if test "x$enable_shared" = "xno"; then
724 XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
725 CFLAGS="$CFLAGS -DLIBXML_STATIC"
726 fi
727 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000728esac
729
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000730
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000731dnl
732dnl check for python
733dnl
734
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000735PYTHON_VERSION=
736PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000737PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000738PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000739pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000740if test "$with_python" != "no" ; then
741 if test -x "$with_python/bin/python"
742 then
743 echo Found python in $with_python/bin/python
744 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000745 else
LRNfbd4ddf2010-11-04 15:45:46 +0100746 if test -x "$with_python/python.exe"
747 then
748 echo Found python in $with_python/python.exe
749 PYTHON="$with_python/python.exe"
750 else
751 if test -x "$with_python"
752 then
753 echo Found python in $with_python
754 PYTHON="$with_python"
755 else
756 if test -x "$PYTHON"
757 then
758 echo Found python in environment PYTHON=$PYTHON
759 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
760 else
761 AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
762 fi
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000763 fi
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000764 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000765 fi
766 if test "$PYTHON" != ""
767 then
768 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
769 echo Found Python version $PYTHON_VERSION
770 fi
771 if test "$PYTHON_VERSION" != ""
772 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000773 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
774 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000775 then
776 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000777 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000778 else
779 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
780 then
Daniel Veillard8492ba12006-04-25 12:52:12 +0000781 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000782 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000783 else
784 if test -r /usr/include/python$PYTHON_VERSION/Python.h
785 then
786 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000787 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000788 else
LRNfbd4ddf2010-11-04 15:45:46 +0100789 if test -r $with_python/include/Python.h -a \
790 -d $with_python/lib/site-packages
791 then
792 PYTHON_INCLUDES=$with_python/include
793 PYTHON_SITE_PACKAGES=$with_python/lib/site-packages
794 else
795 echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h
796 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000797 fi
798 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000799 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000800 then
801 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
802 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000803 fi
Daniel Macks12febe82010-03-15 10:31:24 +0100804 PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000805 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000806 if test "$with_python" != ""
807 then
Daniel Veillardd7d07482006-05-03 13:15:44 +0000808 pythondir='$(PYTHON_SITE_PACKAGES)'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000809 else
Daniel Veillardb2f8f1d2006-04-28 16:30:48 +0000810 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000811 fi
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000812else
813 PYTHON=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000814fi
815AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000816if test "$PYTHON_INCLUDES" != ""
817then
818 PYTHON_SUBDIR=python
819else
820 PYTHON_SUBDIR=
821fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000822AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000823AC_SUBST(PYTHON_SUBDIR)
Frederic Crozate21731d2009-09-12 18:02:40 +0200824AC_SUBST(PYTHON_LIBS)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000825
Daniel Veillardce1648b2005-01-04 15:10:22 +0000826dnl check for dso support
827WITH_MODULES=0
Daniel Veillardce1648b2005-01-04 15:10:22 +0000828TEST_MODULES=
829
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000830if test "$with_modules" != "no" ; then
Daniel Veillard9202b672005-07-14 09:31:14 +0000831 case "$host" in
832 *-*-cygwin*)
833 MODULE_EXTENSION=".dll"
834 AC_CHECK_LIB(cygwin, dlopen, [
835 WITH_MODULES=1
836 MODULE_PLATFORM_LIBS=
837 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
838 ])
839 ;;
Roumen Petrov120a2692010-03-10 10:07:49 +0100840 *-*-mingw*)
841 MODULE_EXTENSION=".dll"
842 WITH_MODULES=1
843 ;;
Daniel Veillard9202b672005-07-14 09:31:14 +0000844 *)
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000845 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
846 AC_CHECK_LIB(dld, shl_load, [
847 MODULE_PLATFORM_LIBS="-ldld"
848 libxml_have_shl_load=yes], [
849 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
850 AC_CHECK_LIB(dl, dlopen, [
851 MODULE_PLATFORM_LIBS="-ldl"
852 libxml_have_dlopen=yes])])])])
853
854 if test "${libxml_have_shl_load}" = "yes"; then
855 MODULE_EXTENSION=".sl"
Daniel Veillard9202b672005-07-14 09:31:14 +0000856 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000857 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000858 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000859
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000860 if test "${libxml_have_dlopen}" = "yes"; then
861 case "${host}" in
862 *-*-hpux* )
863 MODULE_EXTENSION=".sl"
864 ;;
865 * )
866 MODULE_EXTENSION=".so"
867 ;;
868 esac
869
Daniel Veillard9202b672005-07-14 09:31:14 +0000870 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000871 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000872 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000873 ;;
874 esac
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000875fi
Daniel Veillardce1648b2005-01-04 15:10:22 +0000876
877if test "${WITH_MODULES}" = "1"; then
878 TEST_MODULES="ModuleTests"
879fi
880
881AC_SUBST(WITH_MODULES)
882AC_SUBST(MODULE_PLATFORM_LIBS)
883AC_SUBST(MODULE_EXTENSION)
884AC_SUBST(TEST_MODULES)
885
Daniel Veillard437b87b2000-01-03 17:30:46 +0000886dnl
887dnl Tester makes use of readline if present
888dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000889
Daniel Veillard361d8452000-04-03 19:48:13 +0000890dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000891dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000892dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000893dnl
William M. Brack871611b2003-10-18 04:53:14 +0000894if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000895 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Brack7f28a012007-01-11 23:42:10 +0000896 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000897 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000898 if test "$with_minimum" != "yes"
899 then
900 if test "${with_mem_debug}" = "" ; then
Daniel Veillard379a3b72005-08-12 10:18:14 +0000901 echo Activating memory debugging
Daniel Veillard4432df22003-09-28 18:58:27 +0000902 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000903 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000904 fi
905 if test "${with_docbook}" = "" ; then
906 with_docbook="yes"
907 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000908 fi
Daniel Veillard3854c572005-08-25 10:17:45 +0000909 if test "${GCC}" = "yes" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000910 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 +0000911 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000912 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000913dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000914else
915 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000916fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000917AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000918
919dnl
920dnl Check for trio string functions
921dnl
922
923if test "${NEED_TRIO}" = "1" ; then
924 echo Adding trio library for string functions
925 WITH_TRIO=1
926else
927 WITH_TRIO=0
928fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000929AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000930AC_SUBST(WITH_TRIO)
931
Daniel Veillardf6eea272001-01-18 12:17:12 +0000932dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000933dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000934dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000935echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000936
William M. Brack21e4ef22005-01-02 09:53:13 +0000937dnl
938dnl Thread-related stuff
939dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000940THREAD_LIBS=""
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000941BASE_THREAD_LIBS=""
Daniel Veillardb8478642001-10-12 17:29:10 +0000942WITH_THREADS=0
943THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000944TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000945THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000946
Daniel Veillard84942712003-04-18 14:40:05 +0000947if test "$with_threads" = "no" ; then
948 echo Disabling multithreaded support
949else
Daniel Veillardb8478642001-10-12 17:29:10 +0000950 echo Enabling multithreaded support
LRN203fd2e2009-08-07 21:47:25 +0200951 dnl Use pthread by default
Andrew W. Nosenko858084f2009-10-06 18:14:15 +0200952 if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then
LRN203fd2e2009-08-07 21:47:25 +0200953 AC_CHECK_HEADER(pthread.h,
954 AC_CHECK_LIB(pthread, pthread_join,[
955 THREAD_LIBS="-lpthread"
956 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
957 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
958 WITH_THREADS="1"]))
959 fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000960 case $host_os in
LRN203fd2e2009-08-07 21:47:25 +0200961 *mingw32*) if test "$THREAD_LIBS" != "-lpthread"; then
962 WITH_THREADS="1"
963 THREADS_W32="Win32"
964 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
965 fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000966 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000967 *cygwin*) THREAD_LIBS=""
968 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000969 *beos*) WITH_THREADS="1"
970 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
971 ;;
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000972 *linux*)
Daniel Veillard32a461f2005-08-25 21:48:54 +0000973 if test "${GCC}" = "yes" ; then
974 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
975 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
976 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
977 if test "${THREAD_LIBS}" = "-lpthread" ; then
978 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
979 then
980 THREAD_LIBS=""
981 BASE_THREAD_LIBS="-lpthread"
982 else
LRN203fd2e2009-08-07 21:47:25 +0200983 if expr ${GCC_MAJOR} \> 3 > /dev/null
Daniel Veillard32a461f2005-08-25 21:48:54 +0000984 then
985 THREAD_LIBS=""
986 BASE_THREAD_LIBS="-lpthread"
987 else
988 echo old GCC disabling weak symbols for pthread
989 fi
990 fi
991 fi
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000992 fi
993 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000994 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000995 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000996 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
997 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000998 fi
999fi
William M. Brack306e33c2004-06-12 01:01:22 +00001000if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +00001001 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +00001002fi
1003
Daniel Veillardb8478642001-10-12 17:29:10 +00001004AC_SUBST(THREAD_LIBS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +00001005AC_SUBST(BASE_THREAD_LIBS)
Daniel Veillardb8478642001-10-12 17:29:10 +00001006AC_SUBST(WITH_THREADS)
1007AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +00001008AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001009AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +00001010
William M. Brack21e4ef22005-01-02 09:53:13 +00001011dnl
1012dnl xmllint shell history
1013dnl
Daniel Veillard259ff742001-10-06 13:49:59 +00001014if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +00001015 echo Enabling xmllint shell history
1016 dnl check for terminal library. this is a very cool solution
1017 dnl from octave's configure.in
1018 unset tcap
1019 for termlib in ncurses curses termcap terminfo termlib; do
1020 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
1021 test -n "$tcap" && break
1022 done
1023
1024 AC_CHECK_HEADER(readline/history.h,
1025 AC_CHECK_LIB(history, append_history,[
1026 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +00001027 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +00001028 AC_CHECK_HEADER(readline/readline.h,
1029 AC_CHECK_LIB(readline, readline,[
1030 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +00001031 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +00001032 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
1033 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
1034 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +00001035 fi
Daniel Veillardf012a642001-07-23 19:10:52 +00001036fi
1037
William M. Brack21e4ef22005-01-02 09:53:13 +00001038dnl
1039dnl Tree functions
1040dnl
Daniel Veillard652327a2003-09-29 18:02:38 +00001041if test "$with_tree" = "no" ; then
1042 echo Disabling DOM like tree manipulation APIs
1043 WITH_TREE=0
1044else
1045 WITH_TREE=1
1046fi
1047AC_SUBST(WITH_TREE)
1048
Daniel Veillard361d8452000-04-03 19:48:13 +00001049if test "$with_ftp" = "no" ; then
1050 echo Disabling FTP support
1051 WITH_FTP=0
1052 FTP_OBJ=
1053else
1054 WITH_FTP=1
1055 FTP_OBJ=nanoftp.o
1056fi
1057AC_SUBST(WITH_FTP)
1058AC_SUBST(FTP_OBJ)
1059
Daniel Veillard361d8452000-04-03 19:48:13 +00001060if test "$with_http" = "no" ; then
1061 echo Disabling HTTP support
1062 WITH_HTTP=0
1063 HTTP_OBJ=
1064else
1065 WITH_HTTP=1
1066 HTTP_OBJ=nanohttp.o
1067fi
1068AC_SUBST(WITH_HTTP)
1069AC_SUBST(HTTP_OBJ)
1070
Daniel Veillard4432df22003-09-28 18:58:27 +00001071if test "$with_legacy" = "no" ; then
1072 echo Disabling deprecated APIs
1073 WITH_LEGACY=0
1074else
1075 WITH_LEGACY=1
1076fi
1077AC_SUBST(WITH_LEGACY)
1078
Daniel Veillard81273902003-09-30 00:43:48 +00001079if test "$with_reader" = "no" ; then
1080 echo Disabling the xmlReader parsing interface
1081 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +00001082 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +00001083else
1084 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +00001085 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +00001086 if test "$with_push" = "no" ; then
1087 echo xmlReader requires Push interface - enabling it
1088 with_push=yes
1089 fi
Daniel Veillard81273902003-09-30 00:43:48 +00001090fi
1091AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +00001092AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +00001093
William M. Brack21e4ef22005-01-02 09:53:13 +00001094if test "$with_writer" = "no" ; then
1095 echo Disabling the xmlWriter saving interface
1096 WITH_WRITER=0
1097# WRITER_TEST=
1098else
1099 WITH_WRITER=1
1100# WRITER_TEST=Writertests
1101 if test "$with_push" = "no" ; then
1102 echo xmlWriter requires Push interface - enabling it
1103 with_push=yes
1104 fi
1105 if test "$with_output" = "no" ; then
1106 echo xmlWriter requires Output interface - enabling it
1107 with_output=yes
1108 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001109fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001110AC_SUBST(WITH_WRITER)
1111#AC_SUBST(WRITER_TEST)
1112
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001113if test "$with_pattern" = "no" ; then
1114 echo Disabling the xmlPattern parsing interface
1115 WITH_PATTERN=0
Daniel Veillardf9d16912005-01-30 22:36:30 +00001116 TEST_PATTERN=
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001117else
1118 WITH_PATTERN=1
Daniel Veillardf9d16912005-01-30 22:36:30 +00001119 TEST_PATTERN=Patterntests
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001120fi
1121AC_SUBST(WITH_PATTERN)
Daniel Veillardf9d16912005-01-30 22:36:30 +00001122AC_SUBST(TEST_PATTERN)
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001123
Daniel Veillard81273902003-09-30 00:43:48 +00001124if test "$with_sax1" = "no" ; then
1125 echo Disabling the older SAX1 interface
1126 WITH_SAX1=0
1127 TEST_SAX=
1128else
1129 WITH_SAX1=1
1130 TEST_SAX=SAXtests
1131fi
1132AC_SUBST(WITH_SAX1)
1133AC_SUBST(TEST_SAX)
1134
Daniel Veillard73b013f2003-09-30 12:36:01 +00001135if test "$with_push" = "no" ; then
1136 echo Disabling the PUSH parser interfaces
1137 WITH_PUSH=0
1138 TEST_PUSH=
1139else
1140 WITH_PUSH=1
1141 TEST_PUSH="XMLPushtests"
1142fi
1143AC_SUBST(WITH_PUSH)
1144AC_SUBST(TEST_PUSH)
1145
Daniel Veillard73b013f2003-09-30 12:36:01 +00001146if test "$with_html" = "no" ; then
1147 echo Disabling HTML support
1148 WITH_HTML=0
1149 HTML_OBJ=
1150 TEST_HTML=
1151else
1152 WITH_HTML=1
1153 HTML_OBJ="HTMLparser.o HTMLtree.o"
1154 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +00001155 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +00001156 TEST_PHTML=HTMLPushtests
1157 else
1158 TEST_PHTML=
1159 fi
1160fi
1161AC_SUBST(WITH_HTML)
1162AC_SUBST(HTML_OBJ)
1163AC_SUBST(TEST_HTML)
1164AC_SUBST(TEST_PHTML)
1165
Daniel Veillard73b013f2003-09-30 12:36:01 +00001166if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +00001167 echo Disabling DTD validation support
1168 WITH_VALID=0
1169 TEST_VALID=
1170 TEST_VTIME=
1171else
1172 WITH_VALID=1
1173 TEST_VALID=Validtests
1174 TEST_VTIME=VTimingtests
1175fi
1176AC_SUBST(WITH_VALID)
1177AC_SUBST(TEST_VALID)
1178AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +00001179
Daniel Veillarda7374592001-05-10 14:17:55 +00001180if test "$with_catalog" = "no" ; then
1181 echo Disabling Catalog support
1182 WITH_CATALOG=0
1183 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001184 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +00001185else
1186 WITH_CATALOG=1
1187 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +00001188 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +00001189fi
1190AC_SUBST(WITH_CATALOG)
1191AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001192AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +00001193
Daniel Veillardb59076b2001-04-29 17:04:07 +00001194if test "$with_docbook" = "no" ; then
1195 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +00001196 WITH_DOCB=0
1197 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +00001198else
1199 WITH_DOCB=1
1200 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +00001201fi
1202AC_SUBST(WITH_DOCB)
1203AC_SUBST(DOCB_OBJ)
1204
1205
William M. Brack21e4ef22005-01-02 09:53:13 +00001206if test "$with_xptr" = "no" ; then
1207 echo Disabling XPointer support
1208 WITH_XPTR=0
1209 XPTR_OBJ=
1210 TEST_XPTR=
1211else
1212 WITH_XPTR=1
1213 XPTR_OBJ=xpointer.o
1214 TEST_XPTR=XPtrtests
1215 if test "$with_xpath" = "no" ; then
1216 echo XPointer requires XPath support - enabling it
1217 with_xpath=yes
1218 fi
Daniel Veillard4432df22003-09-28 18:58:27 +00001219fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001220AC_SUBST(WITH_XPTR)
1221AC_SUBST(XPTR_OBJ)
1222AC_SUBST(TEST_XPTR)
1223
1224if test "$with_c14n" = "no" ; then
1225 echo Disabling C14N support
1226 WITH_C14N=0
1227 C14N_OBJ=
1228 TEST_C14N=
1229else
1230 WITH_C14N=1
1231 C14N_OBJ="c14n.c"
1232 TEST_C14N=C14Ntests
1233 if test "$with_xpath" = "no" ; then
1234 echo C14N requires XPath support - enabling it
1235 with_xpath=yes
1236 fi
1237fi
1238AC_SUBST(WITH_C14N)
1239AC_SUBST(C14N_OBJ)
1240AC_SUBST(TEST_C14N)
1241
1242if test "$with_xinclude" = "no" ; then
1243 echo Disabling XInclude support
1244 WITH_XINCLUDE=0
1245 XINCLUDE_OBJ=
1246 with_xinclude="no"
1247 TEST_XINCLUDE=
1248else
1249 WITH_XINCLUDE=1
1250 XINCLUDE_OBJ=xinclude.o
1251 TEST_XINCLUDE=XIncludetests
1252 if test "$with_xpath" = "no" ; then
1253 echo XInclude requires XPath support - enabling it
1254 with_xpath=yes
1255 fi
1256fi
1257AC_SUBST(WITH_XINCLUDE)
1258AC_SUBST(XINCLUDE_OBJ)
1259AC_SUBST(TEST_XINCLUDE)
1260
Daniel Veillard361d8452000-04-03 19:48:13 +00001261if test "$with_xpath" = "no" ; then
1262 echo Disabling XPATH support
1263 WITH_XPATH=0
1264 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001265 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001266else
1267 WITH_XPATH=1
1268 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001269 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001270fi
1271AC_SUBST(WITH_XPATH)
1272AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001273AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001274
William M. Brack21e4ef22005-01-02 09:53:13 +00001275dnl
1276dnl output functions
1277dnl
1278if test "$with_output" = "no" ; then
1279 echo Disabling serialization/saving support
1280 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001281else
William M. Brack21e4ef22005-01-02 09:53:13 +00001282 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001283fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001284AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001285
Daniel Veillard6e90d192001-07-03 16:37:49 +00001286WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001287if test "$with_iconv" = "no" ; then
1288 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001289else
Daniel Veillard220346d2001-12-07 11:33:54 +00001290 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001291 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001292 # Export this since our headers include iconv.h
1293 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001294 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001295 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001296
1297 AC_CHECK_HEADER(iconv.h,
1298 AC_MSG_CHECKING(for iconv)
1299 AC_TRY_LINK([#include <stdlib.h>
1300#include <iconv.h>],[
1301iconv_t cd = iconv_open ("","");
1302iconv (cd, NULL, NULL, NULL, NULL);],[
1303 AC_MSG_RESULT(yes)
1304 WITH_ICONV=1],[
1305 AC_MSG_RESULT(no)
1306 AC_MSG_CHECKING(for iconv in -liconv)
1307
1308 _ldflags="${LDFLAGS}"
1309 _libs="${LIBS}"
1310 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1311 LIBS="${LIBS} -liconv"
1312
1313 AC_TRY_LINK([#include <stdlib.h>
1314#include <iconv.h>],[
1315iconv_t cd = iconv_open ("","");
1316iconv (cd, NULL, NULL, NULL, NULL);],[
1317 AC_MSG_RESULT(yes)
1318 WITH_ICONV=1
1319 ICONV_LIBS="${ICONV_LIBS} -liconv"
1320 LIBS="${_libs}"
1321 LDFLAGS="${_ldflags}"],[
1322 AC_MSG_RESULT(no)
1323 LIBS="${_libs}"
1324 LDFLAGS="${_ldflags}"])]))
Daniel Veillard8e1a46d2008-02-15 07:47:26 +00001325
1326 if test "$WITH_ICONV" = "1" ; then
1327 AC_MSG_CHECKING([for iconv declaration])
1328 AC_CACHE_VAL(xml_cv_iconv_arg2, [
1329 AC_TRY_COMPILE([#include <stdlib.h>
1330#include <iconv.h>
1331extern
1332#ifdef __cplusplus
1333"C"
1334#endif
1335#if defined(__STDC__) || defined(__cplusplus)
1336size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1337#else
1338size_t iconv();
1339#endif
1340], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
1341
1342 xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
1343 AC_MSG_RESULT([${xml_xxx:-
1344 }$xml_cv_iconv_decl])
1345 AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
1346 [Define as const if the declaration of iconv() needs const.])
1347 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001348fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001349case "$host" in
1350 *mingw*) M_LIBS=""
1351 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001352 *beos*) M_LIBS=""
1353 ;;
Scott McCreary508a8d62009-08-24 16:35:35 +02001354 *haiku*) M_LIBS=""
1355 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001356 *) M_LIBS="-lm"
1357 ;;
1358esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001359XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001360XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001361AC_SUBST(WITH_ICONV)
1362
Giuseppe Iuculano48f7dcb2010-11-04 17:42:42 +01001363WITH_ICU=0
1364if test "$with_icu" != "yes" ; then
1365 echo Disabling ICU support
1366else
1367 ICU_CONFIG=icu-config
1368 if ${ICU_CONFIG} --cflags >/dev/null 2>&1
1369 then
1370 ICU_LIBS=`icu-config --ldflags`
1371 LDFLAGS="$LDFLAGS $ICU_LIBS"
1372 WITH_ICU=1
1373 echo Enabling ICU support
1374 else
1375 AC_MSG_ERROR([libicu config program icu-config not found])
1376 fi
1377fi
1378AC_SUBST(WITH_ICU)
1379
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001380WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001381if test "$WITH_ICONV" != "1" ; then
1382if test "$with_iso8859x" = "no" ; then
1383 echo Disabling ISO8859X support
1384 WITH_ISO8859X=0
1385fi
1386fi
1387AC_SUBST(WITH_ISO8859X)
1388
Daniel Veillarded6c5492005-07-23 15:00:22 +00001389if test "$with_schematron" = "no" ; then
1390 echo "Disabling Schematron support"
1391 WITH_SCHEMATRON=0
1392 TEST_SCHEMATRON=
1393else
1394 echo "Enabled Schematron support"
1395 WITH_SCHEMATRON=1
1396 TEST_SCHEMATRON="Schematrontests"
1397 with_xpath=yes
1398 with_pattern=yes
1399fi
1400AC_SUBST(WITH_SCHEMATRON)
1401AC_SUBST(TEST_SCHEMATRON)
1402
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001403if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001404 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001405 WITH_SCHEMAS=0
1406 TEST_SCHEMAS=
1407else
Daniel Veillard71531f32003-02-05 13:19:53 +00001408 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001409 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001410 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001411 if test "$PYTHON_INCLUDES" != "" ; then
1412 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1413 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001414 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001415fi
1416AC_SUBST(WITH_SCHEMAS)
1417AC_SUBST(TEST_SCHEMAS)
1418
Daniel Veillard23e73572002-09-19 19:56:43 +00001419if test "$with_regexps" = "no" ; then
1420 echo Disabling Regexps support
1421 WITH_REGEXPS=0
1422 TEST_REGEXPS=
1423else
1424 WITH_REGEXPS=1
1425 TEST_REGEXPS="Regexptests Automatatests"
1426fi
1427AC_SUBST(WITH_REGEXPS)
1428AC_SUBST(TEST_REGEXPS)
1429
Daniel Veillard361d8452000-04-03 19:48:13 +00001430if test "$with_debug" = "no" ; then
1431 echo Disabling DEBUG support
1432 WITH_DEBUG=0
1433 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001434 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001435else
1436 WITH_DEBUG=1
1437 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001438 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001439fi
1440AC_SUBST(WITH_DEBUG)
1441AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001442AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001443
Daniel Veillard361d8452000-04-03 19:48:13 +00001444if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001445 if test "$with_thread_alloc" = "yes" ; then
1446 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1447 WITH_MEM_DEBUG=0
1448 else
1449 echo Enabling memory debug support
1450 WITH_MEM_DEBUG=1
1451 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001452else
1453 WITH_MEM_DEBUG=0
1454fi
1455AC_SUBST(WITH_MEM_DEBUG)
1456
Daniel Veillard22cdb842004-10-04 14:09:17 +00001457if test "$with_run_debug" = "yes" ; then
1458 echo Enabling runtime debug support
1459 WITH_RUN_DEBUG=1
1460else
1461 WITH_RUN_DEBUG=0
1462fi
1463AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001464
1465WIN32_EXTRA_LIBADD=
1466WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001467CYGWIN_EXTRA_LDFLAGS=
1468CYGWIN_EXTRA_PYTHON_LIBADD=
LRNfbd4ddf2010-11-04 15:45:46 +01001469WIN32_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001470case "$host" in
1471 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001472 CPPFLAGS="$CPPFLAGS -DWIN32"
1473 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001474 WIN32_EXTRA_LDFLAGS="-no-undefined"
1475 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1476 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1477 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
LRNfbd4ddf2010-11-04 15:45:46 +01001478 if test "${PYTHON}" != ""
1479 then
1480 WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython${PYTHON_VERSION//./}"
1481 fi
Daniel Veillard1638a472003-08-14 01:23:25 +00001482 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001483 *-*-cygwin*)
1484 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001485 if test "${PYTHON}" != ""
1486 then
1487 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1488 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001489 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001490esac
1491AC_SUBST(WIN32_EXTRA_LIBADD)
1492AC_SUBST(WIN32_EXTRA_LDFLAGS)
LRNfbd4ddf2010-11-04 15:45:46 +01001493AC_SUBST(WIN32_EXTRA_PYTHON_LIBADD)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001494AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1495AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001496
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001497if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
1498then
1499 echo Enabling code coverage for GCC
1500 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
1501 LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
1502else
1503 echo Disabling code coverage for GCC
1504fi
1505
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001506AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001507AC_SUBST(CFLAGS)
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001508AC_SUBST(LDFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001509AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001510
Daniel Veillardb05deb71999-08-10 19:04:08 +00001511AC_SUBST(XML_LIBDIR)
1512AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001513AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001514AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001515AC_SUBST(XML_INCLUDEDIR)
1516AC_SUBST(HTML_DIR)
1517AC_SUBST(HAVE_ISNAN)
1518AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001519AC_SUBST(PYTHON)
1520AC_SUBST(PYTHON_VERSION)
1521AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001522AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001523
Daniel Veillardb05deb71999-08-10 19:04:08 +00001524AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001525AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001526
Daniel Veillard9715c172002-11-25 16:33:40 +00001527dnl for the spec file
1528RELDATE=`date +'%a %b %e %Y'`
1529AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001530AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001531
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001532rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001533ln -s Copyright COPYING
1534
Daniel Veillarde4177a52004-01-08 16:43:57 +00001535# keep on one line for cygwin c.f. #130896
Daniel Veillard99b78502005-09-11 22:04:08 +00001536AC_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 +00001537
Daniel Veillard06d25242004-02-25 13:01:42 +00001538chmod +x xml2-config python/setup.py
Daniel Veillard67952602006-01-05 15:29:44 +00001539echo Done configuring