blob: 9c8665092f9bebc6243caf8ba16eef9c536a1472 [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.2)
Owen Taylor3473f882001-02-23 17:55:21 +00003AC_INIT(entities.c)
Daniel Veillard01791d51998-07-24 19:24:09 +00004AM_CONFIG_HEADER(config.h)
Daniel Veillardd2ade932000-09-30 14:39:55 +00005AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00006
Daniel Veillardcf461992000-03-14 18:30:20 +00007LIBXML_MAJOR_VERSION=2
Daniel Veillard4fc52812003-09-01 20:33:13 +00008LIBXML_MINOR_VERSION=6
Daniel Veillard45cb0f42004-07-05 17:45:35 +00009LIBXML_MICRO_VERSION=11
Daniel Veillard3e35f8e2003-10-21 00:05:38 +000010LIBXML_MICRO_VERSION_SUFFIX=
Daniel Veillard4fc52812003-09-01 20:33:13 +000011LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
Daniel Veillard14fff061999-06-22 21:49:07 +000012LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
13
Daniel Veillard361d8452000-04-03 19:48:13 +000014LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
15
Daniel Veillard14fff061999-06-22 21:49:07 +000016AC_SUBST(LIBXML_MAJOR_VERSION)
17AC_SUBST(LIBXML_MINOR_VERSION)
18AC_SUBST(LIBXML_MICRO_VERSION)
19AC_SUBST(LIBXML_VERSION)
20AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000021AC_SUBST(LIBXML_VERSION_NUMBER)
Daniel Veillard14fff061999-06-22 21:49:07 +000022
Daniel Veillard361d8452000-04-03 19:48:13 +000023VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000024
Daniel Veillardedfb29b2000-03-14 19:59:05 +000025AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000026
Daniel Veillard01791d51998-07-24 19:24:09 +000027dnl Checks for programs.
28AC_PROG_CC
29AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000030AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000031AC_PATH_PROG(RM, rm, /bin/rm)
32AC_PATH_PROG(MV, mv, /bin/mv)
33AC_PATH_PROG(TAR, tar, /bin/tar)
William M. Brack1826d0a2004-07-21 09:03:57 +000034AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard01791d51998-07-24 19:24:09 +000035
Daniel Veillard03109292000-08-14 14:58:22 +000036dnl Make sure we have an ANSI compiler
37AM_C_PROTOTYPES
38test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
39
Daniel Veillard6984e6d2003-12-09 14:20:17 +000040AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000041AM_PROG_LIBTOOL
42
Daniel Veillardd8cf9062003-11-11 21:12:36 +000043# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000044
Daniel Veillard4432df22003-09-28 18:58:27 +000045dnl
46dnl option to build a minimal libxml2 library
47dnl
48AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
49if test "$with_minimum" = "yes"
50then
51 echo "Configuring for a minimal library"
52fi
53
Daniel Veillard71b656e2000-01-05 14:46:17 +000054dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000055_cppflags="${CPPFLAGS}"
56_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000057
Daniel Veillard259ff742001-10-06 13:49:59 +000058
Owen Taylor3473f882001-02-23 17:55:21 +000059AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +000060[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +000061 if test "$withval" != "no" -a "$withval" != "yes"; then
62 Z_DIR=$withval
63 CPPFLAGS="${CPPFLAGS} -I$withval/include"
64 LDFLAGS="${LDFLAGS} -L$withval/lib"
65 fi
Daniel Veillard259ff742001-10-06 13:49:59 +000066])
Daniel Veillard4432df22003-09-28 18:58:27 +000067if test "$with_minimum" = "yes" -a "$with_zlib" = ""
68then
69 with_zlib=no
70fi
Daniel Veillard259ff742001-10-06 13:49:59 +000071if test "$with_zlib" = "no"; then
72 echo "Disabling compression support"
73else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000074 AC_CHECK_HEADERS(zlib.h,
75 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +000076 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000077 if test "x${Z_DIR}" != "x"; then
78 Z_CFLAGS="-I${Z_DIR}/include"
79 Z_LIBS="-L${Z_DIR}/lib -lz"
80 [case ${host} in
81 *-*-solaris*)
82 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
83 ;;
84 esac]
85 else
86 Z_LIBS="-lz"
87 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +000088fi
Owen Taylor3473f882001-02-23 17:55:21 +000089
Owen Taylor3473f882001-02-23 17:55:21 +000090AC_SUBST(Z_CFLAGS)
91AC_SUBST(Z_LIBS)
92
93CPPFLAGS=${_cppflags}
94LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000095
Daniel Veillard01791d51998-07-24 19:24:09 +000096dnl Checks for header files.
97AC_HEADER_DIRENT
98AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +000099AC_CHECK_HEADERS([fcntl.h])
100AC_CHECK_HEADERS([unistd.h])
101AC_CHECK_HEADERS([ctype.h])
102AC_CHECK_HEADERS([dirent.h])
103AC_CHECK_HEADERS([errno.h])
104AC_CHECK_HEADERS([malloc.h])
105AC_CHECK_HEADERS([stdarg.h])
106AC_CHECK_HEADERS([sys/stat.h])
107AC_CHECK_HEADERS([sys/types.h])
108AC_CHECK_HEADERS([time.h])
109AC_CHECK_HEADERS([ansidecl.h])
110AC_CHECK_HEADERS([ieeefp.h])
111AC_CHECK_HEADERS([nan.h])
112AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000113AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000114AC_CHECK_HEADERS([fp_class.h])
115AC_CHECK_HEADERS([float.h])
116AC_CHECK_HEADERS([stdlib.h])
117AC_CHECK_HEADERS([sys/socket.h], [], [],
118[#if HAVE_SYS_TYPES_H
119# include <sys/types.h>
120# endif
121])
122AC_CHECK_HEADERS([netinet/in.h], [], [],
123[#if HAVE_SYS_TYPES_H
124# include <sys/types.h>
125# endif
126])
127AC_CHECK_HEADERS([arpa/inet.h], [], [],
128[#if HAVE_SYS_TYPES_H
129# include <sys/types.h>
130# endif
131#if HAVE_ARPA_INET_H
132# include <arpa/inet.h>
133# endif
134])
135AC_CHECK_HEADERS([netdb.h])
136AC_CHECK_HEADERS([sys/time.h])
137AC_CHECK_HEADERS([sys/select.h])
138AC_CHECK_HEADERS([sys/mman.h])
139AC_CHECK_HEADERS([sys/timeb.h])
140AC_CHECK_HEADERS([signal.h])
141AC_CHECK_HEADERS([arpa/nameser.h], [], [],
142[#if HAVE_SYS_TYPES_H
143# include <sys/types.h>
144# endif
145])
146AC_CHECK_HEADERS([resolv.h], [], [],
147[#if HAVE_SYS_TYPES_H
148# include <sys/types.h>
149# endif
150#if HAVE_NETINET_IN_H
151# include <netinet/in.h>
152# endif
153#if HAVE_ARPA_NAMESER_H
154# include <arpa/nameser.h>
155# endif
156])
Daniel Veillard01791d51998-07-24 19:24:09 +0000157
Daniel Veillard1164e751999-02-16 16:29:17 +0000158dnl Specific dir for HTML output ?
Daniel Veillardfc979062004-03-04 22:07:16 +0000159AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
160 [path to base html directory, default $datadir/doc/html]),
161 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
162
163AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
164 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
165 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
166 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
Daniel Veillard1164e751999-02-16 16:29:17 +0000167
168AC_SUBST(HTML_DIR)
169
Daniel Veillard01791d51998-07-24 19:24:09 +0000170dnl Checks for library functions.
171AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000172AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000173AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000174AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000175AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000176
Daniel Veillard92ad2102001-03-27 12:47:33 +0000177dnl Checking the standard string functions availability
178AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
179 NEED_TRIO=1)
180
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000181dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000182AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
183AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
184AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000185
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000186dnl Determine what socket length (socklen_t) data type is
187AC_MSG_CHECKING([for type of socket length (socklen_t)])
188AC_TRY_COMPILE2([
189#include <stddef.h>
190#include <sys/types.h>
191#include <sys/socket.h>],[
192(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
193 AC_MSG_RESULT(socklen_t *)
194 SOCKLEN_T=socklen_t],[
195 AC_TRY_COMPILE2([
196#include <stddef.h>
197#include <sys/types.h>
198#include <sys/socket.h>],[
199(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
200 AC_MSG_RESULT(size_t *)
201 SOCKLEN_T=size_t],[
202 AC_TRY_COMPILE2([
203#include <stddef.h>
204#include <sys/types.h>
205#include <sys/socket.h>],[
206(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
207 AC_MSG_RESULT(int *)
208 SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000209 AC_MSG_WARN(could not determine)
210 SOCKLEN_T="unsigned int"])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000211AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000212
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000213dnl ***********************Checking for availability of IPv6*******************
214
215AC_MSG_CHECKING([whether to enable IPv6])
216AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000217if test "$with_minimum" = "yes"
218then
219 enable_ipv6=no
220fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000221if test $enable_ipv6 = yes; then
222 have_ipv6=no
223 AC_TRY_COMPILE([
224 #include <sys/socket.h>
225 #include <sys/types.h>], [
226 struct sockaddr_storage ss;
227 socket(AF_INET6, SOCK_STREAM, 0)
228 ],
229 have_ipv6=yes,
230 have_ipv6=no
231 )
232 AC_MSG_RESULT($have_ipv6)
233
William M. Brack476cd962003-08-13 11:09:42 +0000234 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000235 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000236
237 have_getaddrinfo=no
238 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
239 if test $have_getaddrinfo != yes; then
240 for lib in bsd socket inet; do
241 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
242 done
243 fi
244
William M. Brack476cd962003-08-13 11:09:42 +0000245 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000246 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000247 fi
248 fi
249fi
250
251dnl ******************************End IPv6 checks******************************
252
Daniel Veillardb05deb71999-08-10 19:04:08 +0000253dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000254AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000255 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000256
Daniel Veillardc790bf42003-10-11 10:50:10 +0000257AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
258 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000259
260XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000261XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000262
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000263dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000264dnl Extra flags
265dnl
266XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000267RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000268
Daniel Veillardd94849b2003-07-28 13:02:24 +0000269AC_ARG_WITH(fexceptions,
270[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000271if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
272then
273 with_fexceptions=no
274fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000275dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000276dnl Workaround for native compilers
277dnl HP : http://bugs.gnome.org/db/31/3163.html
278dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000279dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000280if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000281 case "${host}" in
282 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000283 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000284 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000285 *-dec-osf* )
286 CFLAGS="${CFLAGS} -ieee"
287 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000288 alpha*-*-linux* )
289 CFLAGS="${CFLAGS} -ieee"
290 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000291 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000292else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000293 if test "$with_fexceptions" = "yes"
294 then
295 #
296 # Not activated by default because this inflates the code size
297 # Used to allow propagation of C++ exceptions through the library
298 #
299 CFLAGS="${CFLAGS} -fexceptions"
300 fi
301
Daniel Veillardd574f782001-03-14 19:40:17 +0000302 CFLAGS="${CFLAGS} -Wall"
Daniel Veillard14839d52001-06-06 16:11:56 +0000303 case "${host}" in
304 alpha*-*-linux* )
305 CFLAGS="${CFLAGS} -mieee"
306 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000307 alpha*-*-osf* )
308 CFLAGS="${CFLAGS} -mieee"
309 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000310 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000311fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000312case ${host} in
313 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000314 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
315 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000316 hppa*-hp-mpeix)
317 NEED_TRIO=1
318 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000319esac
320
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000321
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000322dnl
323dnl check for python
324dnl
325
326PYTHON=
327PYTHON_VERSION=
328PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000329PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000330PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000331pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000332AC_ARG_WITH(python,
333[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000334if test "$with_minimum" = "yes" -a "$with_python" = ""
335then
336 with_python=no
337fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000338if test "$with_python" != "no" ; then
339 if test -x "$with_python/bin/python"
340 then
341 echo Found python in $with_python/bin/python
342 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000343 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000344 if test -x "$with_python"
345 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000346 echo Found python in $with_python
347 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000348 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000349 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000350 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000351 fi
352 if test "$PYTHON" != ""
353 then
354 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
355 echo Found Python version $PYTHON_VERSION
356 fi
357 if test "$PYTHON_VERSION" != ""
358 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000359 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
360 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000361 then
362 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000363 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000364 else
365 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
366 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000367 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000368 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000369 else
370 if test -r /usr/include/python$PYTHON_VERSION/Python.h
371 then
372 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000373 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000374 else
375 echo could not find python$PYTHON_VERSION/Python.h
376 fi
377 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000378 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000379 then
380 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
381 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000382 fi
383 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000384 if test "$with_python" != ""
385 then
386 pythondir='$(PYTHON_SITE_PACKAGES)'
387 else
388 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
389 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000390fi
391AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000392if test "$PYTHON_INCLUDES" != ""
393then
394 PYTHON_SUBDIR=python
395else
396 PYTHON_SUBDIR=
397fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000398AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000399AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000400
Daniel Veillard437b87b2000-01-03 17:30:46 +0000401dnl
402dnl Tester makes use of readline if present
403dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000404_cppflags="${CPPFLAGS}"
405_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000406
Daniel Veillard03109292000-08-14 14:58:22 +0000407AC_ARG_WITH(readline,
408[ --with-readline=DIR use readline in DIR],[
409 if test "$withval" != "no" -a "$withval" != "yes"; then
410 RDL_DIR=$withval
411 CPPFLAGS="${CPPFLAGS} -I$withval/include"
412 LDFLAGS="${LDFLAGS} -L$withval/lib"
413 fi
414])
Daniel Veillard4432df22003-09-28 18:58:27 +0000415if test "$with_minimum" = "yes" -a "$with_readline" = ""
416then
417 with_readline=no
418fi
Daniel Veillard03109292000-08-14 14:58:22 +0000419
Daniel Veillard361d8452000-04-03 19:48:13 +0000420dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000421dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000422dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000423dnl
William M. Brack871611b2003-10-18 04:53:14 +0000424if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000425 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000426 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
William M. Brack4119d1c2004-06-24 02:24:44 +0000427 [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000428 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000429 if test "$with_minimum" != "yes"
430 then
431 if test "${with_mem_debug}" = "" ; then
432 with_mem_debug="yes"
433 fi
434 if test "${with_docbook}" = "" ; then
435 with_docbook="yes"
436 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000437 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000438 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 +0000439 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000440dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000441else
442 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000443fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000444AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000445
446dnl
447dnl Check for trio string functions
448dnl
449
450if test "${NEED_TRIO}" = "1" ; then
451 echo Adding trio library for string functions
452 WITH_TRIO=1
453else
454 WITH_TRIO=0
455fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000456AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000457AC_SUBST(WITH_TRIO)
458
Daniel Veillardf6eea272001-01-18 12:17:12 +0000459dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000460dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000461dnl
462
Daniel Veillardb8478642001-10-12 17:29:10 +0000463THREAD_LIBS=""
464WITH_THREADS=0
465THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000466TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000467THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000468
William M. Brack97ad4c72003-05-13 08:08:36 +0000469AC_ARG_WITH(threads,
470[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000471if test "$with_minimum" = "yes" -a "$with_threads" = ""
472then
473 with_threads=no
474fi
Daniel Veillard84942712003-04-18 14:40:05 +0000475if test "$with_threads" = "no" ; then
476 echo Disabling multithreaded support
477else
Daniel Veillardb8478642001-10-12 17:29:10 +0000478 echo Enabling multithreaded support
479
480 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000481 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000482 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000483 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
484 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000485 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000486 case $host_os in
487 *mingw32*) WITH_THREADS="1"
488 THREADS_W32="Win32"
489 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
490 ;;
491 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000492 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000493 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
494 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000495 fi
496fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000497AC_ARG_WITH(thread-alloc,
498[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000499if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
500then
501 with_thread_alloc=no
502fi
William M. Brack306e33c2004-06-12 01:01:22 +0000503if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000504 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000505fi
506
Daniel Veillardb8478642001-10-12 17:29:10 +0000507AC_SUBST(THREAD_LIBS)
508AC_SUBST(WITH_THREADS)
509AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000510AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000511AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000512
William M. Brack97ad4c72003-05-13 08:08:36 +0000513AC_ARG_WITH(history,
514[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000515if test "$with_minimum" = "yes" -a "$with_history" = ""
516then
517 with_history=no
518fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000519if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000520 echo Enabling xmllint shell history
521 dnl check for terminal library. this is a very cool solution
522 dnl from octave's configure.in
523 unset tcap
524 for termlib in ncurses curses termcap terminfo termlib; do
525 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
526 test -n "$tcap" && break
527 done
528
529 AC_CHECK_HEADER(readline/history.h,
530 AC_CHECK_LIB(history, append_history,[
531 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000532 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000533 AC_CHECK_HEADER(readline/readline.h,
534 AC_CHECK_LIB(readline, readline,[
535 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000536 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000537 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
538 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
539 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
540 else
541 CPPFLAGS=${_cppflags}
542 fi
543 LDFLAGS=${_ldflags}
544fi
545
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000546AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000547[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000548if test "$with_minimum" = "yes" -a "$with_output" = ""
549then
550 with_output=no
551fi
552if test "$with_output" = "no" ; then
553 echo Disabling serialization/saving support
554 WITH_OUTPUT=0
555else
556 WITH_OUTPUT=1
557fi
558AC_SUBST(WITH_OUTPUT)
559
Daniel Veillard652327a2003-09-29 18:02:38 +0000560AC_ARG_WITH(tree,
561[ --with-tree add the DOM like tree manipulation APIs (on)])
562if test "$with_minimum" = "yes" -a "$with_tree" = ""
563then
564 with_tree=no
565fi
566if test "$with_tree" = "no" ; then
567 echo Disabling DOM like tree manipulation APIs
568 WITH_TREE=0
569else
570 WITH_TREE=1
571fi
572AC_SUBST(WITH_TREE)
573
William M. Brack97ad4c72003-05-13 08:08:36 +0000574AC_ARG_WITH(ftp,
575[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000576if test "$with_minimum" = "yes" -a "$with_ftp" = ""
577then
578 with_ftp=no
579fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000580if test "$with_ftp" = "no" ; then
581 echo Disabling FTP support
582 WITH_FTP=0
583 FTP_OBJ=
584else
585 WITH_FTP=1
586 FTP_OBJ=nanoftp.o
587fi
588AC_SUBST(WITH_FTP)
589AC_SUBST(FTP_OBJ)
590
William M. Brack97ad4c72003-05-13 08:08:36 +0000591AC_ARG_WITH(http,
592[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000593if test "$with_minimum" = "yes" -a "$with_http" = ""
594then
595 with_http=no
596fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000597if test "$with_http" = "no" ; then
598 echo Disabling HTTP support
599 WITH_HTTP=0
600 HTTP_OBJ=
601else
602 WITH_HTTP=1
603 HTTP_OBJ=nanohttp.o
604fi
605AC_SUBST(WITH_HTTP)
606AC_SUBST(HTTP_OBJ)
607
Daniel Veillard4432df22003-09-28 18:58:27 +0000608AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000609[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000610if test "$with_minimum" = "yes" -a "$with_legacy" = ""
611then
612 with_legacy=no
613fi
614if test "$with_legacy" = "no" ; then
615 echo Disabling deprecated APIs
616 WITH_LEGACY=0
617else
618 WITH_LEGACY=1
619fi
620AC_SUBST(WITH_LEGACY)
621
Daniel Veillard81273902003-09-30 00:43:48 +0000622AC_ARG_WITH(reader,
623[ --with-reader add the xmlReader parsing interface (on)])
624if test "$with_minimum" = "yes" -a "$with_reader" = ""
625then
626 with_reader=no
627fi
628if test "$with_reader" = "no" ; then
629 echo Disabling the xmlReader parsing interface
630 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000631 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000632else
633 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000634 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000635fi
636AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000637AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000638
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000639AC_ARG_WITH(pattern,
640[ --with-pattern add the xmlPattern selection interface (on)])
641if test "$with_minimum" = "yes" -a "$with_pattern" = ""
642then
643 with_pattern=no
644fi
645if test "$with_pattern" = "no" ; then
646 echo Disabling the xmlPattern parsing interface
647 WITH_PATTERN=0
648 PATTERN_TEST=
649else
650 WITH_PATTERN=1
651 PATTERN_TEST=Patterntests
652fi
653AC_SUBST(WITH_PATTERN)
654AC_SUBST(PATTERN_TEST)
655
Daniel Veillard1d211e22003-10-20 22:32:39 +0000656AC_ARG_WITH(writer,
657[ --with-writer add the xmlWriter saving interface (on)])
658if test "$with_minimum" = "yes" -a "$with_writer" = ""
659then
660 with_writer=no
661fi
662if test "$with_writer" = "no" ; then
663 echo Disabling the xmlWriter saving interface
664 WITH_WRITER=0
665# WRITER_TEST=
666else
667 WITH_WRITER=1
668# WRITER_TEST=Writertests
669fi
670AC_SUBST(WITH_WRITER)
671#AC_SUBST(WRITER_TEST)
672
Daniel Veillard81273902003-09-30 00:43:48 +0000673AC_ARG_WITH(sax1,
674[ --with-sax1 add the older SAX1 interface (on)])
675if test "$with_minimum" = "yes" -a "$with_sax1" = ""
676then
677 with_sax1=no
678fi
679if test "$with_sax1" = "no" ; then
680 echo Disabling the older SAX1 interface
681 WITH_SAX1=0
682 TEST_SAX=
683else
684 WITH_SAX1=1
685 TEST_SAX=SAXtests
686fi
687AC_SUBST(WITH_SAX1)
688AC_SUBST(TEST_SAX)
689
Daniel Veillard73b013f2003-09-30 12:36:01 +0000690AC_ARG_WITH(push,
691[ --with-push add the PUSH parser interfaces (on)])
692if test "$with_minimum" = "yes" -a "$with_push" = ""
693then
694 with_push=no
695fi
696if test "$with_push" = "no" ; then
697 echo Disabling the PUSH parser interfaces
698 WITH_PUSH=0
699 TEST_PUSH=
700else
701 WITH_PUSH=1
702 TEST_PUSH="XMLPushtests"
703fi
704AC_SUBST(WITH_PUSH)
705AC_SUBST(TEST_PUSH)
706
707AC_ARG_WITH(html,
708[ --with-html add the HTML support (on)])
709if test "$with_minimum" = "yes" -a "$with_html" = ""
710then
711 with_html=no
712fi
713if test "$with_html" = "no" ; then
714 echo Disabling HTML support
715 WITH_HTML=0
716 HTML_OBJ=
717 TEST_HTML=
718else
719 WITH_HTML=1
720 HTML_OBJ="HTMLparser.o HTMLtree.o"
721 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000722 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000723 TEST_PHTML=HTMLPushtests
724 else
725 TEST_PHTML=
726 fi
727fi
728AC_SUBST(WITH_HTML)
729AC_SUBST(HTML_OBJ)
730AC_SUBST(TEST_HTML)
731AC_SUBST(TEST_PHTML)
732
Daniel Veillard4432df22003-09-28 18:58:27 +0000733AC_ARG_WITH(valid,
734[ --with-valid add the DTD validation support (on)])
735if test "$with_minimum" = "yes" -a "$with_valid" = ""
736then
737 with_valid=no
738fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000739if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000740 echo Disabling DTD validation support
741 WITH_VALID=0
742 TEST_VALID=
743 TEST_VTIME=
744else
745 WITH_VALID=1
746 TEST_VALID=Validtests
747 TEST_VTIME=VTimingtests
748fi
749AC_SUBST(WITH_VALID)
750AC_SUBST(TEST_VALID)
751AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000752
William M. Brack97ad4c72003-05-13 08:08:36 +0000753AC_ARG_WITH(catalog,
754[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000755if test "$with_minimum" = "yes" -a "$with_catalog" = ""
756then
757 with_catalog=no
758fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000759if test "$with_catalog" = "no" ; then
760 echo Disabling Catalog support
761 WITH_CATALOG=0
762 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000763 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000764else
765 WITH_CATALOG=1
766 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000767 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000768fi
769AC_SUBST(WITH_CATALOG)
770AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000771AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000772
William M. Brack97ad4c72003-05-13 08:08:36 +0000773AC_ARG_WITH(docbook,
774[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000775if test "$with_minimum" = "yes" -a "$with_docbook" = ""
776then
777 with_docbook=no
778fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000779if test "$with_docbook" = "no" ; then
780 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000781 WITH_DOCB=0
782 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000783else
784 WITH_DOCB=1
785 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000786fi
787AC_SUBST(WITH_DOCB)
788AC_SUBST(DOCB_OBJ)
789
790
William M. Brack97ad4c72003-05-13 08:08:36 +0000791AC_ARG_WITH(xpath,
792[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000793if test "$with_minimum" = "yes" -a "$with_xpath" = ""
794then
795 with_xpath=no
796fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000797if test "$with_xpath" = "no" ; then
798 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000799 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000800 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000801 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000802 WITH_XPATH=0
803 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000804 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000805else
806 WITH_XPATH=1
807 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000808 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000809fi
810AC_SUBST(WITH_XPATH)
811AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000812AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000813
William M. Brack97ad4c72003-05-13 08:08:36 +0000814AC_ARG_WITH(xptr,
815[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000816if test "$with_minimum" = "yes" -a "$with_xptr" = ""
817then
818 with_xptr=no
819fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000820if test "$with_xptr" = "no" ; then
821 echo Disabling XPointer support
822 WITH_XPTR=0
823 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000824 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000825else
826 WITH_XPTR=1
827 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000828 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000829fi
830AC_SUBST(WITH_XPTR)
831AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000832AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000833
William M. Brack97ad4c72003-05-13 08:08:36 +0000834AC_ARG_WITH(c14n,
835[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000836if test "$with_minimum" = "yes" -a "$with_c14n" = ""
837then
838 with_c14n=no
839fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000840if test "$with_c14n" = "no" ; then
841 echo Disabling C14N support
842 WITH_C14N=0
843 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000844 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000845else
846 WITH_C14N=1
847 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000848 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000849fi
850AC_SUBST(WITH_C14N)
851AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000852AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000853
William M. Brack97ad4c72003-05-13 08:08:36 +0000854AC_ARG_WITH(xinclude,
855[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000856if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
857then
858 with_xinclude=no
859fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000860if test "$with_xinclude" = "no" ; then
861 echo Disabling XInclude support
862 WITH_XINCLUDE=0
863 XINCLUDE_OBJ=
864 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000865 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000866else
867 WITH_XINCLUDE=1
868 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000869 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000870fi
871AC_SUBST(WITH_XINCLUDE)
872AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000873AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000874
Daniel Veillard6e90d192001-07-03 16:37:49 +0000875WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000876AC_ARG_WITH(iconv,
877[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000878if test "$with_minimum" = "yes" -a "$with_iconv" = ""
879then
880 with_iconv=no
881fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000882if test "$with_iconv" = "no" ; then
883 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000884else
Daniel Veillard220346d2001-12-07 11:33:54 +0000885 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000886 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000887 # Export this since our headers include iconv.h
888 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000889 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000890 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000891
892 AC_CHECK_HEADER(iconv.h,
893 AC_MSG_CHECKING(for iconv)
894 AC_TRY_LINK([#include <stdlib.h>
895#include <iconv.h>],[
896iconv_t cd = iconv_open ("","");
897iconv (cd, NULL, NULL, NULL, NULL);],[
898 AC_MSG_RESULT(yes)
899 WITH_ICONV=1],[
900 AC_MSG_RESULT(no)
901 AC_MSG_CHECKING(for iconv in -liconv)
902
903 _ldflags="${LDFLAGS}"
904 _libs="${LIBS}"
905 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
906 LIBS="${LIBS} -liconv"
907
908 AC_TRY_LINK([#include <stdlib.h>
909#include <iconv.h>],[
910iconv_t cd = iconv_open ("","");
911iconv (cd, NULL, NULL, NULL, NULL);],[
912 AC_MSG_RESULT(yes)
913 WITH_ICONV=1
914 ICONV_LIBS="${ICONV_LIBS} -liconv"
915 LIBS="${_libs}"
916 LDFLAGS="${_ldflags}"],[
917 AC_MSG_RESULT(no)
918 LIBS="${_libs}"
919 LDFLAGS="${_ldflags}"])]))
920fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000921case "$host" in
922 *mingw*) M_LIBS=""
923 ;;
924 *) M_LIBS="-lm"
925 ;;
926esac
Daniel Veillardb82c1662001-12-09 14:00:54 +0000927XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000928XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000929AC_SUBST(WITH_ICONV)
930
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000931WITH_ISO8859X=1
932AC_ARG_WITH(iso8859x,
933[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000934if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
935then
936 with_iso8859x=no
937fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000938if test "$WITH_ICONV" != "1" ; then
939if test "$with_iso8859x" = "no" ; then
940 echo Disabling ISO8859X support
941 WITH_ISO8859X=0
942fi
943fi
944AC_SUBST(WITH_ISO8859X)
945
William M. Brack97ad4c72003-05-13 08:08:36 +0000946AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000947[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000948if test "$with_minimum" = "yes" -a "$with_schemas" = ""
949then
950 with_schemas=no
951fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000952if test "$with_schemas" = "no" ; then
953 echo "Disabled Schemas/Relax-NG support"
954 WITH_SCHEMAS=0
955 TEST_SCHEMAS=
956else
Daniel Veillard71531f32003-02-05 13:19:53 +0000957 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000958 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000959 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +0000960 if test "$PYTHON_INCLUDES" != "" ; then
961 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
962 fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000963 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000964fi
965AC_SUBST(WITH_SCHEMAS)
966AC_SUBST(TEST_SCHEMAS)
967
William M. Brack97ad4c72003-05-13 08:08:36 +0000968AC_ARG_WITH(regexps,
969[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000970if test "$with_minimum" = "yes" -a "$with_regexps" = ""
971then
972 with_regexps=no
973fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000974if test "$with_regexps" = "no" ; then
975 echo Disabling Regexps support
976 WITH_REGEXPS=0
977 TEST_REGEXPS=
978else
979 WITH_REGEXPS=1
980 TEST_REGEXPS="Regexptests Automatatests"
981fi
982AC_SUBST(WITH_REGEXPS)
983AC_SUBST(TEST_REGEXPS)
984
William M. Brack97ad4c72003-05-13 08:08:36 +0000985AC_ARG_WITH(debug,
986[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000987if test "$with_minimum" = "yes" -a "$with_debug" = ""
988then
989 with_debug=no
990fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000991if test "$with_debug" = "no" ; then
992 echo Disabling DEBUG support
993 WITH_DEBUG=0
994 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000995 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000996else
997 WITH_DEBUG=1
998 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000999 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001000fi
1001AC_SUBST(WITH_DEBUG)
1002AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001003AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001004
William M. Brack97ad4c72003-05-13 08:08:36 +00001005AC_ARG_WITH(mem_debug,
1006[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +00001007if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
1008then
1009 with_mem_debug=no
1010fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001011if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001012 if test "$with_thread_alloc" = "yes" ; then
1013 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1014 WITH_MEM_DEBUG=0
1015 else
1016 echo Enabling memory debug support
1017 WITH_MEM_DEBUG=1
1018 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001019else
1020 WITH_MEM_DEBUG=0
1021fi
1022AC_SUBST(WITH_MEM_DEBUG)
1023
Daniel Veillard1638a472003-08-14 01:23:25 +00001024
1025WIN32_EXTRA_LIBADD=
1026WIN32_EXTRA_LDFLAGS=
1027case "$host" in
1028 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001029 CPPFLAGS="$CPPFLAGS -DWIN32"
1030 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001031 WIN32_EXTRA_LDFLAGS="-no-undefined"
1032 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1033 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1034 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1035 ;;
1036esac
1037AC_SUBST(WIN32_EXTRA_LIBADD)
1038AC_SUBST(WIN32_EXTRA_LDFLAGS)
1039
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001040AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001041AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001042AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001043
Daniel Veillardb05deb71999-08-10 19:04:08 +00001044AC_SUBST(XML_LIBDIR)
1045AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001046AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001047AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001048AC_SUBST(XML_INCLUDEDIR)
1049AC_SUBST(HTML_DIR)
1050AC_SUBST(HAVE_ISNAN)
1051AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001052AC_SUBST(PYTHON)
1053AC_SUBST(PYTHON_VERSION)
1054AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001055AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001056
Daniel Veillardb05deb71999-08-10 19:04:08 +00001057AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001058AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001059
Daniel Veillard9715c172002-11-25 16:33:40 +00001060dnl for the spec file
1061RELDATE=`date +'%a %b %e %Y'`
1062AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001063AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001064
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001065rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001066ln -s Copyright COPYING
1067
Daniel Veillarde4177a52004-01-08 16:43:57 +00001068# keep on one line for cygwin c.f. #130896
Daniel Veillard06d25242004-02-25 13:01:42 +00001069AC_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 +00001070
Daniel Veillard06d25242004-02-25 13:01:42 +00001071chmod +x xml2-config python/setup.py