- DBGKD_WAIT_STATE_CHANGE64 is used in KD protocol 5, not number 6 that we use. Proto...
[reactos.git] / reactos / lib / 3rdparty / libxml2 / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(entities.c)
3 AM_CONFIG_HEADER(config.h)
4 AC_CANONICAL_HOST
5
6 LIBXML_MAJOR_VERSION=2
7 LIBXML_MINOR_VERSION=7
8 LIBXML_MICRO_VERSION=6
9 LIBXML_MICRO_VERSION_SUFFIX=
10 LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
11 LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
12
13 LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
14
15 if test -f CVS/Entries ; then
16 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
22 else 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
29 else 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
36 fi
37 fi
38 fi
39 AC_SUBST(LIBXML_MAJOR_VERSION)
40 AC_SUBST(LIBXML_MINOR_VERSION)
41 AC_SUBST(LIBXML_MICRO_VERSION)
42 AC_SUBST(LIBXML_VERSION)
43 AC_SUBST(LIBXML_VERSION_INFO)
44 AC_SUBST(LIBXML_VERSION_NUMBER)
45 AC_SUBST(LIBXML_VERSION_EXTRA)
46
47 VERSION=${LIBXML_VERSION}
48
49 AM_INIT_AUTOMAKE(libxml2, $VERSION)
50
51 dnl Checks for programs.
52 AC_PROG_CC
53 AC_PROG_INSTALL
54 AC_PROG_CPP
55 AC_PATH_PROG(RM, rm, /bin/rm)
56 AC_PATH_PROG(MV, mv, /bin/mv)
57 AC_PATH_PROG(TAR, tar, /bin/tar)
58 AC_PATH_PROG(PERL, perl, /usr/bin/perl)
59 AC_PATH_PROG(WGET, wget, /usr/bin/wget)
60 AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
61 AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
62
63 dnl Make sure we have an ANSI compiler
64 AM_C_PROTOTYPES
65 test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
66
67 AC_LIBTOOL_WIN32_DLL
68 AM_PROG_LIBTOOL
69
70 dnl
71 dnl if the system support linker version scripts for symbol versioning
72 dnl then add it
73 dnl
74 VERSION_SCRIPT_FLAGS=
75 $(/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null) && \
76 VERSION_SCRIPT_FLAGS=-Wl,--version-script=
77 test "`uname`" == "SunOS" && \
78 VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
79 AC_SUBST(VERSION_SCRIPT_FLAGS)
80 AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
81
82 dnl
83 dnl We process the AC_ARG_WITH first so that later we can modify
84 dnl some of them to try to prevent impossible combinations. This
85 dnl also allows up so alphabetize the choices
86 dnl
87
88 dnl
89 dnl zlib option might change flags, so we save them initially
90 dnl
91 _cppflags="${CPPFLAGS}"
92 _ldflags="${LDFLAGS}"
93
94 AC_ARG_WITH(c14n,
95 [ --with-c14n add the Canonicalization support (on)])
96 AC_ARG_WITH(catalog,
97 [ --with-catalog add the Catalog support (on)])
98 AC_ARG_WITH(debug,
99 [ --with-debug add the debugging module (on)])
100 AC_ARG_WITH(docbook,
101 [ --with-docbook add Docbook SGML support (on)])
102 AC_ARG_WITH(fexceptions,
103 [ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
104 AC_ARG_WITH(ftp,
105 [ --with-ftp add the FTP support (on)])
106 AC_ARG_WITH(history,
107 [ --with-history add history support to xmllint shell(off)])
108 AC_ARG_WITH(html,
109 [ --with-html add the HTML support (on)])
110 dnl Specific dir for HTML output ?
111 AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
112 [path to base html directory, default $datadir/doc/html]),
113 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
114
115 AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
116 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
117 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
118 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
119 AC_SUBST(HTML_DIR)
120 AC_ARG_WITH(http,
121 [ --with-http add the HTTP support (on)])
122 AC_ARG_WITH(iconv,
123 [ --with-iconv[[=DIR]] add ICONV support (on)])
124 AC_ARG_WITH(iso8859x,
125 [ --with-iso8859x add ISO8859X support if no iconv (on)])
126 AC_ARG_WITH(legacy,
127 [ --with-legacy add deprecated APIs for compatibility (on)])
128 AC_ARG_WITH(mem_debug,
129 [ --with-mem-debug add the memory debugging module (off)])
130 AC_ARG_WITH(minimum,
131 [ --with-minimum build a minimally sized library (off)])
132 AC_ARG_WITH(output,
133 [ --with-output add the serialization support (on)])
134 AC_ARG_WITH(pattern,
135 [ --with-pattern add the xmlPattern selection interface (on)])
136 AC_ARG_WITH(push,
137 [ --with-push add the PUSH parser interfaces (on)])
138 AC_ARG_WITH(python,
139 [ --with-python[[=DIR]] build Python bindings if found])
140 AC_ARG_WITH(reader,
141 [ --with-reader add the xmlReader parsing interface (on)])
142 AC_ARG_WITH(readline,
143 [ --with-readline=DIR use readline in DIR],[
144 if test "$withval" != "no" -a "$withval" != "yes"; then
145 RDL_DIR=$withval
146 CPPFLAGS="${CPPFLAGS} -I$withval/include"
147 LDFLAGS="${LDFLAGS} -L$withval/lib"
148 fi
149 ])
150 AC_ARG_WITH(regexps,
151 [ --with-regexps add Regular Expressions support (on)])
152 AC_ARG_WITH(run_debug,
153 [ --with-run-debug add the runtime debugging module (off)])
154 AC_ARG_WITH(sax1,
155 [ --with-sax1 add the older SAX1 interface (on)])
156 AC_ARG_WITH(schemas,
157 [ --with-schemas add Relax-NG and Schemas support (on)])
158 AC_ARG_WITH(schematron,
159 [ --with-schematron add Schematron support (on)])
160 AC_ARG_WITH(threads,
161 [ --with-threads add multithread support(on)])
162 AC_ARG_WITH(thread-alloc,
163 [ --with-thread-alloc add per-thread memory(off)])
164 AC_ARG_WITH(tree,
165 [ --with-tree add the DOM like tree manipulation APIs (on)])
166 AC_ARG_WITH(valid,
167 [ --with-valid add the DTD validation support (on)])
168 AC_ARG_WITH(writer,
169 [ --with-writer add the xmlWriter saving interface (on)])
170 AC_ARG_WITH(xinclude,
171 [ --with-xinclude add the XInclude support (on)])
172 AC_ARG_WITH(xpath,
173 [ --with-xpath add the XPATH support (on)])
174 AC_ARG_WITH(xptr,
175 [ --with-xptr add the XPointer support (on)])
176 AC_ARG_WITH(modules,
177 [ --with-modules add the dynamic modules support (on)])
178 AC_ARG_WITH(zlib,
179 [ --with-zlib[[=DIR]] use libz in DIR],[
180 if test "$withval" != "no" -a "$withval" != "yes"; then
181 Z_DIR=$withval
182 CPPFLAGS="${CPPFLAGS} -I$withval/include"
183 LDFLAGS="${LDFLAGS} -L$withval/lib"
184 fi
185 ])
186 AC_ARG_WITH(coverage,
187 [ --with-coverage build for code coverage with GCC (off)])
188
189 AC_ARG_ENABLE(rebuild-docs,
190 [ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=yes]]])
191 AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"])
192
193 dnl
194 dnl hard dependancies on options
195 dnl
196 if test "$with_schemas" = "yes"
197 then
198 with_pattern=yes
199 with_regexps=yes
200 fi
201 if test "$with_schematron" = "yes"
202 then
203 with_pattern=yes
204 with_xpath=yes
205 fi
206 if test "$with_reader" = "yes"
207 then
208 with_push=yes
209 fi
210 if test "$with_xptr" = "yes"
211 then
212 with_xpath=yes
213 fi
214 dnl
215 dnl option to build a minimal libxml2 library
216 dnl
217 if test "$with_minimum" = "yes"
218 then
219 echo "Configuring for a minimal library"
220 if test "$with_c14n" = ""
221 then
222 with_c14n=no
223 fi
224 if test "$with_catalog" = ""
225 then
226 with_catalog=no
227 fi
228 echo So far so good!
229 if test "$with_debug" = ""
230 then
231 with_debug=no
232 fi
233 if test "$with_docbook" = ""
234 then
235 with_docbook=no
236 fi
237 if test "$with_fexceptions" = ""
238 then
239 with_fexceptions=no
240 fi
241 if test "$with_ftp" = ""
242 then
243 with_ftp=no
244 fi
245 if test "$with_history" = ""
246 then
247 with_history=no
248 fi
249 if test "$with_html" = ""
250 then
251 with_html=no
252 fi
253 if test "$with_http" = ""
254 then
255 with_http=no
256 fi
257 if test "$with_iconv" = ""
258 then
259 with_iconv=no
260 fi
261 if test "$with_iso8859x" = ""
262 then
263 with_iso8859x=no
264 fi
265 if test "$with_legacy" = ""
266 then
267 with_legacy=no
268 fi
269 if test "$with_mem_debug" = ""
270 then
271 with_mem_debug=no
272 fi
273 if test "$with_output" = ""
274 then
275 with_output=no
276 fi
277 if test "$with_pattern" = ""
278 then
279 with_pattern=no
280 fi
281 if test "$with_push" = ""
282 then
283 with_push=no
284 fi
285 if test "$with_python" = ""
286 then
287 with_python=no
288 fi
289 if test "$with_reader" = ""
290 then
291 with_reader=no
292 fi
293 if test "$with_readline" = ""
294 then
295 with_readline=no
296 fi
297 if test "$with_regexps" = ""
298 then
299 with_regexps=no
300 fi
301 if test "$with_run_debug" = ""
302 then
303 with_run_debug=no
304 fi
305 if test "$with_sax1" = ""
306 then
307 with_sax1=no
308 fi
309 if test "$with_schemas" = ""
310 then
311 with_schemas=no
312 fi
313 if test "$with_schematron" = ""
314 then
315 with_schematron=no
316 fi
317 if test "$with_threads" = ""
318 then
319 with_threads=no
320 fi
321 if test "$with_thread_alloc" = ""
322 then
323 with_thread_alloc=no
324 fi
325 if test "$with_tree" = ""
326 then
327 with_tree=no
328 fi
329 if test "$with_valid" = ""
330 then
331 with_valid=no
332 fi
333 if test "$with_writer" = ""
334 then
335 with_writer=no
336 fi
337 if test "$with_xinclude" = ""
338 then
339 with_xinclude=no
340 fi
341 if test "$with_xpath" = ""
342 then
343 with_xpath=no
344 fi
345 if test "$with_xptr" = ""
346 then
347 with_xptr=no
348 fi
349 if test "$with_zlib" = ""
350 then
351 with_zlib=no
352 fi
353 if test "$with_modules" = ""
354 then
355 with_modules=no
356 fi
357 fi
358
359 echo Checking zlib
360
361 dnl Checks for zlib library.
362
363 WITH_ZLIB=0
364 if test "$with_zlib" = "no"; then
365 echo "Disabling compression support"
366 else
367 AC_CHECK_HEADERS(zlib.h,
368 AC_CHECK_LIB(z, gzread,[
369 AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
370 WITH_ZLIB=1
371 if test "x${Z_DIR}" != "x"; then
372 Z_CFLAGS="-I${Z_DIR}/include"
373 Z_LIBS="-L${Z_DIR}/lib -lz"
374 [case ${host} in
375 *-*-solaris*)
376 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
377 ;;
378 esac]
379 else
380 Z_LIBS="-lz"
381 fi]))
382 fi
383
384 AC_SUBST(Z_CFLAGS)
385 AC_SUBST(Z_LIBS)
386 AC_SUBST(WITH_ZLIB)
387
388 CPPFLAGS=${_cppflags}
389 LDFLAGS=${_ldflags}
390
391 echo Checking headers
392
393 dnl Checks for header files.
394 AC_HEADER_DIRENT
395 AC_HEADER_STDC
396 AC_CHECK_HEADERS([fcntl.h])
397 AC_CHECK_HEADERS([unistd.h])
398 AC_CHECK_HEADERS([ctype.h])
399 AC_CHECK_HEADERS([dirent.h])
400 AC_CHECK_HEADERS([errno.h])
401 AC_CHECK_HEADERS([malloc.h])
402 AC_CHECK_HEADERS([stdarg.h])
403 AC_CHECK_HEADERS([sys/stat.h])
404 AC_CHECK_HEADERS([sys/types.h])
405 AC_CHECK_HEADERS([stdint.h])
406 AC_CHECK_HEADERS([inttypes.h.h])
407 AC_CHECK_HEADERS([time.h])
408 AC_CHECK_HEADERS([ansidecl.h])
409 AC_CHECK_HEADERS([ieeefp.h])
410 AC_CHECK_HEADERS([nan.h])
411 AC_CHECK_HEADERS([math.h])
412 AC_CHECK_HEADERS([limits.h])
413 AC_CHECK_HEADERS([fp_class.h])
414 AC_CHECK_HEADERS([float.h])
415 AC_CHECK_HEADERS([stdlib.h])
416 AC_CHECK_HEADERS([sys/socket.h], [], [],
417 [#if HAVE_SYS_TYPES_H
418 # include <sys/types.h>
419 # endif
420 ])
421 AC_CHECK_HEADERS([netinet/in.h], [], [],
422 [#if HAVE_SYS_TYPES_H
423 # include <sys/types.h>
424 # endif
425 ])
426 AC_CHECK_HEADERS([arpa/inet.h], [], [],
427 [#if HAVE_SYS_TYPES_H
428 # include <sys/types.h>
429 # endif
430 #if HAVE_ARPA_INET_H
431 # include <arpa/inet.h>
432 # endif
433 ])
434 AC_CHECK_HEADERS([netdb.h])
435 AC_CHECK_HEADERS([sys/time.h])
436 AC_CHECK_HEADERS([sys/select.h])
437 AC_CHECK_HEADERS([poll.h])
438 AC_CHECK_HEADERS([sys/mman.h])
439 AC_CHECK_HEADERS([sys/timeb.h])
440 AC_CHECK_HEADERS([signal.h])
441 AC_CHECK_HEADERS([arpa/nameser.h], [], [],
442 [#if HAVE_SYS_TYPES_H
443 # include <sys/types.h>
444 # endif
445 ])
446 AC_CHECK_HEADERS([resolv.h], [], [],
447 [#if HAVE_SYS_TYPES_H
448 # include <sys/types.h>
449 # endif
450 #if HAVE_NETINET_IN_H
451 # include <netinet/in.h>
452 # endif
453 #if HAVE_ARPA_NAMESER_H
454 # include <arpa/nameser.h>
455 # endif
456 ])
457 AC_CHECK_HEADERS([dl.h])
458 AC_CHECK_HEADERS([dlfcn.h])
459
460
461 echo Checking libraries
462
463 dnl Checks for library functions.
464 AC_FUNC_STRFTIME
465 AC_CHECK_FUNCS(strdup strndup strerror)
466 AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
467 AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
468 AC_CHECK_FUNCS(stat _stat signal)
469
470 dnl Checking the standard string functions availability
471 AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
472 NEED_TRIO=1)
473
474 dnl Checking for va_copy availability
475 AC_MSG_CHECKING([for va_copy])
476 AC_TRY_LINK([#include <stdarg.h>
477 va_list ap1,ap2;], [va_copy(ap1,ap2);],
478 have_va_copy=yes,
479 have_va_copy=no)
480 AC_MSG_RESULT($have_va_copy)
481 if test x"$have_va_copy" = x"yes"; then
482 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
483 else
484 AC_MSG_CHECKING([for __va_copy])
485 AC_TRY_LINK([#include <stdarg.h>
486 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
487 have___va_copy=yes,
488 have___va_copy=no)
489 AC_MSG_RESULT($have___va_copy)
490 if test x"$have___va_copy" = x"yes"; then
491 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
492 fi
493 fi
494
495 dnl Checks for inet libraries:
496 AC_SEARCH_LIBS(gethostent, [nsl])
497 AC_SEARCH_LIBS(setsockopt, [socket net network])
498 AC_SEARCH_LIBS(connect, [inet])
499
500 dnl Determine what socket length (socklen_t) data type is
501 AC_MSG_CHECKING([for type of socket length (socklen_t)])
502 AC_TRY_COMPILE2([
503 #include <stddef.h>
504 #include <sys/types.h>
505 #include <sys/socket.h>],[
506 (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
507 AC_MSG_RESULT(socklen_t *)
508 XML_SOCKLEN_T=socklen_t],[
509 AC_TRY_COMPILE2([
510 #include <stddef.h>
511 #include <sys/types.h>
512 #include <sys/socket.h>],[
513 (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
514 AC_MSG_RESULT(size_t *)
515 XML_SOCKLEN_T=size_t],[
516 AC_TRY_COMPILE2([
517 #include <stddef.h>
518 #include <sys/types.h>
519 #include <sys/socket.h>],[
520 (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
521 AC_MSG_RESULT(int *)
522 XML_SOCKLEN_T=int],[
523 AC_MSG_WARN(could not determine)
524 XML_SOCKLEN_T="int"])])])
525 AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
526
527 dnl ***********************Checking for availability of IPv6*******************
528
529 AC_MSG_CHECKING([whether to enable IPv6])
530 AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
531 if test "$with_minimum" = "yes"
532 then
533 enable_ipv6=no
534 fi
535 if test $enable_ipv6 = yes; then
536 have_ipv6=no
537 AC_TRY_COMPILE([
538 #include <sys/types.h>
539 #include <sys/socket.h>
540 ], [
541 struct sockaddr_storage ss;
542 socket(AF_INET6, SOCK_STREAM, 0)
543 ],
544 have_ipv6=yes,
545 have_ipv6=no
546 )
547 AC_MSG_RESULT($have_ipv6)
548
549 if test $have_ipv6 = yes; then
550 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
551 have_broken_ss_family=no
552
553 dnl *********************************************************************
554 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
555 dnl a ss_family member, but rather __ss_family. Let's detect that
556 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
557 dnl platforms. However, we should only do this if ss_family is not
558 dnl present.
559 dnl ********************************************************************
560 AC_MSG_CHECKING([struct sockaddr::ss_family])
561 AC_TRY_COMPILE([
562 #include <sys/types.h>
563 #include <sys/socket.h>
564 ], [
565 struct sockaddr_storage ss ;
566 ss.ss_family = 0 ;
567 ],
568 have_ss_family=yes,
569 have_ss_family=no
570 )
571 AC_MSG_RESULT($have_ss_family)
572 if test x$have_ss_family = xno ; then
573 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
574 AC_TRY_COMPILE([
575 #include <sys/types.h>
576 #include <sys/socket.h>
577 ], [
578 struct sockaddr_storage ss ;
579 ss.__ss_family = 0 ;
580 ],
581 have_broken_ss_family=yes,
582 have_broken_ss_family=no
583 )
584 AC_MSG_RESULT($have_broken_ss_family)
585 if test x$have_broken_ss_family = xyes ; then
586 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
587 [Whether struct sockaddr::__ss_family exists])
588 AC_DEFINE(ss_family, __ss_family,
589 [ss_family is not defined here, use __ss_family instead])
590 else
591 AC_MSG_WARN(ss_family and __ss_family not found)
592 fi
593 fi
594
595 have_getaddrinfo=no
596 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
597 if test $have_getaddrinfo != yes; then
598 for lib in bsd socket inet; do
599 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
600 done
601 fi
602
603 if test $have_getaddrinfo = yes; then
604 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
605 fi
606 fi
607 fi
608
609 dnl ******************************End IPv6 checks******************************
610
611 dnl Checks for isnan in libm if not in libc
612 AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
613 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
614
615 AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
616 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
617
618 XML_LIBDIR='-L${libdir}'
619 XML_INCLUDEDIR='-I${includedir}/libxml2'
620
621 dnl
622 dnl Extra flags
623 dnl
624 XML_CFLAGS=""
625 RDL_LIBS=""
626
627 dnl
628 dnl Workaround for native compilers
629 dnl HP : http://bugs.gnome.org/db/31/3163.html
630 dnl DEC : Enable NaN/Inf
631 dnl
632 if test "${GCC}" != "yes" ; then
633 case "${host}" in
634 hppa*-*-hpux* )
635 CFLAGS="${CFLAGS} -Wp,-H30000"
636 ;;
637 *-dec-osf* )
638 CFLAGS="${CFLAGS} -ieee"
639 ;;
640 alpha*-*-linux* )
641 CFLAGS="${CFLAGS} -ieee"
642 ;;
643 esac
644 else
645 if test "$with_fexceptions" = "yes"
646 then
647 #
648 # Not activated by default because this inflates the code size
649 # Used to allow propagation of C++ exceptions through the library
650 #
651 CFLAGS="${CFLAGS} -fexceptions"
652 fi
653
654 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"
655 case "${host}" in
656 alpha*-*-linux* )
657 CFLAGS="${CFLAGS} -mieee"
658 ;;
659 alpha*-*-osf* )
660 CFLAGS="${CFLAGS} -mieee"
661 ;;
662 esac
663 fi
664 case ${host} in
665 *-*-solaris*)
666 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
667 ;;
668 hppa*-hp-mpeix)
669 NEED_TRIO=1
670 ;;
671 *-*-mingw* | *-*-cygwin* | *-*-msvc* )
672 # If the host is Windows, and shared libraries are disabled, we
673 # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
674 # work properly (without it, xmlexports.h would force the use of
675 # DLL imports, which obviously aren't present in a static
676 # library).
677 if test "x$enable_shared" = "xno"; then
678 XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
679 CFLAGS="$CFLAGS -DLIBXML_STATIC"
680 fi
681 ;;
682 esac
683
684
685 dnl
686 dnl check for python
687 dnl
688
689 PYTHON_VERSION=
690 PYTHON_INCLUDES=
691 PYTHON_SITE_PACKAGES=
692 PYTHON_TESTS=
693 pythondir=
694 if test "$with_python" != "no" ; then
695 if test -x "$with_python/bin/python"
696 then
697 echo Found python in $with_python/bin/python
698 PYTHON="$with_python/bin/python"
699 else
700 if test -x "$with_python"
701 then
702 echo Found python in $with_python
703 PYTHON="$with_python"
704 else
705 if test -x "$PYTHON"
706 then
707 echo Found python in environment PYTHON=$PYTHON
708 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
709 else
710 AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
711 fi
712 fi
713 fi
714 if test "$PYTHON" != ""
715 then
716 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
717 echo Found Python version $PYTHON_VERSION
718 fi
719 if test "$PYTHON_VERSION" != ""
720 then
721 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
722 -d $with_python/lib/python$PYTHON_VERSION/site-packages
723 then
724 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
725 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
726 else
727 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
728 then
729 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
730 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
731 else
732 if test -r /usr/include/python$PYTHON_VERSION/Python.h
733 then
734 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
735 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
736 else
737 echo could not find python$PYTHON_VERSION/Python.h
738 fi
739 fi
740 if test ! -d "$PYTHON_SITE_PACKAGES"
741 then
742 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
743 fi
744 fi
745 PYTHON_LIBS=`python$PYTHON_VERSION-config --libs`
746 fi
747 if test "$with_python" != ""
748 then
749 pythondir='$(PYTHON_SITE_PACKAGES)'
750 else
751 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
752 fi
753 else
754 PYTHON=
755 fi
756 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
757 if test "$PYTHON_INCLUDES" != ""
758 then
759 PYTHON_SUBDIR=python
760 else
761 PYTHON_SUBDIR=
762 fi
763 AC_SUBST(pythondir)
764 AC_SUBST(PYTHON_SUBDIR)
765 AC_SUBST(PYTHON_LIBS)
766
767 dnl check for dso support
768 WITH_MODULES=0
769 TEST_MODULES=
770
771 if test "$with_modules" != "no" ; then
772 case "$host" in
773 *-*-cygwin*)
774 MODULE_EXTENSION=".dll"
775 AC_CHECK_LIB(cygwin, dlopen, [
776 WITH_MODULES=1
777 MODULE_PLATFORM_LIBS=
778 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
779 ])
780 ;;
781 *)
782 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
783 AC_CHECK_LIB(dld, shl_load, [
784 MODULE_PLATFORM_LIBS="-ldld"
785 libxml_have_shl_load=yes], [
786 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
787 AC_CHECK_LIB(dl, dlopen, [
788 MODULE_PLATFORM_LIBS="-ldl"
789 libxml_have_dlopen=yes])])])])
790
791 if test "${libxml_have_shl_load}" = "yes"; then
792 MODULE_EXTENSION=".sl"
793 WITH_MODULES=1
794 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
795 fi
796
797 if test "${libxml_have_dlopen}" = "yes"; then
798 case "${host}" in
799 *-*-hpux* )
800 MODULE_EXTENSION=".sl"
801 ;;
802 * )
803 MODULE_EXTENSION=".so"
804 ;;
805 esac
806
807 WITH_MODULES=1
808 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
809 fi
810 ;;
811 esac
812 fi
813
814 if test "${WITH_MODULES}" = "1"; then
815 TEST_MODULES="ModuleTests"
816 fi
817
818 AC_SUBST(WITH_MODULES)
819 AC_SUBST(MODULE_PLATFORM_LIBS)
820 AC_SUBST(MODULE_EXTENSION)
821 AC_SUBST(TEST_MODULES)
822
823 dnl
824 dnl Tester makes use of readline if present
825 dnl
826
827 dnl
828 dnl specific tests to setup DV and Bill's devel environments with debug etc ...
829 dnl (-Wunreachable-code)
830 dnl
831 if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
832 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
833 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
834 then
835 if test "$with_minimum" != "yes"
836 then
837 if test "${with_mem_debug}" = "" ; then
838 echo Activating memory debugging
839 with_mem_debug="yes"
840 with_run_debug="yes"
841 fi
842 if test "${with_docbook}" = "" ; then
843 with_docbook="yes"
844 fi
845 fi
846 if test "${GCC}" = "yes" ; then
847 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"
848 fi
849 STATIC_BINARIES="-static"
850 dnl -Wcast-qual -ansi
851 else
852 STATIC_BINARIES=
853 fi
854 AC_SUBST(STATIC_BINARIES)
855
856 dnl
857 dnl Check for trio string functions
858 dnl
859
860 if test "${NEED_TRIO}" = "1" ; then
861 echo Adding trio library for string functions
862 WITH_TRIO=1
863 else
864 WITH_TRIO=0
865 fi
866 AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
867 AC_SUBST(WITH_TRIO)
868
869 dnl
870 dnl Allow to enable/disable various pieces
871 dnl
872 echo Checking configuration requirements
873
874 dnl
875 dnl Thread-related stuff
876 dnl
877 THREAD_LIBS=""
878 BASE_THREAD_LIBS=""
879 WITH_THREADS=0
880 THREAD_CFLAGS=""
881 TEST_THREADS=""
882 THREADS_W32=""
883
884 if test "$with_threads" = "no" ; then
885 echo Disabling multithreaded support
886 else
887 echo Enabling multithreaded support
888 dnl Use pthread by default
889 if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then
890 AC_CHECK_HEADER(pthread.h,
891 AC_CHECK_LIB(pthread, pthread_join,[
892 THREAD_LIBS="-lpthread"
893 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
894 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
895 WITH_THREADS="1"]))
896 fi
897 case $host_os in
898 *mingw32*) if test "$THREAD_LIBS" != "-lpthread"; then
899 WITH_THREADS="1"
900 THREADS_W32="Win32"
901 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
902 fi
903 ;;
904 *cygwin*) THREAD_LIBS=""
905 ;;
906 *beos*) WITH_THREADS="1"
907 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
908 ;;
909 *linux*)
910 if test "${GCC}" = "yes" ; then
911 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
912 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
913 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
914 if test "${THREAD_LIBS}" = "-lpthread" ; then
915 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
916 then
917 THREAD_LIBS=""
918 BASE_THREAD_LIBS="-lpthread"
919 else
920 if expr ${GCC_MAJOR} \> 3 > /dev/null
921 then
922 THREAD_LIBS=""
923 BASE_THREAD_LIBS="-lpthread"
924 else
925 echo old GCC disabling weak symbols for pthread
926 fi
927 fi
928 fi
929 fi
930 ;;
931 esac
932 if test "$WITH_THREADS" = "1" ; then
933 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
934 TEST_THREADS="Threadtests"
935 fi
936 fi
937 if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
938 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
939 fi
940
941 AC_SUBST(THREAD_LIBS)
942 AC_SUBST(BASE_THREAD_LIBS)
943 AC_SUBST(WITH_THREADS)
944 AC_SUBST(THREAD_CFLAGS)
945 AC_SUBST(TEST_THREADS)
946 AC_SUBST(THREADS_W32)
947
948 dnl
949 dnl xmllint shell history
950 dnl
951 if test "$with_history" = "yes" ; then
952 echo Enabling xmllint shell history
953 dnl check for terminal library. this is a very cool solution
954 dnl from octave's configure.in
955 unset tcap
956 for termlib in ncurses curses termcap terminfo termlib; do
957 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
958 test -n "$tcap" && break
959 done
960
961 AC_CHECK_HEADER(readline/history.h,
962 AC_CHECK_LIB(history, append_history,[
963 RDL_LIBS="-lhistory"
964 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
965 AC_CHECK_HEADER(readline/readline.h,
966 AC_CHECK_LIB(readline, readline,[
967 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
968 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
969 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
970 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
971 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
972 fi
973 fi
974
975 dnl
976 dnl Tree functions
977 dnl
978 if test "$with_tree" = "no" ; then
979 echo Disabling DOM like tree manipulation APIs
980 WITH_TREE=0
981 else
982 WITH_TREE=1
983 fi
984 AC_SUBST(WITH_TREE)
985
986 if test "$with_ftp" = "no" ; then
987 echo Disabling FTP support
988 WITH_FTP=0
989 FTP_OBJ=
990 else
991 WITH_FTP=1
992 FTP_OBJ=nanoftp.o
993 fi
994 AC_SUBST(WITH_FTP)
995 AC_SUBST(FTP_OBJ)
996
997 if test "$with_http" = "no" ; then
998 echo Disabling HTTP support
999 WITH_HTTP=0
1000 HTTP_OBJ=
1001 else
1002 WITH_HTTP=1
1003 HTTP_OBJ=nanohttp.o
1004 fi
1005 AC_SUBST(WITH_HTTP)
1006 AC_SUBST(HTTP_OBJ)
1007
1008 if test "$with_legacy" = "no" ; then
1009 echo Disabling deprecated APIs
1010 WITH_LEGACY=0
1011 else
1012 WITH_LEGACY=1
1013 fi
1014 AC_SUBST(WITH_LEGACY)
1015
1016 if test "$with_reader" = "no" ; then
1017 echo Disabling the xmlReader parsing interface
1018 WITH_READER=0
1019 READER_TEST=
1020 else
1021 WITH_READER=1
1022 READER_TEST=Readertests
1023 if test "$with_push" = "no" ; then
1024 echo xmlReader requires Push interface - enabling it
1025 with_push=yes
1026 fi
1027 fi
1028 AC_SUBST(WITH_READER)
1029 AC_SUBST(READER_TEST)
1030
1031 if test "$with_writer" = "no" ; then
1032 echo Disabling the xmlWriter saving interface
1033 WITH_WRITER=0
1034 # WRITER_TEST=
1035 else
1036 WITH_WRITER=1
1037 # WRITER_TEST=Writertests
1038 if test "$with_push" = "no" ; then
1039 echo xmlWriter requires Push interface - enabling it
1040 with_push=yes
1041 fi
1042 if test "$with_output" = "no" ; then
1043 echo xmlWriter requires Output interface - enabling it
1044 with_output=yes
1045 fi
1046 fi
1047 AC_SUBST(WITH_WRITER)
1048 #AC_SUBST(WRITER_TEST)
1049
1050 if test "$with_pattern" = "no" ; then
1051 echo Disabling the xmlPattern parsing interface
1052 WITH_PATTERN=0
1053 TEST_PATTERN=
1054 else
1055 WITH_PATTERN=1
1056 TEST_PATTERN=Patterntests
1057 fi
1058 AC_SUBST(WITH_PATTERN)
1059 AC_SUBST(TEST_PATTERN)
1060
1061 if test "$with_sax1" = "no" ; then
1062 echo Disabling the older SAX1 interface
1063 WITH_SAX1=0
1064 TEST_SAX=
1065 else
1066 WITH_SAX1=1
1067 TEST_SAX=SAXtests
1068 fi
1069 AC_SUBST(WITH_SAX1)
1070 AC_SUBST(TEST_SAX)
1071
1072 if test "$with_push" = "no" ; then
1073 echo Disabling the PUSH parser interfaces
1074 WITH_PUSH=0
1075 TEST_PUSH=
1076 else
1077 WITH_PUSH=1
1078 TEST_PUSH="XMLPushtests"
1079 fi
1080 AC_SUBST(WITH_PUSH)
1081 AC_SUBST(TEST_PUSH)
1082
1083 if test "$with_html" = "no" ; then
1084 echo Disabling HTML support
1085 WITH_HTML=0
1086 HTML_OBJ=
1087 TEST_HTML=
1088 else
1089 WITH_HTML=1
1090 HTML_OBJ="HTMLparser.o HTMLtree.o"
1091 TEST_HTML=HTMLtests
1092 if test "$with_push" != "no" ; then
1093 TEST_PHTML=HTMLPushtests
1094 else
1095 TEST_PHTML=
1096 fi
1097 fi
1098 AC_SUBST(WITH_HTML)
1099 AC_SUBST(HTML_OBJ)
1100 AC_SUBST(TEST_HTML)
1101 AC_SUBST(TEST_PHTML)
1102
1103 if test "$with_valid" = "no" ; then
1104 echo Disabling DTD validation support
1105 WITH_VALID=0
1106 TEST_VALID=
1107 TEST_VTIME=
1108 else
1109 WITH_VALID=1
1110 TEST_VALID=Validtests
1111 TEST_VTIME=VTimingtests
1112 fi
1113 AC_SUBST(WITH_VALID)
1114 AC_SUBST(TEST_VALID)
1115 AC_SUBST(TEST_VTIME)
1116
1117 if test "$with_catalog" = "no" ; then
1118 echo Disabling Catalog support
1119 WITH_CATALOG=0
1120 CATALOG_OBJ=
1121 TEST_CATALOG=
1122 else
1123 WITH_CATALOG=1
1124 CATALOG_OBJ="catalog.o"
1125 TEST_CATALOG=Catatests
1126 fi
1127 AC_SUBST(WITH_CATALOG)
1128 AC_SUBST(CATALOG_OBJ)
1129 AC_SUBST(TEST_CATALOG)
1130
1131 if test "$with_docbook" = "no" ; then
1132 echo Disabling Docbook support
1133 WITH_DOCB=0
1134 DOCB_OBJ=
1135 else
1136 WITH_DOCB=1
1137 DOCB_OBJ="DOCBparser.o"
1138 fi
1139 AC_SUBST(WITH_DOCB)
1140 AC_SUBST(DOCB_OBJ)
1141
1142
1143 if test "$with_xptr" = "no" ; then
1144 echo Disabling XPointer support
1145 WITH_XPTR=0
1146 XPTR_OBJ=
1147 TEST_XPTR=
1148 else
1149 WITH_XPTR=1
1150 XPTR_OBJ=xpointer.o
1151 TEST_XPTR=XPtrtests
1152 if test "$with_xpath" = "no" ; then
1153 echo XPointer requires XPath support - enabling it
1154 with_xpath=yes
1155 fi
1156 fi
1157 AC_SUBST(WITH_XPTR)
1158 AC_SUBST(XPTR_OBJ)
1159 AC_SUBST(TEST_XPTR)
1160
1161 if test "$with_c14n" = "no" ; then
1162 echo Disabling C14N support
1163 WITH_C14N=0
1164 C14N_OBJ=
1165 TEST_C14N=
1166 else
1167 WITH_C14N=1
1168 C14N_OBJ="c14n.c"
1169 TEST_C14N=C14Ntests
1170 if test "$with_xpath" = "no" ; then
1171 echo C14N requires XPath support - enabling it
1172 with_xpath=yes
1173 fi
1174 fi
1175 AC_SUBST(WITH_C14N)
1176 AC_SUBST(C14N_OBJ)
1177 AC_SUBST(TEST_C14N)
1178
1179 if test "$with_xinclude" = "no" ; then
1180 echo Disabling XInclude support
1181 WITH_XINCLUDE=0
1182 XINCLUDE_OBJ=
1183 with_xinclude="no"
1184 TEST_XINCLUDE=
1185 else
1186 WITH_XINCLUDE=1
1187 XINCLUDE_OBJ=xinclude.o
1188 TEST_XINCLUDE=XIncludetests
1189 if test "$with_xpath" = "no" ; then
1190 echo XInclude requires XPath support - enabling it
1191 with_xpath=yes
1192 fi
1193 fi
1194 AC_SUBST(WITH_XINCLUDE)
1195 AC_SUBST(XINCLUDE_OBJ)
1196 AC_SUBST(TEST_XINCLUDE)
1197
1198 if test "$with_xpath" = "no" ; then
1199 echo Disabling XPATH support
1200 WITH_XPATH=0
1201 XPATH_OBJ=
1202 TEST_XPATH=
1203 else
1204 WITH_XPATH=1
1205 XPATH_OBJ=xpath.o
1206 TEST_XPATH=XPathtests
1207 fi
1208 AC_SUBST(WITH_XPATH)
1209 AC_SUBST(XPATH_OBJ)
1210 AC_SUBST(TEST_XPATH)
1211
1212 dnl
1213 dnl output functions
1214 dnl
1215 if test "$with_output" = "no" ; then
1216 echo Disabling serialization/saving support
1217 WITH_OUTPUT=0
1218 else
1219 WITH_OUTPUT=1
1220 fi
1221 AC_SUBST(WITH_OUTPUT)
1222
1223 WITH_ICONV=0
1224 if test "$with_iconv" = "no" ; then
1225 echo Disabling ICONV support
1226 else
1227 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
1228 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
1229 # Export this since our headers include iconv.h
1230 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
1231 ICONV_LIBS="-L$with_iconv/lib"
1232 fi
1233
1234 AC_CHECK_HEADER(iconv.h,
1235 AC_MSG_CHECKING(for iconv)
1236 AC_TRY_LINK([#include <stdlib.h>
1237 #include <iconv.h>],[
1238 iconv_t cd = iconv_open ("","");
1239 iconv (cd, NULL, NULL, NULL, NULL);],[
1240 AC_MSG_RESULT(yes)
1241 WITH_ICONV=1],[
1242 AC_MSG_RESULT(no)
1243 AC_MSG_CHECKING(for iconv in -liconv)
1244
1245 _ldflags="${LDFLAGS}"
1246 _libs="${LIBS}"
1247 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1248 LIBS="${LIBS} -liconv"
1249
1250 AC_TRY_LINK([#include <stdlib.h>
1251 #include <iconv.h>],[
1252 iconv_t cd = iconv_open ("","");
1253 iconv (cd, NULL, NULL, NULL, NULL);],[
1254 AC_MSG_RESULT(yes)
1255 WITH_ICONV=1
1256 ICONV_LIBS="${ICONV_LIBS} -liconv"
1257 LIBS="${_libs}"
1258 LDFLAGS="${_ldflags}"],[
1259 AC_MSG_RESULT(no)
1260 LIBS="${_libs}"
1261 LDFLAGS="${_ldflags}"])]))
1262
1263 if test "$WITH_ICONV" = "1" ; then
1264 AC_MSG_CHECKING([for iconv declaration])
1265 AC_CACHE_VAL(xml_cv_iconv_arg2, [
1266 AC_TRY_COMPILE([#include <stdlib.h>
1267 #include <iconv.h>
1268 extern
1269 #ifdef __cplusplus
1270 "C"
1271 #endif
1272 #if defined(__STDC__) || defined(__cplusplus)
1273 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1274 #else
1275 size_t iconv();
1276 #endif
1277 ], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
1278
1279 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);"
1280 AC_MSG_RESULT([${xml_xxx:-
1281 }$xml_cv_iconv_decl])
1282 AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
1283 [Define as const if the declaration of iconv() needs const.])
1284 fi
1285 fi
1286 case "$host" in
1287 *mingw*) M_LIBS=""
1288 ;;
1289 *beos*) M_LIBS=""
1290 ;;
1291 *haiku*) M_LIBS=""
1292 ;;
1293 *) M_LIBS="-lm"
1294 ;;
1295 esac
1296 XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
1297 XML_LIBTOOLLIBS="libxml2.la"
1298 AC_SUBST(WITH_ICONV)
1299
1300 WITH_ISO8859X=1
1301 if test "$WITH_ICONV" != "1" ; then
1302 if test "$with_iso8859x" = "no" ; then
1303 echo Disabling ISO8859X support
1304 WITH_ISO8859X=0
1305 fi
1306 fi
1307 AC_SUBST(WITH_ISO8859X)
1308
1309 if test "$with_schematron" = "no" ; then
1310 echo "Disabling Schematron support"
1311 WITH_SCHEMATRON=0
1312 TEST_SCHEMATRON=
1313 else
1314 echo "Enabled Schematron support"
1315 WITH_SCHEMATRON=1
1316 TEST_SCHEMATRON="Schematrontests"
1317 with_xpath=yes
1318 with_pattern=yes
1319 fi
1320 AC_SUBST(WITH_SCHEMATRON)
1321 AC_SUBST(TEST_SCHEMATRON)
1322
1323 if test "$with_schemas" = "no" ; then
1324 echo "Disabling Schemas/Relax-NG support"
1325 WITH_SCHEMAS=0
1326 TEST_SCHEMAS=
1327 else
1328 echo "Enabled Schemas/Relax-NG support"
1329 WITH_SCHEMAS=1
1330 TEST_SCHEMAS="Schemastests Relaxtests"
1331 if test "$PYTHON_INCLUDES" != "" ; then
1332 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1333 fi
1334 with_regexps=yes
1335 fi
1336 AC_SUBST(WITH_SCHEMAS)
1337 AC_SUBST(TEST_SCHEMAS)
1338
1339 if test "$with_regexps" = "no" ; then
1340 echo Disabling Regexps support
1341 WITH_REGEXPS=0
1342 TEST_REGEXPS=
1343 else
1344 WITH_REGEXPS=1
1345 TEST_REGEXPS="Regexptests Automatatests"
1346 fi
1347 AC_SUBST(WITH_REGEXPS)
1348 AC_SUBST(TEST_REGEXPS)
1349
1350 if test "$with_debug" = "no" ; then
1351 echo Disabling DEBUG support
1352 WITH_DEBUG=0
1353 DEBUG_OBJ=
1354 TEST_DEBUG=
1355 else
1356 WITH_DEBUG=1
1357 DEBUG_OBJ=debugXML.o
1358 TEST_DEBUG=Scripttests
1359 fi
1360 AC_SUBST(WITH_DEBUG)
1361 AC_SUBST(DEBUG_OBJ)
1362 AC_SUBST(TEST_DEBUG)
1363
1364 if test "$with_mem_debug" = "yes" ; then
1365 if test "$with_thread_alloc" = "yes" ; then
1366 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1367 WITH_MEM_DEBUG=0
1368 else
1369 echo Enabling memory debug support
1370 WITH_MEM_DEBUG=1
1371 fi
1372 else
1373 WITH_MEM_DEBUG=0
1374 fi
1375 AC_SUBST(WITH_MEM_DEBUG)
1376
1377 if test "$with_run_debug" = "yes" ; then
1378 echo Enabling runtime debug support
1379 WITH_RUN_DEBUG=1
1380 else
1381 WITH_RUN_DEBUG=0
1382 fi
1383 AC_SUBST(WITH_RUN_DEBUG)
1384
1385 WIN32_EXTRA_LIBADD=
1386 WIN32_EXTRA_LDFLAGS=
1387 CYGWIN_EXTRA_LDFLAGS=
1388 CYGWIN_EXTRA_PYTHON_LIBADD=
1389 case "$host" in
1390 *-*-mingw*)
1391 CPPFLAGS="$CPPFLAGS -DWIN32"
1392 WIN32_EXTRA_LIBADD="-lws2_32"
1393 WIN32_EXTRA_LDFLAGS="-no-undefined"
1394 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1395 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1396 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1397 ;;
1398 *-*-cygwin*)
1399 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
1400 if test "${PYTHON}" != ""
1401 then
1402 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1403 fi
1404 ;;
1405 esac
1406 AC_SUBST(WIN32_EXTRA_LIBADD)
1407 AC_SUBST(WIN32_EXTRA_LDFLAGS)
1408 AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1409 AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
1410
1411 if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
1412 then
1413 echo Enabling code coverage for GCC
1414 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
1415 LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
1416 else
1417 echo Disabling code coverage for GCC
1418 fi
1419
1420 AC_SUBST(CPPFLAGS)
1421 AC_SUBST(CFLAGS)
1422 AC_SUBST(LDFLAGS)
1423 AC_SUBST(XML_CFLAGS)
1424
1425 AC_SUBST(XML_LIBDIR)
1426 AC_SUBST(XML_LIBS)
1427 AC_SUBST(XML_LIBTOOLLIBS)
1428 AC_SUBST(ICONV_LIBS)
1429 AC_SUBST(XML_INCLUDEDIR)
1430 AC_SUBST(HTML_DIR)
1431 AC_SUBST(HAVE_ISNAN)
1432 AC_SUBST(HAVE_ISINF)
1433 AC_SUBST(PYTHON)
1434 AC_SUBST(PYTHON_VERSION)
1435 AC_SUBST(PYTHON_INCLUDES)
1436 AC_SUBST(PYTHON_SITE_PACKAGES)
1437
1438 AC_SUBST(M_LIBS)
1439 AC_SUBST(RDL_LIBS)
1440
1441 dnl for the spec file
1442 RELDATE=`date +'%a %b %e %Y'`
1443 AC_SUBST(RELDATE)
1444 AC_SUBST(PYTHON_TESTS)
1445
1446 rm -f COPYING.LIB COPYING
1447 ln -s Copyright COPYING
1448
1449 # keep on one line for cygwin c.f. #130896
1450 AC_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)
1451
1452 chmod +x xml2-config python/setup.py
1453 echo Done configuring