blob: a11bcb901fd9876da77801d54778ddc933bdf471 [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 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000179 alpha*-*-osf* )
180 CFLAGS="${CFLAGS} -mieee"
181 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000182 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000183fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000184case ${host} in
185 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000186 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
187 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000188 hppa*-hp-mpeix)
189 NEED_TRIO=1
190 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000191esac
192
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000193
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000194dnl
195dnl check for python
196dnl
197
198PYTHON=
199PYTHON_VERSION=
200PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000201PYTHON_SITE_PACKAGES=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000202AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
203if test "$with_python" != "no" ; then
204 if test -x "$with_python/bin/python"
205 then
206 echo Found python in $with_python/bin/python
207 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000208 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000209 if test -x "$with_python"
210 then
211 echo Found python in $with_python/bin/python
212 PYTHON="$with_python/bin/python"
213 else
214 AC_PATH_PROG(PYTHON, python python2.2 python2.1 python2.0 python1.6 python1.5)
215 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000216 fi
217 if test "$PYTHON" != ""
218 then
219 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
220 echo Found Python version $PYTHON_VERSION
221 fi
222 if test "$PYTHON_VERSION" != ""
223 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000224 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
225 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000226 then
227 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000228 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000229 else
230 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
231 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000232 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
233 PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000234 else
235 if test -r /usr/include/python$PYTHON_VERSION/Python.h
236 then
237 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillard15a143b2002-02-06 22:40:50 +0000238 PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000239 else
240 echo could not find python$PYTHON_VERSION/Python.h
241 fi
242 fi
243 fi
244 fi
245fi
246AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
247
Daniel Veillard437b87b2000-01-03 17:30:46 +0000248dnl
249dnl Tester makes use of readline if present
250dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000251_cppflags="${CPPFLAGS}"
252_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000253
Daniel Veillard03109292000-08-14 14:58:22 +0000254AC_ARG_WITH(readline,
255[ --with-readline=DIR use readline in DIR],[
256 if test "$withval" != "no" -a "$withval" != "yes"; then
257 RDL_DIR=$withval
258 CPPFLAGS="${CPPFLAGS} -I$withval/include"
259 LDFLAGS="${LDFLAGS} -L$withval/lib"
260 fi
261])
262
Daniel Veillard361d8452000-04-03 19:48:13 +0000263dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000264dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000265dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000266dnl
267if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then
268 if test "${with_mem_debug}" = "" ; then
269 with_mem_debug="yes"
270 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000271 if test "${with_docbook}" = "" ; then
272 with_docbook="yes"
273 fi
Daniel Veillardf6eea272001-01-18 12:17:12 +0000274 if test "${with_xptr}" = "" ; then
275 with_xptr="yes"
276 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000277 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 +0000278dnl -Wcast-qual -ansi
Daniel Veillardf6eea272001-01-18 12:17:12 +0000279fi
Daniel Veillard92ad2102001-03-27 12:47:33 +0000280
281dnl
282dnl Check for trio string functions
283dnl
284
285if test "${NEED_TRIO}" = "1" ; then
286 echo Adding trio library for string functions
287 WITH_TRIO=1
288else
289 WITH_TRIO=0
290fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000291AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000292AC_SUBST(WITH_TRIO)
293
Daniel Veillardf6eea272001-01-18 12:17:12 +0000294dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000295dnl Aloow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000296dnl
297
Daniel Veillardb8478642001-10-12 17:29:10 +0000298THREAD_LIBS=""
299WITH_THREADS=0
300THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000301TEST_THREADS=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000302
Daniel Veillardb8478642001-10-12 17:29:10 +0000303AC_ARG_WITH(threads, [ --with-threads Add multithread support(off)])
304if test "$with_threads" = "yes" ; then
305 echo Enabling multithreaded support
306
307 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000308 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000309 THREAD_LIBS="-lpthread"
310 AC_DEFINE(HAVE_LIBPTHREAD)
311 AC_DEFINE(HAVE_PTHREAD_H)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000312 WITH_THREADS="1"]))
Daniel Veillardb8478642001-10-12 17:29:10 +0000313
314 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000315 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
316 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000317 fi
318fi
Daniel Veillard64a411c2001-10-15 12:32:07 +0000319AC_ARG_WITH(thread-alloc, [ --with-thread-alloc Add per-thread memory(off)])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000320if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
321 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000322fi
323
Daniel Veillardb8478642001-10-12 17:29:10 +0000324AC_SUBST(THREAD_LIBS)
325AC_SUBST(WITH_THREADS)
326AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000327AC_SUBST(TEST_THREADS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000328
329AC_ARG_WITH(history, [ --with-history Add history support to xmllint shell(off)])
Daniel Veillard259ff742001-10-06 13:49:59 +0000330if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000331 echo Enabling xmllint shell history
332 dnl check for terminal library. this is a very cool solution
333 dnl from octave's configure.in
334 unset tcap
335 for termlib in ncurses curses termcap terminfo termlib; do
336 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
337 test -n "$tcap" && break
338 done
339
340 AC_CHECK_HEADER(readline/history.h,
341 AC_CHECK_LIB(history, append_history,[
342 RDL_LIBS="-lhistory"
343 AC_DEFINE(HAVE_LIBHISTORY)]))
344 AC_CHECK_HEADER(readline/readline.h,
345 AC_CHECK_LIB(readline, readline,[
346 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
347 AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
348 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
349 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
350 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
351 else
352 CPPFLAGS=${_cppflags}
353 fi
354 LDFLAGS=${_ldflags}
355fi
356
357AC_SUBST(WITH_FTP)
358AC_SUBST(FTP_OBJ)
Daniel Veillard361d8452000-04-03 19:48:13 +0000359AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)])
360if test "$with_ftp" = "no" ; then
361 echo Disabling FTP support
362 WITH_FTP=0
363 FTP_OBJ=
364else
365 WITH_FTP=1
366 FTP_OBJ=nanoftp.o
367fi
368AC_SUBST(WITH_FTP)
369AC_SUBST(FTP_OBJ)
370
371AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)])
372if test "$with_http" = "no" ; then
373 echo Disabling HTTP support
374 WITH_HTTP=0
375 HTTP_OBJ=
376else
377 WITH_HTTP=1
378 HTTP_OBJ=nanohttp.o
379fi
380AC_SUBST(WITH_HTTP)
381AC_SUBST(HTTP_OBJ)
382
383AC_ARG_WITH(html, [ --with-html Add the HTML support (on)])
384if test "$with_html" = "no" ; then
385 echo Disabling HTML support
386 WITH_HTML=0
387 HTML_OBJ=
388else
389 WITH_HTML=1
390 HTML_OBJ="HTMLparser.o HTMLtree.o"
391fi
392AC_SUBST(WITH_HTML)
393AC_SUBST(HTML_OBJ)
394
Daniel Veillarda7374592001-05-10 14:17:55 +0000395AC_ARG_WITH(catalog, [ --with-catalog Add the Catalog support (on)])
396if test "$with_catalog" = "no" ; then
397 echo Disabling Catalog support
398 WITH_CATALOG=0
399 CATALOG_OBJ=
400else
401 WITH_CATALOG=1
402 CATALOG_OBJ="catalog.o"
403fi
404AC_SUBST(WITH_CATALOG)
405AC_SUBST(CATALOG_OBJ)
406
Daniel Veillard6e90d192001-07-03 16:37:49 +0000407AC_ARG_WITH(docbook, [ --with-docbook Add Docbook SGML support (on)])
Daniel Veillardb59076b2001-04-29 17:04:07 +0000408if test "$with_docbook" = "no" ; then
409 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000410 WITH_DOCB=0
411 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000412else
413 WITH_DOCB=1
414 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000415fi
416AC_SUBST(WITH_DOCB)
417AC_SUBST(DOCB_OBJ)
418
419
Daniel Veillard361d8452000-04-03 19:48:13 +0000420AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)])
421if test "$with_xpath" = "no" ; then
422 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000423 with_xptr="no"
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000424 with-c14n="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000425 WITH_XPATH=0
426 XPATH_OBJ=
427else
428 WITH_XPATH=1
429 XPATH_OBJ=xpath.o
430fi
431AC_SUBST(WITH_XPATH)
432AC_SUBST(XPATH_OBJ)
433
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000434AC_ARG_WITH(xptr, [ --with-xptr Add the XPointer support (on)])
435if test "$with_xptr" = "no" ; then
436 echo Disabling XPointer support
437 WITH_XPTR=0
438 XPTR_OBJ=
439else
440 WITH_XPTR=1
441 XPTR_OBJ=xpointer.o
442fi
443AC_SUBST(WITH_XPTR)
444AC_SUBST(XPTR_OBJ)
445
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000446AC_ARG_WITH(c14n, [ --with-c14n Add the Canonicalization support (on)])
447if test "$with_c14n" = "no" ; then
448 echo Disabling C14N support
449 WITH_C14N=0
450 C14N_OBJ=
451else
452 WITH_C14N=1
453 C14N_OBJ="c14n.c"
454fi
455AC_SUBST(WITH_C14N)
456AC_SUBST(C14N_OBJ)
457
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000458AC_ARG_WITH(xinclude, [ --with-xinclude Add the XInclude support (on)])
459if test "$with_xinclude" = "no" ; then
460 echo Disabling XInclude support
461 WITH_XINCLUDE=0
462 XINCLUDE_OBJ=
463 with_xinclude="no"
464else
465 WITH_XINCLUDE=1
466 XINCLUDE_OBJ=xinclude.o
467fi
468AC_SUBST(WITH_XINCLUDE)
469AC_SUBST(XINCLUDE_OBJ)
470
Daniel Veillard6e90d192001-07-03 16:37:49 +0000471WITH_ICONV=0
472AC_ARG_WITH(iconv, [ --with-iconv[=DIR] Add ICONV support (on)])
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000473if test "$with_iconv" = "no" ; then
474 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000475else
Daniel Veillard220346d2001-12-07 11:33:54 +0000476 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000477 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000478 # Export this since our headers include iconv.h
479 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000480 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000481 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000482
483 AC_CHECK_HEADER(iconv.h,
484 AC_MSG_CHECKING(for iconv)
485 AC_TRY_LINK([#include <stdlib.h>
486#include <iconv.h>],[
487iconv_t cd = iconv_open ("","");
488iconv (cd, NULL, NULL, NULL, NULL);],[
489 AC_MSG_RESULT(yes)
490 WITH_ICONV=1],[
491 AC_MSG_RESULT(no)
492 AC_MSG_CHECKING(for iconv in -liconv)
493
494 _ldflags="${LDFLAGS}"
495 _libs="${LIBS}"
496 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
497 LIBS="${LIBS} -liconv"
498
499 AC_TRY_LINK([#include <stdlib.h>
500#include <iconv.h>],[
501iconv_t cd = iconv_open ("","");
502iconv (cd, NULL, NULL, NULL, NULL);],[
503 AC_MSG_RESULT(yes)
504 WITH_ICONV=1
505 ICONV_LIBS="${ICONV_LIBS} -liconv"
506 LIBS="${_libs}"
507 LDFLAGS="${_ldflags}"],[
508 AC_MSG_RESULT(no)
509 LIBS="${_libs}"
510 LDFLAGS="${_ldflags}"])]))
511fi
Daniel Veillardb82c1662001-12-09 14:00:54 +0000512M_LIBS="-lm"
513XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000514AC_SUBST(WITH_ICONV)
515
Daniel Veillard361d8452000-04-03 19:48:13 +0000516AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)])
517if test "$with_debug" = "no" ; then
518 echo Disabling DEBUG support
519 WITH_DEBUG=0
520 DEBUG_OBJ=
521else
522 WITH_DEBUG=1
523 DEBUG_OBJ=debugXML.o
524fi
525AC_SUBST(WITH_DEBUG)
526AC_SUBST(DEBUG_OBJ)
527
528AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
529if test "$with_mem_debug" = "yes" ; then
530 echo Enabling memory debug support
531 WITH_MEM_DEBUG=1
532else
533 WITH_MEM_DEBUG=0
534fi
535AC_SUBST(WITH_MEM_DEBUG)
536
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000537AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000538AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000539
Daniel Veillardb05deb71999-08-10 19:04:08 +0000540AC_SUBST(XML_LIBDIR)
541AC_SUBST(XML_LIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +0000542AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000543AC_SUBST(XML_INCLUDEDIR)
544AC_SUBST(HTML_DIR)
545AC_SUBST(HAVE_ISNAN)
546AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000547AC_SUBST(PYTHON)
548AC_SUBST(PYTHON_VERSION)
549AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000550AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000551
Daniel Veillardb05deb71999-08-10 19:04:08 +0000552AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +0000553AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000554
Daniel Veillardc575b992002-02-08 13:28:40 +0000555rm -f rm COPYING.LIB COPYING
556ln -s Copyright COPYING
557
Daniel Veillardfa49d872002-03-09 10:20:00 +0000558AC_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 +0000559
Daniel Veillard9b731d72002-04-14 12:56:08 +0000560chmod +x xml2-config xml2Conf.sh python/setup.py