blob: 59395a7891bb92e97bfc45e01812c81a0c59e30e [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 Veillard7b4b2f92003-01-06 13:11:20 +00008LIBXML_MINOR_VERSION=5
Daniel Veillarde2830f12003-01-08 17:47:49 +00009LIBXML_MICRO_VERSION=1
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
Daniel Veillard817e70b2002-11-19 22:28:48 +000085AC_CHECK_HEADERS([fcntl.h])
86AC_CHECK_HEADERS([unistd.h])
87AC_CHECK_HEADERS([ctype.h])
88AC_CHECK_HEADERS([dirent.h])
89AC_CHECK_HEADERS([errno.h])
90AC_CHECK_HEADERS([malloc.h])
91AC_CHECK_HEADERS([stdarg.h])
92AC_CHECK_HEADERS([sys/stat.h])
93AC_CHECK_HEADERS([sys/types.h])
94AC_CHECK_HEADERS([time.h])
95AC_CHECK_HEADERS([ansidecl.h])
96AC_CHECK_HEADERS([ieeefp.h])
97AC_CHECK_HEADERS([nan.h])
98AC_CHECK_HEADERS([math.h])
99AC_CHECK_HEADERS([fp_class.h])
100AC_CHECK_HEADERS([float.h])
101AC_CHECK_HEADERS([stdlib.h])
102AC_CHECK_HEADERS([sys/socket.h], [], [],
103[#if HAVE_SYS_TYPES_H
104# include <sys/types.h>
105# endif
106])
107AC_CHECK_HEADERS([netinet/in.h], [], [],
108[#if HAVE_SYS_TYPES_H
109# include <sys/types.h>
110# endif
111])
112AC_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])
120AC_CHECK_HEADERS([netdb.h])
121AC_CHECK_HEADERS([sys/time.h])
122AC_CHECK_HEADERS([sys/select.h])
123AC_CHECK_HEADERS([sys/mman.h])
124AC_CHECK_HEADERS([sys/timeb.h])
125AC_CHECK_HEADERS([signal.h])
126AC_CHECK_HEADERS([arpa/nameser.h], [], [],
127[#if HAVE_SYS_TYPES_H
128# include <sys/types.h>
129# endif
130])
131AC_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])
Daniel Veillard01791d51998-07-24 19:24:09 +0000142
Daniel Veillard1164e751999-02-16 16:29:17 +0000143dnl Specific dir for HTML output ?
144if test "x$with_html_dir" = "x" ; then
Daniel Veillard0a6c3582001-03-14 19:15:37 +0000145 HTML_DIR='$(prefix)/doc'
Daniel Veillard1164e751999-02-16 16:29:17 +0000146else
147 HTML_DIR=$with_html_dir
148fi
149
150AC_SUBST(HTML_DIR)
151
Daniel Veillard01791d51998-07-24 19:24:09 +0000152dnl Checks for library functions.
153AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000154AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000155AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000156AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000157AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000158
Daniel Veillard92ad2102001-03-27 12:47:33 +0000159dnl Checking the standard string functions availability
160AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
161 NEED_TRIO=1)
162
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000163dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000164AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
165AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
166AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000167
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000168dnl Determine what socket length (socklen_t) data type is
169AC_MSG_CHECKING([for type of socket length (socklen_t)])
170AC_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)])])])
192AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T)
193
Daniel Veillardb05deb71999-08-10 19:04:08 +0000194dnl Checks for isnan in libm if not in libc
Daniel Veillard71b656e2000-01-05 14:46:17 +0000195AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
Bjorn Reesee1dc0112001-03-03 12:09:03 +0000196 [AC_DEFINE(HAVE_ISNAN)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000197
Daniel Veillard760f4422001-02-15 14:59:48 +0000198AC_CHECK_FUNC(isinf, AC_DEFINE(HAVE_ISINF) , AC_CHECK_LIB(m, isinf,
Bjorn Reesee1dc0112001-03-03 12:09:03 +0000199 [AC_DEFINE(HAVE_ISINF)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000200
201XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000202XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000203
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000204dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000205dnl Extra flags
206dnl
207XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000208RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000209
210dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000211dnl Workaround for native compilers
212dnl HP : http://bugs.gnome.org/db/31/3163.html
213dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000214dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000215if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000216 case "${host}" in
217 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000218 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000219 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000220 *-dec-osf* )
221 CFLAGS="${CFLAGS} -ieee"
222 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000223 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000224else
225 CFLAGS="${CFLAGS} -Wall"
Daniel Veillard14839d52001-06-06 16:11:56 +0000226 case "${host}" in
227 alpha*-*-linux* )
228 CFLAGS="${CFLAGS} -mieee"
229 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000230 alpha*-*-osf* )
231 CFLAGS="${CFLAGS} -mieee"
232 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000233 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000234fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000235case ${host} in
236 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000237 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
238 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000239 hppa*-hp-mpeix)
240 NEED_TRIO=1
241 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000242esac
243
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000244
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000245dnl
246dnl check for python
247dnl
248
249PYTHON=
250PYTHON_VERSION=
251PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000252PYTHON_SITE_PACKAGES=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000253AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
254if 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"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000259 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000260 if test -x "$with_python"
261 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000262 echo Found python in $with_python
263 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000264 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000265 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000266 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000267 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
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000275 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
276 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000277 then
278 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000279 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000280 else
281 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
282 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000283 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000284 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000285 else
286 if test -r /usr/include/python$PYTHON_VERSION/Python.h
287 then
288 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000289 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000290 else
291 echo could not find python$PYTHON_VERSION/Python.h
292 fi
293 fi
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000294 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
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000298 fi
299 fi
300fi
301AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000302if test "$PYTHON_INCLUDES" != ""
303then
304 PYTHON_SUBDIR=python
305else
306 PYTHON_SUBDIR=
307fi
308AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000309
Daniel Veillard437b87b2000-01-03 17:30:46 +0000310dnl
311dnl Tester makes use of readline if present
312dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000313_cppflags="${CPPFLAGS}"
314_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000315
Daniel Veillard03109292000-08-14 14:58:22 +0000316AC_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
Daniel Veillard361d8452000-04-03 19:48:13 +0000325dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000326dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000327dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000328dnl
329if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then
330 if test "${with_mem_debug}" = "" ; then
331 with_mem_debug="yes"
332 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000333 if test "${with_docbook}" = "" ; then
334 with_docbook="yes"
335 fi
Daniel Veillardf6eea272001-01-18 12:17:12 +0000336 if test "${with_xptr}" = "" ; then
337 with_xptr="yes"
338 fi
Daniel Veillard4255d502002-04-16 15:50:10 +0000339 if test "${with_schemas}" = "" ; then
340 with_schemas="yes"
341 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000342 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 +0000343dnl -Wcast-qual -ansi
Daniel Veillardf6eea272001-01-18 12:17:12 +0000344fi
Daniel Veillard92ad2102001-03-27 12:47:33 +0000345
346dnl
347dnl Check for trio string functions
348dnl
349
350if test "${NEED_TRIO}" = "1" ; then
351 echo Adding trio library for string functions
352 WITH_TRIO=1
353else
354 WITH_TRIO=0
355fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000356AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000357AC_SUBST(WITH_TRIO)
358
Daniel Veillardf6eea272001-01-18 12:17:12 +0000359dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000360dnl Aloow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000361dnl
362
Daniel Veillardb8478642001-10-12 17:29:10 +0000363THREAD_LIBS=""
364WITH_THREADS=0
365THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000366TEST_THREADS=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000367
Daniel Veillardb8478642001-10-12 17:29:10 +0000368AC_ARG_WITH(threads, [ --with-threads Add multithread support(off)])
369if test "$with_threads" = "yes" ; then
370 echo Enabling multithreaded support
371
372 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000373 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000374 THREAD_LIBS="-lpthread"
375 AC_DEFINE(HAVE_LIBPTHREAD)
376 AC_DEFINE(HAVE_PTHREAD_H)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000377 WITH_THREADS="1"]))
Daniel Veillardb8478642001-10-12 17:29:10 +0000378
379 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000380 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
381 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000382 fi
383fi
Daniel Veillard64a411c2001-10-15 12:32:07 +0000384AC_ARG_WITH(thread-alloc, [ --with-thread-alloc Add per-thread memory(off)])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000385if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
386 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000387fi
388
Daniel Veillardb8478642001-10-12 17:29:10 +0000389AC_SUBST(THREAD_LIBS)
390AC_SUBST(WITH_THREADS)
391AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000392AC_SUBST(TEST_THREADS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000393
394AC_ARG_WITH(history, [ --with-history Add history support to xmllint shell(off)])
Daniel Veillard259ff742001-10-06 13:49:59 +0000395if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000396 echo Enabling xmllint shell history
397 dnl check for terminal library. this is a very cool solution
398 dnl from octave's configure.in
399 unset tcap
400 for termlib in ncurses curses termcap terminfo termlib; do
401 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
402 test -n "$tcap" && break
403 done
404
405 AC_CHECK_HEADER(readline/history.h,
406 AC_CHECK_LIB(history, append_history,[
407 RDL_LIBS="-lhistory"
408 AC_DEFINE(HAVE_LIBHISTORY)]))
409 AC_CHECK_HEADER(readline/readline.h,
410 AC_CHECK_LIB(readline, readline,[
411 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
412 AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
413 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
414 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
415 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
416 else
417 CPPFLAGS=${_cppflags}
418 fi
419 LDFLAGS=${_ldflags}
420fi
421
422AC_SUBST(WITH_FTP)
423AC_SUBST(FTP_OBJ)
Daniel Veillard361d8452000-04-03 19:48:13 +0000424AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)])
425if test "$with_ftp" = "no" ; then
426 echo Disabling FTP support
427 WITH_FTP=0
428 FTP_OBJ=
429else
430 WITH_FTP=1
431 FTP_OBJ=nanoftp.o
432fi
433AC_SUBST(WITH_FTP)
434AC_SUBST(FTP_OBJ)
435
436AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)])
437if test "$with_http" = "no" ; then
438 echo Disabling HTTP support
439 WITH_HTTP=0
440 HTTP_OBJ=
441else
442 WITH_HTTP=1
443 HTTP_OBJ=nanohttp.o
444fi
445AC_SUBST(WITH_HTTP)
446AC_SUBST(HTTP_OBJ)
447
448AC_ARG_WITH(html, [ --with-html Add the HTML support (on)])
449if test "$with_html" = "no" ; then
450 echo Disabling HTML support
451 WITH_HTML=0
452 HTML_OBJ=
453else
454 WITH_HTML=1
455 HTML_OBJ="HTMLparser.o HTMLtree.o"
456fi
457AC_SUBST(WITH_HTML)
458AC_SUBST(HTML_OBJ)
459
Daniel Veillarda7374592001-05-10 14:17:55 +0000460AC_ARG_WITH(catalog, [ --with-catalog Add the Catalog support (on)])
461if test "$with_catalog" = "no" ; then
462 echo Disabling Catalog support
463 WITH_CATALOG=0
464 CATALOG_OBJ=
465else
466 WITH_CATALOG=1
467 CATALOG_OBJ="catalog.o"
468fi
469AC_SUBST(WITH_CATALOG)
470AC_SUBST(CATALOG_OBJ)
471
Daniel Veillard6e90d192001-07-03 16:37:49 +0000472AC_ARG_WITH(docbook, [ --with-docbook Add Docbook SGML support (on)])
Daniel Veillardb59076b2001-04-29 17:04:07 +0000473if test "$with_docbook" = "no" ; then
474 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000475 WITH_DOCB=0
476 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000477else
478 WITH_DOCB=1
479 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000480fi
481AC_SUBST(WITH_DOCB)
482AC_SUBST(DOCB_OBJ)
483
484
Daniel Veillard361d8452000-04-03 19:48:13 +0000485AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)])
486if test "$with_xpath" = "no" ; then
487 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000488 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000489 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000490 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000491 WITH_XPATH=0
492 XPATH_OBJ=
493else
494 WITH_XPATH=1
495 XPATH_OBJ=xpath.o
496fi
497AC_SUBST(WITH_XPATH)
498AC_SUBST(XPATH_OBJ)
499
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000500AC_ARG_WITH(xptr, [ --with-xptr Add the XPointer support (on)])
501if test "$with_xptr" = "no" ; then
502 echo Disabling XPointer support
503 WITH_XPTR=0
504 XPTR_OBJ=
505else
506 WITH_XPTR=1
507 XPTR_OBJ=xpointer.o
508fi
509AC_SUBST(WITH_XPTR)
510AC_SUBST(XPTR_OBJ)
511
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000512AC_ARG_WITH(c14n, [ --with-c14n Add the Canonicalization support (on)])
513if test "$with_c14n" = "no" ; then
514 echo Disabling C14N support
515 WITH_C14N=0
516 C14N_OBJ=
517else
518 WITH_C14N=1
519 C14N_OBJ="c14n.c"
520fi
521AC_SUBST(WITH_C14N)
522AC_SUBST(C14N_OBJ)
523
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000524AC_ARG_WITH(xinclude, [ --with-xinclude Add the XInclude support (on)])
525if test "$with_xinclude" = "no" ; then
526 echo Disabling XInclude support
527 WITH_XINCLUDE=0
528 XINCLUDE_OBJ=
529 with_xinclude="no"
530else
531 WITH_XINCLUDE=1
532 XINCLUDE_OBJ=xinclude.o
533fi
534AC_SUBST(WITH_XINCLUDE)
535AC_SUBST(XINCLUDE_OBJ)
536
Daniel Veillard6e90d192001-07-03 16:37:49 +0000537WITH_ICONV=0
538AC_ARG_WITH(iconv, [ --with-iconv[=DIR] Add ICONV support (on)])
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000539if test "$with_iconv" = "no" ; then
540 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000541else
Daniel Veillard220346d2001-12-07 11:33:54 +0000542 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000543 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000544 # Export this since our headers include iconv.h
545 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000546 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000547 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000548
549 AC_CHECK_HEADER(iconv.h,
550 AC_MSG_CHECKING(for iconv)
551 AC_TRY_LINK([#include <stdlib.h>
552#include <iconv.h>],[
553iconv_t cd = iconv_open ("","");
554iconv (cd, NULL, NULL, NULL, NULL);],[
555 AC_MSG_RESULT(yes)
556 WITH_ICONV=1],[
557 AC_MSG_RESULT(no)
558 AC_MSG_CHECKING(for iconv in -liconv)
559
560 _ldflags="${LDFLAGS}"
561 _libs="${LIBS}"
562 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
563 LIBS="${LIBS} -liconv"
564
565 AC_TRY_LINK([#include <stdlib.h>
566#include <iconv.h>],[
567iconv_t cd = iconv_open ("","");
568iconv (cd, NULL, NULL, NULL, NULL);],[
569 AC_MSG_RESULT(yes)
570 WITH_ICONV=1
571 ICONV_LIBS="${ICONV_LIBS} -liconv"
572 LIBS="${_libs}"
573 LDFLAGS="${_ldflags}"],[
574 AC_MSG_RESULT(no)
575 LIBS="${_libs}"
576 LDFLAGS="${_ldflags}"])]))
577fi
Daniel Veillardb82c1662001-12-09 14:00:54 +0000578M_LIBS="-lm"
579XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000580AC_SUBST(WITH_ICONV)
581
Daniel Veillard4255d502002-04-16 15:50:10 +0000582AC_ARG_WITH(schemas, [ --with-schemas Add experimental Schemas support (off)])
583if test "$with_schemas" = "yes" ; then
Daniel Veillard6eadf632003-01-23 18:29:16 +0000584 echo "Enabling Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000585 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000586 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard23e73572002-09-19 19:56:43 +0000587 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000588else
589 WITH_SCHEMAS=0
590 TEST_SCHEMAS=
591fi
592AC_SUBST(WITH_SCHEMAS)
593AC_SUBST(TEST_SCHEMAS)
594
Daniel Veillard23e73572002-09-19 19:56:43 +0000595AC_ARG_WITH(regexps, [ --with-regexps Add Regular Expressions support (on)])
596if test "$with_regexps" = "no" ; then
597 echo Disabling Regexps support
598 WITH_REGEXPS=0
599 TEST_REGEXPS=
600else
601 WITH_REGEXPS=1
602 TEST_REGEXPS="Regexptests Automatatests"
603fi
604AC_SUBST(WITH_REGEXPS)
605AC_SUBST(TEST_REGEXPS)
606
Daniel Veillard361d8452000-04-03 19:48:13 +0000607AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)])
608if test "$with_debug" = "no" ; then
609 echo Disabling DEBUG support
610 WITH_DEBUG=0
611 DEBUG_OBJ=
612else
613 WITH_DEBUG=1
614 DEBUG_OBJ=debugXML.o
615fi
616AC_SUBST(WITH_DEBUG)
617AC_SUBST(DEBUG_OBJ)
618
619AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
620if test "$with_mem_debug" = "yes" ; then
621 echo Enabling memory debug support
622 WITH_MEM_DEBUG=1
623else
624 WITH_MEM_DEBUG=0
625fi
626AC_SUBST(WITH_MEM_DEBUG)
627
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000628AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000629AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000630
Daniel Veillardb05deb71999-08-10 19:04:08 +0000631AC_SUBST(XML_LIBDIR)
632AC_SUBST(XML_LIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +0000633AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000634AC_SUBST(XML_INCLUDEDIR)
635AC_SUBST(HTML_DIR)
636AC_SUBST(HAVE_ISNAN)
637AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000638AC_SUBST(PYTHON)
639AC_SUBST(PYTHON_VERSION)
640AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000641AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000642
Daniel Veillardb05deb71999-08-10 19:04:08 +0000643AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +0000644AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000645
Daniel Veillard9715c172002-11-25 16:33:40 +0000646dnl for the spec file
647RELDATE=`date +'%a %b %e %Y'`
648AC_SUBST(RELDATE)
649
Daniel Veillardc6e997c2003-01-27 12:35:42 +0000650rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +0000651ln -s Copyright COPYING
652
Igor Zlatkovic1d696512002-10-29 17:33:22 +0000653AC_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)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000654
Daniel Veillard9b731d72002-04-14 12:56:08 +0000655chmod +x xml2-config xml2Conf.sh python/setup.py