source: trunk/third/libxml2/configure.in @ 21532

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