1 dnl Process this file with autoconf to produce a configure script.
3 AM_CONFIG_HEADER(config.h)
4 AC_CONFIG_MACRO_DIR([m4])
10 LIBXML_MICRO_VERSION_SUFFIX=
11 LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
12 LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
14 LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
16 if test -f CVS/Entries ; then
17 extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
19 if test "$extra" != ""
21 LIBXML_VERSION_EXTRA="-CVS$extra"
23 else if test -d .svn ; then
24 extra=`svn info | grep Revision | sed 's+Revision: ++'`
26 if test "$extra" != ""
28 LIBXML_VERSION_EXTRA="-SVN$extra"
30 else if test -d .git ; then
31 extra=`git describe | sed 's+LIBXML[[0-9.]]*-++'`
33 if test "$extra" != ""
35 LIBXML_VERSION_EXTRA="-GIT$extra"
40 AC_SUBST(LIBXML_MAJOR_VERSION)
41 AC_SUBST(LIBXML_MINOR_VERSION)
42 AC_SUBST(LIBXML_MICRO_VERSION)
43 AC_SUBST(LIBXML_VERSION)
44 AC_SUBST(LIBXML_VERSION_INFO)
45 AC_SUBST(LIBXML_VERSION_NUMBER)
46 AC_SUBST(LIBXML_VERSION_EXTRA)
48 VERSION=${LIBXML_VERSION}
50 AM_INIT_AUTOMAKE(libxml2, $VERSION)
52 dnl Checks for programs.
56 AC_PATH_PROG(RM, rm, /bin/rm)
57 AC_PATH_PROG(MV, mv, /bin/mv)
58 AC_PATH_PROG(TAR, tar, /bin/tar)
59 AC_PATH_PROG(PERL, perl, /usr/bin/perl)
60 AC_PATH_PROG(WGET, wget, /usr/bin/wget)
61 AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
62 AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
64 dnl Make sure we have an ANSI compiler
66 test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
72 dnl if the system support linker version scripts for symbol versioning
76 # lt_cv_prog_gnu_ld is from libtool 2.+
77 if test "$lt_cv_prog_gnu_ld" = yes; then
78 VERSION_SCRIPT_FLAGS=-Wl,--version-script=
81 *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
84 AC_SUBST(VERSION_SCRIPT_FLAGS)
85 AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
88 dnl We process the AC_ARG_WITH first so that later we can modify
89 dnl some of them to try to prevent impossible combinations. This
90 dnl also allows up so alphabetize the choices
94 dnl zlib option might change flags, so we save them initially
96 _cppflags="${CPPFLAGS}"
100 [ --with-c14n add the Canonicalization support (on)])
102 [ --with-catalog add the Catalog support (on)])
104 [ --with-debug add the debugging module (on)])
106 [ --with-docbook add Docbook SGML support (on)])
107 AC_ARG_WITH(fexceptions,
108 [ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
110 [ --with-ftp add the FTP support (on)])
112 [ --with-history add history support to xmllint shell(off)])
114 [ --with-html add the HTML support (on)])
115 dnl Specific dir for HTML output ?
116 AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
117 [path to base html directory, default $datadir/doc/html]),
118 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
120 AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
121 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
122 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
123 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
126 [ --with-http add the HTTP support (on)])
128 [ --with-iconv[[=DIR]] add ICONV support (on)])
129 AC_ARG_WITH(iso8859x,
130 [ --with-iso8859x add ISO8859X support if no iconv (on)])
132 [ --with-legacy add deprecated APIs for compatibility (on)])
133 AC_ARG_WITH(mem_debug,
134 [ --with-mem-debug add the memory debugging module (off)])
136 [ --with-minimum build a minimally sized library (off)])
138 [ --with-output add the serialization support (on)])
140 [ --with-pattern add the xmlPattern selection interface (on)])
142 [ --with-push add the PUSH parser interfaces (on)])
144 [ --with-python[[=DIR]] build Python bindings if found])
146 [ --with-reader add the xmlReader parsing interface (on)])
147 AC_ARG_WITH(readline,
148 [ --with-readline=DIR use readline in DIR],[
149 if test "$withval" != "no" -a "$withval" != "yes"; then
151 CPPFLAGS="${CPPFLAGS} -I$withval/include"
152 LDFLAGS="${LDFLAGS} -L$withval/lib"
156 [ --with-regexps add Regular Expressions support (on)])
157 AC_ARG_WITH(run_debug,
158 [ --with-run-debug add the runtime debugging module (off)])
160 [ --with-sax1 add the older SAX1 interface (on)])
162 [ --with-schemas add Relax-NG and Schemas support (on)])
163 AC_ARG_WITH(schematron,
164 [ --with-schematron add Schematron support (on)])
166 [ --with-threads add multithread support(on)])
167 AC_ARG_WITH(thread-alloc,
168 [ --with-thread-alloc add per-thread memory(off)])
170 [ --with-tree add the DOM like tree manipulation APIs (on)])
172 [ --with-valid add the DTD validation support (on)])
174 [ --with-writer add the xmlWriter saving interface (on)])
175 AC_ARG_WITH(xinclude,
176 [ --with-xinclude add the XInclude support (on)])
178 [ --with-xpath add the XPATH support (on)])
180 [ --with-xptr add the XPointer support (on)])
182 [ --with-modules add the dynamic modules support (on)])
184 [ --with-zlib[[=DIR]] use libz in DIR],[
185 if test "$withval" != "no" -a "$withval" != "yes"; then
187 CPPFLAGS="${CPPFLAGS} -I$withval/include"
188 LDFLAGS="${LDFLAGS} -L$withval/lib"
191 AC_ARG_WITH(coverage,
192 [ --with-coverage build for code coverage with GCC (off)])
194 AC_ARG_ENABLE(rebuild-docs,
195 [ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=yes]]])
196 AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"])
199 dnl hard dependancies on options
201 if test "$with_schemas" = "yes"
206 if test "$with_schematron" = "yes"
211 if test "$with_reader" = "yes"
215 if test "$with_xptr" = "yes"
220 dnl option to build a minimal libxml2 library
222 if test "$with_minimum" = "yes"
224 echo "Configuring for a minimal library"
225 if test "$with_c14n" = ""
229 if test "$with_catalog" = ""
234 if test "$with_debug" = ""
238 if test "$with_docbook" = ""
242 if test "$with_fexceptions" = ""
246 if test "$with_ftp" = ""
250 if test "$with_history" = ""
254 if test "$with_html" = ""
258 if test "$with_http" = ""
262 if test "$with_iconv" = ""
266 if test "$with_iso8859x" = ""
270 if test "$with_legacy" = ""
274 if test "$with_mem_debug" = ""
278 if test "$with_output" = ""
282 if test "$with_pattern" = ""
286 if test "$with_push" = ""
290 if test "$with_python" = ""
294 if test "$with_reader" = ""
298 if test "$with_readline" = ""
302 if test "$with_regexps" = ""
306 if test "$with_run_debug" = ""
310 if test "$with_sax1" = ""
314 if test "$with_schemas" = ""
318 if test "$with_schematron" = ""
322 if test "$with_threads" = ""
326 if test "$with_thread_alloc" = ""
330 if test "$with_tree" = ""
334 if test "$with_valid" = ""
338 if test "$with_writer" = ""
342 if test "$with_xinclude" = ""
346 if test "$with_xpath" = ""
350 if test "$with_xptr" = ""
354 if test "$with_zlib" = ""
358 if test "$with_modules" = ""
366 dnl Checks for zlib library.
369 if test "$with_zlib" = "no"; then
370 echo "Disabling compression support"
372 AC_CHECK_HEADERS(zlib.h,
373 AC_CHECK_LIB(z, gzread,[
374 AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
376 if test "x${Z_DIR}" != "x"; then
377 Z_CFLAGS="-I${Z_DIR}/include"
378 Z_LIBS="-L${Z_DIR}/lib -lz"
381 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
393 CPPFLAGS=${_cppflags}
396 echo Checking headers
398 dnl Checks for header files.
401 AC_CHECK_HEADERS([fcntl.h])
402 AC_CHECK_HEADERS([unistd.h])
403 AC_CHECK_HEADERS([ctype.h])
404 AC_CHECK_HEADERS([dirent.h])
405 AC_CHECK_HEADERS([errno.h])
406 AC_CHECK_HEADERS([malloc.h])
407 AC_CHECK_HEADERS([stdarg.h])
408 AC_CHECK_HEADERS([sys/stat.h])
409 AC_CHECK_HEADERS([sys/types.h])
410 AC_CHECK_HEADERS([stdint.h])
411 AC_CHECK_HEADERS([inttypes.h.h])
412 AC_CHECK_HEADERS([time.h])
413 AC_CHECK_HEADERS([ansidecl.h])
414 AC_CHECK_HEADERS([ieeefp.h])
415 AC_CHECK_HEADERS([nan.h])
416 AC_CHECK_HEADERS([math.h])
417 AC_CHECK_HEADERS([limits.h])
418 AC_CHECK_HEADERS([fp_class.h])
419 AC_CHECK_HEADERS([float.h])
420 AC_CHECK_HEADERS([stdlib.h])
421 AC_CHECK_HEADERS([sys/socket.h], [], [],
422 [#if HAVE_SYS_TYPES_H
423 # include <sys/types.h>
426 AC_CHECK_HEADERS([netinet/in.h], [], [],
427 [#if HAVE_SYS_TYPES_H
428 # include <sys/types.h>
431 AC_CHECK_HEADERS([arpa/inet.h], [], [],
432 [#if HAVE_SYS_TYPES_H
433 # include <sys/types.h>
436 # include <arpa/inet.h>
439 AC_CHECK_HEADERS([netdb.h])
440 AC_CHECK_HEADERS([sys/time.h])
441 AC_CHECK_HEADERS([sys/select.h])
442 AC_CHECK_HEADERS([poll.h])
443 AC_CHECK_HEADERS([sys/mman.h])
444 AC_CHECK_HEADERS([sys/timeb.h])
445 AC_CHECK_HEADERS([signal.h])
446 AC_CHECK_HEADERS([arpa/nameser.h], [], [],
447 [#if HAVE_SYS_TYPES_H
448 # include <sys/types.h>
451 AC_CHECK_HEADERS([resolv.h], [], [],
452 [#if HAVE_SYS_TYPES_H
453 # include <sys/types.h>
455 #if HAVE_NETINET_IN_H
456 # include <netinet/in.h>
458 #if HAVE_ARPA_NAMESER_H
459 # include <arpa/nameser.h>
462 AC_CHECK_HEADERS([dl.h])
463 AC_CHECK_HEADERS([dlfcn.h])
466 echo Checking libraries
468 dnl Checks for library functions.
470 AC_CHECK_FUNCS(strdup strndup strerror)
471 AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
472 AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
473 AC_CHECK_FUNCS(stat _stat signal)
475 dnl Checking the standard string functions availability
476 AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
479 dnl Checking for va_copy availability
480 AC_MSG_CHECKING([for va_copy])
481 AC_TRY_LINK([#include <stdarg.h>
482 va_list ap1,ap2;], [va_copy(ap1,ap2);],
485 AC_MSG_RESULT($have_va_copy)
486 if test x"$have_va_copy" = x"yes"; then
487 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
489 AC_MSG_CHECKING([for __va_copy])
490 AC_TRY_LINK([#include <stdarg.h>
491 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
494 AC_MSG_RESULT($have___va_copy)
495 if test x"$have___va_copy" = x"yes"; then
496 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
500 dnl Checks for inet libraries:
501 AC_SEARCH_LIBS(gethostent, [nsl])
502 AC_SEARCH_LIBS(setsockopt, [socket net network])
503 AC_SEARCH_LIBS(connect, [inet])
505 dnl Determine what socket length (socklen_t) data type is
506 AC_MSG_CHECKING([for type of socket length (socklen_t)])
509 #include <sys/types.h>
510 #include <sys/socket.h>],[
511 (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
512 AC_MSG_RESULT(socklen_t *)
513 XML_SOCKLEN_T=socklen_t],[
516 #include <sys/types.h>
517 #include <sys/socket.h>],[
518 (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
519 AC_MSG_RESULT(size_t *)
520 XML_SOCKLEN_T=size_t],[
523 #include <sys/types.h>
524 #include <sys/socket.h>],[
525 (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
528 AC_MSG_WARN(could not determine)
529 XML_SOCKLEN_T="int"])])])
530 AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
532 dnl ***********************Checking for availability of IPv6*******************
534 AC_MSG_CHECKING([whether to enable IPv6])
535 AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
536 if test "$with_minimum" = "yes"
540 if test $enable_ipv6 = yes; then
543 #include <sys/types.h>
544 #include <sys/socket.h>
546 struct sockaddr_storage ss;
547 socket(AF_INET6, SOCK_STREAM, 0)
552 AC_MSG_RESULT($have_ipv6)
554 if test $have_ipv6 = yes; then
555 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
556 have_broken_ss_family=no
558 dnl *********************************************************************
559 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
560 dnl a ss_family member, but rather __ss_family. Let's detect that
561 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
562 dnl platforms. However, we should only do this if ss_family is not
564 dnl ********************************************************************
565 AC_MSG_CHECKING([struct sockaddr::ss_family])
567 #include <sys/types.h>
568 #include <sys/socket.h>
570 struct sockaddr_storage ss ;
576 AC_MSG_RESULT($have_ss_family)
577 if test x$have_ss_family = xno ; then
578 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
580 #include <sys/types.h>
581 #include <sys/socket.h>
583 struct sockaddr_storage ss ;
586 have_broken_ss_family=yes,
587 have_broken_ss_family=no
589 AC_MSG_RESULT($have_broken_ss_family)
590 if test x$have_broken_ss_family = xyes ; then
591 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
592 [Whether struct sockaddr::__ss_family exists])
593 AC_DEFINE(ss_family, __ss_family,
594 [ss_family is not defined here, use __ss_family instead])
596 AC_MSG_WARN(ss_family and __ss_family not found)
601 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
602 if test $have_getaddrinfo != yes; then
603 for lib in bsd socket inet; do
604 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
608 if test $have_getaddrinfo = yes; then
609 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
614 dnl ******************************End IPv6 checks******************************
616 dnl Checks for isnan in libm if not in libc
617 AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
618 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
620 AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
621 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
623 XML_LIBDIR='-L${libdir}'
624 XML_INCLUDEDIR='-I${includedir}/libxml2'
633 dnl Workaround for native compilers
634 dnl HP : http://bugs.gnome.org/db/31/3163.html
635 dnl DEC : Enable NaN/Inf
637 if test "${GCC}" != "yes" ; then
640 CFLAGS="${CFLAGS} -Wp,-H30000"
643 CFLAGS="${CFLAGS} -ieee"
646 CFLAGS="${CFLAGS} -ieee"
650 if test "$with_fexceptions" = "yes"
653 # Not activated by default because this inflates the code size
654 # Used to allow propagation of C++ exceptions through the library
656 CFLAGS="${CFLAGS} -fexceptions"
659 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"
662 CFLAGS="${CFLAGS} -mieee"
665 CFLAGS="${CFLAGS} -mieee"
671 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
676 *-*-mingw* | *-*-cygwin* | *-*-msvc* )
677 # If the host is Windows, and shared libraries are disabled, we
678 # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
679 # work properly (without it, xmlexports.h would force the use of
680 # DLL imports, which obviously aren't present in a static
682 if test "x$enable_shared" = "xno"; then
683 XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
684 CFLAGS="$CFLAGS -DLIBXML_STATIC"
696 PYTHON_SITE_PACKAGES=
699 if test "$with_python" != "no" ; then
700 if test -x "$with_python/bin/python"
702 echo Found python in $with_python/bin/python
703 PYTHON="$with_python/bin/python"
705 if test -x "$with_python"
707 echo Found python in $with_python
708 PYTHON="$with_python"
712 echo Found python in environment PYTHON=$PYTHON
713 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
715 AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
719 if test "$PYTHON" != ""
721 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
722 echo Found Python version $PYTHON_VERSION
724 if test "$PYTHON_VERSION" != ""
726 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
727 -d $with_python/lib/python$PYTHON_VERSION/site-packages
729 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
730 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
732 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
734 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
735 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
737 if test -r /usr/include/python$PYTHON_VERSION/Python.h
739 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
740 PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
742 echo could not find python$PYTHON_VERSION/Python.h
745 if test ! -d "$PYTHON_SITE_PACKAGES"
747 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
750 PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
752 if test "$with_python" != ""
754 pythondir='$(PYTHON_SITE_PACKAGES)'
756 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
761 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
762 if test "$PYTHON_INCLUDES" != ""
769 AC_SUBST(PYTHON_SUBDIR)
770 AC_SUBST(PYTHON_LIBS)
772 dnl check for dso support
776 if test "$with_modules" != "no" ; then
779 MODULE_EXTENSION=".dll"
780 AC_CHECK_LIB(cygwin, dlopen, [
782 MODULE_PLATFORM_LIBS=
783 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
787 MODULE_EXTENSION=".dll"
791 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
792 AC_CHECK_LIB(dld, shl_load, [
793 MODULE_PLATFORM_LIBS="-ldld"
794 libxml_have_shl_load=yes], [
795 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
796 AC_CHECK_LIB(dl, dlopen, [
797 MODULE_PLATFORM_LIBS="-ldl"
798 libxml_have_dlopen=yes])])])])
800 if test "${libxml_have_shl_load}" = "yes"; then
801 MODULE_EXTENSION=".sl"
803 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
806 if test "${libxml_have_dlopen}" = "yes"; then
809 MODULE_EXTENSION=".sl"
812 MODULE_EXTENSION=".so"
817 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
823 if test "${WITH_MODULES}" = "1"; then
824 TEST_MODULES="ModuleTests"
827 AC_SUBST(WITH_MODULES)
828 AC_SUBST(MODULE_PLATFORM_LIBS)
829 AC_SUBST(MODULE_EXTENSION)
830 AC_SUBST(TEST_MODULES)
833 dnl Tester makes use of readline if present
837 dnl specific tests to setup DV and Bill's devel environments with debug etc ...
838 dnl (-Wunreachable-code)
840 if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
841 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
842 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
844 if test "$with_minimum" != "yes"
846 if test "${with_mem_debug}" = "" ; then
847 echo Activating memory debugging
851 if test "${with_docbook}" = "" ; then
855 if test "${GCC}" = "yes" ; then
856 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"
858 STATIC_BINARIES="-static"
859 dnl -Wcast-qual -ansi
863 AC_SUBST(STATIC_BINARIES)
866 dnl Check for trio string functions
869 if test "${NEED_TRIO}" = "1" ; then
870 echo Adding trio library for string functions
875 AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
879 dnl Allow to enable/disable various pieces
881 echo Checking configuration requirements
884 dnl Thread-related stuff
893 if test "$with_threads" = "no" ; then
894 echo Disabling multithreaded support
896 echo Enabling multithreaded support
897 dnl Use pthread by default
898 if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then
899 AC_CHECK_HEADER(pthread.h,
900 AC_CHECK_LIB(pthread, pthread_join,[
901 THREAD_LIBS="-lpthread"
902 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
903 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
907 *mingw32*) if test "$THREAD_LIBS" != "-lpthread"; then
910 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
913 *cygwin*) THREAD_LIBS=""
915 *beos*) WITH_THREADS="1"
916 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
919 if test "${GCC}" = "yes" ; then
920 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
921 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
922 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
923 if test "${THREAD_LIBS}" = "-lpthread" ; then
924 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
927 BASE_THREAD_LIBS="-lpthread"
929 if expr ${GCC_MAJOR} \> 3 > /dev/null
932 BASE_THREAD_LIBS="-lpthread"
934 echo old GCC disabling weak symbols for pthread
941 if test "$WITH_THREADS" = "1" ; then
942 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
943 TEST_THREADS="Threadtests"
946 if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
947 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
950 AC_SUBST(THREAD_LIBS)
951 AC_SUBST(BASE_THREAD_LIBS)
952 AC_SUBST(WITH_THREADS)
953 AC_SUBST(THREAD_CFLAGS)
954 AC_SUBST(TEST_THREADS)
955 AC_SUBST(THREADS_W32)
958 dnl xmllint shell history
960 if test "$with_history" = "yes" ; then
961 echo Enabling xmllint shell history
962 dnl check for terminal library. this is a very cool solution
963 dnl from octave's configure.in
965 for termlib in ncurses curses termcap terminfo termlib; do
966 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
967 test -n "$tcap" && break
970 AC_CHECK_HEADER(readline/history.h,
971 AC_CHECK_LIB(history, append_history,[
973 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
974 AC_CHECK_HEADER(readline/readline.h,
975 AC_CHECK_LIB(readline, readline,[
976 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
977 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
978 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
979 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
980 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
987 if test "$with_tree" = "no" ; then
988 echo Disabling DOM like tree manipulation APIs
995 if test "$with_ftp" = "no" ; then
996 echo Disabling FTP support
1006 if test "$with_http" = "no" ; then
1007 echo Disabling HTTP support
1017 if test "$with_legacy" = "no" ; then
1018 echo Disabling deprecated APIs
1023 AC_SUBST(WITH_LEGACY)
1025 if test "$with_reader" = "no" ; then
1026 echo Disabling the xmlReader parsing interface
1031 READER_TEST=Readertests
1032 if test "$with_push" = "no" ; then
1033 echo xmlReader requires Push interface - enabling it
1037 AC_SUBST(WITH_READER)
1038 AC_SUBST(READER_TEST)
1040 if test "$with_writer" = "no" ; then
1041 echo Disabling the xmlWriter saving interface
1046 # WRITER_TEST=Writertests
1047 if test "$with_push" = "no" ; then
1048 echo xmlWriter requires Push interface - enabling it
1051 if test "$with_output" = "no" ; then
1052 echo xmlWriter requires Output interface - enabling it
1056 AC_SUBST(WITH_WRITER)
1057 #AC_SUBST(WRITER_TEST)
1059 if test "$with_pattern" = "no" ; then
1060 echo Disabling the xmlPattern parsing interface
1065 TEST_PATTERN=Patterntests
1067 AC_SUBST(WITH_PATTERN)
1068 AC_SUBST(TEST_PATTERN)
1070 if test "$with_sax1" = "no" ; then
1071 echo Disabling the older SAX1 interface
1081 if test "$with_push" = "no" ; then
1082 echo Disabling the PUSH parser interfaces
1087 TEST_PUSH="XMLPushtests"
1092 if test "$with_html" = "no" ; then
1093 echo Disabling HTML support
1099 HTML_OBJ="HTMLparser.o HTMLtree.o"
1101 if test "$with_push" != "no" ; then
1102 TEST_PHTML=HTMLPushtests
1110 AC_SUBST(TEST_PHTML)
1112 if test "$with_valid" = "no" ; then
1113 echo Disabling DTD validation support
1119 TEST_VALID=Validtests
1120 TEST_VTIME=VTimingtests
1122 AC_SUBST(WITH_VALID)
1123 AC_SUBST(TEST_VALID)
1124 AC_SUBST(TEST_VTIME)
1126 if test "$with_catalog" = "no" ; then
1127 echo Disabling Catalog support
1133 CATALOG_OBJ="catalog.o"
1134 TEST_CATALOG=Catatests
1136 AC_SUBST(WITH_CATALOG)
1137 AC_SUBST(CATALOG_OBJ)
1138 AC_SUBST(TEST_CATALOG)
1140 if test "$with_docbook" = "no" ; then
1141 echo Disabling Docbook support
1146 DOCB_OBJ="DOCBparser.o"
1152 if test "$with_xptr" = "no" ; then
1153 echo Disabling XPointer support
1161 if test "$with_xpath" = "no" ; then
1162 echo XPointer requires XPath support - enabling it
1170 if test "$with_c14n" = "no" ; then
1171 echo Disabling C14N support
1179 if test "$with_xpath" = "no" ; then
1180 echo C14N requires XPath support - enabling it
1188 if test "$with_xinclude" = "no" ; then
1189 echo Disabling XInclude support
1196 XINCLUDE_OBJ=xinclude.o
1197 TEST_XINCLUDE=XIncludetests
1198 if test "$with_xpath" = "no" ; then
1199 echo XInclude requires XPath support - enabling it
1203 AC_SUBST(WITH_XINCLUDE)
1204 AC_SUBST(XINCLUDE_OBJ)
1205 AC_SUBST(TEST_XINCLUDE)
1207 if test "$with_xpath" = "no" ; then
1208 echo Disabling XPATH support
1215 TEST_XPATH=XPathtests
1217 AC_SUBST(WITH_XPATH)
1219 AC_SUBST(TEST_XPATH)
1222 dnl output functions
1224 if test "$with_output" = "no" ; then
1225 echo Disabling serialization/saving support
1230 AC_SUBST(WITH_OUTPUT)
1233 if test "$with_iconv" = "no" ; then
1234 echo Disabling ICONV support
1236 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
1237 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
1238 # Export this since our headers include iconv.h
1239 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
1240 ICONV_LIBS="-L$with_iconv/lib"
1243 AC_CHECK_HEADER(iconv.h,
1244 AC_MSG_CHECKING(for iconv)
1245 AC_TRY_LINK([#include <stdlib.h>
1246 #include <iconv.h>],[
1247 iconv_t cd = iconv_open ("","");
1248 iconv (cd, NULL, NULL, NULL, NULL);],[
1252 AC_MSG_CHECKING(for iconv in -liconv)
1254 _ldflags="${LDFLAGS}"
1256 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1257 LIBS="${LIBS} -liconv"
1259 AC_TRY_LINK([#include <stdlib.h>
1260 #include <iconv.h>],[
1261 iconv_t cd = iconv_open ("","");
1262 iconv (cd, NULL, NULL, NULL, NULL);],[
1265 ICONV_LIBS="${ICONV_LIBS} -liconv"
1267 LDFLAGS="${_ldflags}"],[
1270 LDFLAGS="${_ldflags}"])]))
1272 if test "$WITH_ICONV" = "1" ; then
1273 AC_MSG_CHECKING([for iconv declaration])
1274 AC_CACHE_VAL(xml_cv_iconv_arg2, [
1275 AC_TRY_COMPILE([#include <stdlib.h>
1281 #if defined(__STDC__) || defined(__cplusplus)
1282 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1286 ], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
1288 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);"
1289 AC_MSG_RESULT([${xml_xxx:-
1290 }$xml_cv_iconv_decl])
1291 AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
1292 [Define as const if the declaration of iconv() needs const.])
1305 XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
1306 XML_LIBTOOLLIBS="libxml2.la"
1307 AC_SUBST(WITH_ICONV)
1310 if test "$WITH_ICONV" != "1" ; then
1311 if test "$with_iso8859x" = "no" ; then
1312 echo Disabling ISO8859X support
1316 AC_SUBST(WITH_ISO8859X)
1318 if test "$with_schematron" = "no" ; then
1319 echo "Disabling Schematron support"
1323 echo "Enabled Schematron support"
1325 TEST_SCHEMATRON="Schematrontests"
1329 AC_SUBST(WITH_SCHEMATRON)
1330 AC_SUBST(TEST_SCHEMATRON)
1332 if test "$with_schemas" = "no" ; then
1333 echo "Disabling Schemas/Relax-NG support"
1337 echo "Enabled Schemas/Relax-NG support"
1339 TEST_SCHEMAS="Schemastests Relaxtests"
1340 if test "$PYTHON_INCLUDES" != "" ; then
1341 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1345 AC_SUBST(WITH_SCHEMAS)
1346 AC_SUBST(TEST_SCHEMAS)
1348 if test "$with_regexps" = "no" ; then
1349 echo Disabling Regexps support
1354 TEST_REGEXPS="Regexptests Automatatests"
1356 AC_SUBST(WITH_REGEXPS)
1357 AC_SUBST(TEST_REGEXPS)
1359 if test "$with_debug" = "no" ; then
1360 echo Disabling DEBUG support
1366 DEBUG_OBJ=debugXML.o
1367 TEST_DEBUG=Scripttests
1369 AC_SUBST(WITH_DEBUG)
1371 AC_SUBST(TEST_DEBUG)
1373 if test "$with_mem_debug" = "yes" ; then
1374 if test "$with_thread_alloc" = "yes" ; then
1375 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1378 echo Enabling memory debug support
1384 AC_SUBST(WITH_MEM_DEBUG)
1386 if test "$with_run_debug" = "yes" ; then
1387 echo Enabling runtime debug support
1392 AC_SUBST(WITH_RUN_DEBUG)
1395 WIN32_EXTRA_LDFLAGS=
1396 CYGWIN_EXTRA_LDFLAGS=
1397 CYGWIN_EXTRA_PYTHON_LIBADD=
1400 CPPFLAGS="$CPPFLAGS -DWIN32"
1401 WIN32_EXTRA_LIBADD="-lws2_32"
1402 WIN32_EXTRA_LDFLAGS="-no-undefined"
1403 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1404 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1405 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1408 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
1409 if test "${PYTHON}" != ""
1411 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1415 AC_SUBST(WIN32_EXTRA_LIBADD)
1416 AC_SUBST(WIN32_EXTRA_LDFLAGS)
1417 AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1418 AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
1420 if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
1422 echo Enabling code coverage for GCC
1423 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
1424 LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
1426 echo Disabling code coverage for GCC
1432 AC_SUBST(XML_CFLAGS)
1434 AC_SUBST(XML_LIBDIR)
1436 AC_SUBST(XML_LIBTOOLLIBS)
1437 AC_SUBST(ICONV_LIBS)
1438 AC_SUBST(XML_INCLUDEDIR)
1440 AC_SUBST(HAVE_ISNAN)
1441 AC_SUBST(HAVE_ISINF)
1443 AC_SUBST(PYTHON_VERSION)
1444 AC_SUBST(PYTHON_INCLUDES)
1445 AC_SUBST(PYTHON_SITE_PACKAGES)
1450 dnl for the spec file
1451 RELDATE=`date +'%a %b %e %Y'`
1453 AC_SUBST(PYTHON_TESTS)
1455 rm -f COPYING.LIB COPYING
1456 ln -s Copyright COPYING
1458 # keep on one line for cygwin c.f. #130896
1459 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)
1461 chmod +x xml2-config python/setup.py
1462 echo Done configuring