blob: 9603e8fd38ca41010c38c74d2684634aac6a499e [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
Owen Taylor3473f882001-02-23 17:55:21 +00002AC_INIT(entities.c)
Daniel Veillard01791d51998-07-24 19:24:09 +00003AM_CONFIG_HEADER(config.h)
Daniel Veillardd2ade932000-09-30 14:39:55 +00004AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00005
Daniel Veillardcf461992000-03-14 18:30:20 +00006LIBXML_MAJOR_VERSION=2
Daniel Veillard15724252008-08-30 15:01:04 +00007LIBXML_MINOR_VERSION=7
Daniel Veillard7f4547c2008-10-03 07:58:23 +00008LIBXML_MICRO_VERSION=2
Daniel Veillard3e35f8e2003-10-21 00:05:38 +00009LIBXML_MICRO_VERSION_SUFFIX=
Daniel Veillard4fc52812003-09-01 20:33:13 +000010LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
Daniel Veillard14fff061999-06-22 21:49:07 +000011LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
12
Daniel Veillard361d8452000-04-03 19:48:13 +000013LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
14
Daniel Veillard9cb1b642007-01-03 15:07:44 +000015if test -f CVS/Entries ; then
Daniel Veillarddab93ea2004-08-20 16:47:10 +000016 extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
17 echo extra=$extra
18 if test "$extra" != ""
19 then
20 LIBXML_VERSION_EXTRA="-CVS$extra"
21 fi
Daniel Veillard9cb1b642007-01-03 15:07:44 +000022else if test -d .svn ; then
23 extra=`svn info | grep Revision | sed 's+Revision: ++'`
24 echo extra=$extra
25 if test "$extra" != ""
26 then
27 LIBXML_VERSION_EXTRA="-SVN$extra"
28 fi
29fi
William M. Brackf4025492004-08-18 21:08:46 +000030fi
Daniel Veillard14fff061999-06-22 21:49:07 +000031AC_SUBST(LIBXML_MAJOR_VERSION)
32AC_SUBST(LIBXML_MINOR_VERSION)
33AC_SUBST(LIBXML_MICRO_VERSION)
34AC_SUBST(LIBXML_VERSION)
35AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000036AC_SUBST(LIBXML_VERSION_NUMBER)
William M. Brackf4025492004-08-18 21:08:46 +000037AC_SUBST(LIBXML_VERSION_EXTRA)
Daniel Veillard14fff061999-06-22 21:49:07 +000038
Daniel Veillard361d8452000-04-03 19:48:13 +000039VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000040
Daniel Veillardedfb29b2000-03-14 19:59:05 +000041AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000042
Daniel Veillard01791d51998-07-24 19:24:09 +000043dnl Checks for programs.
44AC_PROG_CC
45AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000046AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000047AC_PATH_PROG(RM, rm, /bin/rm)
48AC_PATH_PROG(MV, mv, /bin/mv)
49AC_PATH_PROG(TAR, tar, /bin/tar)
William M. Brack1826d0a2004-07-21 09:03:57 +000050AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard33a2de92006-10-11 08:33:22 +000051AC_PATH_PROG(WGET, wget, /usr/bin/wget)
Daniel Veillard8b817da2004-09-30 09:19:33 +000052AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
Daniel Veillard06500c82004-09-07 09:12:44 +000053AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
Daniel Veillard01791d51998-07-24 19:24:09 +000054
Daniel Veillard03109292000-08-14 14:58:22 +000055dnl Make sure we have an ANSI compiler
56AM_C_PROTOTYPES
57test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
58
Daniel Veillard6984e6d2003-12-09 14:20:17 +000059AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000060AM_PROG_LIBTOOL
61
Daniel Veillard4432df22003-09-28 18:58:27 +000062dnl
William M. Brack21e4ef22005-01-02 09:53:13 +000063dnl We process the AC_ARG_WITH first so that later we can modify
64dnl some of them to try to prevent impossible combinations. This
65dnl also allows up so alphabetize the choices
Daniel Veillard4432df22003-09-28 18:58:27 +000066dnl
Daniel Veillard4432df22003-09-28 18:58:27 +000067
William M. Brack21e4ef22005-01-02 09:53:13 +000068dnl
69dnl zlib option might change flags, so we save them initially
70dnl
Owen Taylor3473f882001-02-23 17:55:21 +000071_cppflags="${CPPFLAGS}"
72_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000073
William M. Brack21e4ef22005-01-02 09:53:13 +000074AC_ARG_WITH(c14n,
75[ --with-c14n add the Canonicalization support (on)])
76AC_ARG_WITH(catalog,
77[ --with-catalog add the Catalog support (on)])
78AC_ARG_WITH(debug,
79[ --with-debug add the debugging module (on)])
80AC_ARG_WITH(docbook,
81[ --with-docbook add Docbook SGML support (on)])
82AC_ARG_WITH(fexceptions,
83[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
84AC_ARG_WITH(ftp,
85[ --with-ftp add the FTP support (on)])
86AC_ARG_WITH(history,
87[ --with-history add history support to xmllint shell(off)])
88AC_ARG_WITH(html,
89[ --with-html add the HTML support (on)])
90dnl Specific dir for HTML output ?
91AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
92 [path to base html directory, default $datadir/doc/html]),
93 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
Daniel Veillard259ff742001-10-06 13:49:59 +000094
William M. Brack21e4ef22005-01-02 09:53:13 +000095AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
96 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
97 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
98 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
99AC_SUBST(HTML_DIR)
100AC_ARG_WITH(http,
101[ --with-http add the HTTP support (on)])
102AC_ARG_WITH(iconv,
103[ --with-iconv[[=DIR]] add ICONV support (on)])
104AC_ARG_WITH(iso8859x,
105[ --with-iso8859x add ISO8859X support if no iconv (on)])
106AC_ARG_WITH(legacy,
107[ --with-legacy add deprecated APIs for compatibility (on)])
108AC_ARG_WITH(mem_debug,
109[ --with-mem-debug add the memory debugging module (off)])
110AC_ARG_WITH(minimum,
111[ --with-minimum build a minimally sized library (off)])
112AC_ARG_WITH(output,
113[ --with-output add the serialization support (on)])
114AC_ARG_WITH(pattern,
115[ --with-pattern add the xmlPattern selection interface (on)])
116AC_ARG_WITH(push,
117[ --with-push add the PUSH parser interfaces (on)])
118AC_ARG_WITH(python,
119[ --with-python[[=DIR]] build Python bindings if found])
120AC_ARG_WITH(reader,
121[ --with-reader add the xmlReader parsing interface (on)])
122AC_ARG_WITH(readline,
123[ --with-readline=DIR use readline in DIR],[
124 if test "$withval" != "no" -a "$withval" != "yes"; then
125 RDL_DIR=$withval
126 CPPFLAGS="${CPPFLAGS} -I$withval/include"
127 LDFLAGS="${LDFLAGS} -L$withval/lib"
128 fi
129])
130AC_ARG_WITH(regexps,
131[ --with-regexps add Regular Expressions support (on)])
132AC_ARG_WITH(run_debug,
133[ --with-run-debug add the runtime debugging module (off)])
134AC_ARG_WITH(sax1,
135[ --with-sax1 add the older SAX1 interface (on)])
136AC_ARG_WITH(schemas,
Daniel Veillard39e5c892005-07-03 22:48:50 +0000137[ --with-schemas add Relax-NG and Schemas support (on)])
Daniel Veillarded6c5492005-07-23 15:00:22 +0000138AC_ARG_WITH(schematron,
139[ --with-schematron add Schematron support (on)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000140AC_ARG_WITH(threads,
141[ --with-threads add multithread support(on)])
142AC_ARG_WITH(thread-alloc,
143[ --with-thread-alloc add per-thread memory(off)])
144AC_ARG_WITH(tree,
145[ --with-tree add the DOM like tree manipulation APIs (on)])
146AC_ARG_WITH(valid,
147[ --with-valid add the DTD validation support (on)])
148AC_ARG_WITH(writer,
149[ --with-writer add the xmlWriter saving interface (on)])
150AC_ARG_WITH(xinclude,
151[ --with-xinclude add the XInclude support (on)])
152AC_ARG_WITH(xpath,
153[ --with-xpath add the XPATH support (on)])
154AC_ARG_WITH(xptr,
155[ --with-xptr add the XPointer support (on)])
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000156AC_ARG_WITH(modules,
157[ --with-modules add the dynamic modules support (on)])
Owen Taylor3473f882001-02-23 17:55:21 +0000158AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +0000159[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +0000160 if test "$withval" != "no" -a "$withval" != "yes"; then
161 Z_DIR=$withval
162 CPPFLAGS="${CPPFLAGS} -I$withval/include"
163 LDFLAGS="${LDFLAGS} -L$withval/lib"
164 fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000165])
Daniel Veillardbfa5cf12008-08-27 15:33:28 +0000166AC_ARG_WITH(coverage,
167[ --with-coverage build for code coverage with GCC (off)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000168
Daniel Veillardb40744e2008-10-17 13:26:44 +0000169AC_ARG_ENABLE(rebuild-docs,
170[ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=yes]]])
171AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"])
172
William M. Brack21e4ef22005-01-02 09:53:13 +0000173dnl
Daniel Veillard39e5c892005-07-03 22:48:50 +0000174dnl hard dependancies on options
175dnl
176if test "$with_schemas" = "yes"
177then
178 with_pattern=yes
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000179 with_regexps=yes
Daniel Veillard39e5c892005-07-03 22:48:50 +0000180fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000181if test "$with_schematron" = "yes"
182then
183 with_pattern=yes
184 with_xpath=yes
185fi
Daniel Veillard39e5c892005-07-03 22:48:50 +0000186if test "$with_reader" = "yes"
187then
188 with_push=yes
189fi
190if test "$with_xptr" = "yes"
191then
192 with_xpath=yes
193fi
194dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000195dnl option to build a minimal libxml2 library
196dnl
197if test "$with_minimum" = "yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000198then
William M. Brack21e4ef22005-01-02 09:53:13 +0000199 echo "Configuring for a minimal library"
200 if test "$with_c14n" = ""
201 then
202 with_c14n=no
203 fi
204 if test "$with_catalog" = ""
205 then
206 with_catalog=no
207 fi
208 echo So far so good!
209 if test "$with_debug" = ""
210 then
211 with_debug=no
212 fi
213 if test "$with_docbook" = ""
214 then
215 with_docbook=no
216 fi
217 if test "$with_fexceptions" = ""
218 then
219 with_fexceptions=no
220 fi
221 if test "$with_ftp" = ""
222 then
223 with_ftp=no
224 fi
225 if test "$with_history" = ""
226 then
227 with_history=no
228 fi
229 if test "$with_html" = ""
230 then
231 with_html=no
232 fi
233 if test "$with_http" = ""
234 then
235 with_http=no
236 fi
237 if test "$with_iconv" = ""
238 then
239 with_iconv=no
240 fi
241 if test "$with_iso8859x" = ""
242 then
243 with_iso8859x=no
244 fi
245 if test "$with_legacy" = ""
246 then
247 with_legacy=no
248 fi
249 if test "$with_mem_debug" = ""
250 then
251 with_mem_debug=no
252 fi
253 if test "$with_output" = ""
254 then
255 with_output=no
256 fi
257 if test "$with_pattern" = ""
258 then
259 with_pattern=no
260 fi
261 if test "$with_push" = ""
262 then
263 with_push=no
264 fi
265 if test "$with_python" = ""
266 then
267 with_python=no
268 fi
269 if test "$with_reader" = ""
270 then
271 with_reader=no
272 fi
273 if test "$with_readline" = ""
274 then
275 with_readline=no
276 fi
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000277 if test "$with_regexps" = ""
William M. Brack21e4ef22005-01-02 09:53:13 +0000278 then
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000279 with_regexps=no
William M. Brack21e4ef22005-01-02 09:53:13 +0000280 fi
281 if test "$with_run_debug" = ""
282 then
283 with_run_debug=no
284 fi
285 if test "$with_sax1" = ""
286 then
287 with_sax1=no
288 fi
289 if test "$with_schemas" = ""
290 then
291 with_schemas=no
292 fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000293 if test "$with_schematron" = ""
294 then
295 with_schematron=no
296 fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000297 if test "$with_threads" = ""
298 then
299 with_threads=no
300 fi
301 if test "$with_thread_alloc" = ""
302 then
303 with_thread_alloc=no
304 fi
305 if test "$with_tree" = ""
306 then
307 with_tree=no
308 fi
309 if test "$with_valid" = ""
310 then
311 with_valid=no
312 fi
313 if test "$with_writer" = ""
314 then
315 with_writer=no
316 fi
317 if test "$with_xinclude" = ""
318 then
319 with_xinclude=no
320 fi
321 if test "$with_xpath" = ""
322 then
323 with_xpath=no
324 fi
325 if test "$with_xptr" = ""
326 then
327 with_xptr=no
328 fi
329 if test "$with_zlib" = ""
330 then
331 with_zlib=no
332 fi
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000333 if test "$with_modules" = ""
334 then
335 with_modules=no
336 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000337fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000338
339echo Checking zlib
340
341dnl Checks for zlib library.
342
Daniel Veillard75acfee2006-07-13 06:29:56 +0000343WITH_ZLIB=0
Daniel Veillard259ff742001-10-06 13:49:59 +0000344if test "$with_zlib" = "no"; then
345 echo "Disabling compression support"
346else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000347 AC_CHECK_HEADERS(zlib.h,
348 AC_CHECK_LIB(z, gzread,[
Daniel Veillard75acfee2006-07-13 06:29:56 +0000349 AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
350 WITH_ZLIB=1
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000351 if test "x${Z_DIR}" != "x"; then
352 Z_CFLAGS="-I${Z_DIR}/include"
353 Z_LIBS="-L${Z_DIR}/lib -lz"
354 [case ${host} in
355 *-*-solaris*)
356 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
357 ;;
358 esac]
359 else
360 Z_LIBS="-lz"
361 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +0000362fi
Owen Taylor3473f882001-02-23 17:55:21 +0000363
Owen Taylor3473f882001-02-23 17:55:21 +0000364AC_SUBST(Z_CFLAGS)
365AC_SUBST(Z_LIBS)
Daniel Veillard75acfee2006-07-13 06:29:56 +0000366AC_SUBST(WITH_ZLIB)
Owen Taylor3473f882001-02-23 17:55:21 +0000367
368CPPFLAGS=${_cppflags}
369LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000370
William M. Brack21e4ef22005-01-02 09:53:13 +0000371echo Checking headers
372
Daniel Veillard01791d51998-07-24 19:24:09 +0000373dnl Checks for header files.
374AC_HEADER_DIRENT
375AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000376AC_CHECK_HEADERS([fcntl.h])
377AC_CHECK_HEADERS([unistd.h])
378AC_CHECK_HEADERS([ctype.h])
379AC_CHECK_HEADERS([dirent.h])
380AC_CHECK_HEADERS([errno.h])
381AC_CHECK_HEADERS([malloc.h])
382AC_CHECK_HEADERS([stdarg.h])
383AC_CHECK_HEADERS([sys/stat.h])
384AC_CHECK_HEADERS([sys/types.h])
Daniel Veillard7f4547c2008-10-03 07:58:23 +0000385AC_CHECK_HEADERS([stdint.h])
386AC_CHECK_HEADERS([inttypes.h.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000387AC_CHECK_HEADERS([time.h])
388AC_CHECK_HEADERS([ansidecl.h])
389AC_CHECK_HEADERS([ieeefp.h])
390AC_CHECK_HEADERS([nan.h])
391AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000392AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000393AC_CHECK_HEADERS([fp_class.h])
394AC_CHECK_HEADERS([float.h])
395AC_CHECK_HEADERS([stdlib.h])
396AC_CHECK_HEADERS([sys/socket.h], [], [],
397[#if HAVE_SYS_TYPES_H
398# include <sys/types.h>
399# endif
400])
401AC_CHECK_HEADERS([netinet/in.h], [], [],
402[#if HAVE_SYS_TYPES_H
403# include <sys/types.h>
404# endif
405])
406AC_CHECK_HEADERS([arpa/inet.h], [], [],
407[#if HAVE_SYS_TYPES_H
408# include <sys/types.h>
409# endif
410#if HAVE_ARPA_INET_H
411# include <arpa/inet.h>
412# endif
413])
414AC_CHECK_HEADERS([netdb.h])
415AC_CHECK_HEADERS([sys/time.h])
416AC_CHECK_HEADERS([sys/select.h])
417AC_CHECK_HEADERS([sys/mman.h])
418AC_CHECK_HEADERS([sys/timeb.h])
419AC_CHECK_HEADERS([signal.h])
420AC_CHECK_HEADERS([arpa/nameser.h], [], [],
421[#if HAVE_SYS_TYPES_H
422# include <sys/types.h>
423# endif
424])
425AC_CHECK_HEADERS([resolv.h], [], [],
426[#if HAVE_SYS_TYPES_H
427# include <sys/types.h>
428# endif
429#if HAVE_NETINET_IN_H
430# include <netinet/in.h>
431# endif
432#if HAVE_ARPA_NAMESER_H
433# include <arpa/nameser.h>
434# endif
435])
Daniel Veillarddcd93902005-01-13 11:25:15 +0000436AC_CHECK_HEADERS([dl.h])
437AC_CHECK_HEADERS([dlfcn.h])
Daniel Veillard01791d51998-07-24 19:24:09 +0000438
Daniel Veillardfc979062004-03-04 22:07:16 +0000439
William M. Brack21e4ef22005-01-02 09:53:13 +0000440echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000441
Daniel Veillard01791d51998-07-24 19:24:09 +0000442dnl Checks for library functions.
443AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000444AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000445AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000446AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000447AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000448
Daniel Veillard92ad2102001-03-27 12:47:33 +0000449dnl Checking the standard string functions availability
450AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
451 NEED_TRIO=1)
452
William M. Brackf4caa5e2005-10-20 09:04:05 +0000453dnl Checking for va_copy availability
454AC_MSG_CHECKING([for va_copy])
455AC_TRY_LINK([#include <stdarg.h>
456va_list ap1,ap2;], [va_copy(ap1,ap2);],
457have_va_copy=yes,
458have_va_copy=no)
459AC_MSG_RESULT($have_va_copy)
460if test x"$have_va_copy" = x"yes"; then
461 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
462else
463 AC_MSG_CHECKING([for __va_copy])
464 AC_TRY_LINK([#include <stdarg.h>
465 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
466 have___va_copy=yes,
467 have___va_copy=no)
468 AC_MSG_RESULT($have___va_copy)
469 if test x"$have___va_copy" = x"yes"; then
470 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
471 fi
472fi
473
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000474dnl Checks for inet libraries:
Daniel Veillardd4e39ae2005-10-28 15:59:14 +0000475AC_SEARCH_LIBS(gethostent, [nsl])
476AC_SEARCH_LIBS(setsockopt, [socket net])
477AC_SEARCH_LIBS(connect, [inet])
Daniel Veillardb05deb71999-08-10 19:04:08 +0000478
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000479dnl Determine what socket length (socklen_t) data type is
480AC_MSG_CHECKING([for type of socket length (socklen_t)])
481AC_TRY_COMPILE2([
482#include <stddef.h>
483#include <sys/types.h>
484#include <sys/socket.h>],[
485(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
486 AC_MSG_RESULT(socklen_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000487 XML_SOCKLEN_T=socklen_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000488 AC_TRY_COMPILE2([
489#include <stddef.h>
490#include <sys/types.h>
491#include <sys/socket.h>],[
492(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
493 AC_MSG_RESULT(size_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000494 XML_SOCKLEN_T=size_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000495 AC_TRY_COMPILE2([
496#include <stddef.h>
497#include <sys/types.h>
498#include <sys/socket.h>],[
499(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
500 AC_MSG_RESULT(int *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000501 XML_SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000502 AC_MSG_WARN(could not determine)
Daniel Veillardc284c642005-03-31 10:24:24 +0000503 XML_SOCKLEN_T="int"])])])
504AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000505
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000506dnl ***********************Checking for availability of IPv6*******************
507
508AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000509AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000510if test "$with_minimum" = "yes"
511then
512 enable_ipv6=no
513fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000514if test $enable_ipv6 = yes; then
515 have_ipv6=no
516 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000517 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000518 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000519 ], [
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000520 struct sockaddr_storage ss;
521 socket(AF_INET6, SOCK_STREAM, 0)
522 ],
523 have_ipv6=yes,
524 have_ipv6=no
525 )
526 AC_MSG_RESULT($have_ipv6)
527
William M. Brack476cd962003-08-13 11:09:42 +0000528 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000529 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000530 have_broken_ss_family=no
531
532 dnl *********************************************************************
533 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
534 dnl a ss_family member, but rather __ss_family. Let's detect that
William M. Brack7d8b36b2005-06-25 07:30:50 +0000535 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
536 dnl platforms. However, we should only do this if ss_family is not
537 dnl present.
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000538 dnl ********************************************************************
William M. Brack7d8b36b2005-06-25 07:30:50 +0000539 AC_MSG_CHECKING([struct sockaddr::ss_family])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000540 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000541 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000542 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000543 ], [
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000544 struct sockaddr_storage ss ;
William M. Brack7d8b36b2005-06-25 07:30:50 +0000545 ss.ss_family = 0 ;
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000546 ],
William M. Brack7d8b36b2005-06-25 07:30:50 +0000547 have_ss_family=yes,
548 have_ss_family=no
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000549 )
William M. Brack7d8b36b2005-06-25 07:30:50 +0000550 AC_MSG_RESULT($have_ss_family)
551 if test x$have_ss_family = xno ; then
552 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
553 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000554 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000555 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000556 ], [
William M. Brack7d8b36b2005-06-25 07:30:50 +0000557 struct sockaddr_storage ss ;
558 ss.__ss_family = 0 ;
559 ],
560 have_broken_ss_family=yes,
561 have_broken_ss_family=no
562 )
563 AC_MSG_RESULT($have_broken_ss_family)
564 if test x$have_broken_ss_family = xyes ; then
565 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
566 [Whether struct sockaddr::__ss_family exists])
567 AC_DEFINE(ss_family, __ss_family,
568 [ss_family is not defined here, use __ss_family instead])
569 else
570 AC_MSG_WARN(ss_family and __ss_family not found)
571 fi
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000572 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000573
574 have_getaddrinfo=no
575 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
576 if test $have_getaddrinfo != yes; then
577 for lib in bsd socket inet; do
578 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
579 done
580 fi
581
William M. Brack476cd962003-08-13 11:09:42 +0000582 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000583 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000584 fi
585 fi
586fi
587
588dnl ******************************End IPv6 checks******************************
589
Daniel Veillardb05deb71999-08-10 19:04:08 +0000590dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000591AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000592 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000593
Daniel Veillardc790bf42003-10-11 10:50:10 +0000594AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
595 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000596
597XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000598XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000599
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000600dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000601dnl Extra flags
602dnl
603XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000604RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000605
606dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000607dnl Workaround for native compilers
608dnl HP : http://bugs.gnome.org/db/31/3163.html
609dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000610dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000611if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000612 case "${host}" in
Daniel Veillard6a0baa02005-12-10 11:11:12 +0000613 hppa*-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000614 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000615 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000616 *-dec-osf* )
617 CFLAGS="${CFLAGS} -ieee"
618 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000619 alpha*-*-linux* )
620 CFLAGS="${CFLAGS} -ieee"
621 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000622 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000623else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000624 if test "$with_fexceptions" = "yes"
625 then
626 #
627 # Not activated by default because this inflates the code size
628 # Used to allow propagation of C++ exceptions through the library
629 #
630 CFLAGS="${CFLAGS} -fexceptions"
631 fi
632
Daniel Veillard05f97352004-10-31 15:35:32 +0000633 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 +0000634 case "${host}" in
635 alpha*-*-linux* )
636 CFLAGS="${CFLAGS} -mieee"
637 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000638 alpha*-*-osf* )
639 CFLAGS="${CFLAGS} -mieee"
640 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000641 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000642fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000643case ${host} in
644 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000645 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
646 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000647 hppa*-hp-mpeix)
648 NEED_TRIO=1
649 ;;
Daniel Veillard4188ddf2006-01-19 08:58:42 +0000650 *-*-mingw* | *-*-cygwin* | *-*-msvc* )
651 # If the host is Windows, and shared libraries are disabled, we
652 # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
653 # work properly (without it, xmlexports.h would force the use of
654 # DLL imports, which obviously aren't present in a static
655 # library).
656 if test "x$enable_shared" = "xno"; then
657 XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
658 CFLAGS="$CFLAGS -DLIBXML_STATIC"
659 fi
660 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000661esac
662
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000663
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000664dnl
665dnl check for python
666dnl
667
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000668PYTHON_VERSION=
669PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000670PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000671PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000672pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000673if test "$with_python" != "no" ; then
674 if test -x "$with_python/bin/python"
675 then
676 echo Found python in $with_python/bin/python
677 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000678 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000679 if test -x "$with_python"
680 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000681 echo Found python in $with_python
682 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000683 else
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000684 if test -x "$PYTHON"
685 then
686 echo Found python in environment PYTHON=$PYTHON
Daniel Veillard8492ba12006-04-25 12:52:12 +0000687 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000688 else
Daniel Veillardc2f70562005-09-01 12:45:26 +0000689 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 +0000690 fi
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000691 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000692 fi
693 if test "$PYTHON" != ""
694 then
695 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
696 echo Found Python version $PYTHON_VERSION
697 fi
698 if test "$PYTHON_VERSION" != ""
699 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000700 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
701 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000702 then
703 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000704 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000705 else
706 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
707 then
Daniel Veillard8492ba12006-04-25 12:52:12 +0000708 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000709 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000710 else
711 if test -r /usr/include/python$PYTHON_VERSION/Python.h
712 then
713 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000714 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000715 else
716 echo could not find python$PYTHON_VERSION/Python.h
717 fi
718 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000719 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000720 then
721 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
722 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000723 fi
724 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000725 if test "$with_python" != ""
726 then
Daniel Veillardd7d07482006-05-03 13:15:44 +0000727 pythondir='$(PYTHON_SITE_PACKAGES)'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000728 else
Daniel Veillardb2f8f1d2006-04-28 16:30:48 +0000729 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000730 fi
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000731else
732 PYTHON=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000733fi
734AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000735if test "$PYTHON_INCLUDES" != ""
736then
737 PYTHON_SUBDIR=python
738else
739 PYTHON_SUBDIR=
740fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000741AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000742AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000743
Daniel Veillardce1648b2005-01-04 15:10:22 +0000744dnl check for dso support
745WITH_MODULES=0
Daniel Veillardce1648b2005-01-04 15:10:22 +0000746TEST_MODULES=
747
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000748if test "$with_modules" != "no" ; then
Daniel Veillard9202b672005-07-14 09:31:14 +0000749 case "$host" in
750 *-*-cygwin*)
751 MODULE_EXTENSION=".dll"
752 AC_CHECK_LIB(cygwin, dlopen, [
753 WITH_MODULES=1
754 MODULE_PLATFORM_LIBS=
755 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
756 ])
757 ;;
758 *)
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000759 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
760 AC_CHECK_LIB(dld, shl_load, [
761 MODULE_PLATFORM_LIBS="-ldld"
762 libxml_have_shl_load=yes], [
763 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
764 AC_CHECK_LIB(dl, dlopen, [
765 MODULE_PLATFORM_LIBS="-ldl"
766 libxml_have_dlopen=yes])])])])
767
768 if test "${libxml_have_shl_load}" = "yes"; then
769 MODULE_EXTENSION=".sl"
Daniel Veillard9202b672005-07-14 09:31:14 +0000770 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000771 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000772 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000773
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000774 if test "${libxml_have_dlopen}" = "yes"; then
775 case "${host}" in
776 *-*-hpux* )
777 MODULE_EXTENSION=".sl"
778 ;;
779 * )
780 MODULE_EXTENSION=".so"
781 ;;
782 esac
783
Daniel Veillard9202b672005-07-14 09:31:14 +0000784 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000785 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000786 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000787 ;;
788 esac
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000789fi
Daniel Veillardce1648b2005-01-04 15:10:22 +0000790
791if test "${WITH_MODULES}" = "1"; then
792 TEST_MODULES="ModuleTests"
793fi
794
795AC_SUBST(WITH_MODULES)
796AC_SUBST(MODULE_PLATFORM_LIBS)
797AC_SUBST(MODULE_EXTENSION)
798AC_SUBST(TEST_MODULES)
799
Daniel Veillard437b87b2000-01-03 17:30:46 +0000800dnl
801dnl Tester makes use of readline if present
802dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000803
Daniel Veillard361d8452000-04-03 19:48:13 +0000804dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000805dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000806dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000807dnl
William M. Brack871611b2003-10-18 04:53:14 +0000808if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000809 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Brack7f28a012007-01-11 23:42:10 +0000810 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000811 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000812 if test "$with_minimum" != "yes"
813 then
814 if test "${with_mem_debug}" = "" ; then
Daniel Veillard379a3b72005-08-12 10:18:14 +0000815 echo Activating memory debugging
Daniel Veillard4432df22003-09-28 18:58:27 +0000816 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000817 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000818 fi
819 if test "${with_docbook}" = "" ; then
820 with_docbook="yes"
821 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000822 fi
Daniel Veillard3854c572005-08-25 10:17:45 +0000823 if test "${GCC}" = "yes" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000824 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 +0000825 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000826 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000827dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000828else
829 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000830fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000831AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000832
833dnl
834dnl Check for trio string functions
835dnl
836
837if test "${NEED_TRIO}" = "1" ; then
838 echo Adding trio library for string functions
839 WITH_TRIO=1
840else
841 WITH_TRIO=0
842fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000843AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000844AC_SUBST(WITH_TRIO)
845
Daniel Veillardf6eea272001-01-18 12:17:12 +0000846dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000847dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000848dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000849echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000850
William M. Brack21e4ef22005-01-02 09:53:13 +0000851dnl
852dnl Thread-related stuff
853dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000854THREAD_LIBS=""
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000855BASE_THREAD_LIBS=""
Daniel Veillardb8478642001-10-12 17:29:10 +0000856WITH_THREADS=0
857THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000858TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000859THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000860
Daniel Veillard84942712003-04-18 14:40:05 +0000861if test "$with_threads" = "no" ; then
862 echo Disabling multithreaded support
863else
Daniel Veillardb8478642001-10-12 17:29:10 +0000864 echo Enabling multithreaded support
865
866 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000867 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000868 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000869 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
870 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000871 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000872 case $host_os in
873 *mingw32*) WITH_THREADS="1"
874 THREADS_W32="Win32"
875 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
876 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000877 *cygwin*) THREAD_LIBS=""
878 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000879 *beos*) WITH_THREADS="1"
880 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
881 ;;
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000882 *linux*)
Daniel Veillard32a461f2005-08-25 21:48:54 +0000883 if test "${GCC}" = "yes" ; then
884 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
885 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
886 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
887 if test "${THREAD_LIBS}" = "-lpthread" ; then
888 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
889 then
890 THREAD_LIBS=""
891 BASE_THREAD_LIBS="-lpthread"
892 else
893 if expr ${GCC_MAJOR} \> 3 > /dev/null
894 then
895 THREAD_LIBS=""
896 BASE_THREAD_LIBS="-lpthread"
897 else
898 echo old GCC disabling weak symbols for pthread
899 fi
900 fi
901 fi
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000902 fi
903 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000904 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000905 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000906 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
907 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000908 fi
909fi
William M. Brack306e33c2004-06-12 01:01:22 +0000910if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000911 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000912fi
913
Daniel Veillardb8478642001-10-12 17:29:10 +0000914AC_SUBST(THREAD_LIBS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000915AC_SUBST(BASE_THREAD_LIBS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000916AC_SUBST(WITH_THREADS)
917AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000918AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000919AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000920
William M. Brack21e4ef22005-01-02 09:53:13 +0000921dnl
922dnl xmllint shell history
923dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000924if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000925 echo Enabling xmllint shell history
926 dnl check for terminal library. this is a very cool solution
927 dnl from octave's configure.in
928 unset tcap
929 for termlib in ncurses curses termcap terminfo termlib; do
930 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
931 test -n "$tcap" && break
932 done
933
934 AC_CHECK_HEADER(readline/history.h,
935 AC_CHECK_LIB(history, append_history,[
936 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000937 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000938 AC_CHECK_HEADER(readline/readline.h,
939 AC_CHECK_LIB(readline, readline,[
940 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000941 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000942 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
943 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
944 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000945 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000946fi
947
William M. Brack21e4ef22005-01-02 09:53:13 +0000948dnl
949dnl Tree functions
950dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000951if test "$with_tree" = "no" ; then
952 echo Disabling DOM like tree manipulation APIs
953 WITH_TREE=0
954else
955 WITH_TREE=1
956fi
957AC_SUBST(WITH_TREE)
958
Daniel Veillard361d8452000-04-03 19:48:13 +0000959if test "$with_ftp" = "no" ; then
960 echo Disabling FTP support
961 WITH_FTP=0
962 FTP_OBJ=
963else
964 WITH_FTP=1
965 FTP_OBJ=nanoftp.o
966fi
967AC_SUBST(WITH_FTP)
968AC_SUBST(FTP_OBJ)
969
Daniel Veillard361d8452000-04-03 19:48:13 +0000970if test "$with_http" = "no" ; then
971 echo Disabling HTTP support
972 WITH_HTTP=0
973 HTTP_OBJ=
974else
975 WITH_HTTP=1
976 HTTP_OBJ=nanohttp.o
977fi
978AC_SUBST(WITH_HTTP)
979AC_SUBST(HTTP_OBJ)
980
Daniel Veillard4432df22003-09-28 18:58:27 +0000981if test "$with_legacy" = "no" ; then
982 echo Disabling deprecated APIs
983 WITH_LEGACY=0
984else
985 WITH_LEGACY=1
986fi
987AC_SUBST(WITH_LEGACY)
988
Daniel Veillard81273902003-09-30 00:43:48 +0000989if test "$with_reader" = "no" ; then
990 echo Disabling the xmlReader parsing interface
991 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000992 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000993else
994 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000995 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +0000996 if test "$with_push" = "no" ; then
997 echo xmlReader requires Push interface - enabling it
998 with_push=yes
999 fi
Daniel Veillard81273902003-09-30 00:43:48 +00001000fi
1001AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +00001002AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +00001003
William M. Brack21e4ef22005-01-02 09:53:13 +00001004if test "$with_writer" = "no" ; then
1005 echo Disabling the xmlWriter saving interface
1006 WITH_WRITER=0
1007# WRITER_TEST=
1008else
1009 WITH_WRITER=1
1010# WRITER_TEST=Writertests
1011 if test "$with_push" = "no" ; then
1012 echo xmlWriter requires Push interface - enabling it
1013 with_push=yes
1014 fi
1015 if test "$with_output" = "no" ; then
1016 echo xmlWriter requires Output interface - enabling it
1017 with_output=yes
1018 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001019fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001020AC_SUBST(WITH_WRITER)
1021#AC_SUBST(WRITER_TEST)
1022
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001023if test "$with_pattern" = "no" ; then
1024 echo Disabling the xmlPattern parsing interface
1025 WITH_PATTERN=0
Daniel Veillardf9d16912005-01-30 22:36:30 +00001026 TEST_PATTERN=
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001027else
1028 WITH_PATTERN=1
Daniel Veillardf9d16912005-01-30 22:36:30 +00001029 TEST_PATTERN=Patterntests
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001030fi
1031AC_SUBST(WITH_PATTERN)
Daniel Veillardf9d16912005-01-30 22:36:30 +00001032AC_SUBST(TEST_PATTERN)
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001033
Daniel Veillard81273902003-09-30 00:43:48 +00001034if test "$with_sax1" = "no" ; then
1035 echo Disabling the older SAX1 interface
1036 WITH_SAX1=0
1037 TEST_SAX=
1038else
1039 WITH_SAX1=1
1040 TEST_SAX=SAXtests
1041fi
1042AC_SUBST(WITH_SAX1)
1043AC_SUBST(TEST_SAX)
1044
Daniel Veillard73b013f2003-09-30 12:36:01 +00001045if test "$with_push" = "no" ; then
1046 echo Disabling the PUSH parser interfaces
1047 WITH_PUSH=0
1048 TEST_PUSH=
1049else
1050 WITH_PUSH=1
1051 TEST_PUSH="XMLPushtests"
1052fi
1053AC_SUBST(WITH_PUSH)
1054AC_SUBST(TEST_PUSH)
1055
Daniel Veillard73b013f2003-09-30 12:36:01 +00001056if test "$with_html" = "no" ; then
1057 echo Disabling HTML support
1058 WITH_HTML=0
1059 HTML_OBJ=
1060 TEST_HTML=
1061else
1062 WITH_HTML=1
1063 HTML_OBJ="HTMLparser.o HTMLtree.o"
1064 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +00001065 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +00001066 TEST_PHTML=HTMLPushtests
1067 else
1068 TEST_PHTML=
1069 fi
1070fi
1071AC_SUBST(WITH_HTML)
1072AC_SUBST(HTML_OBJ)
1073AC_SUBST(TEST_HTML)
1074AC_SUBST(TEST_PHTML)
1075
Daniel Veillard73b013f2003-09-30 12:36:01 +00001076if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +00001077 echo Disabling DTD validation support
1078 WITH_VALID=0
1079 TEST_VALID=
1080 TEST_VTIME=
1081else
1082 WITH_VALID=1
1083 TEST_VALID=Validtests
1084 TEST_VTIME=VTimingtests
1085fi
1086AC_SUBST(WITH_VALID)
1087AC_SUBST(TEST_VALID)
1088AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +00001089
Daniel Veillarda7374592001-05-10 14:17:55 +00001090if test "$with_catalog" = "no" ; then
1091 echo Disabling Catalog support
1092 WITH_CATALOG=0
1093 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001094 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +00001095else
1096 WITH_CATALOG=1
1097 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +00001098 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +00001099fi
1100AC_SUBST(WITH_CATALOG)
1101AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001102AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +00001103
Daniel Veillardb59076b2001-04-29 17:04:07 +00001104if test "$with_docbook" = "no" ; then
1105 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +00001106 WITH_DOCB=0
1107 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +00001108else
1109 WITH_DOCB=1
1110 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +00001111fi
1112AC_SUBST(WITH_DOCB)
1113AC_SUBST(DOCB_OBJ)
1114
1115
William M. Brack21e4ef22005-01-02 09:53:13 +00001116if test "$with_xptr" = "no" ; then
1117 echo Disabling XPointer support
1118 WITH_XPTR=0
1119 XPTR_OBJ=
1120 TEST_XPTR=
1121else
1122 WITH_XPTR=1
1123 XPTR_OBJ=xpointer.o
1124 TEST_XPTR=XPtrtests
1125 if test "$with_xpath" = "no" ; then
1126 echo XPointer requires XPath support - enabling it
1127 with_xpath=yes
1128 fi
Daniel Veillard4432df22003-09-28 18:58:27 +00001129fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001130AC_SUBST(WITH_XPTR)
1131AC_SUBST(XPTR_OBJ)
1132AC_SUBST(TEST_XPTR)
1133
1134if test "$with_c14n" = "no" ; then
1135 echo Disabling C14N support
1136 WITH_C14N=0
1137 C14N_OBJ=
1138 TEST_C14N=
1139else
1140 WITH_C14N=1
1141 C14N_OBJ="c14n.c"
1142 TEST_C14N=C14Ntests
1143 if test "$with_xpath" = "no" ; then
1144 echo C14N requires XPath support - enabling it
1145 with_xpath=yes
1146 fi
1147fi
1148AC_SUBST(WITH_C14N)
1149AC_SUBST(C14N_OBJ)
1150AC_SUBST(TEST_C14N)
1151
1152if test "$with_xinclude" = "no" ; then
1153 echo Disabling XInclude support
1154 WITH_XINCLUDE=0
1155 XINCLUDE_OBJ=
1156 with_xinclude="no"
1157 TEST_XINCLUDE=
1158else
1159 WITH_XINCLUDE=1
1160 XINCLUDE_OBJ=xinclude.o
1161 TEST_XINCLUDE=XIncludetests
1162 if test "$with_xpath" = "no" ; then
1163 echo XInclude requires XPath support - enabling it
1164 with_xpath=yes
1165 fi
1166fi
1167AC_SUBST(WITH_XINCLUDE)
1168AC_SUBST(XINCLUDE_OBJ)
1169AC_SUBST(TEST_XINCLUDE)
1170
Daniel Veillard361d8452000-04-03 19:48:13 +00001171if test "$with_xpath" = "no" ; then
1172 echo Disabling XPATH support
1173 WITH_XPATH=0
1174 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001175 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001176else
1177 WITH_XPATH=1
1178 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001179 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001180fi
1181AC_SUBST(WITH_XPATH)
1182AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001183AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001184
William M. Brack21e4ef22005-01-02 09:53:13 +00001185dnl
1186dnl output functions
1187dnl
1188if test "$with_output" = "no" ; then
1189 echo Disabling serialization/saving support
1190 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001191else
William M. Brack21e4ef22005-01-02 09:53:13 +00001192 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001193fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001194AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001195
Daniel Veillard6e90d192001-07-03 16:37:49 +00001196WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001197if test "$with_iconv" = "no" ; then
1198 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001199else
Daniel Veillard220346d2001-12-07 11:33:54 +00001200 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001201 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001202 # Export this since our headers include iconv.h
1203 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001204 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001205 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001206
1207 AC_CHECK_HEADER(iconv.h,
1208 AC_MSG_CHECKING(for iconv)
1209 AC_TRY_LINK([#include <stdlib.h>
1210#include <iconv.h>],[
1211iconv_t cd = iconv_open ("","");
1212iconv (cd, NULL, NULL, NULL, NULL);],[
1213 AC_MSG_RESULT(yes)
1214 WITH_ICONV=1],[
1215 AC_MSG_RESULT(no)
1216 AC_MSG_CHECKING(for iconv in -liconv)
1217
1218 _ldflags="${LDFLAGS}"
1219 _libs="${LIBS}"
1220 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1221 LIBS="${LIBS} -liconv"
1222
1223 AC_TRY_LINK([#include <stdlib.h>
1224#include <iconv.h>],[
1225iconv_t cd = iconv_open ("","");
1226iconv (cd, NULL, NULL, NULL, NULL);],[
1227 AC_MSG_RESULT(yes)
1228 WITH_ICONV=1
1229 ICONV_LIBS="${ICONV_LIBS} -liconv"
1230 LIBS="${_libs}"
1231 LDFLAGS="${_ldflags}"],[
1232 AC_MSG_RESULT(no)
1233 LIBS="${_libs}"
1234 LDFLAGS="${_ldflags}"])]))
Daniel Veillard8e1a46d2008-02-15 07:47:26 +00001235
1236 if test "$WITH_ICONV" = "1" ; then
1237 AC_MSG_CHECKING([for iconv declaration])
1238 AC_CACHE_VAL(xml_cv_iconv_arg2, [
1239 AC_TRY_COMPILE([#include <stdlib.h>
1240#include <iconv.h>
1241extern
1242#ifdef __cplusplus
1243"C"
1244#endif
1245#if defined(__STDC__) || defined(__cplusplus)
1246size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1247#else
1248size_t iconv();
1249#endif
1250], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
1251
1252 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);"
1253 AC_MSG_RESULT([${xml_xxx:-
1254 }$xml_cv_iconv_decl])
1255 AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
1256 [Define as const if the declaration of iconv() needs const.])
1257 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001258fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001259case "$host" in
1260 *mingw*) M_LIBS=""
1261 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001262 *beos*) M_LIBS=""
1263 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001264 *) M_LIBS="-lm"
1265 ;;
1266esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001267XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001268XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001269AC_SUBST(WITH_ICONV)
1270
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001271WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001272if test "$WITH_ICONV" != "1" ; then
1273if test "$with_iso8859x" = "no" ; then
1274 echo Disabling ISO8859X support
1275 WITH_ISO8859X=0
1276fi
1277fi
1278AC_SUBST(WITH_ISO8859X)
1279
Daniel Veillarded6c5492005-07-23 15:00:22 +00001280if test "$with_schematron" = "no" ; then
1281 echo "Disabling Schematron support"
1282 WITH_SCHEMATRON=0
1283 TEST_SCHEMATRON=
1284else
1285 echo "Enabled Schematron support"
1286 WITH_SCHEMATRON=1
1287 TEST_SCHEMATRON="Schematrontests"
1288 with_xpath=yes
1289 with_pattern=yes
1290fi
1291AC_SUBST(WITH_SCHEMATRON)
1292AC_SUBST(TEST_SCHEMATRON)
1293
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001294if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001295 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001296 WITH_SCHEMAS=0
1297 TEST_SCHEMAS=
1298else
Daniel Veillard71531f32003-02-05 13:19:53 +00001299 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001300 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001301 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001302 if test "$PYTHON_INCLUDES" != "" ; then
1303 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1304 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001305 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001306fi
1307AC_SUBST(WITH_SCHEMAS)
1308AC_SUBST(TEST_SCHEMAS)
1309
Daniel Veillard23e73572002-09-19 19:56:43 +00001310if test "$with_regexps" = "no" ; then
1311 echo Disabling Regexps support
1312 WITH_REGEXPS=0
1313 TEST_REGEXPS=
1314else
1315 WITH_REGEXPS=1
1316 TEST_REGEXPS="Regexptests Automatatests"
1317fi
1318AC_SUBST(WITH_REGEXPS)
1319AC_SUBST(TEST_REGEXPS)
1320
Daniel Veillard361d8452000-04-03 19:48:13 +00001321if test "$with_debug" = "no" ; then
1322 echo Disabling DEBUG support
1323 WITH_DEBUG=0
1324 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001325 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001326else
1327 WITH_DEBUG=1
1328 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001329 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001330fi
1331AC_SUBST(WITH_DEBUG)
1332AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001333AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001334
Daniel Veillard361d8452000-04-03 19:48:13 +00001335if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001336 if test "$with_thread_alloc" = "yes" ; then
1337 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1338 WITH_MEM_DEBUG=0
1339 else
1340 echo Enabling memory debug support
1341 WITH_MEM_DEBUG=1
1342 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001343else
1344 WITH_MEM_DEBUG=0
1345fi
1346AC_SUBST(WITH_MEM_DEBUG)
1347
Daniel Veillard22cdb842004-10-04 14:09:17 +00001348if test "$with_run_debug" = "yes" ; then
1349 echo Enabling runtime debug support
1350 WITH_RUN_DEBUG=1
1351else
1352 WITH_RUN_DEBUG=0
1353fi
1354AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001355
1356WIN32_EXTRA_LIBADD=
1357WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001358CYGWIN_EXTRA_LDFLAGS=
1359CYGWIN_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001360case "$host" in
1361 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001362 CPPFLAGS="$CPPFLAGS -DWIN32"
1363 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001364 WIN32_EXTRA_LDFLAGS="-no-undefined"
1365 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1366 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1367 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1368 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001369 *-*-cygwin*)
1370 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001371 if test "${PYTHON}" != ""
1372 then
1373 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1374 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001375 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001376esac
1377AC_SUBST(WIN32_EXTRA_LIBADD)
1378AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001379AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1380AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001381
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001382if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
1383then
1384 echo Enabling code coverage for GCC
1385 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
1386 LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
1387else
1388 echo Disabling code coverage for GCC
1389fi
1390
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001391AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001392AC_SUBST(CFLAGS)
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001393AC_SUBST(LDFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001394AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001395
Daniel Veillardb05deb71999-08-10 19:04:08 +00001396AC_SUBST(XML_LIBDIR)
1397AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001398AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001399AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001400AC_SUBST(XML_INCLUDEDIR)
1401AC_SUBST(HTML_DIR)
1402AC_SUBST(HAVE_ISNAN)
1403AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001404AC_SUBST(PYTHON)
1405AC_SUBST(PYTHON_VERSION)
1406AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001407AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001408
Daniel Veillardb05deb71999-08-10 19:04:08 +00001409AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001410AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001411
Daniel Veillard9715c172002-11-25 16:33:40 +00001412dnl for the spec file
1413RELDATE=`date +'%a %b %e %Y'`
1414AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001415AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001416
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001417rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001418ln -s Copyright COPYING
1419
Daniel Veillarde4177a52004-01-08 16:43:57 +00001420# keep on one line for cygwin c.f. #130896
Daniel Veillard99b78502005-09-11 22:04:08 +00001421AC_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 +00001422
Daniel Veillard06d25242004-02-25 13:01:42 +00001423chmod +x xml2-config python/setup.py
Daniel Veillard67952602006-01-05 15:29:44 +00001424echo Done configuring