blob: 391dda77f272ff4213e4cccb0b95ccf3baa3e7e9 [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 Veillard252004d2004-03-23 12:32:32 +00009LIBXML_MICRO_VERSION=8
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)
Daniel Veillard01791d51998-07-24 19:24:09 +000034
Daniel Veillard03109292000-08-14 14:58:22 +000035dnl Make sure we have an ANSI compiler
36AM_C_PROTOTYPES
37test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
38
Daniel Veillard6984e6d2003-12-09 14:20:17 +000039AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000040AM_PROG_LIBTOOL
41
Daniel Veillardd8cf9062003-11-11 21:12:36 +000042# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000043
Daniel Veillard4432df22003-09-28 18:58:27 +000044dnl
45dnl option to build a minimal libxml2 library
46dnl
47AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
48if test "$with_minimum" = "yes"
49then
50 echo "Configuring for a minimal library"
51fi
52
Daniel Veillard71b656e2000-01-05 14:46:17 +000053dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000054_cppflags="${CPPFLAGS}"
55_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000056
Daniel Veillard259ff742001-10-06 13:49:59 +000057
Owen Taylor3473f882001-02-23 17:55:21 +000058AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +000059[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +000060 if test "$withval" != "no" -a "$withval" != "yes"; then
61 Z_DIR=$withval
62 CPPFLAGS="${CPPFLAGS} -I$withval/include"
63 LDFLAGS="${LDFLAGS} -L$withval/lib"
64 fi
Daniel Veillard259ff742001-10-06 13:49:59 +000065])
Daniel Veillard4432df22003-09-28 18:58:27 +000066if test "$with_minimum" = "yes" -a "$with_zlib" = ""
67then
68 with_zlib=no
69fi
Daniel Veillard259ff742001-10-06 13:49:59 +000070if test "$with_zlib" = "no"; then
71 echo "Disabling compression support"
72else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000073 AC_CHECK_HEADERS(zlib.h,
74 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +000075 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000076 if test "x${Z_DIR}" != "x"; then
77 Z_CFLAGS="-I${Z_DIR}/include"
78 Z_LIBS="-L${Z_DIR}/lib -lz"
79 [case ${host} in
80 *-*-solaris*)
81 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
82 ;;
83 esac]
84 else
85 Z_LIBS="-lz"
86 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +000087fi
Owen Taylor3473f882001-02-23 17:55:21 +000088
Owen Taylor3473f882001-02-23 17:55:21 +000089AC_SUBST(Z_CFLAGS)
90AC_SUBST(Z_LIBS)
91
92CPPFLAGS=${_cppflags}
93LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000094
Daniel Veillard01791d51998-07-24 19:24:09 +000095dnl Checks for header files.
96AC_HEADER_DIRENT
97AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +000098AC_CHECK_HEADERS([fcntl.h])
99AC_CHECK_HEADERS([unistd.h])
100AC_CHECK_HEADERS([ctype.h])
101AC_CHECK_HEADERS([dirent.h])
102AC_CHECK_HEADERS([errno.h])
103AC_CHECK_HEADERS([malloc.h])
104AC_CHECK_HEADERS([stdarg.h])
105AC_CHECK_HEADERS([sys/stat.h])
106AC_CHECK_HEADERS([sys/types.h])
107AC_CHECK_HEADERS([time.h])
108AC_CHECK_HEADERS([ansidecl.h])
109AC_CHECK_HEADERS([ieeefp.h])
110AC_CHECK_HEADERS([nan.h])
111AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000112AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000113AC_CHECK_HEADERS([fp_class.h])
114AC_CHECK_HEADERS([float.h])
115AC_CHECK_HEADERS([stdlib.h])
116AC_CHECK_HEADERS([sys/socket.h], [], [],
117[#if HAVE_SYS_TYPES_H
118# include <sys/types.h>
119# endif
120])
121AC_CHECK_HEADERS([netinet/in.h], [], [],
122[#if HAVE_SYS_TYPES_H
123# include <sys/types.h>
124# endif
125])
126AC_CHECK_HEADERS([arpa/inet.h], [], [],
127[#if HAVE_SYS_TYPES_H
128# include <sys/types.h>
129# endif
130#if HAVE_ARPA_INET_H
131# include <arpa/inet.h>
132# endif
133])
134AC_CHECK_HEADERS([netdb.h])
135AC_CHECK_HEADERS([sys/time.h])
136AC_CHECK_HEADERS([sys/select.h])
137AC_CHECK_HEADERS([sys/mman.h])
138AC_CHECK_HEADERS([sys/timeb.h])
139AC_CHECK_HEADERS([signal.h])
140AC_CHECK_HEADERS([arpa/nameser.h], [], [],
141[#if HAVE_SYS_TYPES_H
142# include <sys/types.h>
143# endif
144])
145AC_CHECK_HEADERS([resolv.h], [], [],
146[#if HAVE_SYS_TYPES_H
147# include <sys/types.h>
148# endif
149#if HAVE_NETINET_IN_H
150# include <netinet/in.h>
151# endif
152#if HAVE_ARPA_NAMESER_H
153# include <arpa/nameser.h>
154# endif
155])
Daniel Veillard01791d51998-07-24 19:24:09 +0000156
Daniel Veillard1164e751999-02-16 16:29:17 +0000157dnl Specific dir for HTML output ?
Daniel Veillardfc979062004-03-04 22:07:16 +0000158AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
159 [path to base html directory, default $datadir/doc/html]),
160 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
161
162AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
163 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
164 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
165 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
Daniel Veillard1164e751999-02-16 16:29:17 +0000166
167AC_SUBST(HTML_DIR)
168
Daniel Veillard01791d51998-07-24 19:24:09 +0000169dnl Checks for library functions.
170AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000171AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000172AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000173AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000174AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000175
Daniel Veillard92ad2102001-03-27 12:47:33 +0000176dnl Checking the standard string functions availability
177AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
178 NEED_TRIO=1)
179
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000180dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000181AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
182AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
183AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000184
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000185dnl Determine what socket length (socklen_t) data type is
186AC_MSG_CHECKING([for type of socket length (socklen_t)])
187AC_TRY_COMPILE2([
188#include <stddef.h>
189#include <sys/types.h>
190#include <sys/socket.h>],[
191(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
192 AC_MSG_RESULT(socklen_t *)
193 SOCKLEN_T=socklen_t],[
194 AC_TRY_COMPILE2([
195#include <stddef.h>
196#include <sys/types.h>
197#include <sys/socket.h>],[
198(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
199 AC_MSG_RESULT(size_t *)
200 SOCKLEN_T=size_t],[
201 AC_TRY_COMPILE2([
202#include <stddef.h>
203#include <sys/types.h>
204#include <sys/socket.h>],[
205(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
206 AC_MSG_RESULT(int *)
207 SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000208 AC_MSG_WARN(could not determine)
209 SOCKLEN_T="unsigned int"])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000210AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000211
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000212dnl ***********************Checking for availability of IPv6*******************
213
214AC_MSG_CHECKING([whether to enable IPv6])
215AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000216if test "$with_minimum" = "yes"
217then
218 enable_ipv6=no
219fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000220if test $enable_ipv6 = yes; then
221 have_ipv6=no
222 AC_TRY_COMPILE([
223 #include <sys/socket.h>
224 #include <sys/types.h>], [
225 struct sockaddr_storage ss;
226 socket(AF_INET6, SOCK_STREAM, 0)
227 ],
228 have_ipv6=yes,
229 have_ipv6=no
230 )
231 AC_MSG_RESULT($have_ipv6)
232
William M. Brack476cd962003-08-13 11:09:42 +0000233 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000234 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000235
236 have_getaddrinfo=no
237 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
238 if test $have_getaddrinfo != yes; then
239 for lib in bsd socket inet; do
240 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
241 done
242 fi
243
William M. Brack476cd962003-08-13 11:09:42 +0000244 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000245 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000246 fi
247 fi
248fi
249
250dnl ******************************End IPv6 checks******************************
251
Daniel Veillardb05deb71999-08-10 19:04:08 +0000252dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000253AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000254 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000255
Daniel Veillardc790bf42003-10-11 10:50:10 +0000256AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
257 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000258
259XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000260XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000261
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000262dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000263dnl Extra flags
264dnl
265XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000266RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000267
Daniel Veillardd94849b2003-07-28 13:02:24 +0000268AC_ARG_WITH(fexceptions,
269[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000270if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
271then
272 with_fexceptions=no
273fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000274dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000275dnl Workaround for native compilers
276dnl HP : http://bugs.gnome.org/db/31/3163.html
277dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000278dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000279if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000280 case "${host}" in
281 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000282 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000283 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000284 *-dec-osf* )
285 CFLAGS="${CFLAGS} -ieee"
286 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000287 alpha*-*-linux* )
288 CFLAGS="${CFLAGS} -ieee"
289 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000290 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000291else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000292 if test "$with_fexceptions" = "yes"
293 then
294 #
295 # Not activated by default because this inflates the code size
296 # Used to allow propagation of C++ exceptions through the library
297 #
298 CFLAGS="${CFLAGS} -fexceptions"
299 fi
300
Daniel Veillardd574f782001-03-14 19:40:17 +0000301 CFLAGS="${CFLAGS} -Wall"
Daniel Veillard14839d52001-06-06 16:11:56 +0000302 case "${host}" in
303 alpha*-*-linux* )
304 CFLAGS="${CFLAGS} -mieee"
305 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000306 alpha*-*-osf* )
307 CFLAGS="${CFLAGS} -mieee"
308 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000309 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000310fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000311case ${host} in
312 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000313 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
314 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000315 hppa*-hp-mpeix)
316 NEED_TRIO=1
317 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000318esac
319
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000320
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000321dnl
322dnl check for python
323dnl
324
325PYTHON=
326PYTHON_VERSION=
327PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000328PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000329PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000330pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000331AC_ARG_WITH(python,
332[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000333if test "$with_minimum" = "yes" -a "$with_python" = ""
334then
335 with_python=no
336fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000337if test "$with_python" != "no" ; then
338 if test -x "$with_python/bin/python"
339 then
340 echo Found python in $with_python/bin/python
341 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000342 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000343 if test -x "$with_python"
344 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000345 echo Found python in $with_python
346 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000347 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000348 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000349 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000350 fi
351 if test "$PYTHON" != ""
352 then
353 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
354 echo Found Python version $PYTHON_VERSION
355 fi
356 if test "$PYTHON_VERSION" != ""
357 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000358 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
359 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000360 then
361 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000362 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000363 else
364 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
365 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000366 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000367 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000368 else
369 if test -r /usr/include/python$PYTHON_VERSION/Python.h
370 then
371 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000372 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000373 else
374 echo could not find python$PYTHON_VERSION/Python.h
375 fi
376 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000377 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000378 then
379 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
380 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000381 fi
382 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000383 if test "$with_python" != ""
384 then
385 pythondir='$(PYTHON_SITE_PACKAGES)'
386 else
387 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
388 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000389fi
390AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000391if test "$PYTHON_INCLUDES" != ""
392then
393 PYTHON_SUBDIR=python
394else
395 PYTHON_SUBDIR=
396fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000397AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000398AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000399
Daniel Veillard437b87b2000-01-03 17:30:46 +0000400dnl
401dnl Tester makes use of readline if present
402dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000403_cppflags="${CPPFLAGS}"
404_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000405
Daniel Veillard03109292000-08-14 14:58:22 +0000406AC_ARG_WITH(readline,
407[ --with-readline=DIR use readline in DIR],[
408 if test "$withval" != "no" -a "$withval" != "yes"; then
409 RDL_DIR=$withval
410 CPPFLAGS="${CPPFLAGS} -I$withval/include"
411 LDFLAGS="${LDFLAGS} -L$withval/lib"
412 fi
413])
Daniel Veillard4432df22003-09-28 18:58:27 +0000414if test "$with_minimum" = "yes" -a "$with_readline" = ""
415then
416 with_readline=no
417fi
Daniel Veillard03109292000-08-14 14:58:22 +0000418
Daniel Veillard361d8452000-04-03 19:48:13 +0000419dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000420dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000421dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000422dnl
William M. Brack871611b2003-10-18 04:53:14 +0000423if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000424 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
425 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmlnew" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000426 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000427 if test "$with_minimum" != "yes"
428 then
429 if test "${with_mem_debug}" = "" ; then
430 with_mem_debug="yes"
431 fi
432 if test "${with_docbook}" = "" ; then
433 with_docbook="yes"
434 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000435 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000436 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 +0000437 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000438dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000439else
440 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000441fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000442AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000443
444dnl
445dnl Check for trio string functions
446dnl
447
448if test "${NEED_TRIO}" = "1" ; then
449 echo Adding trio library for string functions
450 WITH_TRIO=1
451else
452 WITH_TRIO=0
453fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000454AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000455AC_SUBST(WITH_TRIO)
456
Daniel Veillardf6eea272001-01-18 12:17:12 +0000457dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000458dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000459dnl
460
Daniel Veillardb8478642001-10-12 17:29:10 +0000461THREAD_LIBS=""
462WITH_THREADS=0
463THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000464TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000465THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000466
William M. Brack97ad4c72003-05-13 08:08:36 +0000467AC_ARG_WITH(threads,
468[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000469if test "$with_minimum" = "yes" -a "$with_threads" = ""
470then
471 with_threads=no
472fi
Daniel Veillard84942712003-04-18 14:40:05 +0000473if test "$with_threads" = "no" ; then
474 echo Disabling multithreaded support
475else
Daniel Veillardb8478642001-10-12 17:29:10 +0000476 echo Enabling multithreaded support
477
478 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000479 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000480 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000481 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
482 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000483 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000484 case $host_os in
485 *mingw32*) WITH_THREADS="1"
486 THREADS_W32="Win32"
487 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
488 ;;
489 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000490 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000491 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
492 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000493 fi
494fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000495AC_ARG_WITH(thread-alloc,
496[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000497if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
498then
499 with_thread_alloc=no
500fi
Daniel Veillardab7488e2001-10-17 11:30:37 +0000501if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
502 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000503fi
504
Daniel Veillardb8478642001-10-12 17:29:10 +0000505AC_SUBST(THREAD_LIBS)
506AC_SUBST(WITH_THREADS)
507AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000508AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000509AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000510
William M. Brack97ad4c72003-05-13 08:08:36 +0000511AC_ARG_WITH(history,
512[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000513if test "$with_minimum" = "yes" -a "$with_history" = ""
514then
515 with_history=no
516fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000517if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000518 echo Enabling xmllint shell history
519 dnl check for terminal library. this is a very cool solution
520 dnl from octave's configure.in
521 unset tcap
522 for termlib in ncurses curses termcap terminfo termlib; do
523 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
524 test -n "$tcap" && break
525 done
526
527 AC_CHECK_HEADER(readline/history.h,
528 AC_CHECK_LIB(history, append_history,[
529 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000530 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000531 AC_CHECK_HEADER(readline/readline.h,
532 AC_CHECK_LIB(readline, readline,[
533 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000534 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000535 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
536 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
537 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
538 else
539 CPPFLAGS=${_cppflags}
540 fi
541 LDFLAGS=${_ldflags}
542fi
543
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000544AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000545[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000546if test "$with_minimum" = "yes" -a "$with_output" = ""
547then
548 with_output=no
549fi
550if test "$with_output" = "no" ; then
551 echo Disabling serialization/saving support
552 WITH_OUTPUT=0
553else
554 WITH_OUTPUT=1
555fi
556AC_SUBST(WITH_OUTPUT)
557
Daniel Veillard652327a2003-09-29 18:02:38 +0000558AC_ARG_WITH(tree,
559[ --with-tree add the DOM like tree manipulation APIs (on)])
560if test "$with_minimum" = "yes" -a "$with_tree" = ""
561then
562 with_tree=no
563fi
564if test "$with_tree" = "no" ; then
565 echo Disabling DOM like tree manipulation APIs
566 WITH_TREE=0
567else
568 WITH_TREE=1
569fi
570AC_SUBST(WITH_TREE)
571
William M. Brack97ad4c72003-05-13 08:08:36 +0000572AC_ARG_WITH(ftp,
573[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000574if test "$with_minimum" = "yes" -a "$with_ftp" = ""
575then
576 with_ftp=no
577fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000578if test "$with_ftp" = "no" ; then
579 echo Disabling FTP support
580 WITH_FTP=0
581 FTP_OBJ=
582else
583 WITH_FTP=1
584 FTP_OBJ=nanoftp.o
585fi
586AC_SUBST(WITH_FTP)
587AC_SUBST(FTP_OBJ)
588
William M. Brack97ad4c72003-05-13 08:08:36 +0000589AC_ARG_WITH(http,
590[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000591if test "$with_minimum" = "yes" -a "$with_http" = ""
592then
593 with_http=no
594fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000595if test "$with_http" = "no" ; then
596 echo Disabling HTTP support
597 WITH_HTTP=0
598 HTTP_OBJ=
599else
600 WITH_HTTP=1
601 HTTP_OBJ=nanohttp.o
602fi
603AC_SUBST(WITH_HTTP)
604AC_SUBST(HTTP_OBJ)
605
Daniel Veillard4432df22003-09-28 18:58:27 +0000606AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000607[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000608if test "$with_minimum" = "yes" -a "$with_legacy" = ""
609then
610 with_legacy=no
611fi
612if test "$with_legacy" = "no" ; then
613 echo Disabling deprecated APIs
614 WITH_LEGACY=0
615else
616 WITH_LEGACY=1
617fi
618AC_SUBST(WITH_LEGACY)
619
Daniel Veillard81273902003-09-30 00:43:48 +0000620AC_ARG_WITH(reader,
621[ --with-reader add the xmlReader parsing interface (on)])
622if test "$with_minimum" = "yes" -a "$with_reader" = ""
623then
624 with_reader=no
625fi
626if test "$with_reader" = "no" ; then
627 echo Disabling the xmlReader parsing interface
628 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000629 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000630else
631 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000632 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000633fi
634AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000635AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000636
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000637AC_ARG_WITH(pattern,
638[ --with-pattern add the xmlPattern selection interface (on)])
639if test "$with_minimum" = "yes" -a "$with_pattern" = ""
640then
641 with_pattern=no
642fi
643if test "$with_pattern" = "no" ; then
644 echo Disabling the xmlPattern parsing interface
645 WITH_PATTERN=0
646 PATTERN_TEST=
647else
648 WITH_PATTERN=1
649 PATTERN_TEST=Patterntests
650fi
651AC_SUBST(WITH_PATTERN)
652AC_SUBST(PATTERN_TEST)
653
Daniel Veillard1d211e22003-10-20 22:32:39 +0000654AC_ARG_WITH(writer,
655[ --with-writer add the xmlWriter saving interface (on)])
656if test "$with_minimum" = "yes" -a "$with_writer" = ""
657then
658 with_writer=no
659fi
660if test "$with_writer" = "no" ; then
661 echo Disabling the xmlWriter saving interface
662 WITH_WRITER=0
663# WRITER_TEST=
664else
665 WITH_WRITER=1
666# WRITER_TEST=Writertests
667fi
668AC_SUBST(WITH_WRITER)
669#AC_SUBST(WRITER_TEST)
670
Daniel Veillard81273902003-09-30 00:43:48 +0000671AC_ARG_WITH(sax1,
672[ --with-sax1 add the older SAX1 interface (on)])
673if test "$with_minimum" = "yes" -a "$with_sax1" = ""
674then
675 with_sax1=no
676fi
677if test "$with_sax1" = "no" ; then
678 echo Disabling the older SAX1 interface
679 WITH_SAX1=0
680 TEST_SAX=
681else
682 WITH_SAX1=1
683 TEST_SAX=SAXtests
684fi
685AC_SUBST(WITH_SAX1)
686AC_SUBST(TEST_SAX)
687
Daniel Veillard73b013f2003-09-30 12:36:01 +0000688AC_ARG_WITH(push,
689[ --with-push add the PUSH parser interfaces (on)])
690if test "$with_minimum" = "yes" -a "$with_push" = ""
691then
692 with_push=no
693fi
694if test "$with_push" = "no" ; then
695 echo Disabling the PUSH parser interfaces
696 WITH_PUSH=0
697 TEST_PUSH=
698else
699 WITH_PUSH=1
700 TEST_PUSH="XMLPushtests"
701fi
702AC_SUBST(WITH_PUSH)
703AC_SUBST(TEST_PUSH)
704
705AC_ARG_WITH(html,
706[ --with-html add the HTML support (on)])
707if test "$with_minimum" = "yes" -a "$with_html" = ""
708then
709 with_html=no
710fi
711if test "$with_html" = "no" ; then
712 echo Disabling HTML support
713 WITH_HTML=0
714 HTML_OBJ=
715 TEST_HTML=
716else
717 WITH_HTML=1
718 HTML_OBJ="HTMLparser.o HTMLtree.o"
719 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000720 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000721 TEST_PHTML=HTMLPushtests
722 else
723 TEST_PHTML=
724 fi
725fi
726AC_SUBST(WITH_HTML)
727AC_SUBST(HTML_OBJ)
728AC_SUBST(TEST_HTML)
729AC_SUBST(TEST_PHTML)
730
Daniel Veillard4432df22003-09-28 18:58:27 +0000731AC_ARG_WITH(valid,
732[ --with-valid add the DTD validation support (on)])
733if test "$with_minimum" = "yes" -a "$with_valid" = ""
734then
735 with_valid=no
736fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000737if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000738 echo Disabling DTD validation support
739 WITH_VALID=0
740 TEST_VALID=
741 TEST_VTIME=
742else
743 WITH_VALID=1
744 TEST_VALID=Validtests
745 TEST_VTIME=VTimingtests
746fi
747AC_SUBST(WITH_VALID)
748AC_SUBST(TEST_VALID)
749AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000750
William M. Brack97ad4c72003-05-13 08:08:36 +0000751AC_ARG_WITH(catalog,
752[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000753if test "$with_minimum" = "yes" -a "$with_catalog" = ""
754then
755 with_catalog=no
756fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000757if test "$with_catalog" = "no" ; then
758 echo Disabling Catalog support
759 WITH_CATALOG=0
760 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000761 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000762else
763 WITH_CATALOG=1
764 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000765 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000766fi
767AC_SUBST(WITH_CATALOG)
768AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000769AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000770
William M. Brack97ad4c72003-05-13 08:08:36 +0000771AC_ARG_WITH(docbook,
772[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000773if test "$with_minimum" = "yes" -a "$with_docbook" = ""
774then
775 with_docbook=no
776fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000777if test "$with_docbook" = "no" ; then
778 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000779 WITH_DOCB=0
780 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000781else
782 WITH_DOCB=1
783 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000784fi
785AC_SUBST(WITH_DOCB)
786AC_SUBST(DOCB_OBJ)
787
788
William M. Brack97ad4c72003-05-13 08:08:36 +0000789AC_ARG_WITH(xpath,
790[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000791if test "$with_minimum" = "yes" -a "$with_xpath" = ""
792then
793 with_xpath=no
794fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000795if test "$with_xpath" = "no" ; then
796 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000797 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000798 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000799 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000800 WITH_XPATH=0
801 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000802 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000803else
804 WITH_XPATH=1
805 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000806 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000807fi
808AC_SUBST(WITH_XPATH)
809AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000810AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000811
William M. Brack97ad4c72003-05-13 08:08:36 +0000812AC_ARG_WITH(xptr,
813[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000814if test "$with_minimum" = "yes" -a "$with_xptr" = ""
815then
816 with_xptr=no
817fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000818if test "$with_xptr" = "no" ; then
819 echo Disabling XPointer support
820 WITH_XPTR=0
821 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000822 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000823else
824 WITH_XPTR=1
825 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000826 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000827fi
828AC_SUBST(WITH_XPTR)
829AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000830AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000831
William M. Brack97ad4c72003-05-13 08:08:36 +0000832AC_ARG_WITH(c14n,
833[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000834if test "$with_minimum" = "yes" -a "$with_c14n" = ""
835then
836 with_c14n=no
837fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000838if test "$with_c14n" = "no" ; then
839 echo Disabling C14N support
840 WITH_C14N=0
841 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000842 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000843else
844 WITH_C14N=1
845 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000846 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000847fi
848AC_SUBST(WITH_C14N)
849AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000850AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000851
William M. Brack97ad4c72003-05-13 08:08:36 +0000852AC_ARG_WITH(xinclude,
853[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000854if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
855then
856 with_xinclude=no
857fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000858if test "$with_xinclude" = "no" ; then
859 echo Disabling XInclude support
860 WITH_XINCLUDE=0
861 XINCLUDE_OBJ=
862 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000863 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000864else
865 WITH_XINCLUDE=1
866 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000867 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000868fi
869AC_SUBST(WITH_XINCLUDE)
870AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000871AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000872
Daniel Veillard6e90d192001-07-03 16:37:49 +0000873WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000874AC_ARG_WITH(iconv,
875[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000876if test "$with_minimum" = "yes" -a "$with_iconv" = ""
877then
878 with_iconv=no
879fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000880if test "$with_iconv" = "no" ; then
881 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000882else
Daniel Veillard220346d2001-12-07 11:33:54 +0000883 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000884 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000885 # Export this since our headers include iconv.h
886 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000887 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000888 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000889
890 AC_CHECK_HEADER(iconv.h,
891 AC_MSG_CHECKING(for iconv)
892 AC_TRY_LINK([#include <stdlib.h>
893#include <iconv.h>],[
894iconv_t cd = iconv_open ("","");
895iconv (cd, NULL, NULL, NULL, NULL);],[
896 AC_MSG_RESULT(yes)
897 WITH_ICONV=1],[
898 AC_MSG_RESULT(no)
899 AC_MSG_CHECKING(for iconv in -liconv)
900
901 _ldflags="${LDFLAGS}"
902 _libs="${LIBS}"
903 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
904 LIBS="${LIBS} -liconv"
905
906 AC_TRY_LINK([#include <stdlib.h>
907#include <iconv.h>],[
908iconv_t cd = iconv_open ("","");
909iconv (cd, NULL, NULL, NULL, NULL);],[
910 AC_MSG_RESULT(yes)
911 WITH_ICONV=1
912 ICONV_LIBS="${ICONV_LIBS} -liconv"
913 LIBS="${_libs}"
914 LDFLAGS="${_ldflags}"],[
915 AC_MSG_RESULT(no)
916 LIBS="${_libs}"
917 LDFLAGS="${_ldflags}"])]))
918fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000919case "$host" in
920 *mingw*) M_LIBS=""
921 ;;
922 *) M_LIBS="-lm"
923 ;;
924esac
Daniel Veillardb82c1662001-12-09 14:00:54 +0000925XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000926XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000927AC_SUBST(WITH_ICONV)
928
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000929WITH_ISO8859X=1
930AC_ARG_WITH(iso8859x,
931[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000932if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
933then
934 with_iso8859x=no
935fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000936if test "$WITH_ICONV" != "1" ; then
937if test "$with_iso8859x" = "no" ; then
938 echo Disabling ISO8859X support
939 WITH_ISO8859X=0
940fi
941fi
942AC_SUBST(WITH_ISO8859X)
943
William M. Brack97ad4c72003-05-13 08:08:36 +0000944AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000945[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000946if test "$with_minimum" = "yes" -a "$with_schemas" = ""
947then
948 with_schemas=no
949fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000950if test "$with_schemas" = "no" ; then
951 echo "Disabled Schemas/Relax-NG support"
952 WITH_SCHEMAS=0
953 TEST_SCHEMAS=
954else
Daniel Veillard71531f32003-02-05 13:19:53 +0000955 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000956 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000957 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +0000958 if test "$PYTHON_INCLUDES" != "" ; then
959 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
960 fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000961 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000962fi
963AC_SUBST(WITH_SCHEMAS)
964AC_SUBST(TEST_SCHEMAS)
965
William M. Brack97ad4c72003-05-13 08:08:36 +0000966AC_ARG_WITH(regexps,
967[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000968if test "$with_minimum" = "yes" -a "$with_regexps" = ""
969then
970 with_regexps=no
971fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000972if test "$with_regexps" = "no" ; then
973 echo Disabling Regexps support
974 WITH_REGEXPS=0
975 TEST_REGEXPS=
976else
977 WITH_REGEXPS=1
978 TEST_REGEXPS="Regexptests Automatatests"
979fi
980AC_SUBST(WITH_REGEXPS)
981AC_SUBST(TEST_REGEXPS)
982
William M. Brack97ad4c72003-05-13 08:08:36 +0000983AC_ARG_WITH(debug,
984[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000985if test "$with_minimum" = "yes" -a "$with_debug" = ""
986then
987 with_debug=no
988fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000989if test "$with_debug" = "no" ; then
990 echo Disabling DEBUG support
991 WITH_DEBUG=0
992 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000993 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000994else
995 WITH_DEBUG=1
996 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000997 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +0000998fi
999AC_SUBST(WITH_DEBUG)
1000AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001001AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001002
William M. Brack97ad4c72003-05-13 08:08:36 +00001003AC_ARG_WITH(mem_debug,
1004[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +00001005if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
1006then
1007 with_mem_debug=no
1008fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001009if test "$with_mem_debug" = "yes" ; then
1010 echo Enabling memory debug support
1011 WITH_MEM_DEBUG=1
1012else
1013 WITH_MEM_DEBUG=0
1014fi
1015AC_SUBST(WITH_MEM_DEBUG)
1016
Daniel Veillard1638a472003-08-14 01:23:25 +00001017
1018WIN32_EXTRA_LIBADD=
1019WIN32_EXTRA_LDFLAGS=
1020case "$host" in
1021 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001022 CPPFLAGS="$CPPFLAGS -DWIN32"
1023 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001024 WIN32_EXTRA_LDFLAGS="-no-undefined"
1025 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1026 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1027 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1028 ;;
1029esac
1030AC_SUBST(WIN32_EXTRA_LIBADD)
1031AC_SUBST(WIN32_EXTRA_LDFLAGS)
1032
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001033AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001034AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001035AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001036
Daniel Veillardb05deb71999-08-10 19:04:08 +00001037AC_SUBST(XML_LIBDIR)
1038AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001039AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001040AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001041AC_SUBST(XML_INCLUDEDIR)
1042AC_SUBST(HTML_DIR)
1043AC_SUBST(HAVE_ISNAN)
1044AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001045AC_SUBST(PYTHON)
1046AC_SUBST(PYTHON_VERSION)
1047AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001048AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001049
Daniel Veillardb05deb71999-08-10 19:04:08 +00001050AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001051AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001052
Daniel Veillard9715c172002-11-25 16:33:40 +00001053dnl for the spec file
1054RELDATE=`date +'%a %b %e %Y'`
1055AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001056AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001057
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001058rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001059ln -s Copyright COPYING
1060
Daniel Veillarde4177a52004-01-08 16:43:57 +00001061# keep on one line for cygwin c.f. #130896
Daniel Veillard06d25242004-02-25 13:01:42 +00001062AC_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 +00001063
Daniel Veillard06d25242004-02-25 13:01:42 +00001064chmod +x xml2-config python/setup.py