blob: 6f23db60473f3a4f77034fa732fe93ea7bd9b66b [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
9LIBXML_MICRO_VERSION=0
Daniel Veillard1a993962003-10-11 20:58:06 +000010LIBXML_MICRO_VERSION_SUFFIX=beta6
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 Veillard01791d51998-07-24 19:24:09 +000042AM_PROG_LIBTOOL
43
44AM_MAINTAINER_MODE
45
Daniel Veillard4432df22003-09-28 18:58:27 +000046dnl
47dnl option to build a minimal libxml2 library
48dnl
49AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
50if test "$with_minimum" = "yes"
51then
52 echo "Configuring for a minimal library"
53fi
54
Daniel Veillard71b656e2000-01-05 14:46:17 +000055dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000056_cppflags="${CPPFLAGS}"
57_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000058
Daniel Veillard259ff742001-10-06 13:49:59 +000059
Owen Taylor3473f882001-02-23 17:55:21 +000060AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +000061[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +000062 if test "$withval" != "no" -a "$withval" != "yes"; then
63 Z_DIR=$withval
64 CPPFLAGS="${CPPFLAGS} -I$withval/include"
65 LDFLAGS="${LDFLAGS} -L$withval/lib"
66 fi
Daniel Veillard259ff742001-10-06 13:49:59 +000067])
Daniel Veillard4432df22003-09-28 18:58:27 +000068if test "$with_minimum" = "yes" -a "$with_zlib" = ""
69then
70 with_zlib=no
71fi
Daniel Veillard259ff742001-10-06 13:49:59 +000072if test "$with_zlib" = "no"; then
73 echo "Disabling compression support"
74else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000075 AC_CHECK_HEADERS(zlib.h,
76 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +000077 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000078 if test "x${Z_DIR}" != "x"; then
79 Z_CFLAGS="-I${Z_DIR}/include"
80 Z_LIBS="-L${Z_DIR}/lib -lz"
81 [case ${host} in
82 *-*-solaris*)
83 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
84 ;;
85 esac]
86 else
87 Z_LIBS="-lz"
88 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +000089fi
Owen Taylor3473f882001-02-23 17:55:21 +000090
Owen Taylor3473f882001-02-23 17:55:21 +000091AC_SUBST(Z_CFLAGS)
92AC_SUBST(Z_LIBS)
93
94CPPFLAGS=${_cppflags}
95LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000096
Daniel Veillard01791d51998-07-24 19:24:09 +000097dnl Checks for header files.
98AC_HEADER_DIRENT
99AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000100AC_CHECK_HEADERS([fcntl.h])
101AC_CHECK_HEADERS([unistd.h])
102AC_CHECK_HEADERS([ctype.h])
103AC_CHECK_HEADERS([dirent.h])
104AC_CHECK_HEADERS([errno.h])
105AC_CHECK_HEADERS([malloc.h])
106AC_CHECK_HEADERS([stdarg.h])
107AC_CHECK_HEADERS([sys/stat.h])
108AC_CHECK_HEADERS([sys/types.h])
109AC_CHECK_HEADERS([time.h])
110AC_CHECK_HEADERS([ansidecl.h])
111AC_CHECK_HEADERS([ieeefp.h])
112AC_CHECK_HEADERS([nan.h])
113AC_CHECK_HEADERS([math.h])
114AC_CHECK_HEADERS([fp_class.h])
115AC_CHECK_HEADERS([float.h])
116AC_CHECK_HEADERS([stdlib.h])
117AC_CHECK_HEADERS([sys/socket.h], [], [],
118[#if HAVE_SYS_TYPES_H
119# include <sys/types.h>
120# endif
121])
122AC_CHECK_HEADERS([netinet/in.h], [], [],
123[#if HAVE_SYS_TYPES_H
124# include <sys/types.h>
125# endif
126])
127AC_CHECK_HEADERS([arpa/inet.h], [], [],
128[#if HAVE_SYS_TYPES_H
129# include <sys/types.h>
130# endif
131#if HAVE_ARPA_INET_H
132# include <arpa/inet.h>
133# endif
134])
135AC_CHECK_HEADERS([netdb.h])
136AC_CHECK_HEADERS([sys/time.h])
137AC_CHECK_HEADERS([sys/select.h])
138AC_CHECK_HEADERS([sys/mman.h])
139AC_CHECK_HEADERS([sys/timeb.h])
140AC_CHECK_HEADERS([signal.h])
141AC_CHECK_HEADERS([arpa/nameser.h], [], [],
142[#if HAVE_SYS_TYPES_H
143# include <sys/types.h>
144# endif
145])
146AC_CHECK_HEADERS([resolv.h], [], [],
147[#if HAVE_SYS_TYPES_H
148# include <sys/types.h>
149# endif
150#if HAVE_NETINET_IN_H
151# include <netinet/in.h>
152# endif
153#if HAVE_ARPA_NAMESER_H
154# include <arpa/nameser.h>
155# endif
156])
Daniel Veillard01791d51998-07-24 19:24:09 +0000157
Daniel Veillard1164e751999-02-16 16:29:17 +0000158dnl Specific dir for HTML output ?
159if test "x$with_html_dir" = "x" ; then
Daniel Veillard0a6c3582001-03-14 19:15:37 +0000160 HTML_DIR='$(prefix)/doc'
Daniel Veillard1164e751999-02-16 16:29:17 +0000161else
162 HTML_DIR=$with_html_dir
163fi
164
165AC_SUBST(HTML_DIR)
166
Daniel Veillard01791d51998-07-24 19:24:09 +0000167dnl Checks for library functions.
168AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000169AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000170AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000171AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000172AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000173
Daniel Veillard92ad2102001-03-27 12:47:33 +0000174dnl Checking the standard string functions availability
175AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
176 NEED_TRIO=1)
177
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000178dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000179AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
180AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
181AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000182
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000183dnl Determine what socket length (socklen_t) data type is
184AC_MSG_CHECKING([for type of socket length (socklen_t)])
185AC_TRY_COMPILE2([
186#include <stddef.h>
187#include <sys/types.h>
188#include <sys/socket.h>],[
189(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
190 AC_MSG_RESULT(socklen_t *)
191 SOCKLEN_T=socklen_t],[
192 AC_TRY_COMPILE2([
193#include <stddef.h>
194#include <sys/types.h>
195#include <sys/socket.h>],[
196(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
197 AC_MSG_RESULT(size_t *)
198 SOCKLEN_T=size_t],[
199 AC_TRY_COMPILE2([
200#include <stddef.h>
201#include <sys/types.h>
202#include <sys/socket.h>],[
203(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
204 AC_MSG_RESULT(int *)
205 SOCKLEN_T=int],[
206 AC_MSG_WARN(could not determine)])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000207AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000208
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000209dnl ***********************Checking for availability of IPv6*******************
210
211AC_MSG_CHECKING([whether to enable IPv6])
212AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000213if test "$with_minimum" = "yes"
214then
215 enable_ipv6=no
216fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000217if test $enable_ipv6 = yes; then
218 have_ipv6=no
219 AC_TRY_COMPILE([
220 #include <sys/socket.h>
221 #include <sys/types.h>], [
222 struct sockaddr_storage ss;
223 socket(AF_INET6, SOCK_STREAM, 0)
224 ],
225 have_ipv6=yes,
226 have_ipv6=no
227 )
228 AC_MSG_RESULT($have_ipv6)
229
William M. Brack476cd962003-08-13 11:09:42 +0000230 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000231 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000232
233 have_getaddrinfo=no
234 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
235 if test $have_getaddrinfo != yes; then
236 for lib in bsd socket inet; do
237 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
238 done
239 fi
240
William M. Brack476cd962003-08-13 11:09:42 +0000241 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000242 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000243 fi
244 fi
245fi
246
247dnl ******************************End IPv6 checks******************************
248
Daniel Veillardb05deb71999-08-10 19:04:08 +0000249dnl Checks for isnan in libm if not in libc
Daniel Veillard71b656e2000-01-05 14:46:17 +0000250AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000251 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000252
Daniel Veillardc790bf42003-10-11 10:50:10 +0000253AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
254 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000255
256XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000257XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000258
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000259dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000260dnl Extra flags
261dnl
262XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000263RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000264
Daniel Veillardd94849b2003-07-28 13:02:24 +0000265AC_ARG_WITH(fexceptions,
266[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000267if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
268then
269 with_fexceptions=no
270fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000271dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000272dnl Workaround for native compilers
273dnl HP : http://bugs.gnome.org/db/31/3163.html
274dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000275dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000276if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000277 case "${host}" in
278 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000279 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000280 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000281 *-dec-osf* )
282 CFLAGS="${CFLAGS} -ieee"
283 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000284 alpha*-*-linux* )
285 CFLAGS="${CFLAGS} -ieee"
286 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000287 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000288else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000289 if test "$with_fexceptions" = "yes"
290 then
291 #
292 # Not activated by default because this inflates the code size
293 # Used to allow propagation of C++ exceptions through the library
294 #
295 CFLAGS="${CFLAGS} -fexceptions"
296 fi
297
Daniel Veillardd574f782001-03-14 19:40:17 +0000298 CFLAGS="${CFLAGS} -Wall"
Daniel Veillard14839d52001-06-06 16:11:56 +0000299 case "${host}" in
300 alpha*-*-linux* )
301 CFLAGS="${CFLAGS} -mieee"
302 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000303 alpha*-*-osf* )
304 CFLAGS="${CFLAGS} -mieee"
305 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000306 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000307fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000308case ${host} in
309 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000310 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
311 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000312 hppa*-hp-mpeix)
313 NEED_TRIO=1
314 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000315esac
316
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000317
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000318dnl
319dnl check for python
320dnl
321
322PYTHON=
323PYTHON_VERSION=
324PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000325PYTHON_SITE_PACKAGES=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000326pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000327AC_ARG_WITH(python,
328[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000329if test "$with_minimum" = "yes" -a "$with_python" = ""
330then
331 with_python=no
332fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000333if test "$with_python" != "no" ; then
334 if test -x "$with_python/bin/python"
335 then
336 echo Found python in $with_python/bin/python
337 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000338 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000339 if test -x "$with_python"
340 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000341 echo Found python in $with_python
342 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000343 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000344 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000345 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000346 fi
347 if test "$PYTHON" != ""
348 then
349 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
350 echo Found Python version $PYTHON_VERSION
351 fi
352 if test "$PYTHON_VERSION" != ""
353 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000354 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
355 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000356 then
357 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000358 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000359 else
360 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
361 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000362 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000363 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000364 else
365 if test -r /usr/include/python$PYTHON_VERSION/Python.h
366 then
367 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000368 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000369 else
370 echo could not find python$PYTHON_VERSION/Python.h
371 fi
372 fi
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000373 if ! test -d "$PYTHON_SITE_PACKAGES"
374 then
375 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
376 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000377 fi
378 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000379 if test "$with_python" != ""
380 then
381 pythondir='$(PYTHON_SITE_PACKAGES)'
382 else
383 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
384 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000385fi
386AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000387if test "$PYTHON_INCLUDES" != ""
388then
389 PYTHON_SUBDIR=python
390else
391 PYTHON_SUBDIR=
392fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000393AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000394AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000395
Daniel Veillard437b87b2000-01-03 17:30:46 +0000396dnl
397dnl Tester makes use of readline if present
398dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000399_cppflags="${CPPFLAGS}"
400_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000401
Daniel Veillard03109292000-08-14 14:58:22 +0000402AC_ARG_WITH(readline,
403[ --with-readline=DIR use readline in DIR],[
404 if test "$withval" != "no" -a "$withval" != "yes"; then
405 RDL_DIR=$withval
406 CPPFLAGS="${CPPFLAGS} -I$withval/include"
407 LDFLAGS="${LDFLAGS} -L$withval/lib"
408 fi
409])
Daniel Veillard4432df22003-09-28 18:58:27 +0000410if test "$with_minimum" = "yes" -a "$with_readline" = ""
411then
412 with_readline=no
413fi
Daniel Veillard03109292000-08-14 14:58:22 +0000414
Daniel Veillard361d8452000-04-03 19:48:13 +0000415dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000416dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000417dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000418dnl
William M. Brack871611b2003-10-18 04:53:14 +0000419if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
420 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]]
421 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000422 if test "$with_minimum" != "yes"
423 then
424 if test "${with_mem_debug}" = "" ; then
425 with_mem_debug="yes"
426 fi
427 if test "${with_docbook}" = "" ; then
428 with_docbook="yes"
429 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000430 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000431 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 +0000432 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000433dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000434else
435 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000436fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000437AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000438
439dnl
440dnl Check for trio string functions
441dnl
442
443if test "${NEED_TRIO}" = "1" ; then
444 echo Adding trio library for string functions
445 WITH_TRIO=1
446else
447 WITH_TRIO=0
448fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000449AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000450AC_SUBST(WITH_TRIO)
451
Daniel Veillardf6eea272001-01-18 12:17:12 +0000452dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000453dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000454dnl
455
Daniel Veillardb8478642001-10-12 17:29:10 +0000456THREAD_LIBS=""
457WITH_THREADS=0
458THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000459TEST_THREADS=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000460
William M. Brack97ad4c72003-05-13 08:08:36 +0000461AC_ARG_WITH(threads,
462[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000463if test "$with_minimum" = "yes" -a "$with_threads" = ""
464then
465 with_threads=no
466fi
Daniel Veillard84942712003-04-18 14:40:05 +0000467if test "$with_threads" = "no" ; then
468 echo Disabling multithreaded support
469else
Daniel Veillardb8478642001-10-12 17:29:10 +0000470 echo Enabling multithreaded support
471
472 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000473 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000474 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000475 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
476 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000477 WITH_THREADS="1"]))
Daniel Veillardb8478642001-10-12 17:29:10 +0000478
479 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000480 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
481 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000482 fi
483fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000484AC_ARG_WITH(thread-alloc,
485[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000486if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
487then
488 with_thread_alloc=no
489fi
Daniel Veillardab7488e2001-10-17 11:30:37 +0000490if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
491 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000492fi
493
Daniel Veillardb8478642001-10-12 17:29:10 +0000494AC_SUBST(THREAD_LIBS)
495AC_SUBST(WITH_THREADS)
496AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000497AC_SUBST(TEST_THREADS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000498
William M. Brack97ad4c72003-05-13 08:08:36 +0000499AC_ARG_WITH(history,
500[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000501if test "$with_minimum" = "yes" -a "$with_history" = ""
502then
503 with_history=no
504fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000505if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000506 echo Enabling xmllint shell history
507 dnl check for terminal library. this is a very cool solution
508 dnl from octave's configure.in
509 unset tcap
510 for termlib in ncurses curses termcap terminfo termlib; do
511 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
512 test -n "$tcap" && break
513 done
514
515 AC_CHECK_HEADER(readline/history.h,
516 AC_CHECK_LIB(history, append_history,[
517 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000518 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000519 AC_CHECK_HEADER(readline/readline.h,
520 AC_CHECK_LIB(readline, readline,[
521 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000522 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000523 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
524 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
525 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
526 else
527 CPPFLAGS=${_cppflags}
528 fi
529 LDFLAGS=${_ldflags}
530fi
531
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000532AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000533[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000534if test "$with_minimum" = "yes" -a "$with_output" = ""
535then
536 with_output=no
537fi
538if test "$with_output" = "no" ; then
539 echo Disabling serialization/saving support
540 WITH_OUTPUT=0
541else
542 WITH_OUTPUT=1
543fi
544AC_SUBST(WITH_OUTPUT)
545
Daniel Veillard652327a2003-09-29 18:02:38 +0000546AC_ARG_WITH(tree,
547[ --with-tree add the DOM like tree manipulation APIs (on)])
548if test "$with_minimum" = "yes" -a "$with_tree" = ""
549then
550 with_tree=no
551fi
552if test "$with_tree" = "no" ; then
553 echo Disabling DOM like tree manipulation APIs
554 WITH_TREE=0
555else
556 WITH_TREE=1
557fi
558AC_SUBST(WITH_TREE)
559
William M. Brack97ad4c72003-05-13 08:08:36 +0000560AC_ARG_WITH(ftp,
561[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000562if test "$with_minimum" = "yes" -a "$with_ftp" = ""
563then
564 with_ftp=no
565fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000566if test "$with_ftp" = "no" ; then
567 echo Disabling FTP support
568 WITH_FTP=0
569 FTP_OBJ=
570else
571 WITH_FTP=1
572 FTP_OBJ=nanoftp.o
573fi
574AC_SUBST(WITH_FTP)
575AC_SUBST(FTP_OBJ)
576
William M. Brack97ad4c72003-05-13 08:08:36 +0000577AC_ARG_WITH(http,
578[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000579if test "$with_minimum" = "yes" -a "$with_http" = ""
580then
581 with_http=no
582fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000583if test "$with_http" = "no" ; then
584 echo Disabling HTTP support
585 WITH_HTTP=0
586 HTTP_OBJ=
587else
588 WITH_HTTP=1
589 HTTP_OBJ=nanohttp.o
590fi
591AC_SUBST(WITH_HTTP)
592AC_SUBST(HTTP_OBJ)
593
Daniel Veillard4432df22003-09-28 18:58:27 +0000594AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000595[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000596if test "$with_minimum" = "yes" -a "$with_legacy" = ""
597then
598 with_legacy=no
599fi
600if test "$with_legacy" = "no" ; then
601 echo Disabling deprecated APIs
602 WITH_LEGACY=0
603else
604 WITH_LEGACY=1
605fi
606AC_SUBST(WITH_LEGACY)
607
Daniel Veillard81273902003-09-30 00:43:48 +0000608AC_ARG_WITH(reader,
609[ --with-reader add the xmlReader parsing interface (on)])
610if test "$with_minimum" = "yes" -a "$with_reader" = ""
611then
612 with_reader=no
613fi
614if test "$with_reader" = "no" ; then
615 echo Disabling the xmlReader parsing interface
616 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000617 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000618else
619 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000620 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000621fi
622AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000623AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000624
625AC_ARG_WITH(sax1,
626[ --with-sax1 add the older SAX1 interface (on)])
627if test "$with_minimum" = "yes" -a "$with_sax1" = ""
628then
629 with_sax1=no
630fi
631if test "$with_sax1" = "no" ; then
632 echo Disabling the older SAX1 interface
633 WITH_SAX1=0
634 TEST_SAX=
635else
636 WITH_SAX1=1
637 TEST_SAX=SAXtests
638fi
639AC_SUBST(WITH_SAX1)
640AC_SUBST(TEST_SAX)
641
Daniel Veillard1ae42d62003-10-03 23:59:20 +0000642AC_ARG_WITH(walker,
643[ --with-walker add the xmlDocWalker interface (on)])
644if test "$with_minimum" = "yes" -a "$with_walker" = ""
645then
646 with_walker=no
647fi
648if test "$with_walker" = "no" ; then
649 echo Disabling the xmlDocWalker interface
650 WITH_WALKER=0
651 TEST_WALKER=
652else
653 WITH_WALKER=1
654 TEST_WALKER=WALKERtests
655fi
656AC_SUBST(WITH_WALKER)
657AC_SUBST(TEST_WALKER)
658
Daniel Veillard73b013f2003-09-30 12:36:01 +0000659AC_ARG_WITH(push,
660[ --with-push add the PUSH parser interfaces (on)])
661if test "$with_minimum" = "yes" -a "$with_push" = ""
662then
663 with_push=no
664fi
665if test "$with_push" = "no" ; then
666 echo Disabling the PUSH parser interfaces
667 WITH_PUSH=0
668 TEST_PUSH=
669else
670 WITH_PUSH=1
671 TEST_PUSH="XMLPushtests"
672fi
673AC_SUBST(WITH_PUSH)
674AC_SUBST(TEST_PUSH)
675
676AC_ARG_WITH(html,
677[ --with-html add the HTML support (on)])
678if test "$with_minimum" = "yes" -a "$with_html" = ""
679then
680 with_html=no
681fi
682if test "$with_html" = "no" ; then
683 echo Disabling HTML support
684 WITH_HTML=0
685 HTML_OBJ=
686 TEST_HTML=
687else
688 WITH_HTML=1
689 HTML_OBJ="HTMLparser.o HTMLtree.o"
690 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000691 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000692 TEST_PHTML=HTMLPushtests
693 else
694 TEST_PHTML=
695 fi
696fi
697AC_SUBST(WITH_HTML)
698AC_SUBST(HTML_OBJ)
699AC_SUBST(TEST_HTML)
700AC_SUBST(TEST_PHTML)
701
Daniel Veillard4432df22003-09-28 18:58:27 +0000702AC_ARG_WITH(valid,
703[ --with-valid add the DTD validation support (on)])
704if test "$with_minimum" = "yes" -a "$with_valid" = ""
705then
706 with_valid=no
707fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000708if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000709 echo Disabling DTD validation support
710 WITH_VALID=0
711 TEST_VALID=
712 TEST_VTIME=
713else
714 WITH_VALID=1
715 TEST_VALID=Validtests
716 TEST_VTIME=VTimingtests
717fi
718AC_SUBST(WITH_VALID)
719AC_SUBST(TEST_VALID)
720AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000721
William M. Brack97ad4c72003-05-13 08:08:36 +0000722AC_ARG_WITH(catalog,
723[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000724if test "$with_minimum" = "yes" -a "$with_catalog" = ""
725then
726 with_catalog=no
727fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000728if test "$with_catalog" = "no" ; then
729 echo Disabling Catalog support
730 WITH_CATALOG=0
731 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000732 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000733else
734 WITH_CATALOG=1
735 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000736 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000737fi
738AC_SUBST(WITH_CATALOG)
739AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000740AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000741
William M. Brack97ad4c72003-05-13 08:08:36 +0000742AC_ARG_WITH(docbook,
743[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000744if test "$with_minimum" = "yes" -a "$with_docbook" = ""
745then
746 with_docbook=no
747fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000748if test "$with_docbook" = "no" ; then
749 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000750 WITH_DOCB=0
751 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000752else
753 WITH_DOCB=1
754 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000755fi
756AC_SUBST(WITH_DOCB)
757AC_SUBST(DOCB_OBJ)
758
759
William M. Brack97ad4c72003-05-13 08:08:36 +0000760AC_ARG_WITH(xpath,
761[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000762if test "$with_minimum" = "yes" -a "$with_xpath" = ""
763then
764 with_xpath=no
765fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000766if test "$with_xpath" = "no" ; then
767 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000768 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000769 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000770 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000771 WITH_XPATH=0
772 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000773 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000774else
775 WITH_XPATH=1
776 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000777 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000778fi
779AC_SUBST(WITH_XPATH)
780AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000781AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000782
William M. Brack97ad4c72003-05-13 08:08:36 +0000783AC_ARG_WITH(xptr,
784[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000785if test "$with_minimum" = "yes" -a "$with_xptr" = ""
786then
787 with_xptr=no
788fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000789if test "$with_xptr" = "no" ; then
790 echo Disabling XPointer support
791 WITH_XPTR=0
792 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000793 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000794else
795 WITH_XPTR=1
796 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000797 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000798fi
799AC_SUBST(WITH_XPTR)
800AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000801AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000802
William M. Brack97ad4c72003-05-13 08:08:36 +0000803AC_ARG_WITH(c14n,
804[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000805if test "$with_minimum" = "yes" -a "$with_c14n" = ""
806then
807 with_c14n=no
808fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000809if test "$with_c14n" = "no" ; then
810 echo Disabling C14N support
811 WITH_C14N=0
812 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000813 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000814else
815 WITH_C14N=1
816 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000817 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000818fi
819AC_SUBST(WITH_C14N)
820AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000821AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000822
William M. Brack97ad4c72003-05-13 08:08:36 +0000823AC_ARG_WITH(xinclude,
824[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000825if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
826then
827 with_xinclude=no
828fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000829if test "$with_xinclude" = "no" ; then
830 echo Disabling XInclude support
831 WITH_XINCLUDE=0
832 XINCLUDE_OBJ=
833 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000834 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000835else
836 WITH_XINCLUDE=1
837 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000838 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000839fi
840AC_SUBST(WITH_XINCLUDE)
841AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000842AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000843
Daniel Veillard6e90d192001-07-03 16:37:49 +0000844WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000845AC_ARG_WITH(iconv,
846[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000847if test "$with_minimum" = "yes" -a "$with_iconv" = ""
848then
849 with_iconv=no
850fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000851if test "$with_iconv" = "no" ; then
852 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000853else
Daniel Veillard220346d2001-12-07 11:33:54 +0000854 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000855 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000856 # Export this since our headers include iconv.h
857 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000858 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000859 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000860
861 AC_CHECK_HEADER(iconv.h,
862 AC_MSG_CHECKING(for iconv)
863 AC_TRY_LINK([#include <stdlib.h>
864#include <iconv.h>],[
865iconv_t cd = iconv_open ("","");
866iconv (cd, NULL, NULL, NULL, NULL);],[
867 AC_MSG_RESULT(yes)
868 WITH_ICONV=1],[
869 AC_MSG_RESULT(no)
870 AC_MSG_CHECKING(for iconv in -liconv)
871
872 _ldflags="${LDFLAGS}"
873 _libs="${LIBS}"
874 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
875 LIBS="${LIBS} -liconv"
876
877 AC_TRY_LINK([#include <stdlib.h>
878#include <iconv.h>],[
879iconv_t cd = iconv_open ("","");
880iconv (cd, NULL, NULL, NULL, NULL);],[
881 AC_MSG_RESULT(yes)
882 WITH_ICONV=1
883 ICONV_LIBS="${ICONV_LIBS} -liconv"
884 LIBS="${_libs}"
885 LDFLAGS="${_ldflags}"],[
886 AC_MSG_RESULT(no)
887 LIBS="${_libs}"
888 LDFLAGS="${_ldflags}"])]))
889fi
Daniel Veillardb82c1662001-12-09 14:00:54 +0000890M_LIBS="-lm"
891XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000892XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000893AC_SUBST(WITH_ICONV)
894
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000895WITH_ISO8859X=1
896AC_ARG_WITH(iso8859x,
897[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000898if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
899then
900 with_iso8859x=no
901fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000902if test "$WITH_ICONV" != "1" ; then
903if test "$with_iso8859x" = "no" ; then
904 echo Disabling ISO8859X support
905 WITH_ISO8859X=0
906fi
907fi
908AC_SUBST(WITH_ISO8859X)
909
William M. Brack97ad4c72003-05-13 08:08:36 +0000910AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000911[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000912if test "$with_minimum" = "yes" -a "$with_schemas" = ""
913then
914 with_schemas=no
915fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000916if test "$with_schemas" = "no" ; then
917 echo "Disabled Schemas/Relax-NG support"
918 WITH_SCHEMAS=0
919 TEST_SCHEMAS=
920else
Daniel Veillard71531f32003-02-05 13:19:53 +0000921 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000922 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000923 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard23e73572002-09-19 19:56:43 +0000924 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000925fi
926AC_SUBST(WITH_SCHEMAS)
927AC_SUBST(TEST_SCHEMAS)
928
William M. Brack97ad4c72003-05-13 08:08:36 +0000929AC_ARG_WITH(regexps,
930[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000931if test "$with_minimum" = "yes" -a "$with_regexps" = ""
932then
933 with_regexps=no
934fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000935if test "$with_regexps" = "no" ; then
936 echo Disabling Regexps support
937 WITH_REGEXPS=0
938 TEST_REGEXPS=
939else
940 WITH_REGEXPS=1
941 TEST_REGEXPS="Regexptests Automatatests"
942fi
943AC_SUBST(WITH_REGEXPS)
944AC_SUBST(TEST_REGEXPS)
945
William M. Brack97ad4c72003-05-13 08:08:36 +0000946AC_ARG_WITH(debug,
947[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000948if test "$with_minimum" = "yes" -a "$with_debug" = ""
949then
950 with_debug=no
951fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000952if test "$with_debug" = "no" ; then
953 echo Disabling DEBUG support
954 WITH_DEBUG=0
955 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000956 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000957else
958 WITH_DEBUG=1
959 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000960 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +0000961fi
962AC_SUBST(WITH_DEBUG)
963AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000964AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +0000965
William M. Brack97ad4c72003-05-13 08:08:36 +0000966AC_ARG_WITH(mem_debug,
967[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000968if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
969then
970 with_mem_debug=no
971fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000972if test "$with_mem_debug" = "yes" ; then
973 echo Enabling memory debug support
974 WITH_MEM_DEBUG=1
975else
976 WITH_MEM_DEBUG=0
977fi
978AC_SUBST(WITH_MEM_DEBUG)
979
Daniel Veillard1638a472003-08-14 01:23:25 +0000980
981WIN32_EXTRA_LIBADD=
982WIN32_EXTRA_LDFLAGS=
983case "$host" in
984 *-*-mingw*)
985 WIN32_EXTRA_LIBADD="-lwsock32"
986 WIN32_EXTRA_LDFLAGS="-no-undefined"
987 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
988 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
989 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
990 ;;
991esac
992AC_SUBST(WIN32_EXTRA_LIBADD)
993AC_SUBST(WIN32_EXTRA_LDFLAGS)
994
995
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000996AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000997AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000998
Daniel Veillardb05deb71999-08-10 19:04:08 +0000999AC_SUBST(XML_LIBDIR)
1000AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001001AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001002AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001003AC_SUBST(XML_INCLUDEDIR)
1004AC_SUBST(HTML_DIR)
1005AC_SUBST(HAVE_ISNAN)
1006AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001007AC_SUBST(PYTHON)
1008AC_SUBST(PYTHON_VERSION)
1009AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001010AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001011
Daniel Veillardb05deb71999-08-10 19:04:08 +00001012AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001013AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001014
Daniel Veillard9715c172002-11-25 16:33:40 +00001015dnl for the spec file
1016RELDATE=`date +'%a %b %e %Y'`
1017AC_SUBST(RELDATE)
1018
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001019rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001020ln -s Copyright COPYING
1021
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001022AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile
1023include/libxml/Makefile doc/Makefile example/Makefile python/Makefile
1024python/tests/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc
1025libxml-2.0-uninstalled.pc xml2Conf.sh python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001026
Daniel Veillard9b731d72002-04-14 12:56:08 +00001027chmod +x xml2-config xml2Conf.sh python/setup.py