blob: 94525b39aa2028159c24b0e4e6c70650f2844a3f [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 Veillard5c9547e2004-02-12 15:31:49 +00009LIBXML_MICRO_VERSION=6
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
William M. Brack97ad4c72003-05-13 08:08:36 +000027AC_ARG_WITH(html-dir,
28[ --with-html-dir=PATH path to installed docs ])
Daniel Veillard01791d51998-07-24 19:24:09 +000029
30dnl Checks for programs.
31AC_PROG_CC
32AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000033AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000034AC_PATH_PROG(RM, rm, /bin/rm)
35AC_PATH_PROG(MV, mv, /bin/mv)
36AC_PATH_PROG(TAR, tar, /bin/tar)
Daniel Veillard01791d51998-07-24 19:24:09 +000037
Daniel Veillard03109292000-08-14 14:58:22 +000038dnl Make sure we have an ANSI compiler
39AM_C_PROTOTYPES
40test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
41
Daniel Veillard6984e6d2003-12-09 14:20:17 +000042AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000043AM_PROG_LIBTOOL
44
Daniel Veillardd8cf9062003-11-11 21:12:36 +000045# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000046
Daniel Veillard4432df22003-09-28 18:58:27 +000047dnl
48dnl option to build a minimal libxml2 library
49dnl
50AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
51if test "$with_minimum" = "yes"
52then
53 echo "Configuring for a minimal library"
54fi
55
Daniel Veillard71b656e2000-01-05 14:46:17 +000056dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000057_cppflags="${CPPFLAGS}"
58_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000059
Daniel Veillard259ff742001-10-06 13:49:59 +000060
Owen Taylor3473f882001-02-23 17:55:21 +000061AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +000062[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +000063 if test "$withval" != "no" -a "$withval" != "yes"; then
64 Z_DIR=$withval
65 CPPFLAGS="${CPPFLAGS} -I$withval/include"
66 LDFLAGS="${LDFLAGS} -L$withval/lib"
67 fi
Daniel Veillard259ff742001-10-06 13:49:59 +000068])
Daniel Veillard4432df22003-09-28 18:58:27 +000069if test "$with_minimum" = "yes" -a "$with_zlib" = ""
70then
71 with_zlib=no
72fi
Daniel Veillard259ff742001-10-06 13:49:59 +000073if test "$with_zlib" = "no"; then
74 echo "Disabling compression support"
75else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000076 AC_CHECK_HEADERS(zlib.h,
77 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +000078 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000079 if test "x${Z_DIR}" != "x"; then
80 Z_CFLAGS="-I${Z_DIR}/include"
81 Z_LIBS="-L${Z_DIR}/lib -lz"
82 [case ${host} in
83 *-*-solaris*)
84 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
85 ;;
86 esac]
87 else
88 Z_LIBS="-lz"
89 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +000090fi
Owen Taylor3473f882001-02-23 17:55:21 +000091
Owen Taylor3473f882001-02-23 17:55:21 +000092AC_SUBST(Z_CFLAGS)
93AC_SUBST(Z_LIBS)
94
95CPPFLAGS=${_cppflags}
96LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000097
Daniel Veillard01791d51998-07-24 19:24:09 +000098dnl Checks for header files.
99AC_HEADER_DIRENT
100AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000101AC_CHECK_HEADERS([fcntl.h])
102AC_CHECK_HEADERS([unistd.h])
103AC_CHECK_HEADERS([ctype.h])
104AC_CHECK_HEADERS([dirent.h])
105AC_CHECK_HEADERS([errno.h])
106AC_CHECK_HEADERS([malloc.h])
107AC_CHECK_HEADERS([stdarg.h])
108AC_CHECK_HEADERS([sys/stat.h])
109AC_CHECK_HEADERS([sys/types.h])
110AC_CHECK_HEADERS([time.h])
111AC_CHECK_HEADERS([ansidecl.h])
112AC_CHECK_HEADERS([ieeefp.h])
113AC_CHECK_HEADERS([nan.h])
114AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000115AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000116AC_CHECK_HEADERS([fp_class.h])
117AC_CHECK_HEADERS([float.h])
118AC_CHECK_HEADERS([stdlib.h])
119AC_CHECK_HEADERS([sys/socket.h], [], [],
120[#if HAVE_SYS_TYPES_H
121# include <sys/types.h>
122# endif
123])
124AC_CHECK_HEADERS([netinet/in.h], [], [],
125[#if HAVE_SYS_TYPES_H
126# include <sys/types.h>
127# endif
128])
129AC_CHECK_HEADERS([arpa/inet.h], [], [],
130[#if HAVE_SYS_TYPES_H
131# include <sys/types.h>
132# endif
133#if HAVE_ARPA_INET_H
134# include <arpa/inet.h>
135# endif
136])
137AC_CHECK_HEADERS([netdb.h])
138AC_CHECK_HEADERS([sys/time.h])
139AC_CHECK_HEADERS([sys/select.h])
140AC_CHECK_HEADERS([sys/mman.h])
141AC_CHECK_HEADERS([sys/timeb.h])
142AC_CHECK_HEADERS([signal.h])
143AC_CHECK_HEADERS([arpa/nameser.h], [], [],
144[#if HAVE_SYS_TYPES_H
145# include <sys/types.h>
146# endif
147])
148AC_CHECK_HEADERS([resolv.h], [], [],
149[#if HAVE_SYS_TYPES_H
150# include <sys/types.h>
151# endif
152#if HAVE_NETINET_IN_H
153# include <netinet/in.h>
154# endif
155#if HAVE_ARPA_NAMESER_H
156# include <arpa/nameser.h>
157# endif
158])
Daniel Veillard01791d51998-07-24 19:24:09 +0000159
Daniel Veillard1164e751999-02-16 16:29:17 +0000160dnl Specific dir for HTML output ?
161if test "x$with_html_dir" = "x" ; then
Daniel Veillard0a6c3582001-03-14 19:15:37 +0000162 HTML_DIR='$(prefix)/doc'
Daniel Veillard1164e751999-02-16 16:29:17 +0000163else
164 HTML_DIR=$with_html_dir
165fi
166
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 Veillard38b80a82003-05-14 18:59:00 +0000329pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000330AC_ARG_WITH(python,
331[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000332if test "$with_minimum" = "yes" -a "$with_python" = ""
333then
334 with_python=no
335fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000336if test "$with_python" != "no" ; then
337 if test -x "$with_python/bin/python"
338 then
339 echo Found python in $with_python/bin/python
340 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000341 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000342 if test -x "$with_python"
343 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000344 echo Found python in $with_python
345 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000346 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000347 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000348 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000349 fi
350 if test "$PYTHON" != ""
351 then
352 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
353 echo Found Python version $PYTHON_VERSION
354 fi
355 if test "$PYTHON_VERSION" != ""
356 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000357 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
358 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000359 then
360 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000361 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000362 else
363 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
364 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000365 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000366 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000367 else
368 if test -r /usr/include/python$PYTHON_VERSION/Python.h
369 then
370 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000371 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000372 else
373 echo could not find python$PYTHON_VERSION/Python.h
374 fi
375 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000376 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000377 then
378 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
379 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000380 fi
381 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000382 if test "$with_python" != ""
383 then
384 pythondir='$(PYTHON_SITE_PACKAGES)'
385 else
386 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
387 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000388fi
389AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000390if test "$PYTHON_INCLUDES" != ""
391then
392 PYTHON_SUBDIR=python
393else
394 PYTHON_SUBDIR=
395fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000396AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000397AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000398
Daniel Veillard437b87b2000-01-03 17:30:46 +0000399dnl
400dnl Tester makes use of readline if present
401dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000402_cppflags="${CPPFLAGS}"
403_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000404
Daniel Veillard03109292000-08-14 14:58:22 +0000405AC_ARG_WITH(readline,
406[ --with-readline=DIR use readline in DIR],[
407 if test "$withval" != "no" -a "$withval" != "yes"; then
408 RDL_DIR=$withval
409 CPPFLAGS="${CPPFLAGS} -I$withval/include"
410 LDFLAGS="${LDFLAGS} -L$withval/lib"
411 fi
412])
Daniel Veillard4432df22003-09-28 18:58:27 +0000413if test "$with_minimum" = "yes" -a "$with_readline" = ""
414then
415 with_readline=no
416fi
Daniel Veillard03109292000-08-14 14:58:22 +0000417
Daniel Veillard361d8452000-04-03 19:48:13 +0000418dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000419dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000420dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000421dnl
William M. Brack871611b2003-10-18 04:53:14 +0000422if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000423 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
424 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmlnew" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000425 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000426 if test "$with_minimum" != "yes"
427 then
428 if test "${with_mem_debug}" = "" ; then
429 with_mem_debug="yes"
430 fi
431 if test "${with_docbook}" = "" ; then
432 with_docbook="yes"
433 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000434 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000435 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 +0000436 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000437dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000438else
439 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000440fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000441AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000442
443dnl
444dnl Check for trio string functions
445dnl
446
447if test "${NEED_TRIO}" = "1" ; then
448 echo Adding trio library for string functions
449 WITH_TRIO=1
450else
451 WITH_TRIO=0
452fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000453AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000454AC_SUBST(WITH_TRIO)
455
Daniel Veillardf6eea272001-01-18 12:17:12 +0000456dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000457dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000458dnl
459
Daniel Veillardb8478642001-10-12 17:29:10 +0000460THREAD_LIBS=""
461WITH_THREADS=0
462THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000463TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000464THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000465
William M. Brack97ad4c72003-05-13 08:08:36 +0000466AC_ARG_WITH(threads,
467[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000468if test "$with_minimum" = "yes" -a "$with_threads" = ""
469then
470 with_threads=no
471fi
Daniel Veillard84942712003-04-18 14:40:05 +0000472if test "$with_threads" = "no" ; then
473 echo Disabling multithreaded support
474else
Daniel Veillardb8478642001-10-12 17:29:10 +0000475 echo Enabling multithreaded support
476
477 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000478 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000479 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000480 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
481 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000482 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000483 case $host_os in
484 *mingw32*) WITH_THREADS="1"
485 THREADS_W32="Win32"
486 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
487 ;;
488 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000489 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000490 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
491 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000492 fi
493fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000494AC_ARG_WITH(thread-alloc,
495[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000496if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
497then
498 with_thread_alloc=no
499fi
Daniel Veillardab7488e2001-10-17 11:30:37 +0000500if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
501 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000502fi
503
Daniel Veillardb8478642001-10-12 17:29:10 +0000504AC_SUBST(THREAD_LIBS)
505AC_SUBST(WITH_THREADS)
506AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000507AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000508AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000509
William M. Brack97ad4c72003-05-13 08:08:36 +0000510AC_ARG_WITH(history,
511[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000512if test "$with_minimum" = "yes" -a "$with_history" = ""
513then
514 with_history=no
515fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000516if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000517 echo Enabling xmllint shell history
518 dnl check for terminal library. this is a very cool solution
519 dnl from octave's configure.in
520 unset tcap
521 for termlib in ncurses curses termcap terminfo termlib; do
522 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
523 test -n "$tcap" && break
524 done
525
526 AC_CHECK_HEADER(readline/history.h,
527 AC_CHECK_LIB(history, append_history,[
528 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000529 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000530 AC_CHECK_HEADER(readline/readline.h,
531 AC_CHECK_LIB(readline, readline,[
532 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000533 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000534 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
535 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
536 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
537 else
538 CPPFLAGS=${_cppflags}
539 fi
540 LDFLAGS=${_ldflags}
541fi
542
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000543AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000544[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000545if test "$with_minimum" = "yes" -a "$with_output" = ""
546then
547 with_output=no
548fi
549if test "$with_output" = "no" ; then
550 echo Disabling serialization/saving support
551 WITH_OUTPUT=0
552else
553 WITH_OUTPUT=1
554fi
555AC_SUBST(WITH_OUTPUT)
556
Daniel Veillard652327a2003-09-29 18:02:38 +0000557AC_ARG_WITH(tree,
558[ --with-tree add the DOM like tree manipulation APIs (on)])
559if test "$with_minimum" = "yes" -a "$with_tree" = ""
560then
561 with_tree=no
562fi
563if test "$with_tree" = "no" ; then
564 echo Disabling DOM like tree manipulation APIs
565 WITH_TREE=0
566else
567 WITH_TREE=1
568fi
569AC_SUBST(WITH_TREE)
570
William M. Brack97ad4c72003-05-13 08:08:36 +0000571AC_ARG_WITH(ftp,
572[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000573if test "$with_minimum" = "yes" -a "$with_ftp" = ""
574then
575 with_ftp=no
576fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000577if test "$with_ftp" = "no" ; then
578 echo Disabling FTP support
579 WITH_FTP=0
580 FTP_OBJ=
581else
582 WITH_FTP=1
583 FTP_OBJ=nanoftp.o
584fi
585AC_SUBST(WITH_FTP)
586AC_SUBST(FTP_OBJ)
587
William M. Brack97ad4c72003-05-13 08:08:36 +0000588AC_ARG_WITH(http,
589[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000590if test "$with_minimum" = "yes" -a "$with_http" = ""
591then
592 with_http=no
593fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000594if test "$with_http" = "no" ; then
595 echo Disabling HTTP support
596 WITH_HTTP=0
597 HTTP_OBJ=
598else
599 WITH_HTTP=1
600 HTTP_OBJ=nanohttp.o
601fi
602AC_SUBST(WITH_HTTP)
603AC_SUBST(HTTP_OBJ)
604
Daniel Veillard4432df22003-09-28 18:58:27 +0000605AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000606[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000607if test "$with_minimum" = "yes" -a "$with_legacy" = ""
608then
609 with_legacy=no
610fi
611if test "$with_legacy" = "no" ; then
612 echo Disabling deprecated APIs
613 WITH_LEGACY=0
614else
615 WITH_LEGACY=1
616fi
617AC_SUBST(WITH_LEGACY)
618
Daniel Veillard81273902003-09-30 00:43:48 +0000619AC_ARG_WITH(reader,
620[ --with-reader add the xmlReader parsing interface (on)])
621if test "$with_minimum" = "yes" -a "$with_reader" = ""
622then
623 with_reader=no
624fi
625if test "$with_reader" = "no" ; then
626 echo Disabling the xmlReader parsing interface
627 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000628 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000629else
630 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000631 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000632fi
633AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000634AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000635
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000636AC_ARG_WITH(pattern,
637[ --with-pattern add the xmlPattern selection interface (on)])
638if test "$with_minimum" = "yes" -a "$with_pattern" = ""
639then
640 with_pattern=no
641fi
642if test "$with_pattern" = "no" ; then
643 echo Disabling the xmlPattern parsing interface
644 WITH_PATTERN=0
645 PATTERN_TEST=
646else
647 WITH_PATTERN=1
648 PATTERN_TEST=Patterntests
649fi
650AC_SUBST(WITH_PATTERN)
651AC_SUBST(PATTERN_TEST)
652
Daniel Veillard1d211e22003-10-20 22:32:39 +0000653AC_ARG_WITH(writer,
654[ --with-writer add the xmlWriter saving interface (on)])
655if test "$with_minimum" = "yes" -a "$with_writer" = ""
656then
657 with_writer=no
658fi
659if test "$with_writer" = "no" ; then
660 echo Disabling the xmlWriter saving interface
661 WITH_WRITER=0
662# WRITER_TEST=
663else
664 WITH_WRITER=1
665# WRITER_TEST=Writertests
666fi
667AC_SUBST(WITH_WRITER)
668#AC_SUBST(WRITER_TEST)
669
Daniel Veillard81273902003-09-30 00:43:48 +0000670AC_ARG_WITH(sax1,
671[ --with-sax1 add the older SAX1 interface (on)])
672if test "$with_minimum" = "yes" -a "$with_sax1" = ""
673then
674 with_sax1=no
675fi
676if test "$with_sax1" = "no" ; then
677 echo Disabling the older SAX1 interface
678 WITH_SAX1=0
679 TEST_SAX=
680else
681 WITH_SAX1=1
682 TEST_SAX=SAXtests
683fi
684AC_SUBST(WITH_SAX1)
685AC_SUBST(TEST_SAX)
686
Daniel Veillard73b013f2003-09-30 12:36:01 +0000687AC_ARG_WITH(push,
688[ --with-push add the PUSH parser interfaces (on)])
689if test "$with_minimum" = "yes" -a "$with_push" = ""
690then
691 with_push=no
692fi
693if test "$with_push" = "no" ; then
694 echo Disabling the PUSH parser interfaces
695 WITH_PUSH=0
696 TEST_PUSH=
697else
698 WITH_PUSH=1
699 TEST_PUSH="XMLPushtests"
700fi
701AC_SUBST(WITH_PUSH)
702AC_SUBST(TEST_PUSH)
703
704AC_ARG_WITH(html,
705[ --with-html add the HTML support (on)])
706if test "$with_minimum" = "yes" -a "$with_html" = ""
707then
708 with_html=no
709fi
710if test "$with_html" = "no" ; then
711 echo Disabling HTML support
712 WITH_HTML=0
713 HTML_OBJ=
714 TEST_HTML=
715else
716 WITH_HTML=1
717 HTML_OBJ="HTMLparser.o HTMLtree.o"
718 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000719 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000720 TEST_PHTML=HTMLPushtests
721 else
722 TEST_PHTML=
723 fi
724fi
725AC_SUBST(WITH_HTML)
726AC_SUBST(HTML_OBJ)
727AC_SUBST(TEST_HTML)
728AC_SUBST(TEST_PHTML)
729
Daniel Veillard4432df22003-09-28 18:58:27 +0000730AC_ARG_WITH(valid,
731[ --with-valid add the DTD validation support (on)])
732if test "$with_minimum" = "yes" -a "$with_valid" = ""
733then
734 with_valid=no
735fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000736if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000737 echo Disabling DTD validation support
738 WITH_VALID=0
739 TEST_VALID=
740 TEST_VTIME=
741else
742 WITH_VALID=1
743 TEST_VALID=Validtests
744 TEST_VTIME=VTimingtests
745fi
746AC_SUBST(WITH_VALID)
747AC_SUBST(TEST_VALID)
748AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000749
William M. Brack97ad4c72003-05-13 08:08:36 +0000750AC_ARG_WITH(catalog,
751[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000752if test "$with_minimum" = "yes" -a "$with_catalog" = ""
753then
754 with_catalog=no
755fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000756if test "$with_catalog" = "no" ; then
757 echo Disabling Catalog support
758 WITH_CATALOG=0
759 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000760 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000761else
762 WITH_CATALOG=1
763 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000764 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000765fi
766AC_SUBST(WITH_CATALOG)
767AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000768AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000769
William M. Brack97ad4c72003-05-13 08:08:36 +0000770AC_ARG_WITH(docbook,
771[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000772if test "$with_minimum" = "yes" -a "$with_docbook" = ""
773then
774 with_docbook=no
775fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000776if test "$with_docbook" = "no" ; then
777 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000778 WITH_DOCB=0
779 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000780else
781 WITH_DOCB=1
782 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000783fi
784AC_SUBST(WITH_DOCB)
785AC_SUBST(DOCB_OBJ)
786
787
William M. Brack97ad4c72003-05-13 08:08:36 +0000788AC_ARG_WITH(xpath,
789[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000790if test "$with_minimum" = "yes" -a "$with_xpath" = ""
791then
792 with_xpath=no
793fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000794if test "$with_xpath" = "no" ; then
795 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000796 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000797 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000798 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000799 WITH_XPATH=0
800 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000801 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000802else
803 WITH_XPATH=1
804 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000805 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000806fi
807AC_SUBST(WITH_XPATH)
808AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000809AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000810
William M. Brack97ad4c72003-05-13 08:08:36 +0000811AC_ARG_WITH(xptr,
812[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000813if test "$with_minimum" = "yes" -a "$with_xptr" = ""
814then
815 with_xptr=no
816fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000817if test "$with_xptr" = "no" ; then
818 echo Disabling XPointer support
819 WITH_XPTR=0
820 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000821 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000822else
823 WITH_XPTR=1
824 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000825 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000826fi
827AC_SUBST(WITH_XPTR)
828AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000829AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000830
William M. Brack97ad4c72003-05-13 08:08:36 +0000831AC_ARG_WITH(c14n,
832[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000833if test "$with_minimum" = "yes" -a "$with_c14n" = ""
834then
835 with_c14n=no
836fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000837if test "$with_c14n" = "no" ; then
838 echo Disabling C14N support
839 WITH_C14N=0
840 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000841 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000842else
843 WITH_C14N=1
844 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000845 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000846fi
847AC_SUBST(WITH_C14N)
848AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000849AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000850
William M. Brack97ad4c72003-05-13 08:08:36 +0000851AC_ARG_WITH(xinclude,
852[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000853if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
854then
855 with_xinclude=no
856fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000857if test "$with_xinclude" = "no" ; then
858 echo Disabling XInclude support
859 WITH_XINCLUDE=0
860 XINCLUDE_OBJ=
861 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000862 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000863else
864 WITH_XINCLUDE=1
865 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000866 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000867fi
868AC_SUBST(WITH_XINCLUDE)
869AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000870AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000871
Daniel Veillard6e90d192001-07-03 16:37:49 +0000872WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000873AC_ARG_WITH(iconv,
874[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000875if test "$with_minimum" = "yes" -a "$with_iconv" = ""
876then
877 with_iconv=no
878fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000879if test "$with_iconv" = "no" ; then
880 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000881else
Daniel Veillard220346d2001-12-07 11:33:54 +0000882 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000883 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000884 # Export this since our headers include iconv.h
885 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000886 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000887 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000888
889 AC_CHECK_HEADER(iconv.h,
890 AC_MSG_CHECKING(for iconv)
891 AC_TRY_LINK([#include <stdlib.h>
892#include <iconv.h>],[
893iconv_t cd = iconv_open ("","");
894iconv (cd, NULL, NULL, NULL, NULL);],[
895 AC_MSG_RESULT(yes)
896 WITH_ICONV=1],[
897 AC_MSG_RESULT(no)
898 AC_MSG_CHECKING(for iconv in -liconv)
899
900 _ldflags="${LDFLAGS}"
901 _libs="${LIBS}"
902 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
903 LIBS="${LIBS} -liconv"
904
905 AC_TRY_LINK([#include <stdlib.h>
906#include <iconv.h>],[
907iconv_t cd = iconv_open ("","");
908iconv (cd, NULL, NULL, NULL, NULL);],[
909 AC_MSG_RESULT(yes)
910 WITH_ICONV=1
911 ICONV_LIBS="${ICONV_LIBS} -liconv"
912 LIBS="${_libs}"
913 LDFLAGS="${_ldflags}"],[
914 AC_MSG_RESULT(no)
915 LIBS="${_libs}"
916 LDFLAGS="${_ldflags}"])]))
917fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000918case "$host" in
919 *mingw*) M_LIBS=""
920 ;;
921 *) M_LIBS="-lm"
922 ;;
923esac
Daniel Veillardb82c1662001-12-09 14:00:54 +0000924XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000925XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000926AC_SUBST(WITH_ICONV)
927
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000928WITH_ISO8859X=1
929AC_ARG_WITH(iso8859x,
930[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000931if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
932then
933 with_iso8859x=no
934fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000935if test "$WITH_ICONV" != "1" ; then
936if test "$with_iso8859x" = "no" ; then
937 echo Disabling ISO8859X support
938 WITH_ISO8859X=0
939fi
940fi
941AC_SUBST(WITH_ISO8859X)
942
William M. Brack97ad4c72003-05-13 08:08:36 +0000943AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000944[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000945if test "$with_minimum" = "yes" -a "$with_schemas" = ""
946then
947 with_schemas=no
948fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000949if test "$with_schemas" = "no" ; then
950 echo "Disabled Schemas/Relax-NG support"
951 WITH_SCHEMAS=0
952 TEST_SCHEMAS=
953else
Daniel Veillard71531f32003-02-05 13:19:53 +0000954 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000955 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000956 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard23e73572002-09-19 19:56:43 +0000957 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000958fi
959AC_SUBST(WITH_SCHEMAS)
960AC_SUBST(TEST_SCHEMAS)
961
William M. Brack97ad4c72003-05-13 08:08:36 +0000962AC_ARG_WITH(regexps,
963[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000964if test "$with_minimum" = "yes" -a "$with_regexps" = ""
965then
966 with_regexps=no
967fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000968if test "$with_regexps" = "no" ; then
969 echo Disabling Regexps support
970 WITH_REGEXPS=0
971 TEST_REGEXPS=
972else
973 WITH_REGEXPS=1
974 TEST_REGEXPS="Regexptests Automatatests"
975fi
976AC_SUBST(WITH_REGEXPS)
977AC_SUBST(TEST_REGEXPS)
978
William M. Brack97ad4c72003-05-13 08:08:36 +0000979AC_ARG_WITH(debug,
980[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000981if test "$with_minimum" = "yes" -a "$with_debug" = ""
982then
983 with_debug=no
984fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000985if test "$with_debug" = "no" ; then
986 echo Disabling DEBUG support
987 WITH_DEBUG=0
988 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000989 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000990else
991 WITH_DEBUG=1
992 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000993 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +0000994fi
995AC_SUBST(WITH_DEBUG)
996AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000997AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +0000998
William M. Brack97ad4c72003-05-13 08:08:36 +0000999AC_ARG_WITH(mem_debug,
1000[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +00001001if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
1002then
1003 with_mem_debug=no
1004fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001005if test "$with_mem_debug" = "yes" ; then
1006 echo Enabling memory debug support
1007 WITH_MEM_DEBUG=1
1008else
1009 WITH_MEM_DEBUG=0
1010fi
1011AC_SUBST(WITH_MEM_DEBUG)
1012
Daniel Veillard1638a472003-08-14 01:23:25 +00001013
1014WIN32_EXTRA_LIBADD=
1015WIN32_EXTRA_LDFLAGS=
1016case "$host" in
1017 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001018 CPPFLAGS="$CPPFLAGS -DWIN32"
1019 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001020 WIN32_EXTRA_LDFLAGS="-no-undefined"
1021 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1022 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1023 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1024 ;;
1025esac
1026AC_SUBST(WIN32_EXTRA_LIBADD)
1027AC_SUBST(WIN32_EXTRA_LDFLAGS)
1028
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001029AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001030AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001031AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001032
Daniel Veillardb05deb71999-08-10 19:04:08 +00001033AC_SUBST(XML_LIBDIR)
1034AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001035AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001036AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001037AC_SUBST(XML_INCLUDEDIR)
1038AC_SUBST(HTML_DIR)
1039AC_SUBST(HAVE_ISNAN)
1040AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001041AC_SUBST(PYTHON)
1042AC_SUBST(PYTHON_VERSION)
1043AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001044AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001045
Daniel Veillardb05deb71999-08-10 19:04:08 +00001046AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001047AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001048
Daniel Veillard9715c172002-11-25 16:33:40 +00001049dnl for the spec file
1050RELDATE=`date +'%a %b %e %Y'`
1051AC_SUBST(RELDATE)
1052
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001053rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001054ln -s Copyright COPYING
1055
Daniel Veillarde4177a52004-01-08 16:43:57 +00001056# keep on one line for cygwin c.f. #130896
1057AC_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 xml2Conf.sh python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001058
Daniel Veillard9b731d72002-04-14 12:56:08 +00001059chmod +x xml2-config xml2Conf.sh python/setup.py