blob: edfd4189bd4b5394913dced72f767a0ec1c79150 [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 Veillard6d373a22003-11-04 10:26:43 +00009LIBXML_MICRO_VERSION=2
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 Veillard01791d51998-07-24 19:24:09 +000042AM_PROG_LIBTOOL
43
Daniel Veillardd8cf9062003-11-11 21:12:36 +000044# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000045
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
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000625AC_ARG_WITH(pattern,
626[ --with-pattern add the xmlPattern selection interface (on)])
627if test "$with_minimum" = "yes" -a "$with_pattern" = ""
628then
629 with_pattern=no
630fi
631if test "$with_pattern" = "no" ; then
632 echo Disabling the xmlPattern parsing interface
633 WITH_PATTERN=0
634 PATTERN_TEST=
635else
636 WITH_PATTERN=1
637 PATTERN_TEST=Patterntests
638fi
639AC_SUBST(WITH_PATTERN)
640AC_SUBST(PATTERN_TEST)
641
Daniel Veillard1d211e22003-10-20 22:32:39 +0000642AC_ARG_WITH(writer,
643[ --with-writer add the xmlWriter saving interface (on)])
644if test "$with_minimum" = "yes" -a "$with_writer" = ""
645then
646 with_writer=no
647fi
648if test "$with_writer" = "no" ; then
649 echo Disabling the xmlWriter saving interface
650 WITH_WRITER=0
651# WRITER_TEST=
652else
653 WITH_WRITER=1
654# WRITER_TEST=Writertests
655fi
656AC_SUBST(WITH_WRITER)
657#AC_SUBST(WRITER_TEST)
658
Daniel Veillard81273902003-09-30 00:43:48 +0000659AC_ARG_WITH(sax1,
660[ --with-sax1 add the older SAX1 interface (on)])
661if test "$with_minimum" = "yes" -a "$with_sax1" = ""
662then
663 with_sax1=no
664fi
665if test "$with_sax1" = "no" ; then
666 echo Disabling the older SAX1 interface
667 WITH_SAX1=0
668 TEST_SAX=
669else
670 WITH_SAX1=1
671 TEST_SAX=SAXtests
672fi
673AC_SUBST(WITH_SAX1)
674AC_SUBST(TEST_SAX)
675
Daniel Veillard73b013f2003-09-30 12:36:01 +0000676AC_ARG_WITH(push,
677[ --with-push add the PUSH parser interfaces (on)])
678if test "$with_minimum" = "yes" -a "$with_push" = ""
679then
680 with_push=no
681fi
682if test "$with_push" = "no" ; then
683 echo Disabling the PUSH parser interfaces
684 WITH_PUSH=0
685 TEST_PUSH=
686else
687 WITH_PUSH=1
688 TEST_PUSH="XMLPushtests"
689fi
690AC_SUBST(WITH_PUSH)
691AC_SUBST(TEST_PUSH)
692
693AC_ARG_WITH(html,
694[ --with-html add the HTML support (on)])
695if test "$with_minimum" = "yes" -a "$with_html" = ""
696then
697 with_html=no
698fi
699if test "$with_html" = "no" ; then
700 echo Disabling HTML support
701 WITH_HTML=0
702 HTML_OBJ=
703 TEST_HTML=
704else
705 WITH_HTML=1
706 HTML_OBJ="HTMLparser.o HTMLtree.o"
707 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000708 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000709 TEST_PHTML=HTMLPushtests
710 else
711 TEST_PHTML=
712 fi
713fi
714AC_SUBST(WITH_HTML)
715AC_SUBST(HTML_OBJ)
716AC_SUBST(TEST_HTML)
717AC_SUBST(TEST_PHTML)
718
Daniel Veillard4432df22003-09-28 18:58:27 +0000719AC_ARG_WITH(valid,
720[ --with-valid add the DTD validation support (on)])
721if test "$with_minimum" = "yes" -a "$with_valid" = ""
722then
723 with_valid=no
724fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000725if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000726 echo Disabling DTD validation support
727 WITH_VALID=0
728 TEST_VALID=
729 TEST_VTIME=
730else
731 WITH_VALID=1
732 TEST_VALID=Validtests
733 TEST_VTIME=VTimingtests
734fi
735AC_SUBST(WITH_VALID)
736AC_SUBST(TEST_VALID)
737AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000738
William M. Brack97ad4c72003-05-13 08:08:36 +0000739AC_ARG_WITH(catalog,
740[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000741if test "$with_minimum" = "yes" -a "$with_catalog" = ""
742then
743 with_catalog=no
744fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000745if test "$with_catalog" = "no" ; then
746 echo Disabling Catalog support
747 WITH_CATALOG=0
748 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000749 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000750else
751 WITH_CATALOG=1
752 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000753 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000754fi
755AC_SUBST(WITH_CATALOG)
756AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000757AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000758
William M. Brack97ad4c72003-05-13 08:08:36 +0000759AC_ARG_WITH(docbook,
760[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000761if test "$with_minimum" = "yes" -a "$with_docbook" = ""
762then
763 with_docbook=no
764fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000765if test "$with_docbook" = "no" ; then
766 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000767 WITH_DOCB=0
768 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000769else
770 WITH_DOCB=1
771 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000772fi
773AC_SUBST(WITH_DOCB)
774AC_SUBST(DOCB_OBJ)
775
776
William M. Brack97ad4c72003-05-13 08:08:36 +0000777AC_ARG_WITH(xpath,
778[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000779if test "$with_minimum" = "yes" -a "$with_xpath" = ""
780then
781 with_xpath=no
782fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000783if test "$with_xpath" = "no" ; then
784 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000785 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000786 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000787 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000788 WITH_XPATH=0
789 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000790 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000791else
792 WITH_XPATH=1
793 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000794 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000795fi
796AC_SUBST(WITH_XPATH)
797AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000798AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000799
William M. Brack97ad4c72003-05-13 08:08:36 +0000800AC_ARG_WITH(xptr,
801[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000802if test "$with_minimum" = "yes" -a "$with_xptr" = ""
803then
804 with_xptr=no
805fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000806if test "$with_xptr" = "no" ; then
807 echo Disabling XPointer support
808 WITH_XPTR=0
809 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000810 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000811else
812 WITH_XPTR=1
813 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000814 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000815fi
816AC_SUBST(WITH_XPTR)
817AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000818AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000819
William M. Brack97ad4c72003-05-13 08:08:36 +0000820AC_ARG_WITH(c14n,
821[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000822if test "$with_minimum" = "yes" -a "$with_c14n" = ""
823then
824 with_c14n=no
825fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000826if test "$with_c14n" = "no" ; then
827 echo Disabling C14N support
828 WITH_C14N=0
829 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000830 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000831else
832 WITH_C14N=1
833 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000834 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000835fi
836AC_SUBST(WITH_C14N)
837AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000838AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000839
William M. Brack97ad4c72003-05-13 08:08:36 +0000840AC_ARG_WITH(xinclude,
841[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000842if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
843then
844 with_xinclude=no
845fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000846if test "$with_xinclude" = "no" ; then
847 echo Disabling XInclude support
848 WITH_XINCLUDE=0
849 XINCLUDE_OBJ=
850 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000851 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000852else
853 WITH_XINCLUDE=1
854 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000855 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000856fi
857AC_SUBST(WITH_XINCLUDE)
858AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000859AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000860
Daniel Veillard6e90d192001-07-03 16:37:49 +0000861WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000862AC_ARG_WITH(iconv,
863[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000864if test "$with_minimum" = "yes" -a "$with_iconv" = ""
865then
866 with_iconv=no
867fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000868if test "$with_iconv" = "no" ; then
869 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000870else
Daniel Veillard220346d2001-12-07 11:33:54 +0000871 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000872 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000873 # Export this since our headers include iconv.h
874 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000875 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000876 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000877
878 AC_CHECK_HEADER(iconv.h,
879 AC_MSG_CHECKING(for iconv)
880 AC_TRY_LINK([#include <stdlib.h>
881#include <iconv.h>],[
882iconv_t cd = iconv_open ("","");
883iconv (cd, NULL, NULL, NULL, NULL);],[
884 AC_MSG_RESULT(yes)
885 WITH_ICONV=1],[
886 AC_MSG_RESULT(no)
887 AC_MSG_CHECKING(for iconv in -liconv)
888
889 _ldflags="${LDFLAGS}"
890 _libs="${LIBS}"
891 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
892 LIBS="${LIBS} -liconv"
893
894 AC_TRY_LINK([#include <stdlib.h>
895#include <iconv.h>],[
896iconv_t cd = iconv_open ("","");
897iconv (cd, NULL, NULL, NULL, NULL);],[
898 AC_MSG_RESULT(yes)
899 WITH_ICONV=1
900 ICONV_LIBS="${ICONV_LIBS} -liconv"
901 LIBS="${_libs}"
902 LDFLAGS="${_ldflags}"],[
903 AC_MSG_RESULT(no)
904 LIBS="${_libs}"
905 LDFLAGS="${_ldflags}"])]))
906fi
Daniel Veillardb82c1662001-12-09 14:00:54 +0000907M_LIBS="-lm"
908XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000909XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000910AC_SUBST(WITH_ICONV)
911
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000912WITH_ISO8859X=1
913AC_ARG_WITH(iso8859x,
914[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000915if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
916then
917 with_iso8859x=no
918fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000919if test "$WITH_ICONV" != "1" ; then
920if test "$with_iso8859x" = "no" ; then
921 echo Disabling ISO8859X support
922 WITH_ISO8859X=0
923fi
924fi
925AC_SUBST(WITH_ISO8859X)
926
William M. Brack97ad4c72003-05-13 08:08:36 +0000927AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000928[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000929if test "$with_minimum" = "yes" -a "$with_schemas" = ""
930then
931 with_schemas=no
932fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000933if test "$with_schemas" = "no" ; then
934 echo "Disabled Schemas/Relax-NG support"
935 WITH_SCHEMAS=0
936 TEST_SCHEMAS=
937else
Daniel Veillard71531f32003-02-05 13:19:53 +0000938 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000939 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000940 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard23e73572002-09-19 19:56:43 +0000941 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000942fi
943AC_SUBST(WITH_SCHEMAS)
944AC_SUBST(TEST_SCHEMAS)
945
William M. Brack97ad4c72003-05-13 08:08:36 +0000946AC_ARG_WITH(regexps,
947[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000948if test "$with_minimum" = "yes" -a "$with_regexps" = ""
949then
950 with_regexps=no
951fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000952if test "$with_regexps" = "no" ; then
953 echo Disabling Regexps support
954 WITH_REGEXPS=0
955 TEST_REGEXPS=
956else
957 WITH_REGEXPS=1
958 TEST_REGEXPS="Regexptests Automatatests"
959fi
960AC_SUBST(WITH_REGEXPS)
961AC_SUBST(TEST_REGEXPS)
962
William M. Brack97ad4c72003-05-13 08:08:36 +0000963AC_ARG_WITH(debug,
964[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000965if test "$with_minimum" = "yes" -a "$with_debug" = ""
966then
967 with_debug=no
968fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000969if test "$with_debug" = "no" ; then
970 echo Disabling DEBUG support
971 WITH_DEBUG=0
972 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000973 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000974else
975 WITH_DEBUG=1
976 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000977 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +0000978fi
979AC_SUBST(WITH_DEBUG)
980AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000981AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +0000982
William M. Brack97ad4c72003-05-13 08:08:36 +0000983AC_ARG_WITH(mem_debug,
984[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000985if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
986then
987 with_mem_debug=no
988fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000989if test "$with_mem_debug" = "yes" ; then
990 echo Enabling memory debug support
991 WITH_MEM_DEBUG=1
992else
993 WITH_MEM_DEBUG=0
994fi
995AC_SUBST(WITH_MEM_DEBUG)
996
Daniel Veillard1638a472003-08-14 01:23:25 +0000997
998WIN32_EXTRA_LIBADD=
999WIN32_EXTRA_LDFLAGS=
1000case "$host" in
1001 *-*-mingw*)
1002 WIN32_EXTRA_LIBADD="-lwsock32"
1003 WIN32_EXTRA_LDFLAGS="-no-undefined"
1004 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1005 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1006 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1007 ;;
1008esac
1009AC_SUBST(WIN32_EXTRA_LIBADD)
1010AC_SUBST(WIN32_EXTRA_LDFLAGS)
1011
1012
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001013AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001014AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001015
Daniel Veillardb05deb71999-08-10 19:04:08 +00001016AC_SUBST(XML_LIBDIR)
1017AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001018AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001019AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001020AC_SUBST(XML_INCLUDEDIR)
1021AC_SUBST(HTML_DIR)
1022AC_SUBST(HAVE_ISNAN)
1023AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001024AC_SUBST(PYTHON)
1025AC_SUBST(PYTHON_VERSION)
1026AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001027AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001028
Daniel Veillardb05deb71999-08-10 19:04:08 +00001029AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001030AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001031
Daniel Veillard9715c172002-11-25 16:33:40 +00001032dnl for the spec file
1033RELDATE=`date +'%a %b %e %Y'`
1034AC_SUBST(RELDATE)
1035
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001036rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001037ln -s Copyright COPYING
1038
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001039AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile
Daniel Veillardd8cf9062003-11-11 21:12:36 +00001040include/libxml/Makefile doc/Makefile doc/examples/Makefile
1041example/Makefile python/Makefile python/tests/Makefile
1042include/libxml/xmlversion.h xml2-config libxml-2.0.pc
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001043libxml-2.0-uninstalled.pc xml2Conf.sh python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001044
Daniel Veillard9b731d72002-04-14 12:56:08 +00001045chmod +x xml2-config xml2Conf.sh python/setup.py