blob: f30171bc793ed56c7b3a7c25a3438f624255c67c [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
Owen Taylor3473f882001-02-23 17:55:21 +00002AC_INIT(entities.c)
Daniel Veillard01791d51998-07-24 19:24:09 +00003AM_CONFIG_HEADER(config.h)
Daniel Veillardd2ade932000-09-30 14:39:55 +00004AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00005
Daniel Veillardcf461992000-03-14 18:30:20 +00006LIBXML_MAJOR_VERSION=2
Daniel Veillard4fc52812003-09-01 20:33:13 +00007LIBXML_MINOR_VERSION=6
Daniel Veillard45cb0f42004-07-05 17:45:35 +00008LIBXML_MICRO_VERSION=11
Daniel Veillard3e35f8e2003-10-21 00:05:38 +00009LIBXML_MICRO_VERSION_SUFFIX=
Daniel Veillard4fc52812003-09-01 20:33:13 +000010LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
Daniel Veillard14fff061999-06-22 21:49:07 +000011LIBXML_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
William M. Brackf4025492004-08-18 21:08:46 +000015if test -f CVS/Entries; then
16 LIBXML_VERSION_EXTRA=-CVS`grep ChangeLog CVS/Entries | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
17fi
Daniel Veillard14fff061999-06-22 21:49:07 +000018AC_SUBST(LIBXML_MAJOR_VERSION)
19AC_SUBST(LIBXML_MINOR_VERSION)
20AC_SUBST(LIBXML_MICRO_VERSION)
21AC_SUBST(LIBXML_VERSION)
22AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000023AC_SUBST(LIBXML_VERSION_NUMBER)
William M. Brackf4025492004-08-18 21:08:46 +000024AC_SUBST(LIBXML_VERSION_EXTRA)
Daniel Veillard14fff061999-06-22 21:49:07 +000025
Daniel Veillard361d8452000-04-03 19:48:13 +000026VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000027
Daniel Veillardedfb29b2000-03-14 19:59:05 +000028AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000029
Daniel Veillard01791d51998-07-24 19:24:09 +000030dnl 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)
William M. Brack1826d0a2004-07-21 09:03:57 +000037AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard01791d51998-07-24 19:24:09 +000038
Daniel Veillard03109292000-08-14 14:58:22 +000039dnl Make sure we have an ANSI compiler
40AM_C_PROTOTYPES
41test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
42
Daniel Veillard6984e6d2003-12-09 14:20:17 +000043AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000044AM_PROG_LIBTOOL
45
Daniel Veillardd8cf9062003-11-11 21:12:36 +000046# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000047
Daniel Veillard4432df22003-09-28 18:58:27 +000048dnl
49dnl option to build a minimal libxml2 library
50dnl
51AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
52if test "$with_minimum" = "yes"
53then
54 echo "Configuring for a minimal library"
55fi
56
Daniel Veillard71b656e2000-01-05 14:46:17 +000057dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000058_cppflags="${CPPFLAGS}"
59_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000060
Daniel Veillard259ff742001-10-06 13:49:59 +000061
Owen Taylor3473f882001-02-23 17:55:21 +000062AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +000063[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +000064 if test "$withval" != "no" -a "$withval" != "yes"; then
65 Z_DIR=$withval
66 CPPFLAGS="${CPPFLAGS} -I$withval/include"
67 LDFLAGS="${LDFLAGS} -L$withval/lib"
68 fi
Daniel Veillard259ff742001-10-06 13:49:59 +000069])
Daniel Veillard4432df22003-09-28 18:58:27 +000070if test "$with_minimum" = "yes" -a "$with_zlib" = ""
71then
72 with_zlib=no
73fi
Daniel Veillard259ff742001-10-06 13:49:59 +000074if test "$with_zlib" = "no"; then
75 echo "Disabling compression support"
76else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000077 AC_CHECK_HEADERS(zlib.h,
78 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +000079 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000080 if test "x${Z_DIR}" != "x"; then
81 Z_CFLAGS="-I${Z_DIR}/include"
82 Z_LIBS="-L${Z_DIR}/lib -lz"
83 [case ${host} in
84 *-*-solaris*)
85 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
86 ;;
87 esac]
88 else
89 Z_LIBS="-lz"
90 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +000091fi
Owen Taylor3473f882001-02-23 17:55:21 +000092
Owen Taylor3473f882001-02-23 17:55:21 +000093AC_SUBST(Z_CFLAGS)
94AC_SUBST(Z_LIBS)
95
96CPPFLAGS=${_cppflags}
97LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000098
Daniel Veillard01791d51998-07-24 19:24:09 +000099dnl Checks for header files.
100AC_HEADER_DIRENT
101AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000102AC_CHECK_HEADERS([fcntl.h])
103AC_CHECK_HEADERS([unistd.h])
104AC_CHECK_HEADERS([ctype.h])
105AC_CHECK_HEADERS([dirent.h])
106AC_CHECK_HEADERS([errno.h])
107AC_CHECK_HEADERS([malloc.h])
108AC_CHECK_HEADERS([stdarg.h])
109AC_CHECK_HEADERS([sys/stat.h])
110AC_CHECK_HEADERS([sys/types.h])
111AC_CHECK_HEADERS([time.h])
112AC_CHECK_HEADERS([ansidecl.h])
113AC_CHECK_HEADERS([ieeefp.h])
114AC_CHECK_HEADERS([nan.h])
115AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000116AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000117AC_CHECK_HEADERS([fp_class.h])
118AC_CHECK_HEADERS([float.h])
119AC_CHECK_HEADERS([stdlib.h])
120AC_CHECK_HEADERS([sys/socket.h], [], [],
121[#if HAVE_SYS_TYPES_H
122# include <sys/types.h>
123# endif
124])
125AC_CHECK_HEADERS([netinet/in.h], [], [],
126[#if HAVE_SYS_TYPES_H
127# include <sys/types.h>
128# endif
129])
130AC_CHECK_HEADERS([arpa/inet.h], [], [],
131[#if HAVE_SYS_TYPES_H
132# include <sys/types.h>
133# endif
134#if HAVE_ARPA_INET_H
135# include <arpa/inet.h>
136# endif
137])
138AC_CHECK_HEADERS([netdb.h])
139AC_CHECK_HEADERS([sys/time.h])
140AC_CHECK_HEADERS([sys/select.h])
141AC_CHECK_HEADERS([sys/mman.h])
142AC_CHECK_HEADERS([sys/timeb.h])
143AC_CHECK_HEADERS([signal.h])
144AC_CHECK_HEADERS([arpa/nameser.h], [], [],
145[#if HAVE_SYS_TYPES_H
146# include <sys/types.h>
147# endif
148])
149AC_CHECK_HEADERS([resolv.h], [], [],
150[#if HAVE_SYS_TYPES_H
151# include <sys/types.h>
152# endif
153#if HAVE_NETINET_IN_H
154# include <netinet/in.h>
155# endif
156#if HAVE_ARPA_NAMESER_H
157# include <arpa/nameser.h>
158# endif
159])
Daniel Veillard01791d51998-07-24 19:24:09 +0000160
Daniel Veillard1164e751999-02-16 16:29:17 +0000161dnl Specific dir for HTML output ?
Daniel Veillardfc979062004-03-04 22:07:16 +0000162AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
163 [path to base html directory, default $datadir/doc/html]),
164 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
165
166AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
167 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
168 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
169 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
Daniel Veillard1164e751999-02-16 16:29:17 +0000170
171AC_SUBST(HTML_DIR)
172
Daniel Veillard01791d51998-07-24 19:24:09 +0000173dnl Checks for library functions.
174AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000175AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000176AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000177AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000178AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000179
Daniel Veillard92ad2102001-03-27 12:47:33 +0000180dnl Checking the standard string functions availability
181AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
182 NEED_TRIO=1)
183
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000184dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000185AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
186AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
187AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000188
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000189dnl Determine what socket length (socklen_t) data type is
190AC_MSG_CHECKING([for type of socket length (socklen_t)])
191AC_TRY_COMPILE2([
192#include <stddef.h>
193#include <sys/types.h>
194#include <sys/socket.h>],[
195(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
196 AC_MSG_RESULT(socklen_t *)
197 SOCKLEN_T=socklen_t],[
198 AC_TRY_COMPILE2([
199#include <stddef.h>
200#include <sys/types.h>
201#include <sys/socket.h>],[
202(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
203 AC_MSG_RESULT(size_t *)
204 SOCKLEN_T=size_t],[
205 AC_TRY_COMPILE2([
206#include <stddef.h>
207#include <sys/types.h>
208#include <sys/socket.h>],[
209(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
210 AC_MSG_RESULT(int *)
211 SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000212 AC_MSG_WARN(could not determine)
213 SOCKLEN_T="unsigned int"])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000214AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000215
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000216dnl ***********************Checking for availability of IPv6*******************
217
218AC_MSG_CHECKING([whether to enable IPv6])
219AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000220if test "$with_minimum" = "yes"
221then
222 enable_ipv6=no
223fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000224if test $enable_ipv6 = yes; then
225 have_ipv6=no
226 AC_TRY_COMPILE([
227 #include <sys/socket.h>
228 #include <sys/types.h>], [
229 struct sockaddr_storage ss;
230 socket(AF_INET6, SOCK_STREAM, 0)
231 ],
232 have_ipv6=yes,
233 have_ipv6=no
234 )
235 AC_MSG_RESULT($have_ipv6)
236
William M. Brack476cd962003-08-13 11:09:42 +0000237 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000238 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000239
240 have_getaddrinfo=no
241 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
242 if test $have_getaddrinfo != yes; then
243 for lib in bsd socket inet; do
244 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
245 done
246 fi
247
William M. Brack476cd962003-08-13 11:09:42 +0000248 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000249 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000250 fi
251 fi
252fi
253
254dnl ******************************End IPv6 checks******************************
255
Daniel Veillardb05deb71999-08-10 19:04:08 +0000256dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000257AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000258 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000259
Daniel Veillardc790bf42003-10-11 10:50:10 +0000260AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
261 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000262
263XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000264XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000265
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000266dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000267dnl Extra flags
268dnl
269XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000270RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000271
Daniel Veillardd94849b2003-07-28 13:02:24 +0000272AC_ARG_WITH(fexceptions,
273[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000274if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
275then
276 with_fexceptions=no
277fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000278dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000279dnl Workaround for native compilers
280dnl HP : http://bugs.gnome.org/db/31/3163.html
281dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000282dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000283if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000284 case "${host}" in
285 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000286 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000287 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000288 *-dec-osf* )
289 CFLAGS="${CFLAGS} -ieee"
290 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000291 alpha*-*-linux* )
292 CFLAGS="${CFLAGS} -ieee"
293 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000294 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000295else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000296 if test "$with_fexceptions" = "yes"
297 then
298 #
299 # Not activated by default because this inflates the code size
300 # Used to allow propagation of C++ exceptions through the library
301 #
302 CFLAGS="${CFLAGS} -fexceptions"
303 fi
304
Daniel Veillardc0826a72004-08-10 14:17:33 +0000305 CFLAGS="${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 Veillard14839d52001-06-06 16:11:56 +0000306 case "${host}" in
307 alpha*-*-linux* )
308 CFLAGS="${CFLAGS} -mieee"
309 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000310 alpha*-*-osf* )
311 CFLAGS="${CFLAGS} -mieee"
312 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000313 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000314fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000315case ${host} in
316 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000317 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
318 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000319 hppa*-hp-mpeix)
320 NEED_TRIO=1
321 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000322esac
323
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000324
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000325dnl
326dnl check for python
327dnl
328
329PYTHON=
330PYTHON_VERSION=
331PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000332PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000333PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000334pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000335AC_ARG_WITH(python,
336[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000337if test "$with_minimum" = "yes" -a "$with_python" = ""
338then
339 with_python=no
340fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000341if test "$with_python" != "no" ; then
342 if test -x "$with_python/bin/python"
343 then
344 echo Found python in $with_python/bin/python
345 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000346 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000347 if test -x "$with_python"
348 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000349 echo Found python in $with_python
350 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000351 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000352 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000353 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000354 fi
355 if test "$PYTHON" != ""
356 then
357 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
358 echo Found Python version $PYTHON_VERSION
359 fi
360 if test "$PYTHON_VERSION" != ""
361 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000362 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
363 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000364 then
365 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000366 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000367 else
368 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
369 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000370 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000371 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000372 else
373 if test -r /usr/include/python$PYTHON_VERSION/Python.h
374 then
375 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000376 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000377 else
378 echo could not find python$PYTHON_VERSION/Python.h
379 fi
380 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000381 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000382 then
383 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
384 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000385 fi
386 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000387 if test "$with_python" != ""
388 then
389 pythondir='$(PYTHON_SITE_PACKAGES)'
390 else
391 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
392 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000393fi
394AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000395if test "$PYTHON_INCLUDES" != ""
396then
397 PYTHON_SUBDIR=python
398else
399 PYTHON_SUBDIR=
400fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000401AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000402AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000403
Daniel Veillard437b87b2000-01-03 17:30:46 +0000404dnl
405dnl Tester makes use of readline if present
406dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000407_cppflags="${CPPFLAGS}"
408_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000409
Daniel Veillard03109292000-08-14 14:58:22 +0000410AC_ARG_WITH(readline,
411[ --with-readline=DIR use readline in DIR],[
412 if test "$withval" != "no" -a "$withval" != "yes"; then
413 RDL_DIR=$withval
414 CPPFLAGS="${CPPFLAGS} -I$withval/include"
415 LDFLAGS="${LDFLAGS} -L$withval/lib"
416 fi
417])
Daniel Veillard4432df22003-09-28 18:58:27 +0000418if test "$with_minimum" = "yes" -a "$with_readline" = ""
419then
420 with_readline=no
421fi
Daniel Veillard03109292000-08-14 14:58:22 +0000422
Daniel Veillard361d8452000-04-03 19:48:13 +0000423dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000424dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000425dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000426dnl
William M. Brack871611b2003-10-18 04:53:14 +0000427if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000428 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000429 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
William M. Brack4119d1c2004-06-24 02:24:44 +0000430 [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000431 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000432 if test "$with_minimum" != "yes"
433 then
434 if test "${with_mem_debug}" = "" ; then
435 with_mem_debug="yes"
436 fi
437 if test "${with_docbook}" = "" ; then
438 with_docbook="yes"
439 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000440 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000441 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 +0000442 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000443dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000444else
445 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000446fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000447AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000448
449dnl
450dnl Check for trio string functions
451dnl
452
453if test "${NEED_TRIO}" = "1" ; then
454 echo Adding trio library for string functions
455 WITH_TRIO=1
456else
457 WITH_TRIO=0
458fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000459AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000460AC_SUBST(WITH_TRIO)
461
Daniel Veillardf6eea272001-01-18 12:17:12 +0000462dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000463dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000464dnl
465
Daniel Veillardb8478642001-10-12 17:29:10 +0000466THREAD_LIBS=""
467WITH_THREADS=0
468THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000469TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000470THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000471
William M. Brack97ad4c72003-05-13 08:08:36 +0000472AC_ARG_WITH(threads,
473[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000474if test "$with_minimum" = "yes" -a "$with_threads" = ""
475then
476 with_threads=no
477fi
Daniel Veillard84942712003-04-18 14:40:05 +0000478if test "$with_threads" = "no" ; then
479 echo Disabling multithreaded support
480else
Daniel Veillardb8478642001-10-12 17:29:10 +0000481 echo Enabling multithreaded support
482
483 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000484 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000485 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000486 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
487 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000488 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000489 case $host_os in
490 *mingw32*) WITH_THREADS="1"
491 THREADS_W32="Win32"
492 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
493 ;;
494 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000495 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000496 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
497 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000498 fi
499fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000500AC_ARG_WITH(thread-alloc,
501[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000502if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
503then
504 with_thread_alloc=no
505fi
William M. Brack306e33c2004-06-12 01:01:22 +0000506if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000507 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000508fi
509
Daniel Veillardb8478642001-10-12 17:29:10 +0000510AC_SUBST(THREAD_LIBS)
511AC_SUBST(WITH_THREADS)
512AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000513AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000514AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000515
William M. Brack97ad4c72003-05-13 08:08:36 +0000516AC_ARG_WITH(history,
517[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000518if test "$with_minimum" = "yes" -a "$with_history" = ""
519then
520 with_history=no
521fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000522if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000523 echo Enabling xmllint shell history
524 dnl check for terminal library. this is a very cool solution
525 dnl from octave's configure.in
526 unset tcap
527 for termlib in ncurses curses termcap terminfo termlib; do
528 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
529 test -n "$tcap" && break
530 done
531
532 AC_CHECK_HEADER(readline/history.h,
533 AC_CHECK_LIB(history, append_history,[
534 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000535 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000536 AC_CHECK_HEADER(readline/readline.h,
537 AC_CHECK_LIB(readline, readline,[
538 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000539 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000540 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
541 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
542 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
543 else
544 CPPFLAGS=${_cppflags}
545 fi
546 LDFLAGS=${_ldflags}
547fi
548
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000549AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000550[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000551if test "$with_minimum" = "yes" -a "$with_output" = ""
552then
553 with_output=no
554fi
555if test "$with_output" = "no" ; then
556 echo Disabling serialization/saving support
557 WITH_OUTPUT=0
558else
559 WITH_OUTPUT=1
560fi
561AC_SUBST(WITH_OUTPUT)
562
Daniel Veillard652327a2003-09-29 18:02:38 +0000563AC_ARG_WITH(tree,
564[ --with-tree add the DOM like tree manipulation APIs (on)])
565if test "$with_minimum" = "yes" -a "$with_tree" = ""
566then
567 with_tree=no
568fi
569if test "$with_tree" = "no" ; then
570 echo Disabling DOM like tree manipulation APIs
571 WITH_TREE=0
572else
573 WITH_TREE=1
574fi
575AC_SUBST(WITH_TREE)
576
William M. Brack97ad4c72003-05-13 08:08:36 +0000577AC_ARG_WITH(ftp,
578[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000579if test "$with_minimum" = "yes" -a "$with_ftp" = ""
580then
581 with_ftp=no
582fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000583if test "$with_ftp" = "no" ; then
584 echo Disabling FTP support
585 WITH_FTP=0
586 FTP_OBJ=
587else
588 WITH_FTP=1
589 FTP_OBJ=nanoftp.o
590fi
591AC_SUBST(WITH_FTP)
592AC_SUBST(FTP_OBJ)
593
William M. Brack97ad4c72003-05-13 08:08:36 +0000594AC_ARG_WITH(http,
595[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000596if test "$with_minimum" = "yes" -a "$with_http" = ""
597then
598 with_http=no
599fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000600if test "$with_http" = "no" ; then
601 echo Disabling HTTP support
602 WITH_HTTP=0
603 HTTP_OBJ=
604else
605 WITH_HTTP=1
606 HTTP_OBJ=nanohttp.o
607fi
608AC_SUBST(WITH_HTTP)
609AC_SUBST(HTTP_OBJ)
610
Daniel Veillard4432df22003-09-28 18:58:27 +0000611AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000612[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000613if test "$with_minimum" = "yes" -a "$with_legacy" = ""
614then
615 with_legacy=no
616fi
617if test "$with_legacy" = "no" ; then
618 echo Disabling deprecated APIs
619 WITH_LEGACY=0
620else
621 WITH_LEGACY=1
622fi
623AC_SUBST(WITH_LEGACY)
624
Daniel Veillard81273902003-09-30 00:43:48 +0000625AC_ARG_WITH(reader,
626[ --with-reader add the xmlReader parsing interface (on)])
627if test "$with_minimum" = "yes" -a "$with_reader" = ""
628then
629 with_reader=no
630fi
631if test "$with_reader" = "no" ; then
632 echo Disabling the xmlReader parsing interface
633 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000634 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000635else
636 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000637 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000638fi
639AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000640AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000641
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000642AC_ARG_WITH(pattern,
643[ --with-pattern add the xmlPattern selection interface (on)])
644if test "$with_minimum" = "yes" -a "$with_pattern" = ""
645then
646 with_pattern=no
647fi
648if test "$with_pattern" = "no" ; then
649 echo Disabling the xmlPattern parsing interface
650 WITH_PATTERN=0
651 PATTERN_TEST=
652else
653 WITH_PATTERN=1
654 PATTERN_TEST=Patterntests
655fi
656AC_SUBST(WITH_PATTERN)
657AC_SUBST(PATTERN_TEST)
658
Daniel Veillard1d211e22003-10-20 22:32:39 +0000659AC_ARG_WITH(writer,
660[ --with-writer add the xmlWriter saving interface (on)])
661if test "$with_minimum" = "yes" -a "$with_writer" = ""
662then
663 with_writer=no
664fi
665if test "$with_writer" = "no" ; then
666 echo Disabling the xmlWriter saving interface
667 WITH_WRITER=0
668# WRITER_TEST=
669else
670 WITH_WRITER=1
671# WRITER_TEST=Writertests
672fi
673AC_SUBST(WITH_WRITER)
674#AC_SUBST(WRITER_TEST)
675
Daniel Veillard81273902003-09-30 00:43:48 +0000676AC_ARG_WITH(sax1,
677[ --with-sax1 add the older SAX1 interface (on)])
678if test "$with_minimum" = "yes" -a "$with_sax1" = ""
679then
680 with_sax1=no
681fi
682if test "$with_sax1" = "no" ; then
683 echo Disabling the older SAX1 interface
684 WITH_SAX1=0
685 TEST_SAX=
686else
687 WITH_SAX1=1
688 TEST_SAX=SAXtests
689fi
690AC_SUBST(WITH_SAX1)
691AC_SUBST(TEST_SAX)
692
Daniel Veillard73b013f2003-09-30 12:36:01 +0000693AC_ARG_WITH(push,
694[ --with-push add the PUSH parser interfaces (on)])
695if test "$with_minimum" = "yes" -a "$with_push" = ""
696then
697 with_push=no
698fi
699if test "$with_push" = "no" ; then
700 echo Disabling the PUSH parser interfaces
701 WITH_PUSH=0
702 TEST_PUSH=
703else
704 WITH_PUSH=1
705 TEST_PUSH="XMLPushtests"
706fi
707AC_SUBST(WITH_PUSH)
708AC_SUBST(TEST_PUSH)
709
710AC_ARG_WITH(html,
711[ --with-html add the HTML support (on)])
712if test "$with_minimum" = "yes" -a "$with_html" = ""
713then
714 with_html=no
715fi
716if test "$with_html" = "no" ; then
717 echo Disabling HTML support
718 WITH_HTML=0
719 HTML_OBJ=
720 TEST_HTML=
721else
722 WITH_HTML=1
723 HTML_OBJ="HTMLparser.o HTMLtree.o"
724 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000725 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000726 TEST_PHTML=HTMLPushtests
727 else
728 TEST_PHTML=
729 fi
730fi
731AC_SUBST(WITH_HTML)
732AC_SUBST(HTML_OBJ)
733AC_SUBST(TEST_HTML)
734AC_SUBST(TEST_PHTML)
735
Daniel Veillard4432df22003-09-28 18:58:27 +0000736AC_ARG_WITH(valid,
737[ --with-valid add the DTD validation support (on)])
738if test "$with_minimum" = "yes" -a "$with_valid" = ""
739then
740 with_valid=no
741fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000742if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000743 echo Disabling DTD validation support
744 WITH_VALID=0
745 TEST_VALID=
746 TEST_VTIME=
747else
748 WITH_VALID=1
749 TEST_VALID=Validtests
750 TEST_VTIME=VTimingtests
751fi
752AC_SUBST(WITH_VALID)
753AC_SUBST(TEST_VALID)
754AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000755
William M. Brack97ad4c72003-05-13 08:08:36 +0000756AC_ARG_WITH(catalog,
757[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000758if test "$with_minimum" = "yes" -a "$with_catalog" = ""
759then
760 with_catalog=no
761fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000762if test "$with_catalog" = "no" ; then
763 echo Disabling Catalog support
764 WITH_CATALOG=0
765 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000766 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000767else
768 WITH_CATALOG=1
769 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000770 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000771fi
772AC_SUBST(WITH_CATALOG)
773AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000774AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000775
William M. Brack97ad4c72003-05-13 08:08:36 +0000776AC_ARG_WITH(docbook,
777[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000778if test "$with_minimum" = "yes" -a "$with_docbook" = ""
779then
780 with_docbook=no
781fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000782if test "$with_docbook" = "no" ; then
783 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000784 WITH_DOCB=0
785 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000786else
787 WITH_DOCB=1
788 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000789fi
790AC_SUBST(WITH_DOCB)
791AC_SUBST(DOCB_OBJ)
792
793
William M. Brack97ad4c72003-05-13 08:08:36 +0000794AC_ARG_WITH(xpath,
795[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000796if test "$with_minimum" = "yes" -a "$with_xpath" = ""
797then
798 with_xpath=no
799fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000800if test "$with_xpath" = "no" ; then
801 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000802 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000803 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000804 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000805 WITH_XPATH=0
806 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000807 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000808else
809 WITH_XPATH=1
810 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000811 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000812fi
813AC_SUBST(WITH_XPATH)
814AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000815AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000816
William M. Brack97ad4c72003-05-13 08:08:36 +0000817AC_ARG_WITH(xptr,
818[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000819if test "$with_minimum" = "yes" -a "$with_xptr" = ""
820then
821 with_xptr=no
822fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000823if test "$with_xptr" = "no" ; then
824 echo Disabling XPointer support
825 WITH_XPTR=0
826 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000827 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000828else
829 WITH_XPTR=1
830 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000831 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000832fi
833AC_SUBST(WITH_XPTR)
834AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000835AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000836
William M. Brack97ad4c72003-05-13 08:08:36 +0000837AC_ARG_WITH(c14n,
838[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000839if test "$with_minimum" = "yes" -a "$with_c14n" = ""
840then
841 with_c14n=no
842fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000843if test "$with_c14n" = "no" ; then
844 echo Disabling C14N support
845 WITH_C14N=0
846 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000847 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000848else
849 WITH_C14N=1
850 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000851 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000852fi
853AC_SUBST(WITH_C14N)
854AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000855AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000856
William M. Brack97ad4c72003-05-13 08:08:36 +0000857AC_ARG_WITH(xinclude,
858[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000859if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
860then
861 with_xinclude=no
862fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000863if test "$with_xinclude" = "no" ; then
864 echo Disabling XInclude support
865 WITH_XINCLUDE=0
866 XINCLUDE_OBJ=
867 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000868 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000869else
870 WITH_XINCLUDE=1
871 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000872 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000873fi
874AC_SUBST(WITH_XINCLUDE)
875AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000876AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000877
Daniel Veillard6e90d192001-07-03 16:37:49 +0000878WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000879AC_ARG_WITH(iconv,
880[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000881if test "$with_minimum" = "yes" -a "$with_iconv" = ""
882then
883 with_iconv=no
884fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000885if test "$with_iconv" = "no" ; then
886 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000887else
Daniel Veillard220346d2001-12-07 11:33:54 +0000888 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000889 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000890 # Export this since our headers include iconv.h
891 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000892 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000893 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000894
895 AC_CHECK_HEADER(iconv.h,
896 AC_MSG_CHECKING(for iconv)
897 AC_TRY_LINK([#include <stdlib.h>
898#include <iconv.h>],[
899iconv_t cd = iconv_open ("","");
900iconv (cd, NULL, NULL, NULL, NULL);],[
901 AC_MSG_RESULT(yes)
902 WITH_ICONV=1],[
903 AC_MSG_RESULT(no)
904 AC_MSG_CHECKING(for iconv in -liconv)
905
906 _ldflags="${LDFLAGS}"
907 _libs="${LIBS}"
908 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
909 LIBS="${LIBS} -liconv"
910
911 AC_TRY_LINK([#include <stdlib.h>
912#include <iconv.h>],[
913iconv_t cd = iconv_open ("","");
914iconv (cd, NULL, NULL, NULL, NULL);],[
915 AC_MSG_RESULT(yes)
916 WITH_ICONV=1
917 ICONV_LIBS="${ICONV_LIBS} -liconv"
918 LIBS="${_libs}"
919 LDFLAGS="${_ldflags}"],[
920 AC_MSG_RESULT(no)
921 LIBS="${_libs}"
922 LDFLAGS="${_ldflags}"])]))
923fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000924case "$host" in
925 *mingw*) M_LIBS=""
926 ;;
927 *) M_LIBS="-lm"
928 ;;
929esac
Daniel Veillardb82c1662001-12-09 14:00:54 +0000930XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000931XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000932AC_SUBST(WITH_ICONV)
933
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000934WITH_ISO8859X=1
935AC_ARG_WITH(iso8859x,
936[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000937if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
938then
939 with_iso8859x=no
940fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000941if test "$WITH_ICONV" != "1" ; then
942if test "$with_iso8859x" = "no" ; then
943 echo Disabling ISO8859X support
944 WITH_ISO8859X=0
945fi
946fi
947AC_SUBST(WITH_ISO8859X)
948
William M. Brack97ad4c72003-05-13 08:08:36 +0000949AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000950[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000951if test "$with_minimum" = "yes" -a "$with_schemas" = ""
952then
953 with_schemas=no
954fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000955if test "$with_schemas" = "no" ; then
956 echo "Disabled Schemas/Relax-NG support"
957 WITH_SCHEMAS=0
958 TEST_SCHEMAS=
959else
Daniel Veillard71531f32003-02-05 13:19:53 +0000960 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000961 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000962 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +0000963 if test "$PYTHON_INCLUDES" != "" ; then
964 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
965 fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000966 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000967fi
968AC_SUBST(WITH_SCHEMAS)
969AC_SUBST(TEST_SCHEMAS)
970
William M. Brack97ad4c72003-05-13 08:08:36 +0000971AC_ARG_WITH(regexps,
972[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000973if test "$with_minimum" = "yes" -a "$with_regexps" = ""
974then
975 with_regexps=no
976fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000977if test "$with_regexps" = "no" ; then
978 echo Disabling Regexps support
979 WITH_REGEXPS=0
980 TEST_REGEXPS=
981else
982 WITH_REGEXPS=1
983 TEST_REGEXPS="Regexptests Automatatests"
984fi
985AC_SUBST(WITH_REGEXPS)
986AC_SUBST(TEST_REGEXPS)
987
William M. Brack97ad4c72003-05-13 08:08:36 +0000988AC_ARG_WITH(debug,
989[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000990if test "$with_minimum" = "yes" -a "$with_debug" = ""
991then
992 with_debug=no
993fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000994if test "$with_debug" = "no" ; then
995 echo Disabling DEBUG support
996 WITH_DEBUG=0
997 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000998 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000999else
1000 WITH_DEBUG=1
1001 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001002 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001003fi
1004AC_SUBST(WITH_DEBUG)
1005AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001006AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001007
William M. Brack97ad4c72003-05-13 08:08:36 +00001008AC_ARG_WITH(mem_debug,
1009[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +00001010if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
1011then
1012 with_mem_debug=no
1013fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001014if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001015 if test "$with_thread_alloc" = "yes" ; then
1016 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1017 WITH_MEM_DEBUG=0
1018 else
1019 echo Enabling memory debug support
1020 WITH_MEM_DEBUG=1
1021 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001022else
1023 WITH_MEM_DEBUG=0
1024fi
1025AC_SUBST(WITH_MEM_DEBUG)
1026
Daniel Veillard1638a472003-08-14 01:23:25 +00001027
1028WIN32_EXTRA_LIBADD=
1029WIN32_EXTRA_LDFLAGS=
1030case "$host" in
1031 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001032 CPPFLAGS="$CPPFLAGS -DWIN32"
1033 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001034 WIN32_EXTRA_LDFLAGS="-no-undefined"
1035 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1036 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1037 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1038 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001039 *-*-cygwin*)
1040 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
1041 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python2.3/config -lpython2.3"
1042 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001043esac
1044AC_SUBST(WIN32_EXTRA_LIBADD)
1045AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001046AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1047AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001048
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001049AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001050AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001051AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001052
Daniel Veillardb05deb71999-08-10 19:04:08 +00001053AC_SUBST(XML_LIBDIR)
1054AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001055AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001056AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001057AC_SUBST(XML_INCLUDEDIR)
1058AC_SUBST(HTML_DIR)
1059AC_SUBST(HAVE_ISNAN)
1060AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001061AC_SUBST(PYTHON)
1062AC_SUBST(PYTHON_VERSION)
1063AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001064AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001065
Daniel Veillardb05deb71999-08-10 19:04:08 +00001066AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001067AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001068
Daniel Veillard9715c172002-11-25 16:33:40 +00001069dnl for the spec file
1070RELDATE=`date +'%a %b %e %Y'`
1071AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001072AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001073
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001074rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001075ln -s Copyright COPYING
1076
Daniel Veillarde4177a52004-01-08 16:43:57 +00001077# keep on one line for cygwin c.f. #130896
Daniel Veillard06d25242004-02-25 13:01:42 +00001078AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile example/Makefile python/Makefile python/tests/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001079
Daniel Veillard06d25242004-02-25 13:01:42 +00001080chmod +x xml2-config python/setup.py