blob: 6c0e1398b3f8679e7366316de95604bcbb313d6d [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 Veillard97ff9b32009-01-18 21:43:30 +00008LIBXML_MICRO_VERSION=3
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
veillard97c7be62009-05-12 08:43:54 +020029else if test -d .git ; then
30 extra=`git describe | sed 's+LIBXML[[0-9.]]*-++'`
31 echo extra=$extra
32 if test "$extra" != ""
33 then
34 LIBXML_VERSION_EXTRA="-GIT$extra"
35 fi
36fi
Daniel Veillard9cb1b642007-01-03 15:07:44 +000037fi
William M. Brackf4025492004-08-18 21:08:46 +000038fi
Daniel Veillard14fff061999-06-22 21:49:07 +000039AC_SUBST(LIBXML_MAJOR_VERSION)
40AC_SUBST(LIBXML_MINOR_VERSION)
41AC_SUBST(LIBXML_MICRO_VERSION)
42AC_SUBST(LIBXML_VERSION)
43AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000044AC_SUBST(LIBXML_VERSION_NUMBER)
William M. Brackf4025492004-08-18 21:08:46 +000045AC_SUBST(LIBXML_VERSION_EXTRA)
Daniel Veillard14fff061999-06-22 21:49:07 +000046
Daniel Veillard361d8452000-04-03 19:48:13 +000047VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000048
Daniel Veillardedfb29b2000-03-14 19:59:05 +000049AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000050
Daniel Veillard01791d51998-07-24 19:24:09 +000051dnl Checks for programs.
52AC_PROG_CC
53AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000054AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000055AC_PATH_PROG(RM, rm, /bin/rm)
56AC_PATH_PROG(MV, mv, /bin/mv)
57AC_PATH_PROG(TAR, tar, /bin/tar)
William M. Brack1826d0a2004-07-21 09:03:57 +000058AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard33a2de92006-10-11 08:33:22 +000059AC_PATH_PROG(WGET, wget, /usr/bin/wget)
Daniel Veillard8b817da2004-09-30 09:19:33 +000060AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
Daniel Veillard06500c82004-09-07 09:12:44 +000061AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
Daniel Veillard01791d51998-07-24 19:24:09 +000062
Daniel Veillard03109292000-08-14 14:58:22 +000063dnl Make sure we have an ANSI compiler
64AM_C_PROTOTYPES
65test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
66
Daniel Veillard6984e6d2003-12-09 14:20:17 +000067AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000068AM_PROG_LIBTOOL
69
Daniel Veillard4432df22003-09-28 18:58:27 +000070dnl
William M. Brack21e4ef22005-01-02 09:53:13 +000071dnl We process the AC_ARG_WITH first so that later we can modify
72dnl some of them to try to prevent impossible combinations. This
73dnl also allows up so alphabetize the choices
Daniel Veillard4432df22003-09-28 18:58:27 +000074dnl
Daniel Veillard4432df22003-09-28 18:58:27 +000075
William M. Brack21e4ef22005-01-02 09:53:13 +000076dnl
77dnl zlib option might change flags, so we save them initially
78dnl
Owen Taylor3473f882001-02-23 17:55:21 +000079_cppflags="${CPPFLAGS}"
80_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000081
William M. Brack21e4ef22005-01-02 09:53:13 +000082AC_ARG_WITH(c14n,
83[ --with-c14n add the Canonicalization support (on)])
84AC_ARG_WITH(catalog,
85[ --with-catalog add the Catalog support (on)])
86AC_ARG_WITH(debug,
87[ --with-debug add the debugging module (on)])
88AC_ARG_WITH(docbook,
89[ --with-docbook add Docbook SGML support (on)])
90AC_ARG_WITH(fexceptions,
91[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
92AC_ARG_WITH(ftp,
93[ --with-ftp add the FTP support (on)])
94AC_ARG_WITH(history,
95[ --with-history add history support to xmllint shell(off)])
96AC_ARG_WITH(html,
97[ --with-html add the HTML support (on)])
98dnl Specific dir for HTML output ?
99AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
100 [path to base html directory, default $datadir/doc/html]),
101 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
Daniel Veillard259ff742001-10-06 13:49:59 +0000102
William M. Brack21e4ef22005-01-02 09:53:13 +0000103AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
104 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
105 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
106 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
107AC_SUBST(HTML_DIR)
108AC_ARG_WITH(http,
109[ --with-http add the HTTP support (on)])
110AC_ARG_WITH(iconv,
111[ --with-iconv[[=DIR]] add ICONV support (on)])
112AC_ARG_WITH(iso8859x,
113[ --with-iso8859x add ISO8859X support if no iconv (on)])
114AC_ARG_WITH(legacy,
115[ --with-legacy add deprecated APIs for compatibility (on)])
116AC_ARG_WITH(mem_debug,
117[ --with-mem-debug add the memory debugging module (off)])
118AC_ARG_WITH(minimum,
119[ --with-minimum build a minimally sized library (off)])
120AC_ARG_WITH(output,
121[ --with-output add the serialization support (on)])
122AC_ARG_WITH(pattern,
123[ --with-pattern add the xmlPattern selection interface (on)])
124AC_ARG_WITH(push,
125[ --with-push add the PUSH parser interfaces (on)])
126AC_ARG_WITH(python,
127[ --with-python[[=DIR]] build Python bindings if found])
128AC_ARG_WITH(reader,
129[ --with-reader add the xmlReader parsing interface (on)])
130AC_ARG_WITH(readline,
131[ --with-readline=DIR use readline in DIR],[
132 if test "$withval" != "no" -a "$withval" != "yes"; then
133 RDL_DIR=$withval
134 CPPFLAGS="${CPPFLAGS} -I$withval/include"
135 LDFLAGS="${LDFLAGS} -L$withval/lib"
136 fi
137])
138AC_ARG_WITH(regexps,
139[ --with-regexps add Regular Expressions support (on)])
140AC_ARG_WITH(run_debug,
141[ --with-run-debug add the runtime debugging module (off)])
142AC_ARG_WITH(sax1,
143[ --with-sax1 add the older SAX1 interface (on)])
144AC_ARG_WITH(schemas,
Daniel Veillard39e5c892005-07-03 22:48:50 +0000145[ --with-schemas add Relax-NG and Schemas support (on)])
Daniel Veillarded6c5492005-07-23 15:00:22 +0000146AC_ARG_WITH(schematron,
147[ --with-schematron add Schematron support (on)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000148AC_ARG_WITH(threads,
149[ --with-threads add multithread support(on)])
150AC_ARG_WITH(thread-alloc,
151[ --with-thread-alloc add per-thread memory(off)])
152AC_ARG_WITH(tree,
153[ --with-tree add the DOM like tree manipulation APIs (on)])
154AC_ARG_WITH(valid,
155[ --with-valid add the DTD validation support (on)])
156AC_ARG_WITH(writer,
157[ --with-writer add the xmlWriter saving interface (on)])
158AC_ARG_WITH(xinclude,
159[ --with-xinclude add the XInclude support (on)])
160AC_ARG_WITH(xpath,
161[ --with-xpath add the XPATH support (on)])
162AC_ARG_WITH(xptr,
163[ --with-xptr add the XPointer support (on)])
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000164AC_ARG_WITH(modules,
165[ --with-modules add the dynamic modules support (on)])
Owen Taylor3473f882001-02-23 17:55:21 +0000166AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +0000167[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +0000168 if test "$withval" != "no" -a "$withval" != "yes"; then
169 Z_DIR=$withval
170 CPPFLAGS="${CPPFLAGS} -I$withval/include"
171 LDFLAGS="${LDFLAGS} -L$withval/lib"
172 fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000173])
Daniel Veillardbfa5cf12008-08-27 15:33:28 +0000174AC_ARG_WITH(coverage,
175[ --with-coverage build for code coverage with GCC (off)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000176
Daniel Veillardb40744e2008-10-17 13:26:44 +0000177AC_ARG_ENABLE(rebuild-docs,
178[ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=yes]]])
179AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"])
180
William M. Brack21e4ef22005-01-02 09:53:13 +0000181dnl
Daniel Veillard39e5c892005-07-03 22:48:50 +0000182dnl hard dependancies on options
183dnl
184if test "$with_schemas" = "yes"
185then
186 with_pattern=yes
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000187 with_regexps=yes
Daniel Veillard39e5c892005-07-03 22:48:50 +0000188fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000189if test "$with_schematron" = "yes"
190then
191 with_pattern=yes
192 with_xpath=yes
193fi
Daniel Veillard39e5c892005-07-03 22:48:50 +0000194if test "$with_reader" = "yes"
195then
196 with_push=yes
197fi
198if test "$with_xptr" = "yes"
199then
200 with_xpath=yes
201fi
202dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000203dnl option to build a minimal libxml2 library
204dnl
205if test "$with_minimum" = "yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000206then
William M. Brack21e4ef22005-01-02 09:53:13 +0000207 echo "Configuring for a minimal library"
208 if test "$with_c14n" = ""
209 then
210 with_c14n=no
211 fi
212 if test "$with_catalog" = ""
213 then
214 with_catalog=no
215 fi
216 echo So far so good!
217 if test "$with_debug" = ""
218 then
219 with_debug=no
220 fi
221 if test "$with_docbook" = ""
222 then
223 with_docbook=no
224 fi
225 if test "$with_fexceptions" = ""
226 then
227 with_fexceptions=no
228 fi
229 if test "$with_ftp" = ""
230 then
231 with_ftp=no
232 fi
233 if test "$with_history" = ""
234 then
235 with_history=no
236 fi
237 if test "$with_html" = ""
238 then
239 with_html=no
240 fi
241 if test "$with_http" = ""
242 then
243 with_http=no
244 fi
245 if test "$with_iconv" = ""
246 then
247 with_iconv=no
248 fi
249 if test "$with_iso8859x" = ""
250 then
251 with_iso8859x=no
252 fi
253 if test "$with_legacy" = ""
254 then
255 with_legacy=no
256 fi
257 if test "$with_mem_debug" = ""
258 then
259 with_mem_debug=no
260 fi
261 if test "$with_output" = ""
262 then
263 with_output=no
264 fi
265 if test "$with_pattern" = ""
266 then
267 with_pattern=no
268 fi
269 if test "$with_push" = ""
270 then
271 with_push=no
272 fi
273 if test "$with_python" = ""
274 then
275 with_python=no
276 fi
277 if test "$with_reader" = ""
278 then
279 with_reader=no
280 fi
281 if test "$with_readline" = ""
282 then
283 with_readline=no
284 fi
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000285 if test "$with_regexps" = ""
William M. Brack21e4ef22005-01-02 09:53:13 +0000286 then
Daniel Veillardc51f51c2007-05-02 16:25:45 +0000287 with_regexps=no
William M. Brack21e4ef22005-01-02 09:53:13 +0000288 fi
289 if test "$with_run_debug" = ""
290 then
291 with_run_debug=no
292 fi
293 if test "$with_sax1" = ""
294 then
295 with_sax1=no
296 fi
297 if test "$with_schemas" = ""
298 then
299 with_schemas=no
300 fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000301 if test "$with_schematron" = ""
302 then
303 with_schematron=no
304 fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000305 if test "$with_threads" = ""
306 then
307 with_threads=no
308 fi
309 if test "$with_thread_alloc" = ""
310 then
311 with_thread_alloc=no
312 fi
313 if test "$with_tree" = ""
314 then
315 with_tree=no
316 fi
317 if test "$with_valid" = ""
318 then
319 with_valid=no
320 fi
321 if test "$with_writer" = ""
322 then
323 with_writer=no
324 fi
325 if test "$with_xinclude" = ""
326 then
327 with_xinclude=no
328 fi
329 if test "$with_xpath" = ""
330 then
331 with_xpath=no
332 fi
333 if test "$with_xptr" = ""
334 then
335 with_xptr=no
336 fi
337 if test "$with_zlib" = ""
338 then
339 with_zlib=no
340 fi
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000341 if test "$with_modules" = ""
342 then
343 with_modules=no
344 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000345fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000346
347echo Checking zlib
348
349dnl Checks for zlib library.
350
Daniel Veillard75acfee2006-07-13 06:29:56 +0000351WITH_ZLIB=0
Daniel Veillard259ff742001-10-06 13:49:59 +0000352if test "$with_zlib" = "no"; then
353 echo "Disabling compression support"
354else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000355 AC_CHECK_HEADERS(zlib.h,
356 AC_CHECK_LIB(z, gzread,[
Daniel Veillard75acfee2006-07-13 06:29:56 +0000357 AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
358 WITH_ZLIB=1
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000359 if test "x${Z_DIR}" != "x"; then
360 Z_CFLAGS="-I${Z_DIR}/include"
361 Z_LIBS="-L${Z_DIR}/lib -lz"
362 [case ${host} in
363 *-*-solaris*)
364 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
365 ;;
366 esac]
367 else
368 Z_LIBS="-lz"
369 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +0000370fi
Owen Taylor3473f882001-02-23 17:55:21 +0000371
Owen Taylor3473f882001-02-23 17:55:21 +0000372AC_SUBST(Z_CFLAGS)
373AC_SUBST(Z_LIBS)
Daniel Veillard75acfee2006-07-13 06:29:56 +0000374AC_SUBST(WITH_ZLIB)
Owen Taylor3473f882001-02-23 17:55:21 +0000375
376CPPFLAGS=${_cppflags}
377LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000378
William M. Brack21e4ef22005-01-02 09:53:13 +0000379echo Checking headers
380
Daniel Veillard01791d51998-07-24 19:24:09 +0000381dnl Checks for header files.
382AC_HEADER_DIRENT
383AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000384AC_CHECK_HEADERS([fcntl.h])
385AC_CHECK_HEADERS([unistd.h])
386AC_CHECK_HEADERS([ctype.h])
387AC_CHECK_HEADERS([dirent.h])
388AC_CHECK_HEADERS([errno.h])
389AC_CHECK_HEADERS([malloc.h])
390AC_CHECK_HEADERS([stdarg.h])
391AC_CHECK_HEADERS([sys/stat.h])
392AC_CHECK_HEADERS([sys/types.h])
Daniel Veillard7f4547c2008-10-03 07:58:23 +0000393AC_CHECK_HEADERS([stdint.h])
394AC_CHECK_HEADERS([inttypes.h.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000395AC_CHECK_HEADERS([time.h])
396AC_CHECK_HEADERS([ansidecl.h])
397AC_CHECK_HEADERS([ieeefp.h])
398AC_CHECK_HEADERS([nan.h])
399AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000400AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000401AC_CHECK_HEADERS([fp_class.h])
402AC_CHECK_HEADERS([float.h])
403AC_CHECK_HEADERS([stdlib.h])
404AC_CHECK_HEADERS([sys/socket.h], [], [],
405[#if HAVE_SYS_TYPES_H
406# include <sys/types.h>
407# endif
408])
409AC_CHECK_HEADERS([netinet/in.h], [], [],
410[#if HAVE_SYS_TYPES_H
411# include <sys/types.h>
412# endif
413])
414AC_CHECK_HEADERS([arpa/inet.h], [], [],
415[#if HAVE_SYS_TYPES_H
416# include <sys/types.h>
417# endif
418#if HAVE_ARPA_INET_H
419# include <arpa/inet.h>
420# endif
421])
422AC_CHECK_HEADERS([netdb.h])
423AC_CHECK_HEADERS([sys/time.h])
424AC_CHECK_HEADERS([sys/select.h])
425AC_CHECK_HEADERS([sys/mman.h])
426AC_CHECK_HEADERS([sys/timeb.h])
427AC_CHECK_HEADERS([signal.h])
428AC_CHECK_HEADERS([arpa/nameser.h], [], [],
429[#if HAVE_SYS_TYPES_H
430# include <sys/types.h>
431# endif
432])
433AC_CHECK_HEADERS([resolv.h], [], [],
434[#if HAVE_SYS_TYPES_H
435# include <sys/types.h>
436# endif
437#if HAVE_NETINET_IN_H
438# include <netinet/in.h>
439# endif
440#if HAVE_ARPA_NAMESER_H
441# include <arpa/nameser.h>
442# endif
443])
Daniel Veillarddcd93902005-01-13 11:25:15 +0000444AC_CHECK_HEADERS([dl.h])
445AC_CHECK_HEADERS([dlfcn.h])
Daniel Veillard01791d51998-07-24 19:24:09 +0000446
Daniel Veillardfc979062004-03-04 22:07:16 +0000447
William M. Brack21e4ef22005-01-02 09:53:13 +0000448echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000449
Daniel Veillard01791d51998-07-24 19:24:09 +0000450dnl Checks for library functions.
451AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000452AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000453AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000454AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000455AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000456
Daniel Veillard92ad2102001-03-27 12:47:33 +0000457dnl Checking the standard string functions availability
458AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
459 NEED_TRIO=1)
460
William M. Brackf4caa5e2005-10-20 09:04:05 +0000461dnl Checking for va_copy availability
462AC_MSG_CHECKING([for va_copy])
463AC_TRY_LINK([#include <stdarg.h>
464va_list ap1,ap2;], [va_copy(ap1,ap2);],
465have_va_copy=yes,
466have_va_copy=no)
467AC_MSG_RESULT($have_va_copy)
468if test x"$have_va_copy" = x"yes"; then
469 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
470else
471 AC_MSG_CHECKING([for __va_copy])
472 AC_TRY_LINK([#include <stdarg.h>
473 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
474 have___va_copy=yes,
475 have___va_copy=no)
476 AC_MSG_RESULT($have___va_copy)
477 if test x"$have___va_copy" = x"yes"; then
478 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
479 fi
480fi
481
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000482dnl Checks for inet libraries:
Daniel Veillardd4e39ae2005-10-28 15:59:14 +0000483AC_SEARCH_LIBS(gethostent, [nsl])
484AC_SEARCH_LIBS(setsockopt, [socket net])
485AC_SEARCH_LIBS(connect, [inet])
Daniel Veillardb05deb71999-08-10 19:04:08 +0000486
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000487dnl Determine what socket length (socklen_t) data type is
488AC_MSG_CHECKING([for type of socket length (socklen_t)])
489AC_TRY_COMPILE2([
490#include <stddef.h>
491#include <sys/types.h>
492#include <sys/socket.h>],[
493(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
494 AC_MSG_RESULT(socklen_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000495 XML_SOCKLEN_T=socklen_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000496 AC_TRY_COMPILE2([
497#include <stddef.h>
498#include <sys/types.h>
499#include <sys/socket.h>],[
500(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
501 AC_MSG_RESULT(size_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000502 XML_SOCKLEN_T=size_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000503 AC_TRY_COMPILE2([
504#include <stddef.h>
505#include <sys/types.h>
506#include <sys/socket.h>],[
507(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
508 AC_MSG_RESULT(int *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000509 XML_SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000510 AC_MSG_WARN(could not determine)
Daniel Veillardc284c642005-03-31 10:24:24 +0000511 XML_SOCKLEN_T="int"])])])
512AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000513
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000514dnl ***********************Checking for availability of IPv6*******************
515
516AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000517AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000518if test "$with_minimum" = "yes"
519then
520 enable_ipv6=no
521fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000522if test $enable_ipv6 = yes; then
523 have_ipv6=no
524 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000525 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000526 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000527 ], [
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000528 struct sockaddr_storage ss;
529 socket(AF_INET6, SOCK_STREAM, 0)
530 ],
531 have_ipv6=yes,
532 have_ipv6=no
533 )
534 AC_MSG_RESULT($have_ipv6)
535
William M. Brack476cd962003-08-13 11:09:42 +0000536 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000537 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000538 have_broken_ss_family=no
539
540 dnl *********************************************************************
541 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
542 dnl a ss_family member, but rather __ss_family. Let's detect that
William M. Brack7d8b36b2005-06-25 07:30:50 +0000543 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
544 dnl platforms. However, we should only do this if ss_family is not
545 dnl present.
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000546 dnl ********************************************************************
William M. Brack7d8b36b2005-06-25 07:30:50 +0000547 AC_MSG_CHECKING([struct sockaddr::ss_family])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000548 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000549 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000550 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000551 ], [
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000552 struct sockaddr_storage ss ;
William M. Brack7d8b36b2005-06-25 07:30:50 +0000553 ss.ss_family = 0 ;
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000554 ],
William M. Brack7d8b36b2005-06-25 07:30:50 +0000555 have_ss_family=yes,
556 have_ss_family=no
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000557 )
William M. Brack7d8b36b2005-06-25 07:30:50 +0000558 AC_MSG_RESULT($have_ss_family)
559 if test x$have_ss_family = xno ; then
560 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
561 AC_TRY_COMPILE([
William M. Brack0c1e3012007-03-14 12:40:21 +0000562 #include <sys/types.h>
William M. Brack06559b32007-03-14 09:34:15 +0000563 #include <sys/socket.h>
William M. Brack0c1e3012007-03-14 12:40:21 +0000564 ], [
William M. Brack7d8b36b2005-06-25 07:30:50 +0000565 struct sockaddr_storage ss ;
566 ss.__ss_family = 0 ;
567 ],
568 have_broken_ss_family=yes,
569 have_broken_ss_family=no
570 )
571 AC_MSG_RESULT($have_broken_ss_family)
572 if test x$have_broken_ss_family = xyes ; then
573 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
574 [Whether struct sockaddr::__ss_family exists])
575 AC_DEFINE(ss_family, __ss_family,
576 [ss_family is not defined here, use __ss_family instead])
577 else
578 AC_MSG_WARN(ss_family and __ss_family not found)
579 fi
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000580 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000581
582 have_getaddrinfo=no
583 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
584 if test $have_getaddrinfo != yes; then
585 for lib in bsd socket inet; do
586 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
587 done
588 fi
589
William M. Brack476cd962003-08-13 11:09:42 +0000590 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000591 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000592 fi
593 fi
594fi
595
596dnl ******************************End IPv6 checks******************************
597
Daniel Veillardb05deb71999-08-10 19:04:08 +0000598dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000599AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000600 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000601
Daniel Veillardc790bf42003-10-11 10:50:10 +0000602AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
603 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000604
605XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000606XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000607
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000608dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000609dnl Extra flags
610dnl
611XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000612RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000613
614dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000615dnl Workaround for native compilers
616dnl HP : http://bugs.gnome.org/db/31/3163.html
617dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000618dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000619if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000620 case "${host}" in
Daniel Veillard6a0baa02005-12-10 11:11:12 +0000621 hppa*-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000622 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000623 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000624 *-dec-osf* )
625 CFLAGS="${CFLAGS} -ieee"
626 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000627 alpha*-*-linux* )
628 CFLAGS="${CFLAGS} -ieee"
629 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000630 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000631else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000632 if test "$with_fexceptions" = "yes"
633 then
634 #
635 # Not activated by default because this inflates the code size
636 # Used to allow propagation of C++ exceptions through the library
637 #
638 CFLAGS="${CFLAGS} -fexceptions"
639 fi
640
Daniel Veillard05f97352004-10-31 15:35:32 +0000641 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 +0000642 case "${host}" in
643 alpha*-*-linux* )
644 CFLAGS="${CFLAGS} -mieee"
645 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000646 alpha*-*-osf* )
647 CFLAGS="${CFLAGS} -mieee"
648 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000649 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000650fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000651case ${host} in
652 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000653 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
654 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000655 hppa*-hp-mpeix)
656 NEED_TRIO=1
657 ;;
Daniel Veillard4188ddf2006-01-19 08:58:42 +0000658 *-*-mingw* | *-*-cygwin* | *-*-msvc* )
659 # If the host is Windows, and shared libraries are disabled, we
660 # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
661 # work properly (without it, xmlexports.h would force the use of
662 # DLL imports, which obviously aren't present in a static
663 # library).
664 if test "x$enable_shared" = "xno"; then
665 XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
666 CFLAGS="$CFLAGS -DLIBXML_STATIC"
667 fi
668 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000669esac
670
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000671
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000672dnl
673dnl check for python
674dnl
675
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000676PYTHON_VERSION=
677PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000678PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000679PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000680pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000681if test "$with_python" != "no" ; then
682 if test -x "$with_python/bin/python"
683 then
684 echo Found python in $with_python/bin/python
685 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000686 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000687 if test -x "$with_python"
688 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000689 echo Found python in $with_python
690 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000691 else
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000692 if test -x "$PYTHON"
693 then
694 echo Found python in environment PYTHON=$PYTHON
Daniel Veillard8492ba12006-04-25 12:52:12 +0000695 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000696 else
Daniel Veillardc2f70562005-09-01 12:45:26 +0000697 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 +0000698 fi
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000699 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000700 fi
701 if test "$PYTHON" != ""
702 then
703 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
704 echo Found Python version $PYTHON_VERSION
705 fi
706 if test "$PYTHON_VERSION" != ""
707 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000708 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
709 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000710 then
711 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000712 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000713 else
714 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
715 then
Daniel Veillard8492ba12006-04-25 12:52:12 +0000716 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000717 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000718 else
719 if test -r /usr/include/python$PYTHON_VERSION/Python.h
720 then
721 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillardd7d07482006-05-03 13:15:44 +0000722 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000723 else
724 echo could not find python$PYTHON_VERSION/Python.h
725 fi
726 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000727 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000728 then
729 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
730 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000731 fi
732 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000733 if test "$with_python" != ""
734 then
Daniel Veillardd7d07482006-05-03 13:15:44 +0000735 pythondir='$(PYTHON_SITE_PACKAGES)'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000736 else
Daniel Veillardb2f8f1d2006-04-28 16:30:48 +0000737 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillard38b80a82003-05-14 18:59:00 +0000738 fi
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000739else
740 PYTHON=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000741fi
742AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000743if test "$PYTHON_INCLUDES" != ""
744then
745 PYTHON_SUBDIR=python
746else
747 PYTHON_SUBDIR=
748fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000749AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000750AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000751
Daniel Veillardce1648b2005-01-04 15:10:22 +0000752dnl check for dso support
753WITH_MODULES=0
Daniel Veillardce1648b2005-01-04 15:10:22 +0000754TEST_MODULES=
755
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000756if test "$with_modules" != "no" ; then
Daniel Veillard9202b672005-07-14 09:31:14 +0000757 case "$host" in
758 *-*-cygwin*)
759 MODULE_EXTENSION=".dll"
760 AC_CHECK_LIB(cygwin, dlopen, [
761 WITH_MODULES=1
762 MODULE_PLATFORM_LIBS=
763 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
764 ])
765 ;;
766 *)
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000767 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
768 AC_CHECK_LIB(dld, shl_load, [
769 MODULE_PLATFORM_LIBS="-ldld"
770 libxml_have_shl_load=yes], [
771 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
772 AC_CHECK_LIB(dl, dlopen, [
773 MODULE_PLATFORM_LIBS="-ldl"
774 libxml_have_dlopen=yes])])])])
775
776 if test "${libxml_have_shl_load}" = "yes"; then
777 MODULE_EXTENSION=".sl"
Daniel Veillard9202b672005-07-14 09:31:14 +0000778 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000779 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000780 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000781
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000782 if test "${libxml_have_dlopen}" = "yes"; then
783 case "${host}" in
784 *-*-hpux* )
785 MODULE_EXTENSION=".sl"
786 ;;
787 * )
788 MODULE_EXTENSION=".so"
789 ;;
790 esac
791
Daniel Veillard9202b672005-07-14 09:31:14 +0000792 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000793 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000794 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000795 ;;
796 esac
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000797fi
Daniel Veillardce1648b2005-01-04 15:10:22 +0000798
799if test "${WITH_MODULES}" = "1"; then
800 TEST_MODULES="ModuleTests"
801fi
802
803AC_SUBST(WITH_MODULES)
804AC_SUBST(MODULE_PLATFORM_LIBS)
805AC_SUBST(MODULE_EXTENSION)
806AC_SUBST(TEST_MODULES)
807
Daniel Veillard437b87b2000-01-03 17:30:46 +0000808dnl
809dnl Tester makes use of readline if present
810dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000811
Daniel Veillard361d8452000-04-03 19:48:13 +0000812dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000813dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000814dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000815dnl
William M. Brack871611b2003-10-18 04:53:14 +0000816if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000817 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Brack7f28a012007-01-11 23:42:10 +0000818 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000819 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000820 if test "$with_minimum" != "yes"
821 then
822 if test "${with_mem_debug}" = "" ; then
Daniel Veillard379a3b72005-08-12 10:18:14 +0000823 echo Activating memory debugging
Daniel Veillard4432df22003-09-28 18:58:27 +0000824 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000825 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000826 fi
827 if test "${with_docbook}" = "" ; then
828 with_docbook="yes"
829 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000830 fi
Daniel Veillard3854c572005-08-25 10:17:45 +0000831 if test "${GCC}" = "yes" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000832 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 +0000833 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000834 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000835dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000836else
837 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000838fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000839AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000840
841dnl
842dnl Check for trio string functions
843dnl
844
845if test "${NEED_TRIO}" = "1" ; then
846 echo Adding trio library for string functions
847 WITH_TRIO=1
848else
849 WITH_TRIO=0
850fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000851AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000852AC_SUBST(WITH_TRIO)
853
Daniel Veillardf6eea272001-01-18 12:17:12 +0000854dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000855dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000856dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000857echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000858
William M. Brack21e4ef22005-01-02 09:53:13 +0000859dnl
860dnl Thread-related stuff
861dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000862THREAD_LIBS=""
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000863BASE_THREAD_LIBS=""
Daniel Veillardb8478642001-10-12 17:29:10 +0000864WITH_THREADS=0
865THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000866TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000867THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000868
Daniel Veillard84942712003-04-18 14:40:05 +0000869if test "$with_threads" = "no" ; then
870 echo Disabling multithreaded support
871else
Daniel Veillardb8478642001-10-12 17:29:10 +0000872 echo Enabling multithreaded support
LRN203fd2e2009-08-07 21:47:25 +0200873 dnl Use pthread by default
874 if test "$with_threads" = "pthread" | test "$with_threads" = "" ; then
875 AC_CHECK_HEADER(pthread.h,
876 AC_CHECK_LIB(pthread, pthread_join,[
877 THREAD_LIBS="-lpthread"
878 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
879 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
880 WITH_THREADS="1"]))
881 fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000882 case $host_os in
LRN203fd2e2009-08-07 21:47:25 +0200883 *mingw32*) if test "$THREAD_LIBS" != "-lpthread"; then
884 WITH_THREADS="1"
885 THREADS_W32="Win32"
886 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
887 fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000888 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000889 *cygwin*) THREAD_LIBS=""
890 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000891 *beos*) WITH_THREADS="1"
892 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
893 ;;
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000894 *linux*)
Daniel Veillard32a461f2005-08-25 21:48:54 +0000895 if test "${GCC}" = "yes" ; then
896 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
897 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
898 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
899 if test "${THREAD_LIBS}" = "-lpthread" ; then
900 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
901 then
902 THREAD_LIBS=""
903 BASE_THREAD_LIBS="-lpthread"
904 else
LRN203fd2e2009-08-07 21:47:25 +0200905 if expr ${GCC_MAJOR} \> 3 > /dev/null
Daniel Veillard32a461f2005-08-25 21:48:54 +0000906 then
907 THREAD_LIBS=""
908 BASE_THREAD_LIBS="-lpthread"
909 else
910 echo old GCC disabling weak symbols for pthread
911 fi
912 fi
913 fi
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000914 fi
915 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000916 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000917 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000918 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
919 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000920 fi
921fi
William M. Brack306e33c2004-06-12 01:01:22 +0000922if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000923 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000924fi
925
Daniel Veillardb8478642001-10-12 17:29:10 +0000926AC_SUBST(THREAD_LIBS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000927AC_SUBST(BASE_THREAD_LIBS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000928AC_SUBST(WITH_THREADS)
929AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000930AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000931AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000932
William M. Brack21e4ef22005-01-02 09:53:13 +0000933dnl
934dnl xmllint shell history
935dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000936if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000937 echo Enabling xmllint shell history
938 dnl check for terminal library. this is a very cool solution
939 dnl from octave's configure.in
940 unset tcap
941 for termlib in ncurses curses termcap terminfo termlib; do
942 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
943 test -n "$tcap" && break
944 done
945
946 AC_CHECK_HEADER(readline/history.h,
947 AC_CHECK_LIB(history, append_history,[
948 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000949 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000950 AC_CHECK_HEADER(readline/readline.h,
951 AC_CHECK_LIB(readline, readline,[
952 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000953 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000954 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
955 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
956 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000957 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000958fi
959
William M. Brack21e4ef22005-01-02 09:53:13 +0000960dnl
961dnl Tree functions
962dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000963if test "$with_tree" = "no" ; then
964 echo Disabling DOM like tree manipulation APIs
965 WITH_TREE=0
966else
967 WITH_TREE=1
968fi
969AC_SUBST(WITH_TREE)
970
Daniel Veillard361d8452000-04-03 19:48:13 +0000971if test "$with_ftp" = "no" ; then
972 echo Disabling FTP support
973 WITH_FTP=0
974 FTP_OBJ=
975else
976 WITH_FTP=1
977 FTP_OBJ=nanoftp.o
978fi
979AC_SUBST(WITH_FTP)
980AC_SUBST(FTP_OBJ)
981
Daniel Veillard361d8452000-04-03 19:48:13 +0000982if test "$with_http" = "no" ; then
983 echo Disabling HTTP support
984 WITH_HTTP=0
985 HTTP_OBJ=
986else
987 WITH_HTTP=1
988 HTTP_OBJ=nanohttp.o
989fi
990AC_SUBST(WITH_HTTP)
991AC_SUBST(HTTP_OBJ)
992
Daniel Veillard4432df22003-09-28 18:58:27 +0000993if test "$with_legacy" = "no" ; then
994 echo Disabling deprecated APIs
995 WITH_LEGACY=0
996else
997 WITH_LEGACY=1
998fi
999AC_SUBST(WITH_LEGACY)
1000
Daniel Veillard81273902003-09-30 00:43:48 +00001001if test "$with_reader" = "no" ; then
1002 echo Disabling the xmlReader parsing interface
1003 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +00001004 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +00001005else
1006 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +00001007 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +00001008 if test "$with_push" = "no" ; then
1009 echo xmlReader requires Push interface - enabling it
1010 with_push=yes
1011 fi
Daniel Veillard81273902003-09-30 00:43:48 +00001012fi
1013AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +00001014AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +00001015
William M. Brack21e4ef22005-01-02 09:53:13 +00001016if test "$with_writer" = "no" ; then
1017 echo Disabling the xmlWriter saving interface
1018 WITH_WRITER=0
1019# WRITER_TEST=
1020else
1021 WITH_WRITER=1
1022# WRITER_TEST=Writertests
1023 if test "$with_push" = "no" ; then
1024 echo xmlWriter requires Push interface - enabling it
1025 with_push=yes
1026 fi
1027 if test "$with_output" = "no" ; then
1028 echo xmlWriter requires Output interface - enabling it
1029 with_output=yes
1030 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001031fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001032AC_SUBST(WITH_WRITER)
1033#AC_SUBST(WRITER_TEST)
1034
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001035if test "$with_pattern" = "no" ; then
1036 echo Disabling the xmlPattern parsing interface
1037 WITH_PATTERN=0
Daniel Veillardf9d16912005-01-30 22:36:30 +00001038 TEST_PATTERN=
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001039else
1040 WITH_PATTERN=1
Daniel Veillardf9d16912005-01-30 22:36:30 +00001041 TEST_PATTERN=Patterntests
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001042fi
1043AC_SUBST(WITH_PATTERN)
Daniel Veillardf9d16912005-01-30 22:36:30 +00001044AC_SUBST(TEST_PATTERN)
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001045
Daniel Veillard81273902003-09-30 00:43:48 +00001046if test "$with_sax1" = "no" ; then
1047 echo Disabling the older SAX1 interface
1048 WITH_SAX1=0
1049 TEST_SAX=
1050else
1051 WITH_SAX1=1
1052 TEST_SAX=SAXtests
1053fi
1054AC_SUBST(WITH_SAX1)
1055AC_SUBST(TEST_SAX)
1056
Daniel Veillard73b013f2003-09-30 12:36:01 +00001057if test "$with_push" = "no" ; then
1058 echo Disabling the PUSH parser interfaces
1059 WITH_PUSH=0
1060 TEST_PUSH=
1061else
1062 WITH_PUSH=1
1063 TEST_PUSH="XMLPushtests"
1064fi
1065AC_SUBST(WITH_PUSH)
1066AC_SUBST(TEST_PUSH)
1067
Daniel Veillard73b013f2003-09-30 12:36:01 +00001068if test "$with_html" = "no" ; then
1069 echo Disabling HTML support
1070 WITH_HTML=0
1071 HTML_OBJ=
1072 TEST_HTML=
1073else
1074 WITH_HTML=1
1075 HTML_OBJ="HTMLparser.o HTMLtree.o"
1076 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +00001077 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +00001078 TEST_PHTML=HTMLPushtests
1079 else
1080 TEST_PHTML=
1081 fi
1082fi
1083AC_SUBST(WITH_HTML)
1084AC_SUBST(HTML_OBJ)
1085AC_SUBST(TEST_HTML)
1086AC_SUBST(TEST_PHTML)
1087
Daniel Veillard73b013f2003-09-30 12:36:01 +00001088if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +00001089 echo Disabling DTD validation support
1090 WITH_VALID=0
1091 TEST_VALID=
1092 TEST_VTIME=
1093else
1094 WITH_VALID=1
1095 TEST_VALID=Validtests
1096 TEST_VTIME=VTimingtests
1097fi
1098AC_SUBST(WITH_VALID)
1099AC_SUBST(TEST_VALID)
1100AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +00001101
Daniel Veillarda7374592001-05-10 14:17:55 +00001102if test "$with_catalog" = "no" ; then
1103 echo Disabling Catalog support
1104 WITH_CATALOG=0
1105 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001106 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +00001107else
1108 WITH_CATALOG=1
1109 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +00001110 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +00001111fi
1112AC_SUBST(WITH_CATALOG)
1113AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001114AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +00001115
Daniel Veillardb59076b2001-04-29 17:04:07 +00001116if test "$with_docbook" = "no" ; then
1117 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +00001118 WITH_DOCB=0
1119 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +00001120else
1121 WITH_DOCB=1
1122 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +00001123fi
1124AC_SUBST(WITH_DOCB)
1125AC_SUBST(DOCB_OBJ)
1126
1127
William M. Brack21e4ef22005-01-02 09:53:13 +00001128if test "$with_xptr" = "no" ; then
1129 echo Disabling XPointer support
1130 WITH_XPTR=0
1131 XPTR_OBJ=
1132 TEST_XPTR=
1133else
1134 WITH_XPTR=1
1135 XPTR_OBJ=xpointer.o
1136 TEST_XPTR=XPtrtests
1137 if test "$with_xpath" = "no" ; then
1138 echo XPointer requires XPath support - enabling it
1139 with_xpath=yes
1140 fi
Daniel Veillard4432df22003-09-28 18:58:27 +00001141fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001142AC_SUBST(WITH_XPTR)
1143AC_SUBST(XPTR_OBJ)
1144AC_SUBST(TEST_XPTR)
1145
1146if test "$with_c14n" = "no" ; then
1147 echo Disabling C14N support
1148 WITH_C14N=0
1149 C14N_OBJ=
1150 TEST_C14N=
1151else
1152 WITH_C14N=1
1153 C14N_OBJ="c14n.c"
1154 TEST_C14N=C14Ntests
1155 if test "$with_xpath" = "no" ; then
1156 echo C14N requires XPath support - enabling it
1157 with_xpath=yes
1158 fi
1159fi
1160AC_SUBST(WITH_C14N)
1161AC_SUBST(C14N_OBJ)
1162AC_SUBST(TEST_C14N)
1163
1164if test "$with_xinclude" = "no" ; then
1165 echo Disabling XInclude support
1166 WITH_XINCLUDE=0
1167 XINCLUDE_OBJ=
1168 with_xinclude="no"
1169 TEST_XINCLUDE=
1170else
1171 WITH_XINCLUDE=1
1172 XINCLUDE_OBJ=xinclude.o
1173 TEST_XINCLUDE=XIncludetests
1174 if test "$with_xpath" = "no" ; then
1175 echo XInclude requires XPath support - enabling it
1176 with_xpath=yes
1177 fi
1178fi
1179AC_SUBST(WITH_XINCLUDE)
1180AC_SUBST(XINCLUDE_OBJ)
1181AC_SUBST(TEST_XINCLUDE)
1182
Daniel Veillard361d8452000-04-03 19:48:13 +00001183if test "$with_xpath" = "no" ; then
1184 echo Disabling XPATH support
1185 WITH_XPATH=0
1186 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001187 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001188else
1189 WITH_XPATH=1
1190 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001191 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001192fi
1193AC_SUBST(WITH_XPATH)
1194AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001195AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001196
William M. Brack21e4ef22005-01-02 09:53:13 +00001197dnl
1198dnl output functions
1199dnl
1200if test "$with_output" = "no" ; then
1201 echo Disabling serialization/saving support
1202 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001203else
William M. Brack21e4ef22005-01-02 09:53:13 +00001204 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001205fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001206AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001207
Daniel Veillard6e90d192001-07-03 16:37:49 +00001208WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001209if test "$with_iconv" = "no" ; then
1210 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001211else
Daniel Veillard220346d2001-12-07 11:33:54 +00001212 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001213 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001214 # Export this since our headers include iconv.h
1215 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001216 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001217 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001218
1219 AC_CHECK_HEADER(iconv.h,
1220 AC_MSG_CHECKING(for iconv)
1221 AC_TRY_LINK([#include <stdlib.h>
1222#include <iconv.h>],[
1223iconv_t cd = iconv_open ("","");
1224iconv (cd, NULL, NULL, NULL, NULL);],[
1225 AC_MSG_RESULT(yes)
1226 WITH_ICONV=1],[
1227 AC_MSG_RESULT(no)
1228 AC_MSG_CHECKING(for iconv in -liconv)
1229
1230 _ldflags="${LDFLAGS}"
1231 _libs="${LIBS}"
1232 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1233 LIBS="${LIBS} -liconv"
1234
1235 AC_TRY_LINK([#include <stdlib.h>
1236#include <iconv.h>],[
1237iconv_t cd = iconv_open ("","");
1238iconv (cd, NULL, NULL, NULL, NULL);],[
1239 AC_MSG_RESULT(yes)
1240 WITH_ICONV=1
1241 ICONV_LIBS="${ICONV_LIBS} -liconv"
1242 LIBS="${_libs}"
1243 LDFLAGS="${_ldflags}"],[
1244 AC_MSG_RESULT(no)
1245 LIBS="${_libs}"
1246 LDFLAGS="${_ldflags}"])]))
Daniel Veillard8e1a46d2008-02-15 07:47:26 +00001247
1248 if test "$WITH_ICONV" = "1" ; then
1249 AC_MSG_CHECKING([for iconv declaration])
1250 AC_CACHE_VAL(xml_cv_iconv_arg2, [
1251 AC_TRY_COMPILE([#include <stdlib.h>
1252#include <iconv.h>
1253extern
1254#ifdef __cplusplus
1255"C"
1256#endif
1257#if defined(__STDC__) || defined(__cplusplus)
1258size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1259#else
1260size_t iconv();
1261#endif
1262], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
1263
1264 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);"
1265 AC_MSG_RESULT([${xml_xxx:-
1266 }$xml_cv_iconv_decl])
1267 AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
1268 [Define as const if the declaration of iconv() needs const.])
1269 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001270fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001271case "$host" in
1272 *mingw*) M_LIBS=""
1273 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001274 *beos*) M_LIBS=""
1275 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001276 *) M_LIBS="-lm"
1277 ;;
1278esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001279XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001280XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001281AC_SUBST(WITH_ICONV)
1282
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001283WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001284if test "$WITH_ICONV" != "1" ; then
1285if test "$with_iso8859x" = "no" ; then
1286 echo Disabling ISO8859X support
1287 WITH_ISO8859X=0
1288fi
1289fi
1290AC_SUBST(WITH_ISO8859X)
1291
Daniel Veillarded6c5492005-07-23 15:00:22 +00001292if test "$with_schematron" = "no" ; then
1293 echo "Disabling Schematron support"
1294 WITH_SCHEMATRON=0
1295 TEST_SCHEMATRON=
1296else
1297 echo "Enabled Schematron support"
1298 WITH_SCHEMATRON=1
1299 TEST_SCHEMATRON="Schematrontests"
1300 with_xpath=yes
1301 with_pattern=yes
1302fi
1303AC_SUBST(WITH_SCHEMATRON)
1304AC_SUBST(TEST_SCHEMATRON)
1305
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001306if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001307 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001308 WITH_SCHEMAS=0
1309 TEST_SCHEMAS=
1310else
Daniel Veillard71531f32003-02-05 13:19:53 +00001311 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001312 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001313 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001314 if test "$PYTHON_INCLUDES" != "" ; then
1315 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1316 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001317 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001318fi
1319AC_SUBST(WITH_SCHEMAS)
1320AC_SUBST(TEST_SCHEMAS)
1321
Daniel Veillard23e73572002-09-19 19:56:43 +00001322if test "$with_regexps" = "no" ; then
1323 echo Disabling Regexps support
1324 WITH_REGEXPS=0
1325 TEST_REGEXPS=
1326else
1327 WITH_REGEXPS=1
1328 TEST_REGEXPS="Regexptests Automatatests"
1329fi
1330AC_SUBST(WITH_REGEXPS)
1331AC_SUBST(TEST_REGEXPS)
1332
Daniel Veillard361d8452000-04-03 19:48:13 +00001333if test "$with_debug" = "no" ; then
1334 echo Disabling DEBUG support
1335 WITH_DEBUG=0
1336 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001337 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001338else
1339 WITH_DEBUG=1
1340 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001341 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001342fi
1343AC_SUBST(WITH_DEBUG)
1344AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001345AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001346
Daniel Veillard361d8452000-04-03 19:48:13 +00001347if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001348 if test "$with_thread_alloc" = "yes" ; then
1349 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1350 WITH_MEM_DEBUG=0
1351 else
1352 echo Enabling memory debug support
1353 WITH_MEM_DEBUG=1
1354 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001355else
1356 WITH_MEM_DEBUG=0
1357fi
1358AC_SUBST(WITH_MEM_DEBUG)
1359
Daniel Veillard22cdb842004-10-04 14:09:17 +00001360if test "$with_run_debug" = "yes" ; then
1361 echo Enabling runtime debug support
1362 WITH_RUN_DEBUG=1
1363else
1364 WITH_RUN_DEBUG=0
1365fi
1366AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001367
1368WIN32_EXTRA_LIBADD=
1369WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001370CYGWIN_EXTRA_LDFLAGS=
1371CYGWIN_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001372case "$host" in
1373 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001374 CPPFLAGS="$CPPFLAGS -DWIN32"
1375 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001376 WIN32_EXTRA_LDFLAGS="-no-undefined"
1377 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1378 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1379 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1380 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001381 *-*-cygwin*)
1382 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001383 if test "${PYTHON}" != ""
1384 then
1385 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1386 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001387 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001388esac
1389AC_SUBST(WIN32_EXTRA_LIBADD)
1390AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001391AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1392AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001393
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001394if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
1395then
1396 echo Enabling code coverage for GCC
1397 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
1398 LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
1399else
1400 echo Disabling code coverage for GCC
1401fi
1402
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001403AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001404AC_SUBST(CFLAGS)
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001405AC_SUBST(LDFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001406AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001407
Daniel Veillardb05deb71999-08-10 19:04:08 +00001408AC_SUBST(XML_LIBDIR)
1409AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001410AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001411AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001412AC_SUBST(XML_INCLUDEDIR)
1413AC_SUBST(HTML_DIR)
1414AC_SUBST(HAVE_ISNAN)
1415AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001416AC_SUBST(PYTHON)
1417AC_SUBST(PYTHON_VERSION)
1418AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001419AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001420
Daniel Veillardb05deb71999-08-10 19:04:08 +00001421AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001422AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001423
Daniel Veillard9715c172002-11-25 16:33:40 +00001424dnl for the spec file
1425RELDATE=`date +'%a %b %e %Y'`
1426AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001427AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001428
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001429rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001430ln -s Copyright COPYING
1431
Daniel Veillarde4177a52004-01-08 16:43:57 +00001432# keep on one line for cygwin c.f. #130896
Daniel Veillard99b78502005-09-11 22:04:08 +00001433AC_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 +00001434
Daniel Veillard06d25242004-02-25 13:01:42 +00001435chmod +x xml2-config python/setup.py
Daniel Veillard67952602006-01-05 15:29:44 +00001436echo Done configuring