blob: c3d33b1367e37de0c43d0baef68cf442fc0ac6e3 [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.2)
Owen Taylor3473f882001-02-23 17:55:21 +00003AC_INIT(entities.c)
Daniel Veillard01791d51998-07-24 19:24:09 +00004AM_CONFIG_HEADER(config.h)
Daniel Veillardd2ade932000-09-30 14:39:55 +00005AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00006
Daniel Veillardcf461992000-03-14 18:30:20 +00007LIBXML_MAJOR_VERSION=2
Daniel Veillard09ab7e12001-07-10 15:49:44 +00008LIBXML_MINOR_VERSION=4
Daniel Veillard19274092002-03-25 16:48:03 +00009LIBXML_MICRO_VERSION=19
Daniel Veillard14fff061999-06-22 21:49:07 +000010LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
11LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
12
Daniel Veillard361d8452000-04-03 19:48:13 +000013LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
14
Daniel Veillard14fff061999-06-22 21:49:07 +000015AC_SUBST(LIBXML_MAJOR_VERSION)
16AC_SUBST(LIBXML_MINOR_VERSION)
17AC_SUBST(LIBXML_MICRO_VERSION)
18AC_SUBST(LIBXML_VERSION)
19AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000020AC_SUBST(LIBXML_VERSION_NUMBER)
Daniel Veillard14fff061999-06-22 21:49:07 +000021
Daniel Veillard361d8452000-04-03 19:48:13 +000022VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000023
Daniel Veillardedfb29b2000-03-14 19:59:05 +000024AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000025
26AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
Daniel Veillard01791d51998-07-24 19:24:09 +000027
28dnl Checks for programs.
29AC_PROG_CC
30AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000031AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000032AC_PATH_PROG(RM, rm, /bin/rm)
33AC_PATH_PROG(MV, mv, /bin/mv)
34AC_PATH_PROG(TAR, tar, /bin/tar)
Daniel Veillard01791d51998-07-24 19:24:09 +000035
Daniel Veillard03109292000-08-14 14:58:22 +000036dnl Make sure we have an ANSI compiler
37AM_C_PROTOTYPES
38test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
39
Daniel Veillard01791d51998-07-24 19:24:09 +000040AM_PROG_LIBTOOL
41
42AM_MAINTAINER_MODE
43
Daniel Veillard71b656e2000-01-05 14:46:17 +000044dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000045_cppflags="${CPPFLAGS}"
46_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000047
Daniel Veillard259ff742001-10-06 13:49:59 +000048
Owen Taylor3473f882001-02-23 17:55:21 +000049AC_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
Daniel Veillard259ff742001-10-06 13:49:59 +000056])
57if test "$with_zlib" = "no"; then
58 echo "Disabling compression support"
59else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000060 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]))
Daniel Veillard259ff742001-10-06 13:49:59 +000074fi
Owen Taylor3473f882001-02-23 17:55:21 +000075
Owen Taylor3473f882001-02-23 17:55:21 +000076AC_SUBST(Z_CFLAGS)
77AC_SUBST(Z_LIBS)
78
79CPPFLAGS=${_cppflags}
80LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000081
Daniel Veillard01791d51998-07-24 19:24:09 +000082dnl Checks for header files.
83AC_HEADER_DIRENT
84AC_HEADER_STDC
85AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h)
Daniel Veillard27b55282001-04-11 12:22:25 +000086AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h ansidecl.h)
Daniel Veillardb05deb71999-08-10 19:04:08 +000087AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
Daniel Veillard7f7d1111999-09-22 09:46:25 +000088AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h)
Daniel Veillard46e370e2000-07-21 20:32:03 +000089AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h sys/mman.h)
Daniel Veillarddd4b9122002-03-26 07:58:43 +000090AC_CHECK_HEADERS(sys/timeb.h signal.h arpa/nameser.h resolv.h)
Daniel Veillard01791d51998-07-24 19:24:09 +000091
Daniel Veillard1164e751999-02-16 16:29:17 +000092dnl Specific dir for HTML output ?
93if test "x$with_html_dir" = "x" ; then
Daniel Veillard0a6c3582001-03-14 19:15:37 +000094 HTML_DIR='$(prefix)/doc'
Daniel Veillard1164e751999-02-16 16:29:17 +000095else
96 HTML_DIR=$with_html_dir
97fi
98
99AC_SUBST(HTML_DIR)
100
Daniel Veillard01791d51998-07-24 19:24:09 +0000101dnl Checks for library functions.
102AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000103AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000104AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000105AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000106AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000107
Daniel Veillard92ad2102001-03-27 12:47:33 +0000108dnl Checking the standard string functions availability
109AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
110 NEED_TRIO=1)
111
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000112dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000113AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
114AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
115AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000116
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000117dnl Determine what socket length (socklen_t) data type is
118AC_MSG_CHECKING([for type of socket length (socklen_t)])
119AC_TRY_COMPILE2([
120#include <stddef.h>
121#include <sys/types.h>
122#include <sys/socket.h>],[
123(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
124 AC_MSG_RESULT(socklen_t *)
125 SOCKLEN_T=socklen_t],[
126 AC_TRY_COMPILE2([
127#include <stddef.h>
128#include <sys/types.h>
129#include <sys/socket.h>],[
130(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
131 AC_MSG_RESULT(size_t *)
132 SOCKLEN_T=size_t],[
133 AC_TRY_COMPILE2([
134#include <stddef.h>
135#include <sys/types.h>
136#include <sys/socket.h>],[
137(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
138 AC_MSG_RESULT(int *)
139 SOCKLEN_T=int],[
140 AC_MSG_WARN(could not determine)])])])
141AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T)
142
Daniel Veillardb05deb71999-08-10 19:04:08 +0000143dnl Checks for isnan in libm if not in libc
Daniel Veillard71b656e2000-01-05 14:46:17 +0000144AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
Bjorn Reesee1dc0112001-03-03 12:09:03 +0000145 [AC_DEFINE(HAVE_ISNAN)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000146
Daniel Veillard760f4422001-02-15 14:59:48 +0000147AC_CHECK_FUNC(isinf, AC_DEFINE(HAVE_ISINF) , AC_CHECK_LIB(m, isinf,
Bjorn Reesee1dc0112001-03-03 12:09:03 +0000148 [AC_DEFINE(HAVE_ISINF)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000149
150XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000151XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000152
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000153dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000154dnl Extra flags
155dnl
156XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000157RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000158
159dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000160dnl Workaround for native compilers
161dnl HP : http://bugs.gnome.org/db/31/3163.html
162dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000163dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000164if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000165 case "${host}" in
166 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000167 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000168 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000169 *-dec-osf* )
170 CFLAGS="${CFLAGS} -ieee"
171 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000172 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000173else
174 CFLAGS="${CFLAGS} -Wall"
Daniel Veillard14839d52001-06-06 16:11:56 +0000175 case "${host}" in
176 alpha*-*-linux* )
177 CFLAGS="${CFLAGS} -mieee"
178 ;;
179 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000180fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000181case ${host} in
182 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000183 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
184 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000185 hppa*-hp-mpeix)
186 NEED_TRIO=1
187 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000188esac
189
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000190
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000191dnl
192dnl check for python
193dnl
194
195PYTHON=
196PYTHON_VERSION=
197PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000198PYTHON_SITE_PACKAGES=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000199AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
200if test "$with_python" != "no" ; then
201 if test -x "$with_python/bin/python"
202 then
203 echo Found python in $with_python/bin/python
204 PYTHON="$with_python/bin/python"
205 else
206 AC_PATH_PROG(PYTHON, python python2.2 python2.1 python2.0 python1.6 python1.5)
207 fi
208 if test "$PYTHON" != ""
209 then
210 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
211 echo Found Python version $PYTHON_VERSION
212 fi
213 if test "$PYTHON_VERSION" != ""
214 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000215 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
216 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000217 then
218 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000219 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000220 else
221 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
222 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000223 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
224 PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000225 else
226 if test -r /usr/include/python$PYTHON_VERSION/Python.h
227 then
228 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillard15a143b2002-02-06 22:40:50 +0000229 PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000230 else
231 echo could not find python$PYTHON_VERSION/Python.h
232 fi
233 fi
234 fi
235 fi
236fi
237AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
238
Daniel Veillard437b87b2000-01-03 17:30:46 +0000239dnl
240dnl Tester makes use of readline if present
241dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000242_cppflags="${CPPFLAGS}"
243_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000244
Daniel Veillard03109292000-08-14 14:58:22 +0000245AC_ARG_WITH(readline,
246[ --with-readline=DIR use readline in DIR],[
247 if test "$withval" != "no" -a "$withval" != "yes"; then
248 RDL_DIR=$withval
249 CPPFLAGS="${CPPFLAGS} -I$withval/include"
250 LDFLAGS="${LDFLAGS} -L$withval/lib"
251 fi
252])
253
Daniel Veillard361d8452000-04-03 19:48:13 +0000254dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000255dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000256dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000257dnl
258if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then
259 if test "${with_mem_debug}" = "" ; then
260 with_mem_debug="yes"
261 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000262 if test "${with_docbook}" = "" ; then
263 with_docbook="yes"
264 fi
Daniel Veillardf6eea272001-01-18 12:17:12 +0000265 if test "${with_xptr}" = "" ; then
266 with_xptr="yes"
267 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000268 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 "
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000269dnl -Wcast-qual -ansi
Daniel Veillardf6eea272001-01-18 12:17:12 +0000270fi
Daniel Veillard92ad2102001-03-27 12:47:33 +0000271
272dnl
273dnl Check for trio string functions
274dnl
275
276if test "${NEED_TRIO}" = "1" ; then
277 echo Adding trio library for string functions
278 WITH_TRIO=1
279else
280 WITH_TRIO=0
281fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000282AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000283AC_SUBST(WITH_TRIO)
284
Daniel Veillardf6eea272001-01-18 12:17:12 +0000285dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000286dnl Aloow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000287dnl
288
Daniel Veillardb8478642001-10-12 17:29:10 +0000289THREAD_LIBS=""
290WITH_THREADS=0
291THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000292TEST_THREADS=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000293
Daniel Veillardb8478642001-10-12 17:29:10 +0000294AC_ARG_WITH(threads, [ --with-threads Add multithread support(off)])
295if test "$with_threads" = "yes" ; then
296 echo Enabling multithreaded support
297
298 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000299 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000300 THREAD_LIBS="-lpthread"
301 AC_DEFINE(HAVE_LIBPTHREAD)
302 AC_DEFINE(HAVE_PTHREAD_H)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000303 WITH_THREADS="1"]))
Daniel Veillardb8478642001-10-12 17:29:10 +0000304
305 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000306 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
307 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000308 fi
309fi
Daniel Veillard64a411c2001-10-15 12:32:07 +0000310AC_ARG_WITH(thread-alloc, [ --with-thread-alloc Add per-thread memory(off)])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000311if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
312 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000313fi
314
Daniel Veillardb8478642001-10-12 17:29:10 +0000315AC_SUBST(THREAD_LIBS)
316AC_SUBST(WITH_THREADS)
317AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000318AC_SUBST(TEST_THREADS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000319
320AC_ARG_WITH(history, [ --with-history Add history support to xmllint shell(off)])
Daniel Veillard259ff742001-10-06 13:49:59 +0000321if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000322 echo Enabling xmllint shell history
323 dnl check for terminal library. this is a very cool solution
324 dnl from octave's configure.in
325 unset tcap
326 for termlib in ncurses curses termcap terminfo termlib; do
327 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
328 test -n "$tcap" && break
329 done
330
331 AC_CHECK_HEADER(readline/history.h,
332 AC_CHECK_LIB(history, append_history,[
333 RDL_LIBS="-lhistory"
334 AC_DEFINE(HAVE_LIBHISTORY)]))
335 AC_CHECK_HEADER(readline/readline.h,
336 AC_CHECK_LIB(readline, readline,[
337 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
338 AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
339 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
340 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
341 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
342 else
343 CPPFLAGS=${_cppflags}
344 fi
345 LDFLAGS=${_ldflags}
346fi
347
348AC_SUBST(WITH_FTP)
349AC_SUBST(FTP_OBJ)
Daniel Veillard361d8452000-04-03 19:48:13 +0000350AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)])
351if test "$with_ftp" = "no" ; then
352 echo Disabling FTP support
353 WITH_FTP=0
354 FTP_OBJ=
355else
356 WITH_FTP=1
357 FTP_OBJ=nanoftp.o
358fi
359AC_SUBST(WITH_FTP)
360AC_SUBST(FTP_OBJ)
361
362AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)])
363if test "$with_http" = "no" ; then
364 echo Disabling HTTP support
365 WITH_HTTP=0
366 HTTP_OBJ=
367else
368 WITH_HTTP=1
369 HTTP_OBJ=nanohttp.o
370fi
371AC_SUBST(WITH_HTTP)
372AC_SUBST(HTTP_OBJ)
373
374AC_ARG_WITH(html, [ --with-html Add the HTML support (on)])
375if test "$with_html" = "no" ; then
376 echo Disabling HTML support
377 WITH_HTML=0
378 HTML_OBJ=
379else
380 WITH_HTML=1
381 HTML_OBJ="HTMLparser.o HTMLtree.o"
382fi
383AC_SUBST(WITH_HTML)
384AC_SUBST(HTML_OBJ)
385
Daniel Veillarda7374592001-05-10 14:17:55 +0000386AC_ARG_WITH(catalog, [ --with-catalog Add the Catalog support (on)])
387if test "$with_catalog" = "no" ; then
388 echo Disabling Catalog support
389 WITH_CATALOG=0
390 CATALOG_OBJ=
391else
392 WITH_CATALOG=1
393 CATALOG_OBJ="catalog.o"
394fi
395AC_SUBST(WITH_CATALOG)
396AC_SUBST(CATALOG_OBJ)
397
Daniel Veillard6e90d192001-07-03 16:37:49 +0000398AC_ARG_WITH(docbook, [ --with-docbook Add Docbook SGML support (on)])
Daniel Veillardb59076b2001-04-29 17:04:07 +0000399if test "$with_docbook" = "no" ; then
400 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000401 WITH_DOCB=0
402 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000403else
404 WITH_DOCB=1
405 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000406fi
407AC_SUBST(WITH_DOCB)
408AC_SUBST(DOCB_OBJ)
409
410
Daniel Veillard361d8452000-04-03 19:48:13 +0000411AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)])
412if test "$with_xpath" = "no" ; then
413 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000414 with_xptr="no"
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000415 with-c14n="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000416 WITH_XPATH=0
417 XPATH_OBJ=
418else
419 WITH_XPATH=1
420 XPATH_OBJ=xpath.o
421fi
422AC_SUBST(WITH_XPATH)
423AC_SUBST(XPATH_OBJ)
424
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000425AC_ARG_WITH(xptr, [ --with-xptr Add the XPointer support (on)])
426if test "$with_xptr" = "no" ; then
427 echo Disabling XPointer support
428 WITH_XPTR=0
429 XPTR_OBJ=
430else
431 WITH_XPTR=1
432 XPTR_OBJ=xpointer.o
433fi
434AC_SUBST(WITH_XPTR)
435AC_SUBST(XPTR_OBJ)
436
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000437AC_ARG_WITH(c14n, [ --with-c14n Add the Canonicalization support (on)])
438if test "$with_c14n" = "no" ; then
439 echo Disabling C14N support
440 WITH_C14N=0
441 C14N_OBJ=
442else
443 WITH_C14N=1
444 C14N_OBJ="c14n.c"
445fi
446AC_SUBST(WITH_C14N)
447AC_SUBST(C14N_OBJ)
448
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000449AC_ARG_WITH(xinclude, [ --with-xinclude Add the XInclude support (on)])
450if test "$with_xinclude" = "no" ; then
451 echo Disabling XInclude support
452 WITH_XINCLUDE=0
453 XINCLUDE_OBJ=
454 with_xinclude="no"
455else
456 WITH_XINCLUDE=1
457 XINCLUDE_OBJ=xinclude.o
458fi
459AC_SUBST(WITH_XINCLUDE)
460AC_SUBST(XINCLUDE_OBJ)
461
Daniel Veillard6e90d192001-07-03 16:37:49 +0000462WITH_ICONV=0
463AC_ARG_WITH(iconv, [ --with-iconv[=DIR] Add ICONV support (on)])
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000464if test "$with_iconv" = "no" ; then
465 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000466else
Daniel Veillard220346d2001-12-07 11:33:54 +0000467 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000468 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000469 # Export this since our headers include iconv.h
470 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000471 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000472 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000473
474 AC_CHECK_HEADER(iconv.h,
475 AC_MSG_CHECKING(for iconv)
476 AC_TRY_LINK([#include <stdlib.h>
477#include <iconv.h>],[
478iconv_t cd = iconv_open ("","");
479iconv (cd, NULL, NULL, NULL, NULL);],[
480 AC_MSG_RESULT(yes)
481 WITH_ICONV=1],[
482 AC_MSG_RESULT(no)
483 AC_MSG_CHECKING(for iconv in -liconv)
484
485 _ldflags="${LDFLAGS}"
486 _libs="${LIBS}"
487 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
488 LIBS="${LIBS} -liconv"
489
490 AC_TRY_LINK([#include <stdlib.h>
491#include <iconv.h>],[
492iconv_t cd = iconv_open ("","");
493iconv (cd, NULL, NULL, NULL, NULL);],[
494 AC_MSG_RESULT(yes)
495 WITH_ICONV=1
496 ICONV_LIBS="${ICONV_LIBS} -liconv"
497 LIBS="${_libs}"
498 LDFLAGS="${_ldflags}"],[
499 AC_MSG_RESULT(no)
500 LIBS="${_libs}"
501 LDFLAGS="${_ldflags}"])]))
502fi
Daniel Veillardb82c1662001-12-09 14:00:54 +0000503M_LIBS="-lm"
504XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000505AC_SUBST(WITH_ICONV)
506
Daniel Veillard361d8452000-04-03 19:48:13 +0000507AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)])
508if test "$with_debug" = "no" ; then
509 echo Disabling DEBUG support
510 WITH_DEBUG=0
511 DEBUG_OBJ=
512else
513 WITH_DEBUG=1
514 DEBUG_OBJ=debugXML.o
515fi
516AC_SUBST(WITH_DEBUG)
517AC_SUBST(DEBUG_OBJ)
518
519AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
520if test "$with_mem_debug" = "yes" ; then
521 echo Enabling memory debug support
522 WITH_MEM_DEBUG=1
523else
524 WITH_MEM_DEBUG=0
525fi
526AC_SUBST(WITH_MEM_DEBUG)
527
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000528AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000529AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000530
Daniel Veillardb05deb71999-08-10 19:04:08 +0000531AC_SUBST(XML_LIBDIR)
532AC_SUBST(XML_LIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +0000533AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000534AC_SUBST(XML_INCLUDEDIR)
535AC_SUBST(HTML_DIR)
536AC_SUBST(HAVE_ISNAN)
537AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000538AC_SUBST(PYTHON)
539AC_SUBST(PYTHON_VERSION)
540AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000541AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000542
Daniel Veillardb05deb71999-08-10 19:04:08 +0000543AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +0000544AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000545
Daniel Veillardc575b992002-02-08 13:28:40 +0000546rm -f rm COPYING.LIB COPYING
547ln -s Copyright COPYING
548
Daniel Veillardfa49d872002-03-09 10:20:00 +0000549AC_OUTPUT(libxml.spec Makefile include/Makefile include/libxml/Makefile doc/Makefile example/Makefile python/Makefile python/tests/Makefile include/libxml/xmlversion.h include/libxml/xmlwin32version.h xml2-config libxml-2.0.pc xml2Conf.sh python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000550