1
dnl Process this file with autoconf to produce a configure script.
3
AM_CONFIG_HEADER(config.h)
8
LIBXML_MICRO_VERSION=32
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
13
LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
15
if test -f CVS/Entries ; then
16
extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
18
if test "$extra" != ""
20
LIBXML_VERSION_EXTRA="-CVS$extra"
22
else if test -d .svn ; then
23
extra=`svn info | grep Revision | sed 's+Revision: ++'`
25
if test "$extra" != ""
27
LIBXML_VERSION_EXTRA="-SVN$extra"
31
AC_SUBST(LIBXML_MAJOR_VERSION)
32
AC_SUBST(LIBXML_MINOR_VERSION)
33
AC_SUBST(LIBXML_MICRO_VERSION)
34
AC_SUBST(LIBXML_VERSION)
35
AC_SUBST(LIBXML_VERSION_INFO)
36
AC_SUBST(LIBXML_VERSION_NUMBER)
37
AC_SUBST(LIBXML_VERSION_EXTRA)
39
VERSION=${LIBXML_VERSION}
41
AM_INIT_AUTOMAKE(libxml2, $VERSION)
43
dnl Checks for programs.
47
AC_PATH_PROG(RM, rm, /bin/rm)
48
AC_PATH_PROG(MV, mv, /bin/mv)
49
AC_PATH_PROG(TAR, tar, /bin/tar)
50
AC_PATH_PROG(PERL, perl, /usr/bin/perl)
51
AC_PATH_PROG(WGET, wget, /usr/bin/wget)
52
AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
53
AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
55
dnl Make sure we have an ANSI compiler
57
test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
63
dnl We process the AC_ARG_WITH first so that later we can modify
64
dnl some of them to try to prevent impossible combinations. This
65
dnl also allows up so alphabetize the choices
69
dnl zlib option might change flags, so we save them initially
71
_cppflags="${CPPFLAGS}"
75
[ --with-c14n add the Canonicalization support (on)])
77
[ --with-catalog add the Catalog support (on)])
79
[ --with-debug add the debugging module (on)])
81
[ --with-docbook add Docbook SGML support (on)])
82
AC_ARG_WITH(fexceptions,
83
[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
85
[ --with-ftp add the FTP support (on)])
87
[ --with-history add history support to xmllint shell(off)])
89
[ --with-html add the HTML support (on)])
90
dnl Specific dir for HTML output ?
91
AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
92
[path to base html directory, default $datadir/doc/html]),
93
[HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
95
AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
96
[directory used under html-dir, default $PACKAGE-$VERSION/html]),
97
[test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
98
[HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
101
[ --with-http add the HTTP support (on)])
103
[ --with-iconv[[=DIR]] add ICONV support (on)])
104
AC_ARG_WITH(iso8859x,
105
[ --with-iso8859x add ISO8859X support if no iconv (on)])
107
[ --with-legacy add deprecated APIs for compatibility (on)])
108
AC_ARG_WITH(mem_debug,
109
[ --with-mem-debug add the memory debugging module (off)])
111
[ --with-minimum build a minimally sized library (off)])
113
[ --with-output add the serialization support (on)])
115
[ --with-pattern add the xmlPattern selection interface (on)])
117
[ --with-push add the PUSH parser interfaces (on)])
119
[ --with-python[[=DIR]] build Python bindings if found])
121
[ --with-reader add the xmlReader parsing interface (on)])
122
AC_ARG_WITH(readline,
123
[ --with-readline=DIR use readline in DIR],[
124
if test "$withval" != "no" -a "$withval" != "yes"; then
126
CPPFLAGS="${CPPFLAGS} -I$withval/include"
127
LDFLAGS="${LDFLAGS} -L$withval/lib"
131
[ --with-regexps add Regular Expressions support (on)])
132
AC_ARG_WITH(run_debug,
133
[ --with-run-debug add the runtime debugging module (off)])
135
[ --with-sax1 add the older SAX1 interface (on)])
137
[ --with-schemas add Relax-NG and Schemas support (on)])
138
AC_ARG_WITH(schematron,
139
[ --with-schematron add Schematron support (on)])
141
[ --with-threads add multithread support(on)])
142
AC_ARG_WITH(thread-alloc,
143
[ --with-thread-alloc add per-thread memory(off)])
145
[ --with-tree add the DOM like tree manipulation APIs (on)])
147
[ --with-valid add the DTD validation support (on)])
149
[ --with-writer add the xmlWriter saving interface (on)])
150
AC_ARG_WITH(xinclude,
151
[ --with-xinclude add the XInclude support (on)])
153
[ --with-xpath add the XPATH support (on)])
155
[ --with-xptr add the XPointer support (on)])
157
[ --with-modules add the dynamic modules support (on)])
159
[ --with-zlib[[=DIR]] use libz in DIR],[
160
if test "$withval" != "no" -a "$withval" != "yes"; then
162
CPPFLAGS="${CPPFLAGS} -I$withval/include"
163
LDFLAGS="${LDFLAGS} -L$withval/lib"
168
dnl hard dependancies on options
170
if test "$with_schemas" = "yes"
175
if test "$with_schematron" = "yes"
180
if test "$with_reader" = "yes"
184
if test "$with_xptr" = "yes"
189
dnl option to build a minimal libxml2 library
191
if test "$with_minimum" = "yes"
193
echo "Configuring for a minimal library"
194
if test "$with_c14n" = ""
198
if test "$with_catalog" = ""
203
if test "$with_debug" = ""
207
if test "$with_docbook" = ""
211
if test "$with_fexceptions" = ""
215
if test "$with_ftp" = ""
219
if test "$with_history" = ""
223
if test "$with_html" = ""
227
if test "$with_http" = ""
231
if test "$with_iconv" = ""
235
if test "$with_iso8859x" = ""
239
if test "$with_legacy" = ""
243
if test "$with_mem_debug" = ""
247
if test "$with_output" = ""
251
if test "$with_pattern" = ""
255
if test "$with_push" = ""
259
if test "$with_python" = ""
263
if test "$with_reader" = ""
267
if test "$with_readline" = ""
271
if test "$with_regexps" = ""
275
if test "$with_run_debug" = ""
279
if test "$with_sax1" = ""
283
if test "$with_schemas" = ""
287
if test "$with_schematron" = ""
291
if test "$with_threads" = ""
295
if test "$with_thread_alloc" = ""
299
if test "$with_tree" = ""
303
if test "$with_valid" = ""
307
if test "$with_writer" = ""
311
if test "$with_xinclude" = ""
315
if test "$with_xpath" = ""
319
if test "$with_xptr" = ""
323
if test "$with_zlib" = ""
327
if test "$with_modules" = ""
335
dnl Checks for zlib library.
338
if test "$with_zlib" = "no"; then
339
echo "Disabling compression support"
341
AC_CHECK_HEADERS(zlib.h,
342
AC_CHECK_LIB(z, gzread,[
343
AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
345
if test "x${Z_DIR}" != "x"; then
346
Z_CFLAGS="-I${Z_DIR}/include"
347
Z_LIBS="-L${Z_DIR}/lib -lz"
350
Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
362
CPPFLAGS=${_cppflags}
365
echo Checking headers
367
dnl Checks for header files.
370
AC_CHECK_HEADERS([fcntl.h])
371
AC_CHECK_HEADERS([unistd.h])
372
AC_CHECK_HEADERS([ctype.h])
373
AC_CHECK_HEADERS([dirent.h])
374
AC_CHECK_HEADERS([errno.h])
375
AC_CHECK_HEADERS([malloc.h])
376
AC_CHECK_HEADERS([stdarg.h])
377
AC_CHECK_HEADERS([sys/stat.h])
378
AC_CHECK_HEADERS([sys/types.h])
379
AC_CHECK_HEADERS([time.h])
380
AC_CHECK_HEADERS([ansidecl.h])
381
AC_CHECK_HEADERS([ieeefp.h])
382
AC_CHECK_HEADERS([nan.h])
383
AC_CHECK_HEADERS([math.h])
384
AC_CHECK_HEADERS([limits.h])
385
AC_CHECK_HEADERS([fp_class.h])
386
AC_CHECK_HEADERS([float.h])
387
AC_CHECK_HEADERS([stdlib.h])
388
AC_CHECK_HEADERS([sys/socket.h], [], [],
389
[#if HAVE_SYS_TYPES_H
390
# include <sys/types.h>
393
AC_CHECK_HEADERS([netinet/in.h], [], [],
394
[#if HAVE_SYS_TYPES_H
395
# include <sys/types.h>
398
AC_CHECK_HEADERS([arpa/inet.h], [], [],
399
[#if HAVE_SYS_TYPES_H
400
# include <sys/types.h>
403
# include <arpa/inet.h>
406
AC_CHECK_HEADERS([netdb.h])
407
AC_CHECK_HEADERS([sys/time.h])
408
AC_CHECK_HEADERS([sys/select.h])
409
AC_CHECK_HEADERS([sys/mman.h])
410
AC_CHECK_HEADERS([sys/timeb.h])
411
AC_CHECK_HEADERS([signal.h])
412
AC_CHECK_HEADERS([arpa/nameser.h], [], [],
413
[#if HAVE_SYS_TYPES_H
414
# include <sys/types.h>
417
AC_CHECK_HEADERS([resolv.h], [], [],
418
[#if HAVE_SYS_TYPES_H
419
# include <sys/types.h>
421
#if HAVE_NETINET_IN_H
422
# include <netinet/in.h>
424
#if HAVE_ARPA_NAMESER_H
425
# include <arpa/nameser.h>
428
AC_CHECK_HEADERS([dl.h])
429
AC_CHECK_HEADERS([dlfcn.h])
432
echo Checking libraries
434
dnl Checks for library functions.
436
AC_CHECK_FUNCS(strdup strndup strerror)
437
AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
438
AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
439
AC_CHECK_FUNCS(stat _stat signal)
441
dnl Checking the standard string functions availability
442
AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
445
dnl Checking for va_copy availability
446
AC_MSG_CHECKING([for va_copy])
447
AC_TRY_LINK([#include <stdarg.h>
448
va_list ap1,ap2;], [va_copy(ap1,ap2);],
451
AC_MSG_RESULT($have_va_copy)
452
if test x"$have_va_copy" = x"yes"; then
453
AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
455
AC_MSG_CHECKING([for __va_copy])
456
AC_TRY_LINK([#include <stdarg.h>
457
va_list ap1,ap2;], [__va_copy(ap1,ap2);],
460
AC_MSG_RESULT($have___va_copy)
461
if test x"$have___va_copy" = x"yes"; then
462
AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
466
dnl Checks for inet libraries:
467
AC_SEARCH_LIBS(gethostent, [nsl])
468
AC_SEARCH_LIBS(setsockopt, [socket net])
469
AC_SEARCH_LIBS(connect, [inet])
471
dnl Determine what socket length (socklen_t) data type is
472
AC_MSG_CHECKING([for type of socket length (socklen_t)])
475
#include <sys/types.h>
476
#include <sys/socket.h>],[
477
(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
478
AC_MSG_RESULT(socklen_t *)
479
XML_SOCKLEN_T=socklen_t],[
482
#include <sys/types.h>
483
#include <sys/socket.h>],[
484
(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
485
AC_MSG_RESULT(size_t *)
486
XML_SOCKLEN_T=size_t],[
489
#include <sys/types.h>
490
#include <sys/socket.h>],[
491
(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
494
AC_MSG_WARN(could not determine)
495
XML_SOCKLEN_T="int"])])])
496
AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
498
dnl ***********************Checking for availability of IPv6*******************
500
AC_MSG_CHECKING([whether to enable IPv6])
501
AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
502
if test "$with_minimum" = "yes"
506
if test $enable_ipv6 = yes; then
509
#include <sys/types.h>
510
#include <sys/socket.h>
512
struct sockaddr_storage ss;
513
socket(AF_INET6, SOCK_STREAM, 0)
518
AC_MSG_RESULT($have_ipv6)
520
if test $have_ipv6 = yes; then
521
AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
522
have_broken_ss_family=no
524
dnl *********************************************************************
525
dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
526
dnl a ss_family member, but rather __ss_family. Let's detect that
527
dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
528
dnl platforms. However, we should only do this if ss_family is not
530
dnl ********************************************************************
531
AC_MSG_CHECKING([struct sockaddr::ss_family])
533
#include <sys/types.h>
534
#include <sys/socket.h>
536
struct sockaddr_storage ss ;
542
AC_MSG_RESULT($have_ss_family)
543
if test x$have_ss_family = xno ; then
544
AC_MSG_CHECKING([broken struct sockaddr::ss_family])
546
#include <sys/types.h>
547
#include <sys/socket.h>
549
struct sockaddr_storage ss ;
552
have_broken_ss_family=yes,
553
have_broken_ss_family=no
555
AC_MSG_RESULT($have_broken_ss_family)
556
if test x$have_broken_ss_family = xyes ; then
557
AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
558
[Whether struct sockaddr::__ss_family exists])
559
AC_DEFINE(ss_family, __ss_family,
560
[ss_family is not defined here, use __ss_family instead])
562
AC_MSG_WARN(ss_family and __ss_family not found)
567
AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
568
if test $have_getaddrinfo != yes; then
569
for lib in bsd socket inet; do
570
AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
574
if test $have_getaddrinfo = yes; then
575
AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
580
dnl ******************************End IPv6 checks******************************
582
dnl Checks for isnan in libm if not in libc
583
AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
584
[AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
586
AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
587
[AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
589
XML_LIBDIR='-L${libdir}'
590
XML_INCLUDEDIR='-I${includedir}/libxml2'
599
dnl Workaround for native compilers
600
dnl HP : http://bugs.gnome.org/db/31/3163.html
601
dnl DEC : Enable NaN/Inf
603
if test "${GCC}" != "yes" ; then
606
CFLAGS="${CFLAGS} -Wp,-H30000"
609
CFLAGS="${CFLAGS} -ieee"
612
CFLAGS="${CFLAGS} -ieee"
616
if test "$with_fexceptions" = "yes"
619
# Not activated by default because this inflates the code size
620
# Used to allow propagation of C++ exceptions through the library
622
CFLAGS="${CFLAGS} -fexceptions"
625
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"
628
CFLAGS="${CFLAGS} -mieee"
631
CFLAGS="${CFLAGS} -mieee"
637
XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
642
*-*-mingw* | *-*-cygwin* | *-*-msvc* )
643
# If the host is Windows, and shared libraries are disabled, we
644
# need to add -DLIBXML_STATIC to CFLAGS in order for linking to
645
# work properly (without it, xmlexports.h would force the use of
646
# DLL imports, which obviously aren't present in a static
648
if test "x$enable_shared" = "xno"; then
649
XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
650
CFLAGS="$CFLAGS -DLIBXML_STATIC"
662
PYTHON_SITE_PACKAGES=
665
if test "$with_python" != "no" ; then
666
if test -x "$with_python/bin/python"
668
echo Found python in $with_python/bin/python
669
PYTHON="$with_python/bin/python"
671
if test -x "$with_python"
673
echo Found python in $with_python
674
PYTHON="$with_python"
678
echo Found python in environment PYTHON=$PYTHON
679
with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
681
AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
685
if test "$PYTHON" != ""
687
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
688
echo Found Python version $PYTHON_VERSION
690
if test "$PYTHON_VERSION" != ""
692
if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
693
-d $with_python/lib/python$PYTHON_VERSION/site-packages
695
PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
696
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
698
if test -r $prefix/include/python$PYTHON_VERSION/Python.h
700
PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
701
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
703
if test -r /usr/include/python$PYTHON_VERSION/Python.h
705
PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
706
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
708
echo could not find python$PYTHON_VERSION/Python.h
711
if test ! -d "$PYTHON_SITE_PACKAGES"
713
PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
717
if test "$with_python" != ""
719
pythondir='$(PYTHON_SITE_PACKAGES)'
721
pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
726
AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
727
if test "$PYTHON_INCLUDES" != ""
734
AC_SUBST(PYTHON_SUBDIR)
736
dnl check for dso support
740
if test "$with_modules" != "no" ; then
743
MODULE_EXTENSION=".dll"
744
AC_CHECK_LIB(cygwin, dlopen, [
746
MODULE_PLATFORM_LIBS=
747
AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
751
AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
752
AC_CHECK_LIB(dld, shl_load, [
753
MODULE_PLATFORM_LIBS="-ldld"
754
libxml_have_shl_load=yes], [
755
AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
756
AC_CHECK_LIB(dl, dlopen, [
757
MODULE_PLATFORM_LIBS="-ldl"
758
libxml_have_dlopen=yes])])])])
760
if test "${libxml_have_shl_load}" = "yes"; then
761
MODULE_EXTENSION=".sl"
763
AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
766
if test "${libxml_have_dlopen}" = "yes"; then
769
MODULE_EXTENSION=".sl"
772
MODULE_EXTENSION=".so"
777
AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
783
if test "${WITH_MODULES}" = "1"; then
784
TEST_MODULES="ModuleTests"
787
AC_SUBST(WITH_MODULES)
788
AC_SUBST(MODULE_PLATFORM_LIBS)
789
AC_SUBST(MODULE_EXTENSION)
790
AC_SUBST(TEST_MODULES)
793
dnl Tester makes use of readline if present
797
dnl specific tests to setup DV and Bill's devel environments with debug etc ...
798
dnl (-Wunreachable-code)
800
if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
801
[[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
802
[[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
804
if test "$with_minimum" != "yes"
806
if test "${with_mem_debug}" = "" ; then
807
echo Activating memory debugging
811
if test "${with_docbook}" = "" ; then
815
if test "${GCC}" = "yes" ; then
816
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"
818
STATIC_BINARIES="-static"
819
dnl -Wcast-qual -ansi
823
AC_SUBST(STATIC_BINARIES)
826
dnl Check for trio string functions
829
if test "${NEED_TRIO}" = "1" ; then
830
echo Adding trio library for string functions
835
AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
839
dnl Allow to enable/disable various pieces
841
echo Checking configuration requirements
844
dnl Thread-related stuff
853
if test "$with_threads" = "no" ; then
854
echo Disabling multithreaded support
856
echo Enabling multithreaded support
858
AC_CHECK_HEADER(pthread.h,
859
AC_CHECK_LIB(pthread, pthread_join,[
860
THREAD_LIBS="-lpthread"
861
AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
862
AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
865
*mingw32*) WITH_THREADS="1"
867
THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
869
*cygwin*) THREAD_LIBS=""
871
*beos*) WITH_THREADS="1"
872
THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
875
if test "${GCC}" = "yes" ; then
876
GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
877
GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
878
GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
879
if test "${THREAD_LIBS}" = "-lpthread" ; then
880
if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
883
BASE_THREAD_LIBS="-lpthread"
885
if expr ${GCC_MAJOR} \> 3 > /dev/null
888
BASE_THREAD_LIBS="-lpthread"
890
echo old GCC disabling weak symbols for pthread
897
if test "$WITH_THREADS" = "1" ; then
898
THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
899
TEST_THREADS="Threadtests"
902
if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
903
THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
906
AC_SUBST(THREAD_LIBS)
907
AC_SUBST(BASE_THREAD_LIBS)
908
AC_SUBST(WITH_THREADS)
909
AC_SUBST(THREAD_CFLAGS)
910
AC_SUBST(TEST_THREADS)
911
AC_SUBST(THREADS_W32)
914
dnl xmllint shell history
916
if test "$with_history" = "yes" ; then
917
echo Enabling xmllint shell history
918
dnl check for terminal library. this is a very cool solution
919
dnl from octave's configure.in
921
for termlib in ncurses curses termcap terminfo termlib; do
922
AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
923
test -n "$tcap" && break
926
AC_CHECK_HEADER(readline/history.h,
927
AC_CHECK_LIB(history, append_history,[
929
AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
930
AC_CHECK_HEADER(readline/readline.h,
931
AC_CHECK_LIB(readline, readline,[
932
RDL_LIBS="-lreadline $RDL_LIBS $tcap"
933
AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
934
if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
935
CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
936
RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
943
if test "$with_tree" = "no" ; then
944
echo Disabling DOM like tree manipulation APIs
951
if test "$with_ftp" = "no" ; then
952
echo Disabling FTP support
962
if test "$with_http" = "no" ; then
963
echo Disabling HTTP support
973
if test "$with_legacy" = "no" ; then
974
echo Disabling deprecated APIs
979
AC_SUBST(WITH_LEGACY)
981
if test "$with_reader" = "no" ; then
982
echo Disabling the xmlReader parsing interface
987
READER_TEST=Readertests
988
if test "$with_push" = "no" ; then
989
echo xmlReader requires Push interface - enabling it
993
AC_SUBST(WITH_READER)
994
AC_SUBST(READER_TEST)
996
if test "$with_writer" = "no" ; then
997
echo Disabling the xmlWriter saving interface
1002
# WRITER_TEST=Writertests
1003
if test "$with_push" = "no" ; then
1004
echo xmlWriter requires Push interface - enabling it
1007
if test "$with_output" = "no" ; then
1008
echo xmlWriter requires Output interface - enabling it
1012
AC_SUBST(WITH_WRITER)
1013
#AC_SUBST(WRITER_TEST)
1015
if test "$with_pattern" = "no" ; then
1016
echo Disabling the xmlPattern parsing interface
1021
TEST_PATTERN=Patterntests
1023
AC_SUBST(WITH_PATTERN)
1024
AC_SUBST(TEST_PATTERN)
1026
if test "$with_sax1" = "no" ; then
1027
echo Disabling the older SAX1 interface
1037
if test "$with_push" = "no" ; then
1038
echo Disabling the PUSH parser interfaces
1043
TEST_PUSH="XMLPushtests"
1048
if test "$with_html" = "no" ; then
1049
echo Disabling HTML support
1055
HTML_OBJ="HTMLparser.o HTMLtree.o"
1057
if test "$with_push" != "no" ; then
1058
TEST_PHTML=HTMLPushtests
1066
AC_SUBST(TEST_PHTML)
1068
if test "$with_valid" = "no" ; then
1069
echo Disabling DTD validation support
1075
TEST_VALID=Validtests
1076
TEST_VTIME=VTimingtests
1078
AC_SUBST(WITH_VALID)
1079
AC_SUBST(TEST_VALID)
1080
AC_SUBST(TEST_VTIME)
1082
if test "$with_catalog" = "no" ; then
1083
echo Disabling Catalog support
1089
CATALOG_OBJ="catalog.o"
1090
TEST_CATALOG=Catatests
1092
AC_SUBST(WITH_CATALOG)
1093
AC_SUBST(CATALOG_OBJ)
1094
AC_SUBST(TEST_CATALOG)
1096
if test "$with_docbook" = "no" ; then
1097
echo Disabling Docbook support
1102
DOCB_OBJ="DOCBparser.o"
1108
if test "$with_xptr" = "no" ; then
1109
echo Disabling XPointer support
1117
if test "$with_xpath" = "no" ; then
1118
echo XPointer requires XPath support - enabling it
1126
if test "$with_c14n" = "no" ; then
1127
echo Disabling C14N support
1135
if test "$with_xpath" = "no" ; then
1136
echo C14N requires XPath support - enabling it
1144
if test "$with_xinclude" = "no" ; then
1145
echo Disabling XInclude support
1152
XINCLUDE_OBJ=xinclude.o
1153
TEST_XINCLUDE=XIncludetests
1154
if test "$with_xpath" = "no" ; then
1155
echo XInclude requires XPath support - enabling it
1159
AC_SUBST(WITH_XINCLUDE)
1160
AC_SUBST(XINCLUDE_OBJ)
1161
AC_SUBST(TEST_XINCLUDE)
1163
if test "$with_xpath" = "no" ; then
1164
echo Disabling XPATH support
1171
TEST_XPATH=XPathtests
1173
AC_SUBST(WITH_XPATH)
1175
AC_SUBST(TEST_XPATH)
1178
dnl output functions
1180
if test "$with_output" = "no" ; then
1181
echo Disabling serialization/saving support
1186
AC_SUBST(WITH_OUTPUT)
1189
if test "$with_iconv" = "no" ; then
1190
echo Disabling ICONV support
1192
if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
1193
CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
1194
# Export this since our headers include iconv.h
1195
XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
1196
ICONV_LIBS="-L$with_iconv/lib"
1199
AC_CHECK_HEADER(iconv.h,
1200
AC_MSG_CHECKING(for iconv)
1201
AC_TRY_LINK([#include <stdlib.h>
1202
#include <iconv.h>],[
1203
iconv_t cd = iconv_open ("","");
1204
iconv (cd, NULL, NULL, NULL, NULL);],[
1208
AC_MSG_CHECKING(for iconv in -liconv)
1210
_ldflags="${LDFLAGS}"
1212
LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1213
LIBS="${LIBS} -liconv"
1215
AC_TRY_LINK([#include <stdlib.h>
1216
#include <iconv.h>],[
1217
iconv_t cd = iconv_open ("","");
1218
iconv (cd, NULL, NULL, NULL, NULL);],[
1221
ICONV_LIBS="${ICONV_LIBS} -liconv"
1223
LDFLAGS="${_ldflags}"],[
1226
LDFLAGS="${_ldflags}"])]))
1228
if test "$WITH_ICONV" = "1" ; then
1229
AC_MSG_CHECKING([for iconv declaration])
1230
AC_CACHE_VAL(xml_cv_iconv_arg2, [
1231
AC_TRY_COMPILE([#include <stdlib.h>
1237
#if defined(__STDC__) || defined(__cplusplus)
1238
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1242
], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
1244
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);"
1245
AC_MSG_RESULT([${xml_xxx:-
1246
}$xml_cv_iconv_decl])
1247
AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
1248
[Define as const if the declaration of iconv() needs const.])
1259
XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
1260
XML_LIBTOOLLIBS="libxml2.la"
1261
AC_SUBST(WITH_ICONV)
1264
if test "$WITH_ICONV" != "1" ; then
1265
if test "$with_iso8859x" = "no" ; then
1266
echo Disabling ISO8859X support
1270
AC_SUBST(WITH_ISO8859X)
1272
if test "$with_schematron" = "no" ; then
1273
echo "Disabling Schematron support"
1277
echo "Enabled Schematron support"
1279
TEST_SCHEMATRON="Schematrontests"
1283
AC_SUBST(WITH_SCHEMATRON)
1284
AC_SUBST(TEST_SCHEMATRON)
1286
if test "$with_schemas" = "no" ; then
1287
echo "Disabling Schemas/Relax-NG support"
1291
echo "Enabled Schemas/Relax-NG support"
1293
TEST_SCHEMAS="Schemastests Relaxtests"
1294
if test "$PYTHON_INCLUDES" != "" ; then
1295
PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1299
AC_SUBST(WITH_SCHEMAS)
1300
AC_SUBST(TEST_SCHEMAS)
1302
if test "$with_regexps" = "no" ; then
1303
echo Disabling Regexps support
1308
TEST_REGEXPS="Regexptests Automatatests"
1310
AC_SUBST(WITH_REGEXPS)
1311
AC_SUBST(TEST_REGEXPS)
1313
if test "$with_debug" = "no" ; then
1314
echo Disabling DEBUG support
1320
DEBUG_OBJ=debugXML.o
1321
TEST_DEBUG=Scripttests
1323
AC_SUBST(WITH_DEBUG)
1325
AC_SUBST(TEST_DEBUG)
1327
if test "$with_mem_debug" = "yes" ; then
1328
if test "$with_thread_alloc" = "yes" ; then
1329
echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1332
echo Enabling memory debug support
1338
AC_SUBST(WITH_MEM_DEBUG)
1340
if test "$with_run_debug" = "yes" ; then
1341
echo Enabling runtime debug support
1346
AC_SUBST(WITH_RUN_DEBUG)
1349
WIN32_EXTRA_LDFLAGS=
1350
CYGWIN_EXTRA_LDFLAGS=
1351
CYGWIN_EXTRA_PYTHON_LIBADD=
1354
CPPFLAGS="$CPPFLAGS -DWIN32"
1355
WIN32_EXTRA_LIBADD="-lws2_32"
1356
WIN32_EXTRA_LDFLAGS="-no-undefined"
1357
AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1358
AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1359
AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1362
CYGWIN_EXTRA_LDFLAGS="-no-undefined"
1363
if test "${PYTHON}" != ""
1365
CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1369
AC_SUBST(WIN32_EXTRA_LIBADD)
1370
AC_SUBST(WIN32_EXTRA_LDFLAGS)
1371
AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1372
AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
1376
AC_SUBST(XML_CFLAGS)
1378
AC_SUBST(XML_LIBDIR)
1380
AC_SUBST(XML_LIBTOOLLIBS)
1381
AC_SUBST(ICONV_LIBS)
1382
AC_SUBST(XML_INCLUDEDIR)
1384
AC_SUBST(HAVE_ISNAN)
1385
AC_SUBST(HAVE_ISINF)
1387
AC_SUBST(PYTHON_VERSION)
1388
AC_SUBST(PYTHON_INCLUDES)
1389
AC_SUBST(PYTHON_SITE_PACKAGES)
1394
dnl for the spec file
1395
RELDATE=`date +'%a %b %e %Y'`
1397
AC_SUBST(PYTHON_TESTS)
1399
rm -f COPYING.LIB COPYING
1400
ln -s Copyright COPYING
1402
# keep on one line for cygwin c.f. #130896
1403
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)
1405
chmod +x xml2-config python/setup.py
1406
echo Done configuring