blob: fd6ac344e511cadb908a2f0220c02bd24bdd6bec [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 Veillard4fc52812003-09-01 20:33:13 +00008LIBXML_MINOR_VERSION=6
Daniel Veillard6d373a22003-11-04 10:26:43 +00009LIBXML_MICRO_VERSION=2
Daniel Veillard3e35f8e2003-10-21 00:05:38 +000010LIBXML_MICRO_VERSION_SUFFIX=
Daniel Veillard4fc52812003-09-01 20:33:13 +000011LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
Daniel Veillard14fff061999-06-22 21:49:07 +000012LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
13
Daniel Veillard361d8452000-04-03 19:48:13 +000014LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
15
Daniel Veillard14fff061999-06-22 21:49:07 +000016AC_SUBST(LIBXML_MAJOR_VERSION)
17AC_SUBST(LIBXML_MINOR_VERSION)
18AC_SUBST(LIBXML_MICRO_VERSION)
19AC_SUBST(LIBXML_VERSION)
20AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000021AC_SUBST(LIBXML_VERSION_NUMBER)
Daniel Veillard14fff061999-06-22 21:49:07 +000022
Daniel Veillard361d8452000-04-03 19:48:13 +000023VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000024
Daniel Veillardedfb29b2000-03-14 19:59:05 +000025AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000026
William M. Brack97ad4c72003-05-13 08:08:36 +000027AC_ARG_WITH(html-dir,
28[ --with-html-dir=PATH path to installed docs ])
Daniel Veillard01791d51998-07-24 19:24:09 +000029
30dnl Checks for programs.
31AC_PROG_CC
32AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000033AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000034AC_PATH_PROG(RM, rm, /bin/rm)
35AC_PATH_PROG(MV, mv, /bin/mv)
36AC_PATH_PROG(TAR, tar, /bin/tar)
Daniel Veillard01791d51998-07-24 19:24:09 +000037
Daniel Veillard03109292000-08-14 14:58:22 +000038dnl Make sure we have an ANSI compiler
39AM_C_PROTOTYPES
40test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
41
Daniel Veillard01791d51998-07-24 19:24:09 +000042AM_PROG_LIBTOOL
43
Daniel Veillardd8cf9062003-11-11 21:12:36 +000044# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000045
Daniel Veillard4432df22003-09-28 18:58:27 +000046dnl
47dnl option to build a minimal libxml2 library
48dnl
49AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
50if test "$with_minimum" = "yes"
51then
52 echo "Configuring for a minimal library"
53fi
54
Daniel Veillard71b656e2000-01-05 14:46:17 +000055dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000056_cppflags="${CPPFLAGS}"
57_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000058
Daniel Veillard259ff742001-10-06 13:49:59 +000059
Owen Taylor3473f882001-02-23 17:55:21 +000060AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +000061[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +000062 if test "$withval" != "no" -a "$withval" != "yes"; then
63 Z_DIR=$withval
64 CPPFLAGS="${CPPFLAGS} -I$withval/include"
65 LDFLAGS="${LDFLAGS} -L$withval/lib"
66 fi
Daniel Veillard259ff742001-10-06 13:49:59 +000067])
Daniel Veillard4432df22003-09-28 18:58:27 +000068if test "$with_minimum" = "yes" -a "$with_zlib" = ""
69then
70 with_zlib=no
71fi
Daniel Veillard259ff742001-10-06 13:49:59 +000072if test "$with_zlib" = "no"; then
73 echo "Disabling compression support"
74else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000075 AC_CHECK_HEADERS(zlib.h,
76 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +000077 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000078 if test "x${Z_DIR}" != "x"; then
79 Z_CFLAGS="-I${Z_DIR}/include"
80 Z_LIBS="-L${Z_DIR}/lib -lz"
81 [case ${host} in
82 *-*-solaris*)
83 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
84 ;;
85 esac]
86 else
87 Z_LIBS="-lz"
88 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +000089fi
Owen Taylor3473f882001-02-23 17:55:21 +000090
Owen Taylor3473f882001-02-23 17:55:21 +000091AC_SUBST(Z_CFLAGS)
92AC_SUBST(Z_LIBS)
93
94CPPFLAGS=${_cppflags}
95LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000096
Daniel Veillard01791d51998-07-24 19:24:09 +000097dnl Checks for header files.
98AC_HEADER_DIRENT
99AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000100AC_CHECK_HEADERS([fcntl.h])
101AC_CHECK_HEADERS([unistd.h])
102AC_CHECK_HEADERS([ctype.h])
103AC_CHECK_HEADERS([dirent.h])
104AC_CHECK_HEADERS([errno.h])
105AC_CHECK_HEADERS([malloc.h])
106AC_CHECK_HEADERS([stdarg.h])
107AC_CHECK_HEADERS([sys/stat.h])
108AC_CHECK_HEADERS([sys/types.h])
109AC_CHECK_HEADERS([time.h])
110AC_CHECK_HEADERS([ansidecl.h])
111AC_CHECK_HEADERS([ieeefp.h])
112AC_CHECK_HEADERS([nan.h])
113AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000114AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000115AC_CHECK_HEADERS([fp_class.h])
116AC_CHECK_HEADERS([float.h])
117AC_CHECK_HEADERS([stdlib.h])
118AC_CHECK_HEADERS([sys/socket.h], [], [],
119[#if HAVE_SYS_TYPES_H
120# include <sys/types.h>
121# endif
122])
123AC_CHECK_HEADERS([netinet/in.h], [], [],
124[#if HAVE_SYS_TYPES_H
125# include <sys/types.h>
126# endif
127])
128AC_CHECK_HEADERS([arpa/inet.h], [], [],
129[#if HAVE_SYS_TYPES_H
130# include <sys/types.h>
131# endif
132#if HAVE_ARPA_INET_H
133# include <arpa/inet.h>
134# endif
135])
136AC_CHECK_HEADERS([netdb.h])
137AC_CHECK_HEADERS([sys/time.h])
138AC_CHECK_HEADERS([sys/select.h])
139AC_CHECK_HEADERS([sys/mman.h])
140AC_CHECK_HEADERS([sys/timeb.h])
141AC_CHECK_HEADERS([signal.h])
142AC_CHECK_HEADERS([arpa/nameser.h], [], [],
143[#if HAVE_SYS_TYPES_H
144# include <sys/types.h>
145# endif
146])
147AC_CHECK_HEADERS([resolv.h], [], [],
148[#if HAVE_SYS_TYPES_H
149# include <sys/types.h>
150# endif
151#if HAVE_NETINET_IN_H
152# include <netinet/in.h>
153# endif
154#if HAVE_ARPA_NAMESER_H
155# include <arpa/nameser.h>
156# endif
157])
Daniel Veillard01791d51998-07-24 19:24:09 +0000158
Daniel Veillard1164e751999-02-16 16:29:17 +0000159dnl Specific dir for HTML output ?
160if test "x$with_html_dir" = "x" ; then
Daniel Veillard0a6c3582001-03-14 19:15:37 +0000161 HTML_DIR='$(prefix)/doc'
Daniel Veillard1164e751999-02-16 16:29:17 +0000162else
163 HTML_DIR=$with_html_dir
164fi
165
166AC_SUBST(HTML_DIR)
167
Daniel Veillard01791d51998-07-24 19:24:09 +0000168dnl Checks for library functions.
169AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000170AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000171AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000172AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000173AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000174
Daniel Veillard92ad2102001-03-27 12:47:33 +0000175dnl Checking the standard string functions availability
176AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
177 NEED_TRIO=1)
178
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000179dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000180AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
181AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
182AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000183
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000184dnl Determine what socket length (socklen_t) data type is
185AC_MSG_CHECKING([for type of socket length (socklen_t)])
186AC_TRY_COMPILE2([
187#include <stddef.h>
188#include <sys/types.h>
189#include <sys/socket.h>],[
190(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
191 AC_MSG_RESULT(socklen_t *)
192 SOCKLEN_T=socklen_t],[
193 AC_TRY_COMPILE2([
194#include <stddef.h>
195#include <sys/types.h>
196#include <sys/socket.h>],[
197(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
198 AC_MSG_RESULT(size_t *)
199 SOCKLEN_T=size_t],[
200 AC_TRY_COMPILE2([
201#include <stddef.h>
202#include <sys/types.h>
203#include <sys/socket.h>],[
204(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
205 AC_MSG_RESULT(int *)
206 SOCKLEN_T=int],[
207 AC_MSG_WARN(could not determine)])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000208AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000209
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000210dnl ***********************Checking for availability of IPv6*******************
211
212AC_MSG_CHECKING([whether to enable IPv6])
213AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000214if test "$with_minimum" = "yes"
215then
216 enable_ipv6=no
217fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000218if test $enable_ipv6 = yes; then
219 have_ipv6=no
220 AC_TRY_COMPILE([
221 #include <sys/socket.h>
222 #include <sys/types.h>], [
223 struct sockaddr_storage ss;
224 socket(AF_INET6, SOCK_STREAM, 0)
225 ],
226 have_ipv6=yes,
227 have_ipv6=no
228 )
229 AC_MSG_RESULT($have_ipv6)
230
William M. Brack476cd962003-08-13 11:09:42 +0000231 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000232 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000233
234 have_getaddrinfo=no
235 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
236 if test $have_getaddrinfo != yes; then
237 for lib in bsd socket inet; do
238 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
239 done
240 fi
241
William M. Brack476cd962003-08-13 11:09:42 +0000242 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000243 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000244 fi
245 fi
246fi
247
248dnl ******************************End IPv6 checks******************************
249
Daniel Veillardb05deb71999-08-10 19:04:08 +0000250dnl Checks for isnan in libm if not in libc
Daniel Veillard71b656e2000-01-05 14:46:17 +0000251AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000252 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000253
Daniel Veillardc790bf42003-10-11 10:50:10 +0000254AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
255 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000256
257XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000258XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000259
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000260dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000261dnl Extra flags
262dnl
263XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000264RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000265
Daniel Veillardd94849b2003-07-28 13:02:24 +0000266AC_ARG_WITH(fexceptions,
267[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000268if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
269then
270 with_fexceptions=no
271fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000272dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000273dnl Workaround for native compilers
274dnl HP : http://bugs.gnome.org/db/31/3163.html
275dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000276dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000277if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000278 case "${host}" in
279 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000280 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000281 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000282 *-dec-osf* )
283 CFLAGS="${CFLAGS} -ieee"
284 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000285 alpha*-*-linux* )
286 CFLAGS="${CFLAGS} -ieee"
287 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000288 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000289else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000290 if test "$with_fexceptions" = "yes"
291 then
292 #
293 # Not activated by default because this inflates the code size
294 # Used to allow propagation of C++ exceptions through the library
295 #
296 CFLAGS="${CFLAGS} -fexceptions"
297 fi
298
Daniel Veillardd574f782001-03-14 19:40:17 +0000299 CFLAGS="${CFLAGS} -Wall"
Daniel Veillard14839d52001-06-06 16:11:56 +0000300 case "${host}" in
301 alpha*-*-linux* )
302 CFLAGS="${CFLAGS} -mieee"
303 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000304 alpha*-*-osf* )
305 CFLAGS="${CFLAGS} -mieee"
306 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000307 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000308fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000309case ${host} in
310 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000311 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
312 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000313 hppa*-hp-mpeix)
314 NEED_TRIO=1
315 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000316esac
317
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000318
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000319dnl
320dnl check for python
321dnl
322
323PYTHON=
324PYTHON_VERSION=
325PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000326PYTHON_SITE_PACKAGES=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000327pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000328AC_ARG_WITH(python,
329[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000330if test "$with_minimum" = "yes" -a "$with_python" = ""
331then
332 with_python=no
333fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000334if test "$with_python" != "no" ; then
335 if test -x "$with_python/bin/python"
336 then
337 echo Found python in $with_python/bin/python
338 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000339 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000340 if test -x "$with_python"
341 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000342 echo Found python in $with_python
343 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000344 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000345 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000346 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000347 fi
348 if test "$PYTHON" != ""
349 then
350 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
351 echo Found Python version $PYTHON_VERSION
352 fi
353 if test "$PYTHON_VERSION" != ""
354 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000355 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
356 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000357 then
358 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000359 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000360 else
361 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
362 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000363 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000364 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000365 else
366 if test -r /usr/include/python$PYTHON_VERSION/Python.h
367 then
368 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000369 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000370 else
371 echo could not find python$PYTHON_VERSION/Python.h
372 fi
373 fi
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000374 if ! test -d "$PYTHON_SITE_PACKAGES"
375 then
376 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
377 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000378 fi
379 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000380 if test "$with_python" != ""
381 then
382 pythondir='$(PYTHON_SITE_PACKAGES)'
383 else
384 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
385 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000386fi
387AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000388if test "$PYTHON_INCLUDES" != ""
389then
390 PYTHON_SUBDIR=python
391else
392 PYTHON_SUBDIR=
393fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000394AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000395AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000396
Daniel Veillard437b87b2000-01-03 17:30:46 +0000397dnl
398dnl Tester makes use of readline if present
399dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000400_cppflags="${CPPFLAGS}"
401_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000402
Daniel Veillard03109292000-08-14 14:58:22 +0000403AC_ARG_WITH(readline,
404[ --with-readline=DIR use readline in DIR],[
405 if test "$withval" != "no" -a "$withval" != "yes"; then
406 RDL_DIR=$withval
407 CPPFLAGS="${CPPFLAGS} -I$withval/include"
408 LDFLAGS="${LDFLAGS} -L$withval/lib"
409 fi
410])
Daniel Veillard4432df22003-09-28 18:58:27 +0000411if test "$with_minimum" = "yes" -a "$with_readline" = ""
412then
413 with_readline=no
414fi
Daniel Veillard03109292000-08-14 14:58:22 +0000415
Daniel Veillard361d8452000-04-03 19:48:13 +0000416dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000417dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000418dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000419dnl
William M. Brack871611b2003-10-18 04:53:14 +0000420if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
421 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]]
422 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000423 if test "$with_minimum" != "yes"
424 then
425 if test "${with_mem_debug}" = "" ; then
426 with_mem_debug="yes"
427 fi
428 if test "${with_docbook}" = "" ; then
429 with_docbook="yes"
430 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000431 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000432 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 Veillard2e9b1652003-02-19 13:29:45 +0000433 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000434dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000435else
436 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000437fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000438AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000439
440dnl
441dnl Check for trio string functions
442dnl
443
444if test "${NEED_TRIO}" = "1" ; then
445 echo Adding trio library for string functions
446 WITH_TRIO=1
447else
448 WITH_TRIO=0
449fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000450AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000451AC_SUBST(WITH_TRIO)
452
Daniel Veillardf6eea272001-01-18 12:17:12 +0000453dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000454dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000455dnl
456
Daniel Veillardb8478642001-10-12 17:29:10 +0000457THREAD_LIBS=""
458WITH_THREADS=0
459THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000460TEST_THREADS=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000461
William M. Brack97ad4c72003-05-13 08:08:36 +0000462AC_ARG_WITH(threads,
463[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000464if test "$with_minimum" = "yes" -a "$with_threads" = ""
465then
466 with_threads=no
467fi
Daniel Veillard84942712003-04-18 14:40:05 +0000468if test "$with_threads" = "no" ; then
469 echo Disabling multithreaded support
470else
Daniel Veillardb8478642001-10-12 17:29:10 +0000471 echo Enabling multithreaded support
472
473 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000474 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000475 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000476 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
477 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000478 WITH_THREADS="1"]))
Daniel Veillardb8478642001-10-12 17:29:10 +0000479
480 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000481 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
482 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000483 fi
484fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000485AC_ARG_WITH(thread-alloc,
486[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000487if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
488then
489 with_thread_alloc=no
490fi
Daniel Veillardab7488e2001-10-17 11:30:37 +0000491if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
492 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000493fi
494
Daniel Veillardb8478642001-10-12 17:29:10 +0000495AC_SUBST(THREAD_LIBS)
496AC_SUBST(WITH_THREADS)
497AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000498AC_SUBST(TEST_THREADS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000499
William M. Brack97ad4c72003-05-13 08:08:36 +0000500AC_ARG_WITH(history,
501[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000502if test "$with_minimum" = "yes" -a "$with_history" = ""
503then
504 with_history=no
505fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000506if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000507 echo Enabling xmllint shell history
508 dnl check for terminal library. this is a very cool solution
509 dnl from octave's configure.in
510 unset tcap
511 for termlib in ncurses curses termcap terminfo termlib; do
512 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
513 test -n "$tcap" && break
514 done
515
516 AC_CHECK_HEADER(readline/history.h,
517 AC_CHECK_LIB(history, append_history,[
518 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000519 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000520 AC_CHECK_HEADER(readline/readline.h,
521 AC_CHECK_LIB(readline, readline,[
522 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000523 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000524 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
525 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
526 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
527 else
528 CPPFLAGS=${_cppflags}
529 fi
530 LDFLAGS=${_ldflags}
531fi
532
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000533AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000534[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000535if test "$with_minimum" = "yes" -a "$with_output" = ""
536then
537 with_output=no
538fi
539if test "$with_output" = "no" ; then
540 echo Disabling serialization/saving support
541 WITH_OUTPUT=0
542else
543 WITH_OUTPUT=1
544fi
545AC_SUBST(WITH_OUTPUT)
546
Daniel Veillard652327a2003-09-29 18:02:38 +0000547AC_ARG_WITH(tree,
548[ --with-tree add the DOM like tree manipulation APIs (on)])
549if test "$with_minimum" = "yes" -a "$with_tree" = ""
550then
551 with_tree=no
552fi
553if test "$with_tree" = "no" ; then
554 echo Disabling DOM like tree manipulation APIs
555 WITH_TREE=0
556else
557 WITH_TREE=1
558fi
559AC_SUBST(WITH_TREE)
560
William M. Brack97ad4c72003-05-13 08:08:36 +0000561AC_ARG_WITH(ftp,
562[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000563if test "$with_minimum" = "yes" -a "$with_ftp" = ""
564then
565 with_ftp=no
566fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000567if test "$with_ftp" = "no" ; then
568 echo Disabling FTP support
569 WITH_FTP=0
570 FTP_OBJ=
571else
572 WITH_FTP=1
573 FTP_OBJ=nanoftp.o
574fi
575AC_SUBST(WITH_FTP)
576AC_SUBST(FTP_OBJ)
577
William M. Brack97ad4c72003-05-13 08:08:36 +0000578AC_ARG_WITH(http,
579[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000580if test "$with_minimum" = "yes" -a "$with_http" = ""
581then
582 with_http=no
583fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000584if test "$with_http" = "no" ; then
585 echo Disabling HTTP support
586 WITH_HTTP=0
587 HTTP_OBJ=
588else
589 WITH_HTTP=1
590 HTTP_OBJ=nanohttp.o
591fi
592AC_SUBST(WITH_HTTP)
593AC_SUBST(HTTP_OBJ)
594
Daniel Veillard4432df22003-09-28 18:58:27 +0000595AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000596[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000597if test "$with_minimum" = "yes" -a "$with_legacy" = ""
598then
599 with_legacy=no
600fi
601if test "$with_legacy" = "no" ; then
602 echo Disabling deprecated APIs
603 WITH_LEGACY=0
604else
605 WITH_LEGACY=1
606fi
607AC_SUBST(WITH_LEGACY)
608
Daniel Veillard81273902003-09-30 00:43:48 +0000609AC_ARG_WITH(reader,
610[ --with-reader add the xmlReader parsing interface (on)])
611if test "$with_minimum" = "yes" -a "$with_reader" = ""
612then
613 with_reader=no
614fi
615if test "$with_reader" = "no" ; then
616 echo Disabling the xmlReader parsing interface
617 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000618 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000619else
620 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000621 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000622fi
623AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000624AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000625
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000626AC_ARG_WITH(pattern,
627[ --with-pattern add the xmlPattern selection interface (on)])
628if test "$with_minimum" = "yes" -a "$with_pattern" = ""
629then
630 with_pattern=no
631fi
632if test "$with_pattern" = "no" ; then
633 echo Disabling the xmlPattern parsing interface
634 WITH_PATTERN=0
635 PATTERN_TEST=
636else
637 WITH_PATTERN=1
638 PATTERN_TEST=Patterntests
639fi
640AC_SUBST(WITH_PATTERN)
641AC_SUBST(PATTERN_TEST)
642
Daniel Veillard1d211e22003-10-20 22:32:39 +0000643AC_ARG_WITH(writer,
644[ --with-writer add the xmlWriter saving interface (on)])
645if test "$with_minimum" = "yes" -a "$with_writer" = ""
646then
647 with_writer=no
648fi
649if test "$with_writer" = "no" ; then
650 echo Disabling the xmlWriter saving interface
651 WITH_WRITER=0
652# WRITER_TEST=
653else
654 WITH_WRITER=1
655# WRITER_TEST=Writertests
656fi
657AC_SUBST(WITH_WRITER)
658#AC_SUBST(WRITER_TEST)
659
Daniel Veillard81273902003-09-30 00:43:48 +0000660AC_ARG_WITH(sax1,
661[ --with-sax1 add the older SAX1 interface (on)])
662if test "$with_minimum" = "yes" -a "$with_sax1" = ""
663then
664 with_sax1=no
665fi
666if test "$with_sax1" = "no" ; then
667 echo Disabling the older SAX1 interface
668 WITH_SAX1=0
669 TEST_SAX=
670else
671 WITH_SAX1=1
672 TEST_SAX=SAXtests
673fi
674AC_SUBST(WITH_SAX1)
675AC_SUBST(TEST_SAX)
676
Daniel Veillard73b013f2003-09-30 12:36:01 +0000677AC_ARG_WITH(push,
678[ --with-push add the PUSH parser interfaces (on)])
679if test "$with_minimum" = "yes" -a "$with_push" = ""
680then
681 with_push=no
682fi
683if test "$with_push" = "no" ; then
684 echo Disabling the PUSH parser interfaces
685 WITH_PUSH=0
686 TEST_PUSH=
687else
688 WITH_PUSH=1
689 TEST_PUSH="XMLPushtests"
690fi
691AC_SUBST(WITH_PUSH)
692AC_SUBST(TEST_PUSH)
693
694AC_ARG_WITH(html,
695[ --with-html add the HTML support (on)])
696if test "$with_minimum" = "yes" -a "$with_html" = ""
697then
698 with_html=no
699fi
700if test "$with_html" = "no" ; then
701 echo Disabling HTML support
702 WITH_HTML=0
703 HTML_OBJ=
704 TEST_HTML=
705else
706 WITH_HTML=1
707 HTML_OBJ="HTMLparser.o HTMLtree.o"
708 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000709 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000710 TEST_PHTML=HTMLPushtests
711 else
712 TEST_PHTML=
713 fi
714fi
715AC_SUBST(WITH_HTML)
716AC_SUBST(HTML_OBJ)
717AC_SUBST(TEST_HTML)
718AC_SUBST(TEST_PHTML)
719
Daniel Veillard4432df22003-09-28 18:58:27 +0000720AC_ARG_WITH(valid,
721[ --with-valid add the DTD validation support (on)])
722if test "$with_minimum" = "yes" -a "$with_valid" = ""
723then
724 with_valid=no
725fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000726if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000727 echo Disabling DTD validation support
728 WITH_VALID=0
729 TEST_VALID=
730 TEST_VTIME=
731else
732 WITH_VALID=1
733 TEST_VALID=Validtests
734 TEST_VTIME=VTimingtests
735fi
736AC_SUBST(WITH_VALID)
737AC_SUBST(TEST_VALID)
738AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000739
William M. Brack97ad4c72003-05-13 08:08:36 +0000740AC_ARG_WITH(catalog,
741[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000742if test "$with_minimum" = "yes" -a "$with_catalog" = ""
743then
744 with_catalog=no
745fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000746if test "$with_catalog" = "no" ; then
747 echo Disabling Catalog support
748 WITH_CATALOG=0
749 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000750 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000751else
752 WITH_CATALOG=1
753 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000754 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000755fi
756AC_SUBST(WITH_CATALOG)
757AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000758AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000759
William M. Brack97ad4c72003-05-13 08:08:36 +0000760AC_ARG_WITH(docbook,
761[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000762if test "$with_minimum" = "yes" -a "$with_docbook" = ""
763then
764 with_docbook=no
765fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000766if test "$with_docbook" = "no" ; then
767 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000768 WITH_DOCB=0
769 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000770else
771 WITH_DOCB=1
772 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000773fi
774AC_SUBST(WITH_DOCB)
775AC_SUBST(DOCB_OBJ)
776
777
William M. Brack97ad4c72003-05-13 08:08:36 +0000778AC_ARG_WITH(xpath,
779[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000780if test "$with_minimum" = "yes" -a "$with_xpath" = ""
781then
782 with_xpath=no
783fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000784if test "$with_xpath" = "no" ; then
785 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000786 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000787 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000788 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000789 WITH_XPATH=0
790 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000791 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000792else
793 WITH_XPATH=1
794 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000795 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000796fi
797AC_SUBST(WITH_XPATH)
798AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000799AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000800
William M. Brack97ad4c72003-05-13 08:08:36 +0000801AC_ARG_WITH(xptr,
802[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000803if test "$with_minimum" = "yes" -a "$with_xptr" = ""
804then
805 with_xptr=no
806fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000807if test "$with_xptr" = "no" ; then
808 echo Disabling XPointer support
809 WITH_XPTR=0
810 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000811 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000812else
813 WITH_XPTR=1
814 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000815 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000816fi
817AC_SUBST(WITH_XPTR)
818AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000819AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000820
William M. Brack97ad4c72003-05-13 08:08:36 +0000821AC_ARG_WITH(c14n,
822[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000823if test "$with_minimum" = "yes" -a "$with_c14n" = ""
824then
825 with_c14n=no
826fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000827if test "$with_c14n" = "no" ; then
828 echo Disabling C14N support
829 WITH_C14N=0
830 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000831 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000832else
833 WITH_C14N=1
834 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000835 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000836fi
837AC_SUBST(WITH_C14N)
838AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000839AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000840
William M. Brack97ad4c72003-05-13 08:08:36 +0000841AC_ARG_WITH(xinclude,
842[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000843if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
844then
845 with_xinclude=no
846fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000847if test "$with_xinclude" = "no" ; then
848 echo Disabling XInclude support
849 WITH_XINCLUDE=0
850 XINCLUDE_OBJ=
851 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000852 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000853else
854 WITH_XINCLUDE=1
855 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000856 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000857fi
858AC_SUBST(WITH_XINCLUDE)
859AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000860AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000861
Daniel Veillard6e90d192001-07-03 16:37:49 +0000862WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000863AC_ARG_WITH(iconv,
864[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000865if test "$with_minimum" = "yes" -a "$with_iconv" = ""
866then
867 with_iconv=no
868fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000869if test "$with_iconv" = "no" ; then
870 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000871else
Daniel Veillard220346d2001-12-07 11:33:54 +0000872 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000873 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000874 # Export this since our headers include iconv.h
875 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000876 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000877 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000878
879 AC_CHECK_HEADER(iconv.h,
880 AC_MSG_CHECKING(for iconv)
881 AC_TRY_LINK([#include <stdlib.h>
882#include <iconv.h>],[
883iconv_t cd = iconv_open ("","");
884iconv (cd, NULL, NULL, NULL, NULL);],[
885 AC_MSG_RESULT(yes)
886 WITH_ICONV=1],[
887 AC_MSG_RESULT(no)
888 AC_MSG_CHECKING(for iconv in -liconv)
889
890 _ldflags="${LDFLAGS}"
891 _libs="${LIBS}"
892 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
893 LIBS="${LIBS} -liconv"
894
895 AC_TRY_LINK([#include <stdlib.h>
896#include <iconv.h>],[
897iconv_t cd = iconv_open ("","");
898iconv (cd, NULL, NULL, NULL, NULL);],[
899 AC_MSG_RESULT(yes)
900 WITH_ICONV=1
901 ICONV_LIBS="${ICONV_LIBS} -liconv"
902 LIBS="${_libs}"
903 LDFLAGS="${_ldflags}"],[
904 AC_MSG_RESULT(no)
905 LIBS="${_libs}"
906 LDFLAGS="${_ldflags}"])]))
907fi
Daniel Veillardb82c1662001-12-09 14:00:54 +0000908M_LIBS="-lm"
909XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000910XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000911AC_SUBST(WITH_ICONV)
912
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000913WITH_ISO8859X=1
914AC_ARG_WITH(iso8859x,
915[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000916if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
917then
918 with_iso8859x=no
919fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000920if test "$WITH_ICONV" != "1" ; then
921if test "$with_iso8859x" = "no" ; then
922 echo Disabling ISO8859X support
923 WITH_ISO8859X=0
924fi
925fi
926AC_SUBST(WITH_ISO8859X)
927
William M. Brack97ad4c72003-05-13 08:08:36 +0000928AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000929[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000930if test "$with_minimum" = "yes" -a "$with_schemas" = ""
931then
932 with_schemas=no
933fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000934if test "$with_schemas" = "no" ; then
935 echo "Disabled Schemas/Relax-NG support"
936 WITH_SCHEMAS=0
937 TEST_SCHEMAS=
938else
Daniel Veillard71531f32003-02-05 13:19:53 +0000939 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000940 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000941 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard23e73572002-09-19 19:56:43 +0000942 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000943fi
944AC_SUBST(WITH_SCHEMAS)
945AC_SUBST(TEST_SCHEMAS)
946
William M. Brack97ad4c72003-05-13 08:08:36 +0000947AC_ARG_WITH(regexps,
948[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000949if test "$with_minimum" = "yes" -a "$with_regexps" = ""
950then
951 with_regexps=no
952fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000953if test "$with_regexps" = "no" ; then
954 echo Disabling Regexps support
955 WITH_REGEXPS=0
956 TEST_REGEXPS=
957else
958 WITH_REGEXPS=1
959 TEST_REGEXPS="Regexptests Automatatests"
960fi
961AC_SUBST(WITH_REGEXPS)
962AC_SUBST(TEST_REGEXPS)
963
William M. Brack97ad4c72003-05-13 08:08:36 +0000964AC_ARG_WITH(debug,
965[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000966if test "$with_minimum" = "yes" -a "$with_debug" = ""
967then
968 with_debug=no
969fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000970if test "$with_debug" = "no" ; then
971 echo Disabling DEBUG support
972 WITH_DEBUG=0
973 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000974 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000975else
976 WITH_DEBUG=1
977 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000978 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +0000979fi
980AC_SUBST(WITH_DEBUG)
981AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000982AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +0000983
William M. Brack97ad4c72003-05-13 08:08:36 +0000984AC_ARG_WITH(mem_debug,
985[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000986if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
987then
988 with_mem_debug=no
989fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000990if test "$with_mem_debug" = "yes" ; then
991 echo Enabling memory debug support
992 WITH_MEM_DEBUG=1
993else
994 WITH_MEM_DEBUG=0
995fi
996AC_SUBST(WITH_MEM_DEBUG)
997
Daniel Veillard1638a472003-08-14 01:23:25 +0000998
999WIN32_EXTRA_LIBADD=
1000WIN32_EXTRA_LDFLAGS=
1001case "$host" in
1002 *-*-mingw*)
1003 WIN32_EXTRA_LIBADD="-lwsock32"
1004 WIN32_EXTRA_LDFLAGS="-no-undefined"
1005 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1006 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1007 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1008 ;;
1009esac
1010AC_SUBST(WIN32_EXTRA_LIBADD)
1011AC_SUBST(WIN32_EXTRA_LDFLAGS)
1012
1013
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001014AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001015AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001016
Daniel Veillardb05deb71999-08-10 19:04:08 +00001017AC_SUBST(XML_LIBDIR)
1018AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001019AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001020AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001021AC_SUBST(XML_INCLUDEDIR)
1022AC_SUBST(HTML_DIR)
1023AC_SUBST(HAVE_ISNAN)
1024AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001025AC_SUBST(PYTHON)
1026AC_SUBST(PYTHON_VERSION)
1027AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001028AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001029
Daniel Veillardb05deb71999-08-10 19:04:08 +00001030AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001031AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001032
Daniel Veillard9715c172002-11-25 16:33:40 +00001033dnl for the spec file
1034RELDATE=`date +'%a %b %e %Y'`
1035AC_SUBST(RELDATE)
1036
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001037rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001038ln -s Copyright COPYING
1039
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001040AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile
Daniel Veillardd8cf9062003-11-11 21:12:36 +00001041include/libxml/Makefile doc/Makefile doc/examples/Makefile
1042example/Makefile python/Makefile python/tests/Makefile
1043include/libxml/xmlversion.h xml2-config libxml-2.0.pc
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001044libxml-2.0-uninstalled.pc xml2Conf.sh python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001045
Daniel Veillard9b731d72002-04-14 12:56:08 +00001046chmod +x xml2-config xml2Conf.sh python/setup.py