blob: 0d733df0df5cbd2969112633ec5c567506232e8d [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 Veillardb331fff2004-08-22 14:21:57 +00008LIBXML_MICRO_VERSION=12
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
Daniel Veillarddab93ea2004-08-20 16:47:10 +000016 extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
17 echo extra=$extra
18 if test "$extra" != ""
19 then
20 LIBXML_VERSION_EXTRA="-CVS$extra"
21 fi
William M. Brackf4025492004-08-18 21:08:46 +000022fi
Daniel Veillard14fff061999-06-22 21:49:07 +000023AC_SUBST(LIBXML_MAJOR_VERSION)
24AC_SUBST(LIBXML_MINOR_VERSION)
25AC_SUBST(LIBXML_MICRO_VERSION)
26AC_SUBST(LIBXML_VERSION)
27AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000028AC_SUBST(LIBXML_VERSION_NUMBER)
William M. Brackf4025492004-08-18 21:08:46 +000029AC_SUBST(LIBXML_VERSION_EXTRA)
Daniel Veillard14fff061999-06-22 21:49:07 +000030
Daniel Veillard361d8452000-04-03 19:48:13 +000031VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000032
Daniel Veillardedfb29b2000-03-14 19:59:05 +000033AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000034
Daniel Veillard01791d51998-07-24 19:24:09 +000035dnl Checks for programs.
36AC_PROG_CC
37AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000038AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000039AC_PATH_PROG(RM, rm, /bin/rm)
40AC_PATH_PROG(MV, mv, /bin/mv)
41AC_PATH_PROG(TAR, tar, /bin/tar)
William M. Brack1826d0a2004-07-21 09:03:57 +000042AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard01791d51998-07-24 19:24:09 +000043
Daniel Veillard03109292000-08-14 14:58:22 +000044dnl Make sure we have an ANSI compiler
45AM_C_PROTOTYPES
46test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
47
Daniel Veillard6984e6d2003-12-09 14:20:17 +000048AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000049AM_PROG_LIBTOOL
50
Daniel Veillardd8cf9062003-11-11 21:12:36 +000051# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000052
Daniel Veillard4432df22003-09-28 18:58:27 +000053dnl
54dnl option to build a minimal libxml2 library
55dnl
56AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
57if test "$with_minimum" = "yes"
58then
59 echo "Configuring for a minimal library"
60fi
61
Daniel Veillard71b656e2000-01-05 14:46:17 +000062dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000063_cppflags="${CPPFLAGS}"
64_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000065
Daniel Veillard259ff742001-10-06 13:49:59 +000066
Owen Taylor3473f882001-02-23 17:55:21 +000067AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +000068[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +000069 if test "$withval" != "no" -a "$withval" != "yes"; then
70 Z_DIR=$withval
71 CPPFLAGS="${CPPFLAGS} -I$withval/include"
72 LDFLAGS="${LDFLAGS} -L$withval/lib"
73 fi
Daniel Veillard259ff742001-10-06 13:49:59 +000074])
Daniel Veillard4432df22003-09-28 18:58:27 +000075if test "$with_minimum" = "yes" -a "$with_zlib" = ""
76then
77 with_zlib=no
78fi
Daniel Veillard259ff742001-10-06 13:49:59 +000079if test "$with_zlib" = "no"; then
80 echo "Disabling compression support"
81else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000082 AC_CHECK_HEADERS(zlib.h,
83 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +000084 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000085 if test "x${Z_DIR}" != "x"; then
86 Z_CFLAGS="-I${Z_DIR}/include"
87 Z_LIBS="-L${Z_DIR}/lib -lz"
88 [case ${host} in
89 *-*-solaris*)
90 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
91 ;;
92 esac]
93 else
94 Z_LIBS="-lz"
95 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +000096fi
Owen Taylor3473f882001-02-23 17:55:21 +000097
Owen Taylor3473f882001-02-23 17:55:21 +000098AC_SUBST(Z_CFLAGS)
99AC_SUBST(Z_LIBS)
100
101CPPFLAGS=${_cppflags}
102LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000103
Daniel Veillard01791d51998-07-24 19:24:09 +0000104dnl Checks for header files.
105AC_HEADER_DIRENT
106AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000107AC_CHECK_HEADERS([fcntl.h])
108AC_CHECK_HEADERS([unistd.h])
109AC_CHECK_HEADERS([ctype.h])
110AC_CHECK_HEADERS([dirent.h])
111AC_CHECK_HEADERS([errno.h])
112AC_CHECK_HEADERS([malloc.h])
113AC_CHECK_HEADERS([stdarg.h])
114AC_CHECK_HEADERS([sys/stat.h])
115AC_CHECK_HEADERS([sys/types.h])
116AC_CHECK_HEADERS([time.h])
117AC_CHECK_HEADERS([ansidecl.h])
118AC_CHECK_HEADERS([ieeefp.h])
119AC_CHECK_HEADERS([nan.h])
120AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000121AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000122AC_CHECK_HEADERS([fp_class.h])
123AC_CHECK_HEADERS([float.h])
124AC_CHECK_HEADERS([stdlib.h])
125AC_CHECK_HEADERS([sys/socket.h], [], [],
126[#if HAVE_SYS_TYPES_H
127# include <sys/types.h>
128# endif
129])
130AC_CHECK_HEADERS([netinet/in.h], [], [],
131[#if HAVE_SYS_TYPES_H
132# include <sys/types.h>
133# endif
134])
135AC_CHECK_HEADERS([arpa/inet.h], [], [],
136[#if HAVE_SYS_TYPES_H
137# include <sys/types.h>
138# endif
139#if HAVE_ARPA_INET_H
140# include <arpa/inet.h>
141# endif
142])
143AC_CHECK_HEADERS([netdb.h])
144AC_CHECK_HEADERS([sys/time.h])
145AC_CHECK_HEADERS([sys/select.h])
146AC_CHECK_HEADERS([sys/mman.h])
147AC_CHECK_HEADERS([sys/timeb.h])
148AC_CHECK_HEADERS([signal.h])
149AC_CHECK_HEADERS([arpa/nameser.h], [], [],
150[#if HAVE_SYS_TYPES_H
151# include <sys/types.h>
152# endif
153])
154AC_CHECK_HEADERS([resolv.h], [], [],
155[#if HAVE_SYS_TYPES_H
156# include <sys/types.h>
157# endif
158#if HAVE_NETINET_IN_H
159# include <netinet/in.h>
160# endif
161#if HAVE_ARPA_NAMESER_H
162# include <arpa/nameser.h>
163# endif
164])
Daniel Veillard01791d51998-07-24 19:24:09 +0000165
Daniel Veillard1164e751999-02-16 16:29:17 +0000166dnl Specific dir for HTML output ?
Daniel Veillardfc979062004-03-04 22:07:16 +0000167AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
168 [path to base html directory, default $datadir/doc/html]),
169 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
170
171AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
172 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
173 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
174 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
Daniel Veillard1164e751999-02-16 16:29:17 +0000175
176AC_SUBST(HTML_DIR)
177
Daniel Veillard01791d51998-07-24 19:24:09 +0000178dnl Checks for library functions.
179AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000180AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000181AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000182AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000183AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000184
Daniel Veillard92ad2102001-03-27 12:47:33 +0000185dnl Checking the standard string functions availability
186AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
187 NEED_TRIO=1)
188
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000189dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000190AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
191AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
192AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000193
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000194dnl Determine what socket length (socklen_t) data type is
195AC_MSG_CHECKING([for type of socket length (socklen_t)])
196AC_TRY_COMPILE2([
197#include <stddef.h>
198#include <sys/types.h>
199#include <sys/socket.h>],[
200(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
201 AC_MSG_RESULT(socklen_t *)
202 SOCKLEN_T=socklen_t],[
203 AC_TRY_COMPILE2([
204#include <stddef.h>
205#include <sys/types.h>
206#include <sys/socket.h>],[
207(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
208 AC_MSG_RESULT(size_t *)
209 SOCKLEN_T=size_t],[
210 AC_TRY_COMPILE2([
211#include <stddef.h>
212#include <sys/types.h>
213#include <sys/socket.h>],[
214(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
215 AC_MSG_RESULT(int *)
216 SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000217 AC_MSG_WARN(could not determine)
218 SOCKLEN_T="unsigned int"])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000219AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000220
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000221dnl ***********************Checking for availability of IPv6*******************
222
223AC_MSG_CHECKING([whether to enable IPv6])
224AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000225if test "$with_minimum" = "yes"
226then
227 enable_ipv6=no
228fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000229if test $enable_ipv6 = yes; then
230 have_ipv6=no
231 AC_TRY_COMPILE([
232 #include <sys/socket.h>
233 #include <sys/types.h>], [
234 struct sockaddr_storage ss;
235 socket(AF_INET6, SOCK_STREAM, 0)
236 ],
237 have_ipv6=yes,
238 have_ipv6=no
239 )
240 AC_MSG_RESULT($have_ipv6)
241
William M. Brack476cd962003-08-13 11:09:42 +0000242 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000243 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000244
245 have_getaddrinfo=no
246 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
247 if test $have_getaddrinfo != yes; then
248 for lib in bsd socket inet; do
249 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
250 done
251 fi
252
William M. Brack476cd962003-08-13 11:09:42 +0000253 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000254 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000255 fi
256 fi
257fi
258
259dnl ******************************End IPv6 checks******************************
260
Daniel Veillardb05deb71999-08-10 19:04:08 +0000261dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000262AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000263 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000264
Daniel Veillardc790bf42003-10-11 10:50:10 +0000265AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
266 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000267
268XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000269XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000270
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000271dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000272dnl Extra flags
273dnl
274XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000275RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000276
Daniel Veillardd94849b2003-07-28 13:02:24 +0000277AC_ARG_WITH(fexceptions,
278[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000279if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
280then
281 with_fexceptions=no
282fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000283dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000284dnl Workaround for native compilers
285dnl HP : http://bugs.gnome.org/db/31/3163.html
286dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000287dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000288if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000289 case "${host}" in
290 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000291 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000292 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000293 *-dec-osf* )
294 CFLAGS="${CFLAGS} -ieee"
295 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000296 alpha*-*-linux* )
297 CFLAGS="${CFLAGS} -ieee"
298 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000299 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000300else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000301 if test "$with_fexceptions" = "yes"
302 then
303 #
304 # Not activated by default because this inflates the code size
305 # Used to allow propagation of C++ exceptions through the library
306 #
307 CFLAGS="${CFLAGS} -fexceptions"
308 fi
309
Daniel Veillard4918efe2004-08-23 12:35:14 +0000310 CFLAGS="${CFLAGS} -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 +0000311 case "${host}" in
312 alpha*-*-linux* )
313 CFLAGS="${CFLAGS} -mieee"
314 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000315 alpha*-*-osf* )
316 CFLAGS="${CFLAGS} -mieee"
317 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000318 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000319fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000320case ${host} in
321 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000322 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
323 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000324 hppa*-hp-mpeix)
325 NEED_TRIO=1
326 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000327esac
328
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000329
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000330dnl
331dnl check for python
332dnl
333
334PYTHON=
335PYTHON_VERSION=
336PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000337PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000338PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000339pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000340AC_ARG_WITH(python,
341[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000342if test "$with_minimum" = "yes" -a "$with_python" = ""
343then
344 with_python=no
345fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000346if test "$with_python" != "no" ; then
347 if test -x "$with_python/bin/python"
348 then
349 echo Found python in $with_python/bin/python
350 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000351 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000352 if test -x "$with_python"
353 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000354 echo Found python in $with_python
355 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000356 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000357 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000358 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000359 fi
360 if test "$PYTHON" != ""
361 then
362 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
363 echo Found Python version $PYTHON_VERSION
364 fi
365 if test "$PYTHON_VERSION" != ""
366 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000367 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
368 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000369 then
370 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000371 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000372 else
373 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
374 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000375 PYTHON_INCLUDES='$(prefix)/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 if test -r /usr/include/python$PYTHON_VERSION/Python.h
379 then
380 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000381 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000382 else
383 echo could not find python$PYTHON_VERSION/Python.h
384 fi
385 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000386 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000387 then
388 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
389 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000390 fi
391 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000392 if test "$with_python" != ""
393 then
394 pythondir='$(PYTHON_SITE_PACKAGES)'
395 else
396 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
397 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000398fi
399AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000400if test "$PYTHON_INCLUDES" != ""
401then
402 PYTHON_SUBDIR=python
403else
404 PYTHON_SUBDIR=
405fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000406AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000407AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000408
Daniel Veillard437b87b2000-01-03 17:30:46 +0000409dnl
410dnl Tester makes use of readline if present
411dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000412_cppflags="${CPPFLAGS}"
413_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000414
Daniel Veillard03109292000-08-14 14:58:22 +0000415AC_ARG_WITH(readline,
416[ --with-readline=DIR use readline in DIR],[
417 if test "$withval" != "no" -a "$withval" != "yes"; then
418 RDL_DIR=$withval
419 CPPFLAGS="${CPPFLAGS} -I$withval/include"
420 LDFLAGS="${LDFLAGS} -L$withval/lib"
421 fi
422])
Daniel Veillard4432df22003-09-28 18:58:27 +0000423if test "$with_minimum" = "yes" -a "$with_readline" = ""
424then
425 with_readline=no
426fi
Daniel Veillard03109292000-08-14 14:58:22 +0000427
Daniel Veillard361d8452000-04-03 19:48:13 +0000428dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000429dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000430dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000431dnl
William M. Brack871611b2003-10-18 04:53:14 +0000432if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000433 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000434 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
William M. Brack4119d1c2004-06-24 02:24:44 +0000435 [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000436 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000437 if test "$with_minimum" != "yes"
438 then
439 if test "${with_mem_debug}" = "" ; then
440 with_mem_debug="yes"
441 fi
442 if test "${with_docbook}" = "" ; then
443 with_docbook="yes"
444 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000445 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000446 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 +0000447 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000448dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000449else
450 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000451fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000452AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000453
454dnl
455dnl Check for trio string functions
456dnl
457
458if test "${NEED_TRIO}" = "1" ; then
459 echo Adding trio library for string functions
460 WITH_TRIO=1
461else
462 WITH_TRIO=0
463fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000464AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000465AC_SUBST(WITH_TRIO)
466
Daniel Veillardf6eea272001-01-18 12:17:12 +0000467dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000468dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000469dnl
470
Daniel Veillardb8478642001-10-12 17:29:10 +0000471THREAD_LIBS=""
472WITH_THREADS=0
473THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000474TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000475THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000476
William M. Brack97ad4c72003-05-13 08:08:36 +0000477AC_ARG_WITH(threads,
478[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000479if test "$with_minimum" = "yes" -a "$with_threads" = ""
480then
481 with_threads=no
482fi
Daniel Veillard84942712003-04-18 14:40:05 +0000483if test "$with_threads" = "no" ; then
484 echo Disabling multithreaded support
485else
Daniel Veillardb8478642001-10-12 17:29:10 +0000486 echo Enabling multithreaded support
487
488 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000489 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000490 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000491 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
492 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000493 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000494 case $host_os in
495 *mingw32*) WITH_THREADS="1"
496 THREADS_W32="Win32"
497 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
498 ;;
499 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000500 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000501 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
502 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000503 fi
504fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000505AC_ARG_WITH(thread-alloc,
506[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000507if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
508then
509 with_thread_alloc=no
510fi
William M. Brack306e33c2004-06-12 01:01:22 +0000511if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000512 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000513fi
514
Daniel Veillardb8478642001-10-12 17:29:10 +0000515AC_SUBST(THREAD_LIBS)
516AC_SUBST(WITH_THREADS)
517AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000518AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000519AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000520
William M. Brack97ad4c72003-05-13 08:08:36 +0000521AC_ARG_WITH(history,
522[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000523if test "$with_minimum" = "yes" -a "$with_history" = ""
524then
525 with_history=no
526fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000527if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000528 echo Enabling xmllint shell history
529 dnl check for terminal library. this is a very cool solution
530 dnl from octave's configure.in
531 unset tcap
532 for termlib in ncurses curses termcap terminfo termlib; do
533 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
534 test -n "$tcap" && break
535 done
536
537 AC_CHECK_HEADER(readline/history.h,
538 AC_CHECK_LIB(history, append_history,[
539 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000540 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000541 AC_CHECK_HEADER(readline/readline.h,
542 AC_CHECK_LIB(readline, readline,[
543 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000544 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000545 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
546 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
547 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
548 else
549 CPPFLAGS=${_cppflags}
550 fi
551 LDFLAGS=${_ldflags}
552fi
553
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000554AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000555[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000556if test "$with_minimum" = "yes" -a "$with_output" = ""
557then
558 with_output=no
559fi
560if test "$with_output" = "no" ; then
561 echo Disabling serialization/saving support
562 WITH_OUTPUT=0
563else
564 WITH_OUTPUT=1
565fi
566AC_SUBST(WITH_OUTPUT)
567
Daniel Veillard652327a2003-09-29 18:02:38 +0000568AC_ARG_WITH(tree,
569[ --with-tree add the DOM like tree manipulation APIs (on)])
570if test "$with_minimum" = "yes" -a "$with_tree" = ""
571then
572 with_tree=no
573fi
574if test "$with_tree" = "no" ; then
575 echo Disabling DOM like tree manipulation APIs
576 WITH_TREE=0
577else
578 WITH_TREE=1
579fi
580AC_SUBST(WITH_TREE)
581
William M. Brack97ad4c72003-05-13 08:08:36 +0000582AC_ARG_WITH(ftp,
583[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000584if test "$with_minimum" = "yes" -a "$with_ftp" = ""
585then
586 with_ftp=no
587fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000588if test "$with_ftp" = "no" ; then
589 echo Disabling FTP support
590 WITH_FTP=0
591 FTP_OBJ=
592else
593 WITH_FTP=1
594 FTP_OBJ=nanoftp.o
595fi
596AC_SUBST(WITH_FTP)
597AC_SUBST(FTP_OBJ)
598
William M. Brack97ad4c72003-05-13 08:08:36 +0000599AC_ARG_WITH(http,
600[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000601if test "$with_minimum" = "yes" -a "$with_http" = ""
602then
603 with_http=no
604fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000605if test "$with_http" = "no" ; then
606 echo Disabling HTTP support
607 WITH_HTTP=0
608 HTTP_OBJ=
609else
610 WITH_HTTP=1
611 HTTP_OBJ=nanohttp.o
612fi
613AC_SUBST(WITH_HTTP)
614AC_SUBST(HTTP_OBJ)
615
Daniel Veillard4432df22003-09-28 18:58:27 +0000616AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000617[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000618if test "$with_minimum" = "yes" -a "$with_legacy" = ""
619then
620 with_legacy=no
621fi
622if test "$with_legacy" = "no" ; then
623 echo Disabling deprecated APIs
624 WITH_LEGACY=0
625else
626 WITH_LEGACY=1
627fi
628AC_SUBST(WITH_LEGACY)
629
Daniel Veillard81273902003-09-30 00:43:48 +0000630AC_ARG_WITH(reader,
631[ --with-reader add the xmlReader parsing interface (on)])
632if test "$with_minimum" = "yes" -a "$with_reader" = ""
633then
634 with_reader=no
635fi
636if test "$with_reader" = "no" ; then
637 echo Disabling the xmlReader parsing interface
638 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000639 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000640else
641 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000642 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000643fi
644AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000645AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000646
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000647AC_ARG_WITH(pattern,
648[ --with-pattern add the xmlPattern selection interface (on)])
649if test "$with_minimum" = "yes" -a "$with_pattern" = ""
650then
651 with_pattern=no
652fi
653if test "$with_pattern" = "no" ; then
654 echo Disabling the xmlPattern parsing interface
655 WITH_PATTERN=0
656 PATTERN_TEST=
657else
658 WITH_PATTERN=1
659 PATTERN_TEST=Patterntests
660fi
661AC_SUBST(WITH_PATTERN)
662AC_SUBST(PATTERN_TEST)
663
Daniel Veillard1d211e22003-10-20 22:32:39 +0000664AC_ARG_WITH(writer,
665[ --with-writer add the xmlWriter saving interface (on)])
666if test "$with_minimum" = "yes" -a "$with_writer" = ""
667then
668 with_writer=no
669fi
670if test "$with_writer" = "no" ; then
671 echo Disabling the xmlWriter saving interface
672 WITH_WRITER=0
673# WRITER_TEST=
674else
675 WITH_WRITER=1
676# WRITER_TEST=Writertests
677fi
678AC_SUBST(WITH_WRITER)
679#AC_SUBST(WRITER_TEST)
680
Daniel Veillard81273902003-09-30 00:43:48 +0000681AC_ARG_WITH(sax1,
682[ --with-sax1 add the older SAX1 interface (on)])
683if test "$with_minimum" = "yes" -a "$with_sax1" = ""
684then
685 with_sax1=no
686fi
687if test "$with_sax1" = "no" ; then
688 echo Disabling the older SAX1 interface
689 WITH_SAX1=0
690 TEST_SAX=
691else
692 WITH_SAX1=1
693 TEST_SAX=SAXtests
694fi
695AC_SUBST(WITH_SAX1)
696AC_SUBST(TEST_SAX)
697
Daniel Veillard73b013f2003-09-30 12:36:01 +0000698AC_ARG_WITH(push,
699[ --with-push add the PUSH parser interfaces (on)])
700if test "$with_minimum" = "yes" -a "$with_push" = ""
701then
702 with_push=no
703fi
704if test "$with_push" = "no" ; then
705 echo Disabling the PUSH parser interfaces
706 WITH_PUSH=0
707 TEST_PUSH=
708else
709 WITH_PUSH=1
710 TEST_PUSH="XMLPushtests"
711fi
712AC_SUBST(WITH_PUSH)
713AC_SUBST(TEST_PUSH)
714
715AC_ARG_WITH(html,
716[ --with-html add the HTML support (on)])
717if test "$with_minimum" = "yes" -a "$with_html" = ""
718then
719 with_html=no
720fi
721if test "$with_html" = "no" ; then
722 echo Disabling HTML support
723 WITH_HTML=0
724 HTML_OBJ=
725 TEST_HTML=
726else
727 WITH_HTML=1
728 HTML_OBJ="HTMLparser.o HTMLtree.o"
729 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000730 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000731 TEST_PHTML=HTMLPushtests
732 else
733 TEST_PHTML=
734 fi
735fi
736AC_SUBST(WITH_HTML)
737AC_SUBST(HTML_OBJ)
738AC_SUBST(TEST_HTML)
739AC_SUBST(TEST_PHTML)
740
Daniel Veillard4432df22003-09-28 18:58:27 +0000741AC_ARG_WITH(valid,
742[ --with-valid add the DTD validation support (on)])
743if test "$with_minimum" = "yes" -a "$with_valid" = ""
744then
745 with_valid=no
746fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000747if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000748 echo Disabling DTD validation support
749 WITH_VALID=0
750 TEST_VALID=
751 TEST_VTIME=
752else
753 WITH_VALID=1
754 TEST_VALID=Validtests
755 TEST_VTIME=VTimingtests
756fi
757AC_SUBST(WITH_VALID)
758AC_SUBST(TEST_VALID)
759AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000760
William M. Brack97ad4c72003-05-13 08:08:36 +0000761AC_ARG_WITH(catalog,
762[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000763if test "$with_minimum" = "yes" -a "$with_catalog" = ""
764then
765 with_catalog=no
766fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000767if test "$with_catalog" = "no" ; then
768 echo Disabling Catalog support
769 WITH_CATALOG=0
770 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000771 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000772else
773 WITH_CATALOG=1
774 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000775 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000776fi
777AC_SUBST(WITH_CATALOG)
778AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000779AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000780
William M. Brack97ad4c72003-05-13 08:08:36 +0000781AC_ARG_WITH(docbook,
782[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000783if test "$with_minimum" = "yes" -a "$with_docbook" = ""
784then
785 with_docbook=no
786fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000787if test "$with_docbook" = "no" ; then
788 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000789 WITH_DOCB=0
790 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000791else
792 WITH_DOCB=1
793 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000794fi
795AC_SUBST(WITH_DOCB)
796AC_SUBST(DOCB_OBJ)
797
798
William M. Brack97ad4c72003-05-13 08:08:36 +0000799AC_ARG_WITH(xpath,
800[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000801if test "$with_minimum" = "yes" -a "$with_xpath" = ""
802then
803 with_xpath=no
804fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000805if test "$with_xpath" = "no" ; then
806 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000807 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000808 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000809 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000810 WITH_XPATH=0
811 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000812 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000813else
814 WITH_XPATH=1
815 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000816 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000817fi
818AC_SUBST(WITH_XPATH)
819AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000820AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000821
William M. Brack97ad4c72003-05-13 08:08:36 +0000822AC_ARG_WITH(xptr,
823[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000824if test "$with_minimum" = "yes" -a "$with_xptr" = ""
825then
826 with_xptr=no
827fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000828if test "$with_xptr" = "no" ; then
829 echo Disabling XPointer support
830 WITH_XPTR=0
831 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000832 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000833else
834 WITH_XPTR=1
835 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000836 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000837fi
838AC_SUBST(WITH_XPTR)
839AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000840AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000841
William M. Brack97ad4c72003-05-13 08:08:36 +0000842AC_ARG_WITH(c14n,
843[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000844if test "$with_minimum" = "yes" -a "$with_c14n" = ""
845then
846 with_c14n=no
847fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000848if test "$with_c14n" = "no" ; then
849 echo Disabling C14N support
850 WITH_C14N=0
851 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000852 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000853else
854 WITH_C14N=1
855 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000856 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000857fi
858AC_SUBST(WITH_C14N)
859AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000860AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000861
William M. Brack97ad4c72003-05-13 08:08:36 +0000862AC_ARG_WITH(xinclude,
863[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000864if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
865then
866 with_xinclude=no
867fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000868if test "$with_xinclude" = "no" ; then
869 echo Disabling XInclude support
870 WITH_XINCLUDE=0
871 XINCLUDE_OBJ=
872 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000873 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000874else
875 WITH_XINCLUDE=1
876 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000877 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000878fi
879AC_SUBST(WITH_XINCLUDE)
880AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000881AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000882
Daniel Veillard6e90d192001-07-03 16:37:49 +0000883WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000884AC_ARG_WITH(iconv,
885[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000886if test "$with_minimum" = "yes" -a "$with_iconv" = ""
887then
888 with_iconv=no
889fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000890if test "$with_iconv" = "no" ; then
891 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000892else
Daniel Veillard220346d2001-12-07 11:33:54 +0000893 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000894 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000895 # Export this since our headers include iconv.h
896 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000897 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000898 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000899
900 AC_CHECK_HEADER(iconv.h,
901 AC_MSG_CHECKING(for iconv)
902 AC_TRY_LINK([#include <stdlib.h>
903#include <iconv.h>],[
904iconv_t cd = iconv_open ("","");
905iconv (cd, NULL, NULL, NULL, NULL);],[
906 AC_MSG_RESULT(yes)
907 WITH_ICONV=1],[
908 AC_MSG_RESULT(no)
909 AC_MSG_CHECKING(for iconv in -liconv)
910
911 _ldflags="${LDFLAGS}"
912 _libs="${LIBS}"
913 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
914 LIBS="${LIBS} -liconv"
915
916 AC_TRY_LINK([#include <stdlib.h>
917#include <iconv.h>],[
918iconv_t cd = iconv_open ("","");
919iconv (cd, NULL, NULL, NULL, NULL);],[
920 AC_MSG_RESULT(yes)
921 WITH_ICONV=1
922 ICONV_LIBS="${ICONV_LIBS} -liconv"
923 LIBS="${_libs}"
924 LDFLAGS="${_ldflags}"],[
925 AC_MSG_RESULT(no)
926 LIBS="${_libs}"
927 LDFLAGS="${_ldflags}"])]))
928fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000929case "$host" in
930 *mingw*) M_LIBS=""
931 ;;
932 *) M_LIBS="-lm"
933 ;;
934esac
Daniel Veillardb82c1662001-12-09 14:00:54 +0000935XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000936XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000937AC_SUBST(WITH_ICONV)
938
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000939WITH_ISO8859X=1
940AC_ARG_WITH(iso8859x,
941[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000942if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
943then
944 with_iso8859x=no
945fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000946if test "$WITH_ICONV" != "1" ; then
947if test "$with_iso8859x" = "no" ; then
948 echo Disabling ISO8859X support
949 WITH_ISO8859X=0
950fi
951fi
952AC_SUBST(WITH_ISO8859X)
953
William M. Brack97ad4c72003-05-13 08:08:36 +0000954AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000955[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000956if test "$with_minimum" = "yes" -a "$with_schemas" = ""
957then
958 with_schemas=no
959fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000960if test "$with_schemas" = "no" ; then
961 echo "Disabled Schemas/Relax-NG support"
962 WITH_SCHEMAS=0
963 TEST_SCHEMAS=
964else
Daniel Veillard71531f32003-02-05 13:19:53 +0000965 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000966 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000967 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +0000968 if test "$PYTHON_INCLUDES" != "" ; then
969 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
970 fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000971 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000972fi
973AC_SUBST(WITH_SCHEMAS)
974AC_SUBST(TEST_SCHEMAS)
975
William M. Brack97ad4c72003-05-13 08:08:36 +0000976AC_ARG_WITH(regexps,
977[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000978if test "$with_minimum" = "yes" -a "$with_regexps" = ""
979then
980 with_regexps=no
981fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000982if test "$with_regexps" = "no" ; then
983 echo Disabling Regexps support
984 WITH_REGEXPS=0
985 TEST_REGEXPS=
986else
987 WITH_REGEXPS=1
988 TEST_REGEXPS="Regexptests Automatatests"
989fi
990AC_SUBST(WITH_REGEXPS)
991AC_SUBST(TEST_REGEXPS)
992
William M. Brack97ad4c72003-05-13 08:08:36 +0000993AC_ARG_WITH(debug,
994[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000995if test "$with_minimum" = "yes" -a "$with_debug" = ""
996then
997 with_debug=no
998fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000999if test "$with_debug" = "no" ; then
1000 echo Disabling DEBUG support
1001 WITH_DEBUG=0
1002 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001003 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001004else
1005 WITH_DEBUG=1
1006 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001007 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001008fi
1009AC_SUBST(WITH_DEBUG)
1010AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001011AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001012
William M. Brack97ad4c72003-05-13 08:08:36 +00001013AC_ARG_WITH(mem_debug,
1014[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +00001015if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
1016then
1017 with_mem_debug=no
1018fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001019if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001020 if test "$with_thread_alloc" = "yes" ; then
1021 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1022 WITH_MEM_DEBUG=0
1023 else
1024 echo Enabling memory debug support
1025 WITH_MEM_DEBUG=1
1026 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001027else
1028 WITH_MEM_DEBUG=0
1029fi
1030AC_SUBST(WITH_MEM_DEBUG)
1031
Daniel Veillard1638a472003-08-14 01:23:25 +00001032
1033WIN32_EXTRA_LIBADD=
1034WIN32_EXTRA_LDFLAGS=
1035case "$host" in
1036 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001037 CPPFLAGS="$CPPFLAGS -DWIN32"
1038 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001039 WIN32_EXTRA_LDFLAGS="-no-undefined"
1040 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1041 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1042 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1043 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001044 *-*-cygwin*)
1045 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
1046 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python2.3/config -lpython2.3"
1047 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001048esac
1049AC_SUBST(WIN32_EXTRA_LIBADD)
1050AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001051AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1052AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001053
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001054AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001055AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001056AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001057
Daniel Veillardb05deb71999-08-10 19:04:08 +00001058AC_SUBST(XML_LIBDIR)
1059AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001060AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001061AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001062AC_SUBST(XML_INCLUDEDIR)
1063AC_SUBST(HTML_DIR)
1064AC_SUBST(HAVE_ISNAN)
1065AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001066AC_SUBST(PYTHON)
1067AC_SUBST(PYTHON_VERSION)
1068AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001069AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001070
Daniel Veillardb05deb71999-08-10 19:04:08 +00001071AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001072AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001073
Daniel Veillard9715c172002-11-25 16:33:40 +00001074dnl for the spec file
1075RELDATE=`date +'%a %b %e %Y'`
1076AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001077AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001078
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001079rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001080ln -s Copyright COPYING
1081
Daniel Veillarde4177a52004-01-08 16:43:57 +00001082# keep on one line for cygwin c.f. #130896
Daniel Veillard06d25242004-02-25 13:01:42 +00001083AC_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 +00001084
Daniel Veillard06d25242004-02-25 13:01:42 +00001085chmod +x xml2-config python/setup.py