blob: a3d1f579bd2c8f946ca8cbbe0124bb143b451d13 [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 Veillarde6e59cd2003-12-24 11:56:44 +00009LIBXML_MICRO_VERSION=4
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],[
208 AC_MSG_WARN(could not determine)])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000209AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000210
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000211dnl ***********************Checking for availability of IPv6*******************
212
213AC_MSG_CHECKING([whether to enable IPv6])
214AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000215if test "$with_minimum" = "yes"
216then
217 enable_ipv6=no
218fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000219if test $enable_ipv6 = yes; then
220 have_ipv6=no
221 AC_TRY_COMPILE([
222 #include <sys/socket.h>
223 #include <sys/types.h>], [
224 struct sockaddr_storage ss;
225 socket(AF_INET6, SOCK_STREAM, 0)
226 ],
227 have_ipv6=yes,
228 have_ipv6=no
229 )
230 AC_MSG_RESULT($have_ipv6)
231
William M. Brack476cd962003-08-13 11:09:42 +0000232 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000233 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000234
235 have_getaddrinfo=no
236 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
237 if test $have_getaddrinfo != yes; then
238 for lib in bsd socket inet; do
239 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
240 done
241 fi
242
William M. Brack476cd962003-08-13 11:09:42 +0000243 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000244 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000245 fi
246 fi
247fi
248
249dnl ******************************End IPv6 checks******************************
250
Daniel Veillardb05deb71999-08-10 19:04:08 +0000251dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000252AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000253 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000254
Daniel Veillardc790bf42003-10-11 10:50:10 +0000255AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
256 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000257
258XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000259XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000260
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000261dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000262dnl Extra flags
263dnl
264XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000265RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000266
Daniel Veillardd94849b2003-07-28 13:02:24 +0000267AC_ARG_WITH(fexceptions,
268[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000269if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
270then
271 with_fexceptions=no
272fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000273dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000274dnl Workaround for native compilers
275dnl HP : http://bugs.gnome.org/db/31/3163.html
276dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000277dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000278if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000279 case "${host}" in
280 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000281 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000282 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000283 *-dec-osf* )
284 CFLAGS="${CFLAGS} -ieee"
285 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000286 alpha*-*-linux* )
287 CFLAGS="${CFLAGS} -ieee"
288 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000289 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000290else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000291 if test "$with_fexceptions" = "yes"
292 then
293 #
294 # Not activated by default because this inflates the code size
295 # Used to allow propagation of C++ exceptions through the library
296 #
297 CFLAGS="${CFLAGS} -fexceptions"
298 fi
299
Daniel Veillardd574f782001-03-14 19:40:17 +0000300 CFLAGS="${CFLAGS} -Wall"
Daniel Veillard14839d52001-06-06 16:11:56 +0000301 case "${host}" in
302 alpha*-*-linux* )
303 CFLAGS="${CFLAGS} -mieee"
304 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000305 alpha*-*-osf* )
306 CFLAGS="${CFLAGS} -mieee"
307 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000308 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000309fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000310case ${host} in
311 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000312 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
313 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000314 hppa*-hp-mpeix)
315 NEED_TRIO=1
316 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000317esac
318
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000319
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000320dnl
321dnl check for python
322dnl
323
324PYTHON=
325PYTHON_VERSION=
326PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000327PYTHON_SITE_PACKAGES=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000328pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000329AC_ARG_WITH(python,
330[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000331if test "$with_minimum" = "yes" -a "$with_python" = ""
332then
333 with_python=no
334fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000335if test "$with_python" != "no" ; then
336 if test -x "$with_python/bin/python"
337 then
338 echo Found python in $with_python/bin/python
339 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000340 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000341 if test -x "$with_python"
342 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000343 echo Found python in $with_python
344 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000345 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000346 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000347 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000348 fi
349 if test "$PYTHON" != ""
350 then
351 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
352 echo Found Python version $PYTHON_VERSION
353 fi
354 if test "$PYTHON_VERSION" != ""
355 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000356 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
357 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000358 then
359 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000360 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000361 else
362 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
363 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000364 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000365 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000366 else
367 if test -r /usr/include/python$PYTHON_VERSION/Python.h
368 then
369 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000370 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000371 else
372 echo could not find python$PYTHON_VERSION/Python.h
373 fi
374 fi
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000375 if ! test -d "$PYTHON_SITE_PACKAGES"
376 then
377 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
378 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000379 fi
380 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000381 if test "$with_python" != ""
382 then
383 pythondir='$(PYTHON_SITE_PACKAGES)'
384 else
385 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
386 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000387fi
388AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000389if test "$PYTHON_INCLUDES" != ""
390then
391 PYTHON_SUBDIR=python
392else
393 PYTHON_SUBDIR=
394fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000395AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000396AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000397
Daniel Veillard437b87b2000-01-03 17:30:46 +0000398dnl
399dnl Tester makes use of readline if present
400dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000401_cppflags="${CPPFLAGS}"
402_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000403
Daniel Veillard03109292000-08-14 14:58:22 +0000404AC_ARG_WITH(readline,
405[ --with-readline=DIR use readline in DIR],[
406 if test "$withval" != "no" -a "$withval" != "yes"; then
407 RDL_DIR=$withval
408 CPPFLAGS="${CPPFLAGS} -I$withval/include"
409 LDFLAGS="${LDFLAGS} -L$withval/lib"
410 fi
411])
Daniel Veillard4432df22003-09-28 18:58:27 +0000412if test "$with_minimum" = "yes" -a "$with_readline" = ""
413then
414 with_readline=no
415fi
Daniel Veillard03109292000-08-14 14:58:22 +0000416
Daniel Veillard361d8452000-04-03 19:48:13 +0000417dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000418dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000419dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000420dnl
William M. Brack871611b2003-10-18 04:53:14 +0000421if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000422 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
423 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmlnew" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000424 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000425 if test "$with_minimum" != "yes"
426 then
427 if test "${with_mem_debug}" = "" ; then
428 with_mem_debug="yes"
429 fi
430 if test "${with_docbook}" = "" ; then
431 with_docbook="yes"
432 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000433 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000434 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 +0000435 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000436dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000437else
438 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000439fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000440AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000441
442dnl
443dnl Check for trio string functions
444dnl
445
446if test "${NEED_TRIO}" = "1" ; then
447 echo Adding trio library for string functions
448 WITH_TRIO=1
449else
450 WITH_TRIO=0
451fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000452AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000453AC_SUBST(WITH_TRIO)
454
Daniel Veillardf6eea272001-01-18 12:17:12 +0000455dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000456dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000457dnl
458
Daniel Veillardb8478642001-10-12 17:29:10 +0000459THREAD_LIBS=""
460WITH_THREADS=0
461THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000462TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000463THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000464
William M. Brack97ad4c72003-05-13 08:08:36 +0000465AC_ARG_WITH(threads,
466[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000467if test "$with_minimum" = "yes" -a "$with_threads" = ""
468then
469 with_threads=no
470fi
Daniel Veillard84942712003-04-18 14:40:05 +0000471if test "$with_threads" = "no" ; then
472 echo Disabling multithreaded support
473else
Daniel Veillardb8478642001-10-12 17:29:10 +0000474 echo Enabling multithreaded support
475
476 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000477 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000478 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000479 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
480 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000481 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000482 case $host_os in
483 *mingw32*) WITH_THREADS="1"
484 THREADS_W32="Win32"
485 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
486 ;;
487 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000488 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000489 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
490 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000491 fi
492fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000493AC_ARG_WITH(thread-alloc,
494[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000495if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
496then
497 with_thread_alloc=no
498fi
Daniel Veillardab7488e2001-10-17 11:30:37 +0000499if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
500 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000501fi
502
Daniel Veillardb8478642001-10-12 17:29:10 +0000503AC_SUBST(THREAD_LIBS)
504AC_SUBST(WITH_THREADS)
505AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000506AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000507AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000508
William M. Brack97ad4c72003-05-13 08:08:36 +0000509AC_ARG_WITH(history,
510[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000511if test "$with_minimum" = "yes" -a "$with_history" = ""
512then
513 with_history=no
514fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000515if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000516 echo Enabling xmllint shell history
517 dnl check for terminal library. this is a very cool solution
518 dnl from octave's configure.in
519 unset tcap
520 for termlib in ncurses curses termcap terminfo termlib; do
521 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
522 test -n "$tcap" && break
523 done
524
525 AC_CHECK_HEADER(readline/history.h,
526 AC_CHECK_LIB(history, append_history,[
527 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000528 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000529 AC_CHECK_HEADER(readline/readline.h,
530 AC_CHECK_LIB(readline, readline,[
531 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000532 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000533 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
534 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
535 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
536 else
537 CPPFLAGS=${_cppflags}
538 fi
539 LDFLAGS=${_ldflags}
540fi
541
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000542AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000543[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000544if test "$with_minimum" = "yes" -a "$with_output" = ""
545then
546 with_output=no
547fi
548if test "$with_output" = "no" ; then
549 echo Disabling serialization/saving support
550 WITH_OUTPUT=0
551else
552 WITH_OUTPUT=1
553fi
554AC_SUBST(WITH_OUTPUT)
555
Daniel Veillard652327a2003-09-29 18:02:38 +0000556AC_ARG_WITH(tree,
557[ --with-tree add the DOM like tree manipulation APIs (on)])
558if test "$with_minimum" = "yes" -a "$with_tree" = ""
559then
560 with_tree=no
561fi
562if test "$with_tree" = "no" ; then
563 echo Disabling DOM like tree manipulation APIs
564 WITH_TREE=0
565else
566 WITH_TREE=1
567fi
568AC_SUBST(WITH_TREE)
569
William M. Brack97ad4c72003-05-13 08:08:36 +0000570AC_ARG_WITH(ftp,
571[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000572if test "$with_minimum" = "yes" -a "$with_ftp" = ""
573then
574 with_ftp=no
575fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000576if test "$with_ftp" = "no" ; then
577 echo Disabling FTP support
578 WITH_FTP=0
579 FTP_OBJ=
580else
581 WITH_FTP=1
582 FTP_OBJ=nanoftp.o
583fi
584AC_SUBST(WITH_FTP)
585AC_SUBST(FTP_OBJ)
586
William M. Brack97ad4c72003-05-13 08:08:36 +0000587AC_ARG_WITH(http,
588[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000589if test "$with_minimum" = "yes" -a "$with_http" = ""
590then
591 with_http=no
592fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000593if test "$with_http" = "no" ; then
594 echo Disabling HTTP support
595 WITH_HTTP=0
596 HTTP_OBJ=
597else
598 WITH_HTTP=1
599 HTTP_OBJ=nanohttp.o
600fi
601AC_SUBST(WITH_HTTP)
602AC_SUBST(HTTP_OBJ)
603
Daniel Veillard4432df22003-09-28 18:58:27 +0000604AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000605[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000606if test "$with_minimum" = "yes" -a "$with_legacy" = ""
607then
608 with_legacy=no
609fi
610if test "$with_legacy" = "no" ; then
611 echo Disabling deprecated APIs
612 WITH_LEGACY=0
613else
614 WITH_LEGACY=1
615fi
616AC_SUBST(WITH_LEGACY)
617
Daniel Veillard81273902003-09-30 00:43:48 +0000618AC_ARG_WITH(reader,
619[ --with-reader add the xmlReader parsing interface (on)])
620if test "$with_minimum" = "yes" -a "$with_reader" = ""
621then
622 with_reader=no
623fi
624if test "$with_reader" = "no" ; then
625 echo Disabling the xmlReader parsing interface
626 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000627 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000628else
629 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000630 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000631fi
632AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000633AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000634
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000635AC_ARG_WITH(pattern,
636[ --with-pattern add the xmlPattern selection interface (on)])
637if test "$with_minimum" = "yes" -a "$with_pattern" = ""
638then
639 with_pattern=no
640fi
641if test "$with_pattern" = "no" ; then
642 echo Disabling the xmlPattern parsing interface
643 WITH_PATTERN=0
644 PATTERN_TEST=
645else
646 WITH_PATTERN=1
647 PATTERN_TEST=Patterntests
648fi
649AC_SUBST(WITH_PATTERN)
650AC_SUBST(PATTERN_TEST)
651
Daniel Veillard1d211e22003-10-20 22:32:39 +0000652AC_ARG_WITH(writer,
653[ --with-writer add the xmlWriter saving interface (on)])
654if test "$with_minimum" = "yes" -a "$with_writer" = ""
655then
656 with_writer=no
657fi
658if test "$with_writer" = "no" ; then
659 echo Disabling the xmlWriter saving interface
660 WITH_WRITER=0
661# WRITER_TEST=
662else
663 WITH_WRITER=1
664# WRITER_TEST=Writertests
665fi
666AC_SUBST(WITH_WRITER)
667#AC_SUBST(WRITER_TEST)
668
Daniel Veillard81273902003-09-30 00:43:48 +0000669AC_ARG_WITH(sax1,
670[ --with-sax1 add the older SAX1 interface (on)])
671if test "$with_minimum" = "yes" -a "$with_sax1" = ""
672then
673 with_sax1=no
674fi
675if test "$with_sax1" = "no" ; then
676 echo Disabling the older SAX1 interface
677 WITH_SAX1=0
678 TEST_SAX=
679else
680 WITH_SAX1=1
681 TEST_SAX=SAXtests
682fi
683AC_SUBST(WITH_SAX1)
684AC_SUBST(TEST_SAX)
685
Daniel Veillard73b013f2003-09-30 12:36:01 +0000686AC_ARG_WITH(push,
687[ --with-push add the PUSH parser interfaces (on)])
688if test "$with_minimum" = "yes" -a "$with_push" = ""
689then
690 with_push=no
691fi
692if test "$with_push" = "no" ; then
693 echo Disabling the PUSH parser interfaces
694 WITH_PUSH=0
695 TEST_PUSH=
696else
697 WITH_PUSH=1
698 TEST_PUSH="XMLPushtests"
699fi
700AC_SUBST(WITH_PUSH)
701AC_SUBST(TEST_PUSH)
702
703AC_ARG_WITH(html,
704[ --with-html add the HTML support (on)])
705if test "$with_minimum" = "yes" -a "$with_html" = ""
706then
707 with_html=no
708fi
709if test "$with_html" = "no" ; then
710 echo Disabling HTML support
711 WITH_HTML=0
712 HTML_OBJ=
713 TEST_HTML=
714else
715 WITH_HTML=1
716 HTML_OBJ="HTMLparser.o HTMLtree.o"
717 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000718 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000719 TEST_PHTML=HTMLPushtests
720 else
721 TEST_PHTML=
722 fi
723fi
724AC_SUBST(WITH_HTML)
725AC_SUBST(HTML_OBJ)
726AC_SUBST(TEST_HTML)
727AC_SUBST(TEST_PHTML)
728
Daniel Veillard4432df22003-09-28 18:58:27 +0000729AC_ARG_WITH(valid,
730[ --with-valid add the DTD validation support (on)])
731if test "$with_minimum" = "yes" -a "$with_valid" = ""
732then
733 with_valid=no
734fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000735if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000736 echo Disabling DTD validation support
737 WITH_VALID=0
738 TEST_VALID=
739 TEST_VTIME=
740else
741 WITH_VALID=1
742 TEST_VALID=Validtests
743 TEST_VTIME=VTimingtests
744fi
745AC_SUBST(WITH_VALID)
746AC_SUBST(TEST_VALID)
747AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000748
William M. Brack97ad4c72003-05-13 08:08:36 +0000749AC_ARG_WITH(catalog,
750[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000751if test "$with_minimum" = "yes" -a "$with_catalog" = ""
752then
753 with_catalog=no
754fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000755if test "$with_catalog" = "no" ; then
756 echo Disabling Catalog support
757 WITH_CATALOG=0
758 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000759 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000760else
761 WITH_CATALOG=1
762 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000763 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000764fi
765AC_SUBST(WITH_CATALOG)
766AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000767AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000768
William M. Brack97ad4c72003-05-13 08:08:36 +0000769AC_ARG_WITH(docbook,
770[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000771if test "$with_minimum" = "yes" -a "$with_docbook" = ""
772then
773 with_docbook=no
774fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000775if test "$with_docbook" = "no" ; then
776 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000777 WITH_DOCB=0
778 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000779else
780 WITH_DOCB=1
781 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000782fi
783AC_SUBST(WITH_DOCB)
784AC_SUBST(DOCB_OBJ)
785
786
William M. Brack97ad4c72003-05-13 08:08:36 +0000787AC_ARG_WITH(xpath,
788[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000789if test "$with_minimum" = "yes" -a "$with_xpath" = ""
790then
791 with_xpath=no
792fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000793if test "$with_xpath" = "no" ; then
794 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000795 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000796 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000797 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000798 WITH_XPATH=0
799 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000800 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000801else
802 WITH_XPATH=1
803 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000804 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000805fi
806AC_SUBST(WITH_XPATH)
807AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000808AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000809
William M. Brack97ad4c72003-05-13 08:08:36 +0000810AC_ARG_WITH(xptr,
811[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000812if test "$with_minimum" = "yes" -a "$with_xptr" = ""
813then
814 with_xptr=no
815fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000816if test "$with_xptr" = "no" ; then
817 echo Disabling XPointer support
818 WITH_XPTR=0
819 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000820 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000821else
822 WITH_XPTR=1
823 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000824 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000825fi
826AC_SUBST(WITH_XPTR)
827AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000828AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000829
William M. Brack97ad4c72003-05-13 08:08:36 +0000830AC_ARG_WITH(c14n,
831[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000832if test "$with_minimum" = "yes" -a "$with_c14n" = ""
833then
834 with_c14n=no
835fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000836if test "$with_c14n" = "no" ; then
837 echo Disabling C14N support
838 WITH_C14N=0
839 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000840 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000841else
842 WITH_C14N=1
843 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000844 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000845fi
846AC_SUBST(WITH_C14N)
847AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000848AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000849
William M. Brack97ad4c72003-05-13 08:08:36 +0000850AC_ARG_WITH(xinclude,
851[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000852if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
853then
854 with_xinclude=no
855fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000856if test "$with_xinclude" = "no" ; then
857 echo Disabling XInclude support
858 WITH_XINCLUDE=0
859 XINCLUDE_OBJ=
860 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000861 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000862else
863 WITH_XINCLUDE=1
864 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000865 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000866fi
867AC_SUBST(WITH_XINCLUDE)
868AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000869AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000870
Daniel Veillard6e90d192001-07-03 16:37:49 +0000871WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000872AC_ARG_WITH(iconv,
873[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000874if test "$with_minimum" = "yes" -a "$with_iconv" = ""
875then
876 with_iconv=no
877fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000878if test "$with_iconv" = "no" ; then
879 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000880else
Daniel Veillard220346d2001-12-07 11:33:54 +0000881 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000882 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000883 # Export this since our headers include iconv.h
884 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000885 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000886 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000887
888 AC_CHECK_HEADER(iconv.h,
889 AC_MSG_CHECKING(for iconv)
890 AC_TRY_LINK([#include <stdlib.h>
891#include <iconv.h>],[
892iconv_t cd = iconv_open ("","");
893iconv (cd, NULL, NULL, NULL, NULL);],[
894 AC_MSG_RESULT(yes)
895 WITH_ICONV=1],[
896 AC_MSG_RESULT(no)
897 AC_MSG_CHECKING(for iconv in -liconv)
898
899 _ldflags="${LDFLAGS}"
900 _libs="${LIBS}"
901 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
902 LIBS="${LIBS} -liconv"
903
904 AC_TRY_LINK([#include <stdlib.h>
905#include <iconv.h>],[
906iconv_t cd = iconv_open ("","");
907iconv (cd, NULL, NULL, NULL, NULL);],[
908 AC_MSG_RESULT(yes)
909 WITH_ICONV=1
910 ICONV_LIBS="${ICONV_LIBS} -liconv"
911 LIBS="${_libs}"
912 LDFLAGS="${_ldflags}"],[
913 AC_MSG_RESULT(no)
914 LIBS="${_libs}"
915 LDFLAGS="${_ldflags}"])]))
916fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000917case "$host" in
918 *mingw*) M_LIBS=""
919 ;;
920 *) M_LIBS="-lm"
921 ;;
922esac
Daniel Veillardb82c1662001-12-09 14:00:54 +0000923XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000924XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000925AC_SUBST(WITH_ICONV)
926
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000927WITH_ISO8859X=1
928AC_ARG_WITH(iso8859x,
929[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000930if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
931then
932 with_iso8859x=no
933fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000934if test "$WITH_ICONV" != "1" ; then
935if test "$with_iso8859x" = "no" ; then
936 echo Disabling ISO8859X support
937 WITH_ISO8859X=0
938fi
939fi
940AC_SUBST(WITH_ISO8859X)
941
William M. Brack97ad4c72003-05-13 08:08:36 +0000942AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000943[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000944if test "$with_minimum" = "yes" -a "$with_schemas" = ""
945then
946 with_schemas=no
947fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000948if test "$with_schemas" = "no" ; then
949 echo "Disabled Schemas/Relax-NG support"
950 WITH_SCHEMAS=0
951 TEST_SCHEMAS=
952else
Daniel Veillard71531f32003-02-05 13:19:53 +0000953 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000954 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000955 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard23e73572002-09-19 19:56:43 +0000956 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000957fi
958AC_SUBST(WITH_SCHEMAS)
959AC_SUBST(TEST_SCHEMAS)
960
William M. Brack97ad4c72003-05-13 08:08:36 +0000961AC_ARG_WITH(regexps,
962[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000963if test "$with_minimum" = "yes" -a "$with_regexps" = ""
964then
965 with_regexps=no
966fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000967if test "$with_regexps" = "no" ; then
968 echo Disabling Regexps support
969 WITH_REGEXPS=0
970 TEST_REGEXPS=
971else
972 WITH_REGEXPS=1
973 TEST_REGEXPS="Regexptests Automatatests"
974fi
975AC_SUBST(WITH_REGEXPS)
976AC_SUBST(TEST_REGEXPS)
977
William M. Brack97ad4c72003-05-13 08:08:36 +0000978AC_ARG_WITH(debug,
979[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000980if test "$with_minimum" = "yes" -a "$with_debug" = ""
981then
982 with_debug=no
983fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000984if test "$with_debug" = "no" ; then
985 echo Disabling DEBUG support
986 WITH_DEBUG=0
987 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000988 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000989else
990 WITH_DEBUG=1
991 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000992 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +0000993fi
994AC_SUBST(WITH_DEBUG)
995AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000996AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +0000997
William M. Brack97ad4c72003-05-13 08:08:36 +0000998AC_ARG_WITH(mem_debug,
999[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +00001000if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
1001then
1002 with_mem_debug=no
1003fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001004if test "$with_mem_debug" = "yes" ; then
1005 echo Enabling memory debug support
1006 WITH_MEM_DEBUG=1
1007else
1008 WITH_MEM_DEBUG=0
1009fi
1010AC_SUBST(WITH_MEM_DEBUG)
1011
Daniel Veillard1638a472003-08-14 01:23:25 +00001012
1013WIN32_EXTRA_LIBADD=
1014WIN32_EXTRA_LDFLAGS=
1015case "$host" in
1016 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001017 CPPFLAGS="$CPPFLAGS -DWIN32"
1018 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001019 WIN32_EXTRA_LDFLAGS="-no-undefined"
1020 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1021 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1022 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1023 ;;
1024esac
1025AC_SUBST(WIN32_EXTRA_LIBADD)
1026AC_SUBST(WIN32_EXTRA_LDFLAGS)
1027
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001028AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001029AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001030AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001031
Daniel Veillardb05deb71999-08-10 19:04:08 +00001032AC_SUBST(XML_LIBDIR)
1033AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001034AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001035AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001036AC_SUBST(XML_INCLUDEDIR)
1037AC_SUBST(HTML_DIR)
1038AC_SUBST(HAVE_ISNAN)
1039AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001040AC_SUBST(PYTHON)
1041AC_SUBST(PYTHON_VERSION)
1042AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001043AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001044
Daniel Veillardb05deb71999-08-10 19:04:08 +00001045AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001046AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001047
Daniel Veillard9715c172002-11-25 16:33:40 +00001048dnl for the spec file
1049RELDATE=`date +'%a %b %e %Y'`
1050AC_SUBST(RELDATE)
1051
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001052rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001053ln -s Copyright COPYING
1054
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001055AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile
Daniel Veillardd8cf9062003-11-11 21:12:36 +00001056include/libxml/Makefile doc/Makefile doc/examples/Makefile
1057example/Makefile python/Makefile python/tests/Makefile
1058include/libxml/xmlversion.h xml2-config libxml-2.0.pc
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001059libxml-2.0-uninstalled.pc xml2Conf.sh python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001060
Daniel Veillard9b731d72002-04-14 12:56:08 +00001061chmod +x xml2-config xml2Conf.sh python/setup.py