Initial revision
[TestXSLT.git] / libxml2 / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.2)
3 AC_INIT(entities.c)
4 AM_CONFIG_HEADER(config.h)
5 AC_CANONICAL_HOST
6
7 LIBXML_MAJOR_VERSION=2
8 LIBXML_MINOR_VERSION=5
9 LIBXML_MICRO_VERSION=4
10 LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
11 LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
12
13 LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
14
15 AC_SUBST(LIBXML_MAJOR_VERSION)
16 AC_SUBST(LIBXML_MINOR_VERSION)
17 AC_SUBST(LIBXML_MICRO_VERSION)
18 AC_SUBST(LIBXML_VERSION)
19 AC_SUBST(LIBXML_VERSION_INFO)
20 AC_SUBST(LIBXML_VERSION_NUMBER)
21
22 VERSION=${LIBXML_VERSION}
23
24 AM_INIT_AUTOMAKE(libxml2, $VERSION)
25
26 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
27
28 dnl Checks for programs.
29 AC_PROG_CC
30 AC_PROG_INSTALL
31 AC_PROG_CPP
32 AC_PATH_PROG(RM, rm, /bin/rm)
33 AC_PATH_PROG(MV, mv, /bin/mv)
34 AC_PATH_PROG(TAR, tar, /bin/tar)
35
36 dnl Make sure we have an ANSI compiler
37 AM_C_PROTOTYPES
38 test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
39
40 AM_PROG_LIBTOOL
41
42 AM_MAINTAINER_MODE
43
44 dnl Checks for zlib library.
45 _cppflags="${CPPFLAGS}"
46 _ldflags="${LDFLAGS}"
47
48
49 AC_ARG_WITH(zlib,
50 [  --with-zlib[=DIR]       use libz in DIR],[
51   if test "$withval" != "no" -a "$withval" != "yes"; then
52     Z_DIR=$withval
53     CPPFLAGS="${CPPFLAGS} -I$withval/include"
54     LDFLAGS="${LDFLAGS} -L$withval/lib"
55   fi
56 ])
57 if test "$with_zlib" = "no"; then
58     echo "Disabling compression support"
59 else
60     AC_CHECK_HEADERS(zlib.h,
61         AC_CHECK_LIB(z, gzread,[
62             AC_DEFINE(HAVE_LIBZ)
63             if test "x${Z_DIR}" != "x"; then
64                 Z_CFLAGS="-I${Z_DIR}/include"
65                 Z_LIBS="-L${Z_DIR}/lib -lz"
66                 [case ${host} in
67                     *-*-solaris*)
68                         Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
69                         ;;
70                 esac]
71             else
72                 Z_LIBS="-lz"
73             fi]))
74 fi
75
76 AC_SUBST(Z_CFLAGS)
77 AC_SUBST(Z_LIBS)
78
79 CPPFLAGS=${_cppflags}
80 LDFLAGS=${_ldflags}
81
82 dnl Checks for header files.
83 AC_HEADER_DIRENT
84 AC_HEADER_STDC
85 AC_CHECK_HEADERS([fcntl.h])
86 AC_CHECK_HEADERS([unistd.h])
87 AC_CHECK_HEADERS([ctype.h])
88 AC_CHECK_HEADERS([dirent.h])
89 AC_CHECK_HEADERS([errno.h])
90 AC_CHECK_HEADERS([malloc.h])
91 AC_CHECK_HEADERS([stdarg.h])
92 AC_CHECK_HEADERS([sys/stat.h])
93 AC_CHECK_HEADERS([sys/types.h])
94 AC_CHECK_HEADERS([time.h])
95 AC_CHECK_HEADERS([ansidecl.h])
96 AC_CHECK_HEADERS([ieeefp.h])
97 AC_CHECK_HEADERS([nan.h])
98 AC_CHECK_HEADERS([math.h])
99 AC_CHECK_HEADERS([fp_class.h])
100 AC_CHECK_HEADERS([float.h])
101 AC_CHECK_HEADERS([stdlib.h])
102 AC_CHECK_HEADERS([sys/socket.h], [], [],
103 [#if HAVE_SYS_TYPES_H
104 # include <sys/types.h>
105 # endif
106 ])
107 AC_CHECK_HEADERS([netinet/in.h], [], [],
108 [#if HAVE_SYS_TYPES_H
109 # include <sys/types.h>
110 # endif
111 ])
112 AC_CHECK_HEADERS([arpa/inet.h], [], [],
113 [#if HAVE_SYS_TYPES_H
114 # include <sys/types.h>
115 # endif
116 #if HAVE_ARPA_INET_H
117 # include <arpa/inet.h>
118 # endif
119 ])
120 AC_CHECK_HEADERS([netdb.h])
121 AC_CHECK_HEADERS([sys/time.h])
122 AC_CHECK_HEADERS([sys/select.h])
123 AC_CHECK_HEADERS([sys/mman.h])
124 AC_CHECK_HEADERS([sys/timeb.h])
125 AC_CHECK_HEADERS([signal.h])
126 AC_CHECK_HEADERS([arpa/nameser.h], [], [],
127 [#if HAVE_SYS_TYPES_H
128 # include <sys/types.h>
129 # endif
130 ])
131 AC_CHECK_HEADERS([resolv.h], [], [],
132 [#if HAVE_SYS_TYPES_H
133 # include <sys/types.h>
134 # endif
135 #if HAVE_NETINET_IN_H
136 # include <netinet/in.h>
137 # endif
138 #if HAVE_ARPA_NAMESER_H
139 # include <arpa/nameser.h>
140 # endif
141 ])
142
143 dnl Specific dir for HTML output ?
144 if test "x$with_html_dir" = "x" ; then
145   HTML_DIR='$(prefix)/doc'
146 else
147   HTML_DIR=$with_html_dir
148 fi
149
150 AC_SUBST(HTML_DIR)
151
152 dnl Checks for library functions.
153 AC_FUNC_STRFTIME
154 AC_CHECK_FUNCS(strdup strndup strerror)
155 AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
156 AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
157 AC_CHECK_FUNCS(stat _stat signal)
158
159 dnl Checking the standard string functions availability
160 AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
161                NEED_TRIO=1)
162
163 dnl Checks for inet libraries:
164 AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
165 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
166 AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
167
168 dnl Determine what socket length (socklen_t) data type is
169 AC_MSG_CHECKING([for type of socket length (socklen_t)])
170 AC_TRY_COMPILE2([
171 #include <stddef.h>
172 #include <sys/types.h>
173 #include <sys/socket.h>],[
174 (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
175   AC_MSG_RESULT(socklen_t *)
176   SOCKLEN_T=socklen_t],[
177   AC_TRY_COMPILE2([
178 #include <stddef.h>
179 #include <sys/types.h>
180 #include <sys/socket.h>],[
181 (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
182     AC_MSG_RESULT(size_t *)
183     SOCKLEN_T=size_t],[
184     AC_TRY_COMPILE2([
185 #include <stddef.h>
186 #include <sys/types.h>
187 #include <sys/socket.h>],[
188 (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
189       AC_MSG_RESULT(int *)
190       SOCKLEN_T=int],[
191       AC_MSG_WARN(could not determine)])])])
192 AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T)
193
194 dnl Checks for isnan in libm if not in libc
195 AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
196   [AC_DEFINE(HAVE_ISNAN)]))
197
198 AC_CHECK_FUNC(isinf, AC_DEFINE(HAVE_ISINF) , AC_CHECK_LIB(m, isinf,
199   [AC_DEFINE(HAVE_ISINF)]))
200
201 XML_LIBDIR='-L${libdir}'
202 XML_INCLUDEDIR='-I${includedir}/libxml2'
203
204 dnl
205 dnl Extra flags
206 dnl
207 XML_CFLAGS=""
208 RDL_LIBS=""
209
210 dnl
211 dnl Workaround for native compilers
212 dnl  HP  : http://bugs.gnome.org/db/31/3163.html
213 dnl  DEC : Enable NaN/Inf
214 dnl
215 if test "${GCC}" != "yes" ; then
216     case "${host}" in
217           *-*-hpux* )
218                CFLAGS="${CFLAGS} -Wp,-H30000"
219                ;;
220           *-dec-osf* )
221                CFLAGS="${CFLAGS} -ieee"
222                ;;
223     esac
224 else
225     CFLAGS="${CFLAGS} -Wall"
226     case "${host}" in
227           alpha*-*-linux* )
228                CFLAGS="${CFLAGS} -mieee"
229                ;;
230           alpha*-*-osf* )
231                CFLAGS="${CFLAGS} -mieee"
232                ;;
233     esac
234 fi
235 case ${host} in
236     *-*-solaris*)
237         XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
238         ;;
239     hppa*-hp-mpeix)
240         NEED_TRIO=1
241         ;;
242 esac
243
244
245 dnl
246 dnl check for python
247 dnl
248
249 PYTHON=
250 PYTHON_VERSION=
251 PYTHON_INCLUDES=
252 PYTHON_SITE_PACKAGES=
253 AC_ARG_WITH(python, [  --with-python[=DIR]    Build Python bindings if found])
254 if test "$with_python" != "no" ; then
255     if test -x "$with_python/bin/python"
256     then
257         echo Found python in $with_python/bin/python
258         PYTHON="$with_python/bin/python"
259     else
260         if test -x "$with_python"
261         then
262             echo Found python in $with_python
263             PYTHON="$with_python"
264         else
265             AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
266         fi
267     fi
268     if test "$PYTHON" != ""
269     then
270         PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
271         echo Found Python version $PYTHON_VERSION
272     fi
273     if test "$PYTHON_VERSION" != ""
274     then
275         if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
276            -d $with_python/lib/python$PYTHON_VERSION/site-packages
277         then
278             PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
279             PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
280         else
281             if test -r $prefix/include/python$PYTHON_VERSION/Python.h
282             then
283                 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
284                 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
285             else
286                 if test -r /usr/include/python$PYTHON_VERSION/Python.h
287                 then
288                     PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
289                     PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
290                 else
291                     echo could not find python$PYTHON_VERSION/Python.h
292                 fi
293             fi
294             if ! test -d "$PYTHON_SITE_PACKAGES"
295             then
296                     PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
297             fi
298         fi
299     fi
300 fi
301 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
302 if test "$PYTHON_INCLUDES" != ""
303 then
304     PYTHON_SUBDIR=python
305 else
306     PYTHON_SUBDIR=
307 fi
308 AC_SUBST(PYTHON_SUBDIR)
309
310 dnl
311 dnl Tester makes use of readline if present
312 dnl
313 _cppflags="${CPPFLAGS}"
314 _ldflags="${LDFLAGS}"
315
316 AC_ARG_WITH(readline,
317 [  --with-readline=DIR     use readline in DIR],[
318   if test "$withval" != "no" -a "$withval" != "yes"; then
319     RDL_DIR=$withval
320     CPPFLAGS="${CPPFLAGS} -I$withval/include"
321     LDFLAGS="${LDFLAGS} -L$withval/lib"
322   fi
323 ])
324
325 dnl
326 dnl specific tests to setup DV's devel environment with debug etc ...
327 dnl (-Wunreachable-code)
328 dnl
329 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then
330     if test "${with_mem_debug}" = "" ; then
331         with_mem_debug="yes"
332     fi
333     if test "${with_docbook}" = "" ; then
334         with_docbook="yes"
335     fi
336     CFLAGS="-g -O -pedantic -W -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 "
337     STATIC_BINARIES="-static"
338 dnl -Wcast-qual -ansi
339 else
340     STATIC_BINARIES=
341 fi
342 AC_SUBST(STATIC_BINARIES)
343
344 dnl
345 dnl Check for trio string functions
346 dnl
347
348 if test "${NEED_TRIO}" = "1" ; then
349     echo Adding trio library for string functions
350     WITH_TRIO=1
351 else    
352     WITH_TRIO=0
353 fi
354 AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
355 AC_SUBST(WITH_TRIO)
356
357 dnl
358 dnl Aloow to enable/disable various pieces
359 dnl
360
361 THREAD_LIBS=""
362 WITH_THREADS=0
363 THREAD_CFLAGS=""
364 TEST_THREADS=""
365
366 AC_ARG_WITH(threads, [  --with-threads          Add multithread support(off)])
367 if test "$with_threads" = "yes" ; then
368     echo Enabling multithreaded support
369
370     AC_CHECK_HEADER(pthread.h,
371         AC_CHECK_LIB(pthread, pthread_join,[
372            THREAD_LIBS="-lpthread"
373            AC_DEFINE(HAVE_LIBPTHREAD)
374            AC_DEFINE(HAVE_PTHREAD_H)
375            WITH_THREADS="1"]))
376
377     if test "$WITH_THREADS" = "1" ; then
378         THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
379         TEST_THREADS="Threadtests"
380     fi
381 fi
382 AC_ARG_WITH(thread-alloc, [  --with-thread-alloc     Add per-thread memory(off)])
383 if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
384     THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
385 fi
386
387 AC_SUBST(THREAD_LIBS)
388 AC_SUBST(WITH_THREADS)
389 AC_SUBST(THREAD_CFLAGS)
390 AC_SUBST(TEST_THREADS)
391
392 AC_ARG_WITH(history, [  --with-history          Add history support to xmllint shell(off)])
393 if test "$with_history" = "yes" ; then
394     echo Enabling xmllint shell history
395     dnl check for terminal library. this is a very cool solution
396     dnl from octave's configure.in
397     unset tcap
398     for termlib in ncurses curses termcap terminfo termlib; do
399         AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
400         test -n "$tcap" && break
401     done
402
403     AC_CHECK_HEADER(readline/history.h,
404         AC_CHECK_LIB(history, append_history,[
405            RDL_LIBS="-lhistory"
406            AC_DEFINE(HAVE_LIBHISTORY)]))
407     AC_CHECK_HEADER(readline/readline.h,
408         AC_CHECK_LIB(readline, readline,[
409            RDL_LIBS="-lreadline $RDL_LIBS $tcap"
410            AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
411     if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
412         CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
413         RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
414     else
415         CPPFLAGS=${_cppflags}
416     fi
417     LDFLAGS=${_ldflags}
418 fi
419
420 AC_SUBST(WITH_FTP)
421 AC_SUBST(FTP_OBJ)
422 AC_ARG_WITH(ftp, [  --with-ftp              Add the FTP support (on)])
423 if test "$with_ftp" = "no" ; then
424     echo Disabling FTP support
425     WITH_FTP=0
426     FTP_OBJ=
427 else    
428     WITH_FTP=1
429     FTP_OBJ=nanoftp.o
430 fi
431 AC_SUBST(WITH_FTP)
432 AC_SUBST(FTP_OBJ)
433
434 AC_ARG_WITH(http, [  --with-http             Add the HTTP support (on)])
435 if test "$with_http" = "no" ; then
436     echo Disabling HTTP support
437     WITH_HTTP=0
438     HTTP_OBJ=
439 else    
440     WITH_HTTP=1
441     HTTP_OBJ=nanohttp.o
442 fi
443 AC_SUBST(WITH_HTTP)
444 AC_SUBST(HTTP_OBJ)
445
446 AC_ARG_WITH(html, [  --with-html             Add the HTML support (on)])
447 if test "$with_html" = "no" ; then
448     echo Disabling HTML support
449     WITH_HTML=0
450     HTML_OBJ=
451 else    
452     WITH_HTML=1
453     HTML_OBJ="HTMLparser.o HTMLtree.o"
454 fi
455 AC_SUBST(WITH_HTML)
456 AC_SUBST(HTML_OBJ)
457
458 AC_ARG_WITH(catalog, [  --with-catalog          Add the Catalog support (on)])
459 if test "$with_catalog" = "no" ; then
460     echo Disabling Catalog support
461     WITH_CATALOG=0
462     CATALOG_OBJ=
463 else    
464     WITH_CATALOG=1
465     CATALOG_OBJ="catalog.o"
466 fi
467 AC_SUBST(WITH_CATALOG)
468 AC_SUBST(CATALOG_OBJ)
469
470 AC_ARG_WITH(docbook, [  --with-docbook          Add Docbook SGML support (on)])
471 if test "$with_docbook" = "no" ; then
472     echo Disabling Docbook support
473     WITH_DOCB=0
474     DOCB_OBJ=
475 else    
476     WITH_DOCB=1
477     DOCB_OBJ="DOCBparser.o"
478 fi
479 AC_SUBST(WITH_DOCB)
480 AC_SUBST(DOCB_OBJ)
481
482
483 AC_ARG_WITH(xpath, [  --with-xpath            Add the XPATH support (on)])
484 if test "$with_xpath" = "no" ; then
485     echo Disabling XPATH support
486     with_xptr="no"
487     with_c14n="no"
488     with_xinclude="no"
489     WITH_XPATH=0
490     XPATH_OBJ=
491 else    
492     WITH_XPATH=1
493     XPATH_OBJ=xpath.o
494 fi
495 AC_SUBST(WITH_XPATH)
496 AC_SUBST(XPATH_OBJ)
497
498 AC_ARG_WITH(xptr, [  --with-xptr             Add the XPointer support (on)])
499 if test "$with_xptr" = "no" ; then
500     echo Disabling XPointer support
501     WITH_XPTR=0
502     XPTR_OBJ=
503 else    
504     WITH_XPTR=1
505     XPTR_OBJ=xpointer.o
506 fi
507 AC_SUBST(WITH_XPTR)
508 AC_SUBST(XPTR_OBJ)
509
510 AC_ARG_WITH(c14n, [  --with-c14n             Add the Canonicalization support (on)])
511 if test "$with_c14n" = "no" ; then
512     echo Disabling C14N support
513     WITH_C14N=0
514     C14N_OBJ=
515 else    
516     WITH_C14N=1
517     C14N_OBJ="c14n.c"
518 fi
519 AC_SUBST(WITH_C14N)
520 AC_SUBST(C14N_OBJ)
521
522 AC_ARG_WITH(xinclude, [  --with-xinclude         Add the XInclude support (on)])
523 if test "$with_xinclude" = "no" ; then
524     echo Disabling XInclude support
525     WITH_XINCLUDE=0
526     XINCLUDE_OBJ=
527     with_xinclude="no"
528 else    
529     WITH_XINCLUDE=1
530     XINCLUDE_OBJ=xinclude.o
531 fi
532 AC_SUBST(WITH_XINCLUDE)
533 AC_SUBST(XINCLUDE_OBJ)
534
535 WITH_ICONV=0
536 AC_ARG_WITH(iconv, [  --with-iconv[=DIR]      Add ICONV support (on)])
537 if test "$with_iconv" = "no" ; then
538     echo Disabling ICONV support
539 else
540     if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
541         CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
542         # Export this since our headers include iconv.h
543         XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
544         ICONV_LIBS="-L$with_iconv/lib"
545     fi
546
547     AC_CHECK_HEADER(iconv.h,
548         AC_MSG_CHECKING(for iconv)
549         AC_TRY_LINK([#include <stdlib.h>
550 #include <iconv.h>],[
551 iconv_t cd = iconv_open ("","");
552 iconv (cd, NULL, NULL, NULL, NULL);],[
553             AC_MSG_RESULT(yes)
554             WITH_ICONV=1],[
555             AC_MSG_RESULT(no)
556             AC_MSG_CHECKING(for iconv in -liconv)
557
558             _ldflags="${LDFLAGS}"
559             _libs="${LIBS}"
560             LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
561             LIBS="${LIBS} -liconv"
562
563             AC_TRY_LINK([#include <stdlib.h>
564 #include <iconv.h>],[
565 iconv_t cd = iconv_open ("","");
566 iconv (cd, NULL, NULL, NULL, NULL);],[
567                 AC_MSG_RESULT(yes)
568                 WITH_ICONV=1
569                 ICONV_LIBS="${ICONV_LIBS} -liconv"
570                 LIBS="${_libs}"
571                 LDFLAGS="${_ldflags}"],[
572                 AC_MSG_RESULT(no)
573                 LIBS="${_libs}"
574                 LDFLAGS="${_ldflags}"])]))
575 fi
576 M_LIBS="-lm"
577 XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
578 AC_SUBST(WITH_ICONV)
579
580 AC_ARG_WITH(schemas, [  --with-schemas              Add experimental Schemas/RelaxNG support (on)])
581 if test "$with_schemas" = "no" ; then
582     echo "Disabled Schemas/Relax-NG support"
583     WITH_SCHEMAS=0
584     TEST_SCHEMAS=
585 else    
586     echo "Enabled Schemas/Relax-NG support"
587     WITH_SCHEMAS=1
588     TEST_SCHEMAS="Schemastests Relaxtests"
589     with_regexps=yes
590 fi
591 AC_SUBST(WITH_SCHEMAS)
592 AC_SUBST(TEST_SCHEMAS)
593
594 AC_ARG_WITH(regexps, [  --with-regexps              Add Regular Expressions support (on)])
595 if test "$with_regexps" = "no" ; then
596     echo Disabling Regexps support
597     WITH_REGEXPS=0
598     TEST_REGEXPS=
599 else    
600     WITH_REGEXPS=1
601     TEST_REGEXPS="Regexptests Automatatests"
602 fi
603 AC_SUBST(WITH_REGEXPS)
604 AC_SUBST(TEST_REGEXPS)
605
606 AC_ARG_WITH(debug, [  --with-debug            Add the debugging module (on)])
607 if test "$with_debug" = "no" ; then
608     echo Disabling DEBUG support
609     WITH_DEBUG=0
610     DEBUG_OBJ=
611 else    
612     WITH_DEBUG=1
613     DEBUG_OBJ=debugXML.o
614 fi
615 AC_SUBST(WITH_DEBUG)
616 AC_SUBST(DEBUG_OBJ)
617
618 AC_ARG_WITH(mem_debug, [  --with-mem-debug        Add the memory debugging module (off)])
619 if test "$with_mem_debug" = "yes" ; then
620     echo Enabling memory debug support
621     WITH_MEM_DEBUG=1
622 else    
623     WITH_MEM_DEBUG=0
624 fi
625 AC_SUBST(WITH_MEM_DEBUG)
626
627 AC_SUBST(CFLAGS)
628 AC_SUBST(XML_CFLAGS)
629
630 AC_SUBST(XML_LIBDIR)
631 AC_SUBST(XML_LIBS)
632 AC_SUBST(ICONV_LIBS)
633 AC_SUBST(XML_INCLUDEDIR)
634 AC_SUBST(HTML_DIR)
635 AC_SUBST(HAVE_ISNAN)
636 AC_SUBST(HAVE_ISINF)
637 AC_SUBST(PYTHON)
638 AC_SUBST(PYTHON_VERSION)
639 AC_SUBST(PYTHON_INCLUDES)
640 AC_SUBST(PYTHON_SITE_PACKAGES)
641
642 AC_SUBST(M_LIBS)
643 AC_SUBST(RDL_LIBS)
644
645 dnl for the spec file
646 RELDATE=`date +'%a %b %e %Y'`
647 AC_SUBST(RELDATE)
648
649 rm -f COPYING.LIB COPYING
650 ln -s Copyright COPYING
651
652 AC_OUTPUT(libxml.spec Makefile include/Makefile include/libxml/Makefile doc/Makefile example/Makefile python/Makefile python/tests/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc xml2Conf.sh python/setup.py)
653
654 chmod +x xml2-config xml2Conf.sh python/setup.py