blob: 9d64dfdaf752c6f408bf8003803a694a3f3a3d13 [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
873
874 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000875 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000876 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000877 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
878 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000879 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000880 case $host_os in
881 *mingw32*) WITH_THREADS="1"
882 THREADS_W32="Win32"
883 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
884 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000885 *cygwin*) THREAD_LIBS=""
886 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000887 *beos*) WITH_THREADS="1"
888 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
889 ;;
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000890 *linux*)
Daniel Veillard32a461f2005-08-25 21:48:54 +0000891 if test "${GCC}" = "yes" ; then
892 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
893 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
894 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
895 if test "${THREAD_LIBS}" = "-lpthread" ; then
896 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
897 then
898 THREAD_LIBS=""
899 BASE_THREAD_LIBS="-lpthread"
900 else
901 if expr ${GCC_MAJOR} \> 3 > /dev/null
902 then
903 THREAD_LIBS=""
904 BASE_THREAD_LIBS="-lpthread"
905 else
906 echo old GCC disabling weak symbols for pthread
907 fi
908 fi
909 fi
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000910 fi
911 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000912 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000913 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000914 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
915 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000916 fi
917fi
William M. Brack306e33c2004-06-12 01:01:22 +0000918if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000919 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000920fi
921
Daniel Veillardb8478642001-10-12 17:29:10 +0000922AC_SUBST(THREAD_LIBS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000923AC_SUBST(BASE_THREAD_LIBS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000924AC_SUBST(WITH_THREADS)
925AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000926AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000927AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000928
William M. Brack21e4ef22005-01-02 09:53:13 +0000929dnl
930dnl xmllint shell history
931dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000932if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000933 echo Enabling xmllint shell history
934 dnl check for terminal library. this is a very cool solution
935 dnl from octave's configure.in
936 unset tcap
937 for termlib in ncurses curses termcap terminfo termlib; do
938 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
939 test -n "$tcap" && break
940 done
941
942 AC_CHECK_HEADER(readline/history.h,
943 AC_CHECK_LIB(history, append_history,[
944 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000945 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000946 AC_CHECK_HEADER(readline/readline.h,
947 AC_CHECK_LIB(readline, readline,[
948 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000949 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000950 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
951 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
952 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000953 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000954fi
955
William M. Brack21e4ef22005-01-02 09:53:13 +0000956dnl
957dnl Tree functions
958dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000959if test "$with_tree" = "no" ; then
960 echo Disabling DOM like tree manipulation APIs
961 WITH_TREE=0
962else
963 WITH_TREE=1
964fi
965AC_SUBST(WITH_TREE)
966
Daniel Veillard361d8452000-04-03 19:48:13 +0000967if test "$with_ftp" = "no" ; then
968 echo Disabling FTP support
969 WITH_FTP=0
970 FTP_OBJ=
971else
972 WITH_FTP=1
973 FTP_OBJ=nanoftp.o
974fi
975AC_SUBST(WITH_FTP)
976AC_SUBST(FTP_OBJ)
977
Daniel Veillard361d8452000-04-03 19:48:13 +0000978if test "$with_http" = "no" ; then
979 echo Disabling HTTP support
980 WITH_HTTP=0
981 HTTP_OBJ=
982else
983 WITH_HTTP=1
984 HTTP_OBJ=nanohttp.o
985fi
986AC_SUBST(WITH_HTTP)
987AC_SUBST(HTTP_OBJ)
988
Daniel Veillard4432df22003-09-28 18:58:27 +0000989if test "$with_legacy" = "no" ; then
990 echo Disabling deprecated APIs
991 WITH_LEGACY=0
992else
993 WITH_LEGACY=1
994fi
995AC_SUBST(WITH_LEGACY)
996
Daniel Veillard81273902003-09-30 00:43:48 +0000997if test "$with_reader" = "no" ; then
998 echo Disabling the xmlReader parsing interface
999 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +00001000 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +00001001else
1002 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +00001003 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +00001004 if test "$with_push" = "no" ; then
1005 echo xmlReader requires Push interface - enabling it
1006 with_push=yes
1007 fi
Daniel Veillard81273902003-09-30 00:43:48 +00001008fi
1009AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +00001010AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +00001011
William M. Brack21e4ef22005-01-02 09:53:13 +00001012if test "$with_writer" = "no" ; then
1013 echo Disabling the xmlWriter saving interface
1014 WITH_WRITER=0
1015# WRITER_TEST=
1016else
1017 WITH_WRITER=1
1018# WRITER_TEST=Writertests
1019 if test "$with_push" = "no" ; then
1020 echo xmlWriter requires Push interface - enabling it
1021 with_push=yes
1022 fi
1023 if test "$with_output" = "no" ; then
1024 echo xmlWriter requires Output interface - enabling it
1025 with_output=yes
1026 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001027fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001028AC_SUBST(WITH_WRITER)
1029#AC_SUBST(WRITER_TEST)
1030
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001031if test "$with_pattern" = "no" ; then
1032 echo Disabling the xmlPattern parsing interface
1033 WITH_PATTERN=0
Daniel Veillardf9d16912005-01-30 22:36:30 +00001034 TEST_PATTERN=
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001035else
1036 WITH_PATTERN=1
Daniel Veillardf9d16912005-01-30 22:36:30 +00001037 TEST_PATTERN=Patterntests
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001038fi
1039AC_SUBST(WITH_PATTERN)
Daniel Veillardf9d16912005-01-30 22:36:30 +00001040AC_SUBST(TEST_PATTERN)
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001041
Daniel Veillard81273902003-09-30 00:43:48 +00001042if test "$with_sax1" = "no" ; then
1043 echo Disabling the older SAX1 interface
1044 WITH_SAX1=0
1045 TEST_SAX=
1046else
1047 WITH_SAX1=1
1048 TEST_SAX=SAXtests
1049fi
1050AC_SUBST(WITH_SAX1)
1051AC_SUBST(TEST_SAX)
1052
Daniel Veillard73b013f2003-09-30 12:36:01 +00001053if test "$with_push" = "no" ; then
1054 echo Disabling the PUSH parser interfaces
1055 WITH_PUSH=0
1056 TEST_PUSH=
1057else
1058 WITH_PUSH=1
1059 TEST_PUSH="XMLPushtests"
1060fi
1061AC_SUBST(WITH_PUSH)
1062AC_SUBST(TEST_PUSH)
1063
Daniel Veillard73b013f2003-09-30 12:36:01 +00001064if test "$with_html" = "no" ; then
1065 echo Disabling HTML support
1066 WITH_HTML=0
1067 HTML_OBJ=
1068 TEST_HTML=
1069else
1070 WITH_HTML=1
1071 HTML_OBJ="HTMLparser.o HTMLtree.o"
1072 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +00001073 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +00001074 TEST_PHTML=HTMLPushtests
1075 else
1076 TEST_PHTML=
1077 fi
1078fi
1079AC_SUBST(WITH_HTML)
1080AC_SUBST(HTML_OBJ)
1081AC_SUBST(TEST_HTML)
1082AC_SUBST(TEST_PHTML)
1083
Daniel Veillard73b013f2003-09-30 12:36:01 +00001084if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +00001085 echo Disabling DTD validation support
1086 WITH_VALID=0
1087 TEST_VALID=
1088 TEST_VTIME=
1089else
1090 WITH_VALID=1
1091 TEST_VALID=Validtests
1092 TEST_VTIME=VTimingtests
1093fi
1094AC_SUBST(WITH_VALID)
1095AC_SUBST(TEST_VALID)
1096AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +00001097
Daniel Veillarda7374592001-05-10 14:17:55 +00001098if test "$with_catalog" = "no" ; then
1099 echo Disabling Catalog support
1100 WITH_CATALOG=0
1101 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001102 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +00001103else
1104 WITH_CATALOG=1
1105 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +00001106 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +00001107fi
1108AC_SUBST(WITH_CATALOG)
1109AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001110AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +00001111
Daniel Veillardb59076b2001-04-29 17:04:07 +00001112if test "$with_docbook" = "no" ; then
1113 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +00001114 WITH_DOCB=0
1115 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +00001116else
1117 WITH_DOCB=1
1118 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +00001119fi
1120AC_SUBST(WITH_DOCB)
1121AC_SUBST(DOCB_OBJ)
1122
1123
William M. Brack21e4ef22005-01-02 09:53:13 +00001124if test "$with_xptr" = "no" ; then
1125 echo Disabling XPointer support
1126 WITH_XPTR=0
1127 XPTR_OBJ=
1128 TEST_XPTR=
1129else
1130 WITH_XPTR=1
1131 XPTR_OBJ=xpointer.o
1132 TEST_XPTR=XPtrtests
1133 if test "$with_xpath" = "no" ; then
1134 echo XPointer requires XPath support - enabling it
1135 with_xpath=yes
1136 fi
Daniel Veillard4432df22003-09-28 18:58:27 +00001137fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001138AC_SUBST(WITH_XPTR)
1139AC_SUBST(XPTR_OBJ)
1140AC_SUBST(TEST_XPTR)
1141
1142if test "$with_c14n" = "no" ; then
1143 echo Disabling C14N support
1144 WITH_C14N=0
1145 C14N_OBJ=
1146 TEST_C14N=
1147else
1148 WITH_C14N=1
1149 C14N_OBJ="c14n.c"
1150 TEST_C14N=C14Ntests
1151 if test "$with_xpath" = "no" ; then
1152 echo C14N requires XPath support - enabling it
1153 with_xpath=yes
1154 fi
1155fi
1156AC_SUBST(WITH_C14N)
1157AC_SUBST(C14N_OBJ)
1158AC_SUBST(TEST_C14N)
1159
1160if test "$with_xinclude" = "no" ; then
1161 echo Disabling XInclude support
1162 WITH_XINCLUDE=0
1163 XINCLUDE_OBJ=
1164 with_xinclude="no"
1165 TEST_XINCLUDE=
1166else
1167 WITH_XINCLUDE=1
1168 XINCLUDE_OBJ=xinclude.o
1169 TEST_XINCLUDE=XIncludetests
1170 if test "$with_xpath" = "no" ; then
1171 echo XInclude requires XPath support - enabling it
1172 with_xpath=yes
1173 fi
1174fi
1175AC_SUBST(WITH_XINCLUDE)
1176AC_SUBST(XINCLUDE_OBJ)
1177AC_SUBST(TEST_XINCLUDE)
1178
Daniel Veillard361d8452000-04-03 19:48:13 +00001179if test "$with_xpath" = "no" ; then
1180 echo Disabling XPATH support
1181 WITH_XPATH=0
1182 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001183 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001184else
1185 WITH_XPATH=1
1186 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001187 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001188fi
1189AC_SUBST(WITH_XPATH)
1190AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001191AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001192
William M. Brack21e4ef22005-01-02 09:53:13 +00001193dnl
1194dnl output functions
1195dnl
1196if test "$with_output" = "no" ; then
1197 echo Disabling serialization/saving support
1198 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001199else
William M. Brack21e4ef22005-01-02 09:53:13 +00001200 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001201fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001202AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001203
Daniel Veillard6e90d192001-07-03 16:37:49 +00001204WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001205if test "$with_iconv" = "no" ; then
1206 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001207else
Daniel Veillard220346d2001-12-07 11:33:54 +00001208 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001209 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001210 # Export this since our headers include iconv.h
1211 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001212 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001213 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001214
1215 AC_CHECK_HEADER(iconv.h,
1216 AC_MSG_CHECKING(for iconv)
1217 AC_TRY_LINK([#include <stdlib.h>
1218#include <iconv.h>],[
1219iconv_t cd = iconv_open ("","");
1220iconv (cd, NULL, NULL, NULL, NULL);],[
1221 AC_MSG_RESULT(yes)
1222 WITH_ICONV=1],[
1223 AC_MSG_RESULT(no)
1224 AC_MSG_CHECKING(for iconv in -liconv)
1225
1226 _ldflags="${LDFLAGS}"
1227 _libs="${LIBS}"
1228 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1229 LIBS="${LIBS} -liconv"
1230
1231 AC_TRY_LINK([#include <stdlib.h>
1232#include <iconv.h>],[
1233iconv_t cd = iconv_open ("","");
1234iconv (cd, NULL, NULL, NULL, NULL);],[
1235 AC_MSG_RESULT(yes)
1236 WITH_ICONV=1
1237 ICONV_LIBS="${ICONV_LIBS} -liconv"
1238 LIBS="${_libs}"
1239 LDFLAGS="${_ldflags}"],[
1240 AC_MSG_RESULT(no)
1241 LIBS="${_libs}"
1242 LDFLAGS="${_ldflags}"])]))
Daniel Veillard8e1a46d2008-02-15 07:47:26 +00001243
1244 if test "$WITH_ICONV" = "1" ; then
1245 AC_MSG_CHECKING([for iconv declaration])
1246 AC_CACHE_VAL(xml_cv_iconv_arg2, [
1247 AC_TRY_COMPILE([#include <stdlib.h>
1248#include <iconv.h>
1249extern
1250#ifdef __cplusplus
1251"C"
1252#endif
1253#if defined(__STDC__) || defined(__cplusplus)
1254size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1255#else
1256size_t iconv();
1257#endif
1258], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
1259
1260 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);"
1261 AC_MSG_RESULT([${xml_xxx:-
1262 }$xml_cv_iconv_decl])
1263 AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
1264 [Define as const if the declaration of iconv() needs const.])
1265 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001266fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001267case "$host" in
1268 *mingw*) M_LIBS=""
1269 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001270 *beos*) M_LIBS=""
1271 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001272 *) M_LIBS="-lm"
1273 ;;
1274esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001275XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001276XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001277AC_SUBST(WITH_ICONV)
1278
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001279WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001280if test "$WITH_ICONV" != "1" ; then
1281if test "$with_iso8859x" = "no" ; then
1282 echo Disabling ISO8859X support
1283 WITH_ISO8859X=0
1284fi
1285fi
1286AC_SUBST(WITH_ISO8859X)
1287
Daniel Veillarded6c5492005-07-23 15:00:22 +00001288if test "$with_schematron" = "no" ; then
1289 echo "Disabling Schematron support"
1290 WITH_SCHEMATRON=0
1291 TEST_SCHEMATRON=
1292else
1293 echo "Enabled Schematron support"
1294 WITH_SCHEMATRON=1
1295 TEST_SCHEMATRON="Schematrontests"
1296 with_xpath=yes
1297 with_pattern=yes
1298fi
1299AC_SUBST(WITH_SCHEMATRON)
1300AC_SUBST(TEST_SCHEMATRON)
1301
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001302if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001303 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001304 WITH_SCHEMAS=0
1305 TEST_SCHEMAS=
1306else
Daniel Veillard71531f32003-02-05 13:19:53 +00001307 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001308 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001309 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001310 if test "$PYTHON_INCLUDES" != "" ; then
1311 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1312 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001313 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001314fi
1315AC_SUBST(WITH_SCHEMAS)
1316AC_SUBST(TEST_SCHEMAS)
1317
Daniel Veillard23e73572002-09-19 19:56:43 +00001318if test "$with_regexps" = "no" ; then
1319 echo Disabling Regexps support
1320 WITH_REGEXPS=0
1321 TEST_REGEXPS=
1322else
1323 WITH_REGEXPS=1
1324 TEST_REGEXPS="Regexptests Automatatests"
1325fi
1326AC_SUBST(WITH_REGEXPS)
1327AC_SUBST(TEST_REGEXPS)
1328
Daniel Veillard361d8452000-04-03 19:48:13 +00001329if test "$with_debug" = "no" ; then
1330 echo Disabling DEBUG support
1331 WITH_DEBUG=0
1332 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001333 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001334else
1335 WITH_DEBUG=1
1336 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001337 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001338fi
1339AC_SUBST(WITH_DEBUG)
1340AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001341AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001342
Daniel Veillard361d8452000-04-03 19:48:13 +00001343if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001344 if test "$with_thread_alloc" = "yes" ; then
1345 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1346 WITH_MEM_DEBUG=0
1347 else
1348 echo Enabling memory debug support
1349 WITH_MEM_DEBUG=1
1350 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001351else
1352 WITH_MEM_DEBUG=0
1353fi
1354AC_SUBST(WITH_MEM_DEBUG)
1355
Daniel Veillard22cdb842004-10-04 14:09:17 +00001356if test "$with_run_debug" = "yes" ; then
1357 echo Enabling runtime debug support
1358 WITH_RUN_DEBUG=1
1359else
1360 WITH_RUN_DEBUG=0
1361fi
1362AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001363
1364WIN32_EXTRA_LIBADD=
1365WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001366CYGWIN_EXTRA_LDFLAGS=
1367CYGWIN_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001368case "$host" in
1369 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001370 CPPFLAGS="$CPPFLAGS -DWIN32"
1371 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001372 WIN32_EXTRA_LDFLAGS="-no-undefined"
1373 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1374 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1375 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1376 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001377 *-*-cygwin*)
1378 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001379 if test "${PYTHON}" != ""
1380 then
1381 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1382 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001383 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001384esac
1385AC_SUBST(WIN32_EXTRA_LIBADD)
1386AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001387AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1388AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001389
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001390if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
1391then
1392 echo Enabling code coverage for GCC
1393 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
1394 LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
1395else
1396 echo Disabling code coverage for GCC
1397fi
1398
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001399AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001400AC_SUBST(CFLAGS)
Daniel Veillardbfa5cf12008-08-27 15:33:28 +00001401AC_SUBST(LDFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001402AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001403
Daniel Veillardb05deb71999-08-10 19:04:08 +00001404AC_SUBST(XML_LIBDIR)
1405AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001406AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001407AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001408AC_SUBST(XML_INCLUDEDIR)
1409AC_SUBST(HTML_DIR)
1410AC_SUBST(HAVE_ISNAN)
1411AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001412AC_SUBST(PYTHON)
1413AC_SUBST(PYTHON_VERSION)
1414AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001415AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001416
Daniel Veillardb05deb71999-08-10 19:04:08 +00001417AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001418AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001419
Daniel Veillard9715c172002-11-25 16:33:40 +00001420dnl for the spec file
1421RELDATE=`date +'%a %b %e %Y'`
1422AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001423AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001424
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001425rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001426ln -s Copyright COPYING
1427
Daniel Veillarde4177a52004-01-08 16:43:57 +00001428# keep on one line for cygwin c.f. #130896
Daniel Veillard99b78502005-09-11 22:04:08 +00001429AC_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 +00001430
Daniel Veillard06d25242004-02-25 13:01:42 +00001431chmod +x xml2-config python/setup.py
Daniel Veillard67952602006-01-05 15:29:44 +00001432echo Done configuring