blob: ed6b94c4a2446b0983686f6b1b92d4016be184eb [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 Veillard6927b102004-10-27 17:29:04 +00008LIBXML_MICRO_VERSION=15
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 Veillard8b817da2004-09-30 09:19:33 +000043AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
Daniel Veillard06500c82004-09-07 09:12:44 +000044AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
Daniel Veillard01791d51998-07-24 19:24:09 +000045
Daniel Veillard03109292000-08-14 14:58:22 +000046dnl Make sure we have an ANSI compiler
47AM_C_PROTOTYPES
48test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
49
Daniel Veillard6984e6d2003-12-09 14:20:17 +000050AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000051AM_PROG_LIBTOOL
52
Daniel Veillardd8cf9062003-11-11 21:12:36 +000053# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000054
Daniel Veillard4432df22003-09-28 18:58:27 +000055dnl
56dnl option to build a minimal libxml2 library
57dnl
58AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
59if test "$with_minimum" = "yes"
60then
61 echo "Configuring for a minimal library"
62fi
63
Daniel Veillard71b656e2000-01-05 14:46:17 +000064dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000065_cppflags="${CPPFLAGS}"
66_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000067
Daniel Veillard259ff742001-10-06 13:49:59 +000068
Owen Taylor3473f882001-02-23 17:55:21 +000069AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +000070[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +000071 if test "$withval" != "no" -a "$withval" != "yes"; then
72 Z_DIR=$withval
73 CPPFLAGS="${CPPFLAGS} -I$withval/include"
74 LDFLAGS="${LDFLAGS} -L$withval/lib"
75 fi
Daniel Veillard259ff742001-10-06 13:49:59 +000076])
Daniel Veillard4432df22003-09-28 18:58:27 +000077if test "$with_minimum" = "yes" -a "$with_zlib" = ""
78then
79 with_zlib=no
80fi
Daniel Veillard259ff742001-10-06 13:49:59 +000081if test "$with_zlib" = "no"; then
82 echo "Disabling compression support"
83else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000084 AC_CHECK_HEADERS(zlib.h,
85 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +000086 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000087 if test "x${Z_DIR}" != "x"; then
88 Z_CFLAGS="-I${Z_DIR}/include"
89 Z_LIBS="-L${Z_DIR}/lib -lz"
90 [case ${host} in
91 *-*-solaris*)
92 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
93 ;;
94 esac]
95 else
96 Z_LIBS="-lz"
97 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +000098fi
Owen Taylor3473f882001-02-23 17:55:21 +000099
Owen Taylor3473f882001-02-23 17:55:21 +0000100AC_SUBST(Z_CFLAGS)
101AC_SUBST(Z_LIBS)
102
103CPPFLAGS=${_cppflags}
104LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000105
Daniel Veillard01791d51998-07-24 19:24:09 +0000106dnl Checks for header files.
107AC_HEADER_DIRENT
108AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000109AC_CHECK_HEADERS([fcntl.h])
110AC_CHECK_HEADERS([unistd.h])
111AC_CHECK_HEADERS([ctype.h])
112AC_CHECK_HEADERS([dirent.h])
113AC_CHECK_HEADERS([errno.h])
114AC_CHECK_HEADERS([malloc.h])
115AC_CHECK_HEADERS([stdarg.h])
116AC_CHECK_HEADERS([sys/stat.h])
117AC_CHECK_HEADERS([sys/types.h])
118AC_CHECK_HEADERS([time.h])
119AC_CHECK_HEADERS([ansidecl.h])
120AC_CHECK_HEADERS([ieeefp.h])
121AC_CHECK_HEADERS([nan.h])
122AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000123AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000124AC_CHECK_HEADERS([fp_class.h])
125AC_CHECK_HEADERS([float.h])
126AC_CHECK_HEADERS([stdlib.h])
127AC_CHECK_HEADERS([sys/socket.h], [], [],
128[#if HAVE_SYS_TYPES_H
129# include <sys/types.h>
130# endif
131])
132AC_CHECK_HEADERS([netinet/in.h], [], [],
133[#if HAVE_SYS_TYPES_H
134# include <sys/types.h>
135# endif
136])
137AC_CHECK_HEADERS([arpa/inet.h], [], [],
138[#if HAVE_SYS_TYPES_H
139# include <sys/types.h>
140# endif
141#if HAVE_ARPA_INET_H
142# include <arpa/inet.h>
143# endif
144])
145AC_CHECK_HEADERS([netdb.h])
146AC_CHECK_HEADERS([sys/time.h])
147AC_CHECK_HEADERS([sys/select.h])
148AC_CHECK_HEADERS([sys/mman.h])
149AC_CHECK_HEADERS([sys/timeb.h])
150AC_CHECK_HEADERS([signal.h])
151AC_CHECK_HEADERS([arpa/nameser.h], [], [],
152[#if HAVE_SYS_TYPES_H
153# include <sys/types.h>
154# endif
155])
156AC_CHECK_HEADERS([resolv.h], [], [],
157[#if HAVE_SYS_TYPES_H
158# include <sys/types.h>
159# endif
160#if HAVE_NETINET_IN_H
161# include <netinet/in.h>
162# endif
163#if HAVE_ARPA_NAMESER_H
164# include <arpa/nameser.h>
165# endif
166])
Daniel Veillard01791d51998-07-24 19:24:09 +0000167
Daniel Veillard1164e751999-02-16 16:29:17 +0000168dnl Specific dir for HTML output ?
Daniel Veillardfc979062004-03-04 22:07:16 +0000169AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
170 [path to base html directory, default $datadir/doc/html]),
171 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
172
173AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
174 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
175 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
176 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
Daniel Veillard1164e751999-02-16 16:29:17 +0000177
178AC_SUBST(HTML_DIR)
179
Daniel Veillard01791d51998-07-24 19:24:09 +0000180dnl Checks for library functions.
181AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000182AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000183AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000184AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000185AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000186
Daniel Veillard92ad2102001-03-27 12:47:33 +0000187dnl Checking the standard string functions availability
188AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
189 NEED_TRIO=1)
190
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000191dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000192AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
193AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
194AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000195
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000196dnl Determine what socket length (socklen_t) data type is
197AC_MSG_CHECKING([for type of socket length (socklen_t)])
198AC_TRY_COMPILE2([
199#include <stddef.h>
200#include <sys/types.h>
201#include <sys/socket.h>],[
202(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
203 AC_MSG_RESULT(socklen_t *)
204 SOCKLEN_T=socklen_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, (size_t *)NULL)],[
210 AC_MSG_RESULT(size_t *)
211 SOCKLEN_T=size_t],[
212 AC_TRY_COMPILE2([
213#include <stddef.h>
214#include <sys/types.h>
215#include <sys/socket.h>],[
216(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
217 AC_MSG_RESULT(int *)
218 SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000219 AC_MSG_WARN(could not determine)
Daniel Veillardc7e3cc42004-09-28 12:33:52 +0000220 SOCKLEN_T="int"])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000221AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000222
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000223dnl ***********************Checking for availability of IPv6*******************
224
225AC_MSG_CHECKING([whether to enable IPv6])
226AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000227if test "$with_minimum" = "yes"
228then
229 enable_ipv6=no
230fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000231if test $enable_ipv6 = yes; then
232 have_ipv6=no
233 AC_TRY_COMPILE([
234 #include <sys/socket.h>
235 #include <sys/types.h>], [
236 struct sockaddr_storage ss;
237 socket(AF_INET6, SOCK_STREAM, 0)
238 ],
239 have_ipv6=yes,
240 have_ipv6=no
241 )
242 AC_MSG_RESULT($have_ipv6)
243
William M. Brack476cd962003-08-13 11:09:42 +0000244 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000245 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000246
247 have_getaddrinfo=no
248 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
249 if test $have_getaddrinfo != yes; then
250 for lib in bsd socket inet; do
251 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
252 done
253 fi
254
William M. Brack476cd962003-08-13 11:09:42 +0000255 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000256 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000257 fi
258 fi
259fi
260
261dnl ******************************End IPv6 checks******************************
262
Daniel Veillardb05deb71999-08-10 19:04:08 +0000263dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000264AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000265 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000266
Daniel Veillardc790bf42003-10-11 10:50:10 +0000267AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
268 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000269
270XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000271XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000272
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000273dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000274dnl Extra flags
275dnl
276XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000277RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000278
Daniel Veillardd94849b2003-07-28 13:02:24 +0000279AC_ARG_WITH(fexceptions,
280[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000281if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
282then
283 with_fexceptions=no
284fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000285dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000286dnl Workaround for native compilers
287dnl HP : http://bugs.gnome.org/db/31/3163.html
288dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000289dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000290if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000291 case "${host}" in
292 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000293 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000294 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000295 *-dec-osf* )
296 CFLAGS="${CFLAGS} -ieee"
297 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000298 alpha*-*-linux* )
299 CFLAGS="${CFLAGS} -ieee"
300 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000301 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000302else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000303 if test "$with_fexceptions" = "yes"
304 then
305 #
306 # Not activated by default because this inflates the code size
307 # Used to allow propagation of C++ exceptions through the library
308 #
309 CFLAGS="${CFLAGS} -fexceptions"
310 fi
311
Daniel Veillard4918efe2004-08-23 12:35:14 +0000312 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 +0000313 case "${host}" in
314 alpha*-*-linux* )
315 CFLAGS="${CFLAGS} -mieee"
316 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000317 alpha*-*-osf* )
318 CFLAGS="${CFLAGS} -mieee"
319 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000320 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000321fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000322case ${host} in
323 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000324 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
325 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000326 hppa*-hp-mpeix)
327 NEED_TRIO=1
328 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000329esac
330
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000331
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000332dnl
333dnl check for python
334dnl
335
336PYTHON=
337PYTHON_VERSION=
338PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000339PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000340PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000341pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000342AC_ARG_WITH(python,
343[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000344if test "$with_minimum" = "yes" -a "$with_python" = ""
345then
346 with_python=no
347fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000348if test "$with_python" != "no" ; then
349 if test -x "$with_python/bin/python"
350 then
351 echo Found python in $with_python/bin/python
352 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000353 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000354 if test -x "$with_python"
355 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000356 echo Found python in $with_python
357 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000358 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000359 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000360 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000361 fi
362 if test "$PYTHON" != ""
363 then
364 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
365 echo Found Python version $PYTHON_VERSION
366 fi
367 if test "$PYTHON_VERSION" != ""
368 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000369 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
370 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000371 then
372 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000373 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000374 else
375 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
376 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000377 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000378 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000379 else
380 if test -r /usr/include/python$PYTHON_VERSION/Python.h
381 then
382 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000383 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000384 else
385 echo could not find python$PYTHON_VERSION/Python.h
386 fi
387 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000388 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000389 then
390 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
391 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000392 fi
393 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000394 if test "$with_python" != ""
395 then
396 pythondir='$(PYTHON_SITE_PACKAGES)'
397 else
398 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
399 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000400fi
401AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000402if test "$PYTHON_INCLUDES" != ""
403then
404 PYTHON_SUBDIR=python
405else
406 PYTHON_SUBDIR=
407fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000408AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000409AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000410
Daniel Veillard437b87b2000-01-03 17:30:46 +0000411dnl
412dnl Tester makes use of readline if present
413dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000414_cppflags="${CPPFLAGS}"
415_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000416
Daniel Veillard03109292000-08-14 14:58:22 +0000417AC_ARG_WITH(readline,
418[ --with-readline=DIR use readline in DIR],[
419 if test "$withval" != "no" -a "$withval" != "yes"; then
420 RDL_DIR=$withval
421 CPPFLAGS="${CPPFLAGS} -I$withval/include"
422 LDFLAGS="${LDFLAGS} -L$withval/lib"
423 fi
424])
Daniel Veillard4432df22003-09-28 18:58:27 +0000425if test "$with_minimum" = "yes" -a "$with_readline" = ""
426then
427 with_readline=no
428fi
Daniel Veillard03109292000-08-14 14:58:22 +0000429
Daniel Veillard361d8452000-04-03 19:48:13 +0000430dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000431dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000432dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000433dnl
William M. Brack871611b2003-10-18 04:53:14 +0000434if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000435 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000436 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
William M. Brack4119d1c2004-06-24 02:24:44 +0000437 [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000438 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000439 if test "$with_minimum" != "yes"
440 then
441 if test "${with_mem_debug}" = "" ; then
442 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000443 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000444 fi
445 if test "${with_docbook}" = "" ; then
446 with_docbook="yes"
447 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000448 fi
Daniel Veillardeff45a92004-10-29 12:10:55 +0000449 if test "${CC}" = "gcc" ; then
William M. Brack367df6e2004-10-23 18:14:36 +0000450 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 -Wall"
Daniel Veillardeff45a92004-10-29 12:10:55 +0000451 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000452 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000453dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000454else
455 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000456fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000457AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000458
459dnl
460dnl Check for trio string functions
461dnl
462
463if test "${NEED_TRIO}" = "1" ; then
464 echo Adding trio library for string functions
465 WITH_TRIO=1
466else
467 WITH_TRIO=0
468fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000469AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000470AC_SUBST(WITH_TRIO)
471
Daniel Veillardf6eea272001-01-18 12:17:12 +0000472dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000473dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000474dnl
475
Daniel Veillardb8478642001-10-12 17:29:10 +0000476THREAD_LIBS=""
477WITH_THREADS=0
478THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000479TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000480THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000481
William M. Brack97ad4c72003-05-13 08:08:36 +0000482AC_ARG_WITH(threads,
483[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000484if test "$with_minimum" = "yes" -a "$with_threads" = ""
485then
486 with_threads=no
487fi
Daniel Veillard84942712003-04-18 14:40:05 +0000488if test "$with_threads" = "no" ; then
489 echo Disabling multithreaded support
490else
Daniel Veillardb8478642001-10-12 17:29:10 +0000491 echo Enabling multithreaded support
492
493 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000494 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000495 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000496 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
497 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000498 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000499 case $host_os in
500 *mingw32*) WITH_THREADS="1"
501 THREADS_W32="Win32"
502 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
503 ;;
504 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000505 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000506 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
507 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000508 fi
509fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000510AC_ARG_WITH(thread-alloc,
511[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000512if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
513then
514 with_thread_alloc=no
515fi
William M. Brack306e33c2004-06-12 01:01:22 +0000516if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000517 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000518fi
519
Daniel Veillardb8478642001-10-12 17:29:10 +0000520AC_SUBST(THREAD_LIBS)
521AC_SUBST(WITH_THREADS)
522AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000523AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000524AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000525
William M. Brack97ad4c72003-05-13 08:08:36 +0000526AC_ARG_WITH(history,
527[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000528if test "$with_minimum" = "yes" -a "$with_history" = ""
529then
530 with_history=no
531fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000532if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000533 echo Enabling xmllint shell history
534 dnl check for terminal library. this is a very cool solution
535 dnl from octave's configure.in
536 unset tcap
537 for termlib in ncurses curses termcap terminfo termlib; do
538 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
539 test -n "$tcap" && break
540 done
541
542 AC_CHECK_HEADER(readline/history.h,
543 AC_CHECK_LIB(history, append_history,[
544 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000545 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000546 AC_CHECK_HEADER(readline/readline.h,
547 AC_CHECK_LIB(readline, readline,[
548 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000549 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000550 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
551 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
552 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
553 else
554 CPPFLAGS=${_cppflags}
555 fi
556 LDFLAGS=${_ldflags}
557fi
558
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000559AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000560[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000561if test "$with_minimum" = "yes" -a "$with_output" = ""
562then
563 with_output=no
564fi
565if test "$with_output" = "no" ; then
566 echo Disabling serialization/saving support
567 WITH_OUTPUT=0
568else
569 WITH_OUTPUT=1
570fi
571AC_SUBST(WITH_OUTPUT)
572
Daniel Veillard652327a2003-09-29 18:02:38 +0000573AC_ARG_WITH(tree,
574[ --with-tree add the DOM like tree manipulation APIs (on)])
575if test "$with_minimum" = "yes" -a "$with_tree" = ""
576then
577 with_tree=no
578fi
579if test "$with_tree" = "no" ; then
580 echo Disabling DOM like tree manipulation APIs
581 WITH_TREE=0
582else
583 WITH_TREE=1
584fi
585AC_SUBST(WITH_TREE)
586
William M. Brack97ad4c72003-05-13 08:08:36 +0000587AC_ARG_WITH(ftp,
588[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000589if test "$with_minimum" = "yes" -a "$with_ftp" = ""
590then
591 with_ftp=no
592fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000593if test "$with_ftp" = "no" ; then
594 echo Disabling FTP support
595 WITH_FTP=0
596 FTP_OBJ=
597else
598 WITH_FTP=1
599 FTP_OBJ=nanoftp.o
600fi
601AC_SUBST(WITH_FTP)
602AC_SUBST(FTP_OBJ)
603
William M. Brack97ad4c72003-05-13 08:08:36 +0000604AC_ARG_WITH(http,
605[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000606if test "$with_minimum" = "yes" -a "$with_http" = ""
607then
608 with_http=no
609fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000610if test "$with_http" = "no" ; then
611 echo Disabling HTTP support
612 WITH_HTTP=0
613 HTTP_OBJ=
614else
615 WITH_HTTP=1
616 HTTP_OBJ=nanohttp.o
617fi
618AC_SUBST(WITH_HTTP)
619AC_SUBST(HTTP_OBJ)
620
Daniel Veillard4432df22003-09-28 18:58:27 +0000621AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000622[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000623if test "$with_minimum" = "yes" -a "$with_legacy" = ""
624then
625 with_legacy=no
626fi
627if test "$with_legacy" = "no" ; then
628 echo Disabling deprecated APIs
629 WITH_LEGACY=0
630else
631 WITH_LEGACY=1
632fi
633AC_SUBST(WITH_LEGACY)
634
Daniel Veillard81273902003-09-30 00:43:48 +0000635AC_ARG_WITH(reader,
636[ --with-reader add the xmlReader parsing interface (on)])
637if test "$with_minimum" = "yes" -a "$with_reader" = ""
638then
639 with_reader=no
640fi
641if test "$with_reader" = "no" ; then
642 echo Disabling the xmlReader parsing interface
643 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000644 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000645else
646 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000647 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000648fi
649AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000650AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000651
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000652AC_ARG_WITH(pattern,
653[ --with-pattern add the xmlPattern selection interface (on)])
654if test "$with_minimum" = "yes" -a "$with_pattern" = ""
655then
656 with_pattern=no
657fi
658if test "$with_pattern" = "no" ; then
659 echo Disabling the xmlPattern parsing interface
660 WITH_PATTERN=0
661 PATTERN_TEST=
662else
663 WITH_PATTERN=1
664 PATTERN_TEST=Patterntests
665fi
666AC_SUBST(WITH_PATTERN)
667AC_SUBST(PATTERN_TEST)
668
Daniel Veillard1d211e22003-10-20 22:32:39 +0000669AC_ARG_WITH(writer,
670[ --with-writer add the xmlWriter saving interface (on)])
671if test "$with_minimum" = "yes" -a "$with_writer" = ""
672then
673 with_writer=no
674fi
675if test "$with_writer" = "no" ; then
676 echo Disabling the xmlWriter saving interface
677 WITH_WRITER=0
678# WRITER_TEST=
679else
680 WITH_WRITER=1
681# WRITER_TEST=Writertests
682fi
683AC_SUBST(WITH_WRITER)
684#AC_SUBST(WRITER_TEST)
685
Daniel Veillard81273902003-09-30 00:43:48 +0000686AC_ARG_WITH(sax1,
687[ --with-sax1 add the older SAX1 interface (on)])
688if test "$with_minimum" = "yes" -a "$with_sax1" = ""
689then
690 with_sax1=no
691fi
692if test "$with_sax1" = "no" ; then
693 echo Disabling the older SAX1 interface
694 WITH_SAX1=0
695 TEST_SAX=
696else
697 WITH_SAX1=1
698 TEST_SAX=SAXtests
699fi
700AC_SUBST(WITH_SAX1)
701AC_SUBST(TEST_SAX)
702
Daniel Veillard73b013f2003-09-30 12:36:01 +0000703AC_ARG_WITH(push,
704[ --with-push add the PUSH parser interfaces (on)])
705if test "$with_minimum" = "yes" -a "$with_push" = ""
706then
707 with_push=no
708fi
709if test "$with_push" = "no" ; then
710 echo Disabling the PUSH parser interfaces
711 WITH_PUSH=0
712 TEST_PUSH=
713else
714 WITH_PUSH=1
715 TEST_PUSH="XMLPushtests"
716fi
717AC_SUBST(WITH_PUSH)
718AC_SUBST(TEST_PUSH)
719
720AC_ARG_WITH(html,
721[ --with-html add the HTML support (on)])
722if test "$with_minimum" = "yes" -a "$with_html" = ""
723then
724 with_html=no
725fi
726if test "$with_html" = "no" ; then
727 echo Disabling HTML support
728 WITH_HTML=0
729 HTML_OBJ=
730 TEST_HTML=
731else
732 WITH_HTML=1
733 HTML_OBJ="HTMLparser.o HTMLtree.o"
734 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000735 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000736 TEST_PHTML=HTMLPushtests
737 else
738 TEST_PHTML=
739 fi
740fi
741AC_SUBST(WITH_HTML)
742AC_SUBST(HTML_OBJ)
743AC_SUBST(TEST_HTML)
744AC_SUBST(TEST_PHTML)
745
Daniel Veillard4432df22003-09-28 18:58:27 +0000746AC_ARG_WITH(valid,
747[ --with-valid add the DTD validation support (on)])
748if test "$with_minimum" = "yes" -a "$with_valid" = ""
749then
750 with_valid=no
751fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000752if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000753 echo Disabling DTD validation support
754 WITH_VALID=0
755 TEST_VALID=
756 TEST_VTIME=
757else
758 WITH_VALID=1
759 TEST_VALID=Validtests
760 TEST_VTIME=VTimingtests
761fi
762AC_SUBST(WITH_VALID)
763AC_SUBST(TEST_VALID)
764AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000765
William M. Brack97ad4c72003-05-13 08:08:36 +0000766AC_ARG_WITH(catalog,
767[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000768if test "$with_minimum" = "yes" -a "$with_catalog" = ""
769then
770 with_catalog=no
771fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000772if test "$with_catalog" = "no" ; then
773 echo Disabling Catalog support
774 WITH_CATALOG=0
775 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000776 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000777else
778 WITH_CATALOG=1
779 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000780 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000781fi
782AC_SUBST(WITH_CATALOG)
783AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000784AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000785
William M. Brack97ad4c72003-05-13 08:08:36 +0000786AC_ARG_WITH(docbook,
787[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000788if test "$with_minimum" = "yes" -a "$with_docbook" = ""
789then
790 with_docbook=no
791fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000792if test "$with_docbook" = "no" ; then
793 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000794 WITH_DOCB=0
795 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000796else
797 WITH_DOCB=1
798 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000799fi
800AC_SUBST(WITH_DOCB)
801AC_SUBST(DOCB_OBJ)
802
803
William M. Brack97ad4c72003-05-13 08:08:36 +0000804AC_ARG_WITH(xpath,
805[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000806if test "$with_minimum" = "yes" -a "$with_xpath" = ""
807then
808 with_xpath=no
809fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000810if test "$with_xpath" = "no" ; then
811 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000812 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000813 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000814 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000815 WITH_XPATH=0
816 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000817 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000818else
819 WITH_XPATH=1
820 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000821 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000822fi
823AC_SUBST(WITH_XPATH)
824AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000825AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000826
William M. Brack97ad4c72003-05-13 08:08:36 +0000827AC_ARG_WITH(xptr,
828[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000829if test "$with_minimum" = "yes" -a "$with_xptr" = ""
830then
831 with_xptr=no
832fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000833if test "$with_xptr" = "no" ; then
834 echo Disabling XPointer support
835 WITH_XPTR=0
836 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000837 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000838else
839 WITH_XPTR=1
840 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000841 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000842fi
843AC_SUBST(WITH_XPTR)
844AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000845AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000846
William M. Brack97ad4c72003-05-13 08:08:36 +0000847AC_ARG_WITH(c14n,
848[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000849if test "$with_minimum" = "yes" -a "$with_c14n" = ""
850then
851 with_c14n=no
852fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000853if test "$with_c14n" = "no" ; then
854 echo Disabling C14N support
855 WITH_C14N=0
856 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000857 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000858else
859 WITH_C14N=1
860 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000861 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000862fi
863AC_SUBST(WITH_C14N)
864AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000865AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000866
William M. Brack97ad4c72003-05-13 08:08:36 +0000867AC_ARG_WITH(xinclude,
868[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000869if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
870then
871 with_xinclude=no
872fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000873if test "$with_xinclude" = "no" ; then
874 echo Disabling XInclude support
875 WITH_XINCLUDE=0
876 XINCLUDE_OBJ=
877 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000878 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000879else
880 WITH_XINCLUDE=1
881 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000882 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000883fi
884AC_SUBST(WITH_XINCLUDE)
885AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000886AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000887
Daniel Veillard6e90d192001-07-03 16:37:49 +0000888WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000889AC_ARG_WITH(iconv,
890[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000891if test "$with_minimum" = "yes" -a "$with_iconv" = ""
892then
893 with_iconv=no
894fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000895if test "$with_iconv" = "no" ; then
896 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000897else
Daniel Veillard220346d2001-12-07 11:33:54 +0000898 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000899 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000900 # Export this since our headers include iconv.h
901 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000902 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000903 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000904
905 AC_CHECK_HEADER(iconv.h,
906 AC_MSG_CHECKING(for iconv)
907 AC_TRY_LINK([#include <stdlib.h>
908#include <iconv.h>],[
909iconv_t cd = iconv_open ("","");
910iconv (cd, NULL, NULL, NULL, NULL);],[
911 AC_MSG_RESULT(yes)
912 WITH_ICONV=1],[
913 AC_MSG_RESULT(no)
914 AC_MSG_CHECKING(for iconv in -liconv)
915
916 _ldflags="${LDFLAGS}"
917 _libs="${LIBS}"
918 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
919 LIBS="${LIBS} -liconv"
920
921 AC_TRY_LINK([#include <stdlib.h>
922#include <iconv.h>],[
923iconv_t cd = iconv_open ("","");
924iconv (cd, NULL, NULL, NULL, NULL);],[
925 AC_MSG_RESULT(yes)
926 WITH_ICONV=1
927 ICONV_LIBS="${ICONV_LIBS} -liconv"
928 LIBS="${_libs}"
929 LDFLAGS="${_ldflags}"],[
930 AC_MSG_RESULT(no)
931 LIBS="${_libs}"
932 LDFLAGS="${_ldflags}"])]))
933fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000934case "$host" in
935 *mingw*) M_LIBS=""
936 ;;
937 *) M_LIBS="-lm"
938 ;;
939esac
Daniel Veillardb82c1662001-12-09 14:00:54 +0000940XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000941XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000942AC_SUBST(WITH_ICONV)
943
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000944WITH_ISO8859X=1
945AC_ARG_WITH(iso8859x,
946[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000947if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
948then
949 with_iso8859x=no
950fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000951if test "$WITH_ICONV" != "1" ; then
952if test "$with_iso8859x" = "no" ; then
953 echo Disabling ISO8859X support
954 WITH_ISO8859X=0
955fi
956fi
957AC_SUBST(WITH_ISO8859X)
958
William M. Brack97ad4c72003-05-13 08:08:36 +0000959AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000960[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000961if test "$with_minimum" = "yes" -a "$with_schemas" = ""
962then
963 with_schemas=no
964fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000965if test "$with_schemas" = "no" ; then
966 echo "Disabled Schemas/Relax-NG support"
967 WITH_SCHEMAS=0
968 TEST_SCHEMAS=
969else
Daniel Veillard71531f32003-02-05 13:19:53 +0000970 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000971 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000972 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +0000973 if test "$PYTHON_INCLUDES" != "" ; then
974 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
975 fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000976 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000977fi
978AC_SUBST(WITH_SCHEMAS)
979AC_SUBST(TEST_SCHEMAS)
980
William M. Brack97ad4c72003-05-13 08:08:36 +0000981AC_ARG_WITH(regexps,
982[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000983if test "$with_minimum" = "yes" -a "$with_regexps" = ""
984then
985 with_regexps=no
986fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000987if test "$with_regexps" = "no" ; then
988 echo Disabling Regexps support
989 WITH_REGEXPS=0
990 TEST_REGEXPS=
991else
992 WITH_REGEXPS=1
993 TEST_REGEXPS="Regexptests Automatatests"
994fi
995AC_SUBST(WITH_REGEXPS)
996AC_SUBST(TEST_REGEXPS)
997
William M. Brack97ad4c72003-05-13 08:08:36 +0000998AC_ARG_WITH(debug,
999[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +00001000if test "$with_minimum" = "yes" -a "$with_debug" = ""
1001then
1002 with_debug=no
1003fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001004if test "$with_debug" = "no" ; then
1005 echo Disabling DEBUG support
1006 WITH_DEBUG=0
1007 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001008 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001009else
1010 WITH_DEBUG=1
1011 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001012 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001013fi
1014AC_SUBST(WITH_DEBUG)
1015AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001016AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001017
William M. Brack97ad4c72003-05-13 08:08:36 +00001018AC_ARG_WITH(mem_debug,
1019[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +00001020if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
1021then
1022 with_mem_debug=no
1023fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001024if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001025 if test "$with_thread_alloc" = "yes" ; then
1026 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1027 WITH_MEM_DEBUG=0
1028 else
1029 echo Enabling memory debug support
1030 WITH_MEM_DEBUG=1
1031 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001032else
1033 WITH_MEM_DEBUG=0
1034fi
1035AC_SUBST(WITH_MEM_DEBUG)
1036
Daniel Veillard22cdb842004-10-04 14:09:17 +00001037AC_ARG_WITH(run_debug,
1038[ --with-run-debug add the runtime debugging module (off)])
1039if test "$with_minimum" = "yes" -a "$with_run_debug" = ""
1040then
1041 with_run_debug=no
1042fi
1043if test "$with_run_debug" = "yes" ; then
1044 echo Enabling runtime debug support
1045 WITH_RUN_DEBUG=1
1046else
1047 WITH_RUN_DEBUG=0
1048fi
1049AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001050
1051WIN32_EXTRA_LIBADD=
1052WIN32_EXTRA_LDFLAGS=
1053case "$host" in
1054 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001055 CPPFLAGS="$CPPFLAGS -DWIN32"
1056 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001057 WIN32_EXTRA_LDFLAGS="-no-undefined"
1058 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1059 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1060 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1061 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001062 *-*-cygwin*)
1063 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
1064 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python2.3/config -lpython2.3"
1065 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001066esac
1067AC_SUBST(WIN32_EXTRA_LIBADD)
1068AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001069AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1070AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001071
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001072AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001073AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001074AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001075
Daniel Veillardb05deb71999-08-10 19:04:08 +00001076AC_SUBST(XML_LIBDIR)
1077AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001078AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001079AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001080AC_SUBST(XML_INCLUDEDIR)
1081AC_SUBST(HTML_DIR)
1082AC_SUBST(HAVE_ISNAN)
1083AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001084AC_SUBST(PYTHON)
1085AC_SUBST(PYTHON_VERSION)
1086AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001087AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001088
Daniel Veillardb05deb71999-08-10 19:04:08 +00001089AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001090AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001091
Daniel Veillard9715c172002-11-25 16:33:40 +00001092dnl for the spec file
1093RELDATE=`date +'%a %b %e %Y'`
1094AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001095AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001096
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001097rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001098ln -s Copyright COPYING
1099
Daniel Veillarde4177a52004-01-08 16:43:57 +00001100# keep on one line for cygwin c.f. #130896
Daniel Veillardb1da40c2004-09-06 11:57:44 +00001101AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/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 +00001102
Daniel Veillard06d25242004-02-25 13:01:42 +00001103chmod +x xml2-config python/setup.py