blob: 57af8c4542bb919d4dabcbd793ff951938243591 [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 Veillard092643b2003-09-25 14:29:29 +000010LIBXML_MICRO_VERSION_SUFFIX=beta3
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,[
77 AC_DEFINE(HAVE_LIBZ)
78 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)])])])
207AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T)
208
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 Veillardde2a67b2003-06-21 14:20:04 +0000231 AC_DEFINE(SUPPORT_IP6)
232
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 Veillardde2a67b2003-06-21 14:20:04 +0000242 AC_DEFINE(HAVE_GETADDRINFO)
243 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,
Bjorn Reesee1dc0112001-03-03 12:09:03 +0000251 [AC_DEFINE(HAVE_ISNAN)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000252
Daniel Veillard760f4422001-02-15 14:59:48 +0000253AC_CHECK_FUNC(isinf, AC_DEFINE(HAVE_ISINF) , AC_CHECK_LIB(m, isinf,
Bjorn Reesee1dc0112001-03-03 12:09:03 +0000254 [AC_DEFINE(HAVE_ISINF)]))
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
419if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000420 if test "$with_minimum" != "yes"
421 then
422 if test "${with_mem_debug}" = "" ; then
423 with_mem_debug="yes"
424 fi
425 if test "${with_docbook}" = "" ; then
426 with_docbook="yes"
427 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000428 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000429 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 +0000430 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000431dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000432else
433 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000434fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000435AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000436
437dnl
438dnl Check for trio string functions
439dnl
440
441if test "${NEED_TRIO}" = "1" ; then
442 echo Adding trio library for string functions
443 WITH_TRIO=1
444else
445 WITH_TRIO=0
446fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000447AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000448AC_SUBST(WITH_TRIO)
449
Daniel Veillardf6eea272001-01-18 12:17:12 +0000450dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000451dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000452dnl
453
Daniel Veillardb8478642001-10-12 17:29:10 +0000454THREAD_LIBS=""
455WITH_THREADS=0
456THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000457TEST_THREADS=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000458
William M. Brack97ad4c72003-05-13 08:08:36 +0000459AC_ARG_WITH(threads,
460[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000461if test "$with_minimum" = "yes" -a "$with_threads" = ""
462then
463 with_threads=no
464fi
Daniel Veillard84942712003-04-18 14:40:05 +0000465if test "$with_threads" = "no" ; then
466 echo Disabling multithreaded support
467else
Daniel Veillardb8478642001-10-12 17:29:10 +0000468 echo Enabling multithreaded support
469
470 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000471 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000472 THREAD_LIBS="-lpthread"
473 AC_DEFINE(HAVE_LIBPTHREAD)
474 AC_DEFINE(HAVE_PTHREAD_H)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000475 WITH_THREADS="1"]))
Daniel Veillardb8478642001-10-12 17:29:10 +0000476
477 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000478 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
479 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000480 fi
481fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000482AC_ARG_WITH(thread-alloc,
483[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000484if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
485then
486 with_thread_alloc=no
487fi
Daniel Veillardab7488e2001-10-17 11:30:37 +0000488if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
489 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000490fi
491
Daniel Veillardb8478642001-10-12 17:29:10 +0000492AC_SUBST(THREAD_LIBS)
493AC_SUBST(WITH_THREADS)
494AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000495AC_SUBST(TEST_THREADS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000496
William M. Brack97ad4c72003-05-13 08:08:36 +0000497AC_ARG_WITH(history,
498[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000499if test "$with_minimum" = "yes" -a "$with_history" = ""
500then
501 with_history=no
502fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000503if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000504 echo Enabling xmllint shell history
505 dnl check for terminal library. this is a very cool solution
506 dnl from octave's configure.in
507 unset tcap
508 for termlib in ncurses curses termcap terminfo termlib; do
509 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
510 test -n "$tcap" && break
511 done
512
513 AC_CHECK_HEADER(readline/history.h,
514 AC_CHECK_LIB(history, append_history,[
515 RDL_LIBS="-lhistory"
516 AC_DEFINE(HAVE_LIBHISTORY)]))
517 AC_CHECK_HEADER(readline/readline.h,
518 AC_CHECK_LIB(readline, readline,[
519 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
520 AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
521 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
522 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
523 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
524 else
525 CPPFLAGS=${_cppflags}
526 fi
527 LDFLAGS=${_ldflags}
528fi
529
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000530AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000531[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000532if test "$with_minimum" = "yes" -a "$with_output" = ""
533then
534 with_output=no
535fi
536if test "$with_output" = "no" ; then
537 echo Disabling serialization/saving support
538 WITH_OUTPUT=0
539else
540 WITH_OUTPUT=1
541fi
542AC_SUBST(WITH_OUTPUT)
543
Daniel Veillard652327a2003-09-29 18:02:38 +0000544AC_ARG_WITH(tree,
545[ --with-tree add the DOM like tree manipulation APIs (on)])
546if test "$with_minimum" = "yes" -a "$with_tree" = ""
547then
548 with_tree=no
549fi
550if test "$with_tree" = "no" ; then
551 echo Disabling DOM like tree manipulation APIs
552 WITH_TREE=0
553else
554 WITH_TREE=1
555fi
556AC_SUBST(WITH_TREE)
557
William M. Brack97ad4c72003-05-13 08:08:36 +0000558AC_ARG_WITH(ftp,
559[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000560if test "$with_minimum" = "yes" -a "$with_ftp" = ""
561then
562 with_ftp=no
563fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000564if test "$with_ftp" = "no" ; then
565 echo Disabling FTP support
566 WITH_FTP=0
567 FTP_OBJ=
568else
569 WITH_FTP=1
570 FTP_OBJ=nanoftp.o
571fi
572AC_SUBST(WITH_FTP)
573AC_SUBST(FTP_OBJ)
574
William M. Brack97ad4c72003-05-13 08:08:36 +0000575AC_ARG_WITH(http,
576[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000577if test "$with_minimum" = "yes" -a "$with_http" = ""
578then
579 with_http=no
580fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000581if test "$with_http" = "no" ; then
582 echo Disabling HTTP support
583 WITH_HTTP=0
584 HTTP_OBJ=
585else
586 WITH_HTTP=1
587 HTTP_OBJ=nanohttp.o
588fi
589AC_SUBST(WITH_HTTP)
590AC_SUBST(HTTP_OBJ)
591
Daniel Veillard4432df22003-09-28 18:58:27 +0000592AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000593[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000594if test "$with_minimum" = "yes" -a "$with_legacy" = ""
595then
596 with_legacy=no
597fi
598if test "$with_legacy" = "no" ; then
599 echo Disabling deprecated APIs
600 WITH_LEGACY=0
601else
602 WITH_LEGACY=1
603fi
604AC_SUBST(WITH_LEGACY)
605
Daniel Veillard81273902003-09-30 00:43:48 +0000606AC_ARG_WITH(reader,
607[ --with-reader add the xmlReader parsing interface (on)])
608if test "$with_minimum" = "yes" -a "$with_reader" = ""
609then
610 with_reader=no
611fi
612if test "$with_reader" = "no" ; then
613 echo Disabling the xmlReader parsing interface
614 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000615 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000616else
617 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000618 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000619fi
620AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000621AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000622
623AC_ARG_WITH(sax1,
624[ --with-sax1 add the older SAX1 interface (on)])
625if test "$with_minimum" = "yes" -a "$with_sax1" = ""
626then
627 with_sax1=no
628fi
629if test "$with_sax1" = "no" ; then
630 echo Disabling the older SAX1 interface
631 WITH_SAX1=0
632 TEST_SAX=
633else
634 WITH_SAX1=1
635 TEST_SAX=SAXtests
636fi
637AC_SUBST(WITH_SAX1)
638AC_SUBST(TEST_SAX)
639
Daniel Veillard73b013f2003-09-30 12:36:01 +0000640AC_ARG_WITH(push,
641[ --with-push add the PUSH parser interfaces (on)])
642if test "$with_minimum" = "yes" -a "$with_push" = ""
643then
644 with_push=no
645fi
646if test "$with_push" = "no" ; then
647 echo Disabling the PUSH parser interfaces
648 WITH_PUSH=0
649 TEST_PUSH=
650else
651 WITH_PUSH=1
652 TEST_PUSH="XMLPushtests"
653fi
654AC_SUBST(WITH_PUSH)
655AC_SUBST(TEST_PUSH)
656
657AC_ARG_WITH(html,
658[ --with-html add the HTML support (on)])
659if test "$with_minimum" = "yes" -a "$with_html" = ""
660then
661 with_html=no
662fi
663if test "$with_html" = "no" ; then
664 echo Disabling HTML support
665 WITH_HTML=0
666 HTML_OBJ=
667 TEST_HTML=
668else
669 WITH_HTML=1
670 HTML_OBJ="HTMLparser.o HTMLtree.o"
671 TEST_HTML=HTMLtests
672 if "$with_push" != "no" ; then
673 TEST_PHTML=HTMLPushtests
674 else
675 TEST_PHTML=
676 fi
677fi
678AC_SUBST(WITH_HTML)
679AC_SUBST(HTML_OBJ)
680AC_SUBST(TEST_HTML)
681AC_SUBST(TEST_PHTML)
682
Daniel Veillard4432df22003-09-28 18:58:27 +0000683AC_ARG_WITH(valid,
684[ --with-valid add the DTD validation support (on)])
685if test "$with_minimum" = "yes" -a "$with_valid" = ""
686then
687 with_valid=no
688fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000689if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000690 echo Disabling DTD validation support
691 WITH_VALID=0
692 TEST_VALID=
693 TEST_VTIME=
694else
695 WITH_VALID=1
696 TEST_VALID=Validtests
697 TEST_VTIME=VTimingtests
698fi
699AC_SUBST(WITH_VALID)
700AC_SUBST(TEST_VALID)
701AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000702
William M. Brack97ad4c72003-05-13 08:08:36 +0000703AC_ARG_WITH(catalog,
704[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000705if test "$with_minimum" = "yes" -a "$with_catalog" = ""
706then
707 with_catalog=no
708fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000709if test "$with_catalog" = "no" ; then
710 echo Disabling Catalog support
711 WITH_CATALOG=0
712 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000713 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000714else
715 WITH_CATALOG=1
716 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000717 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000718fi
719AC_SUBST(WITH_CATALOG)
720AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000721AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000722
William M. Brack97ad4c72003-05-13 08:08:36 +0000723AC_ARG_WITH(docbook,
724[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000725if test "$with_minimum" = "yes" -a "$with_docbook" = ""
726then
727 with_docbook=no
728fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000729if test "$with_docbook" = "no" ; then
730 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000731 WITH_DOCB=0
732 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000733else
734 WITH_DOCB=1
735 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000736fi
737AC_SUBST(WITH_DOCB)
738AC_SUBST(DOCB_OBJ)
739
740
William M. Brack97ad4c72003-05-13 08:08:36 +0000741AC_ARG_WITH(xpath,
742[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000743if test "$with_minimum" = "yes" -a "$with_xpath" = ""
744then
745 with_xpath=no
746fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000747if test "$with_xpath" = "no" ; then
748 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000749 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000750 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000751 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000752 WITH_XPATH=0
753 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000754 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000755else
756 WITH_XPATH=1
757 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000758 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000759fi
760AC_SUBST(WITH_XPATH)
761AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000762AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000763
William M. Brack97ad4c72003-05-13 08:08:36 +0000764AC_ARG_WITH(xptr,
765[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000766if test "$with_minimum" = "yes" -a "$with_xptr" = ""
767then
768 with_xptr=no
769fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000770if test "$with_xptr" = "no" ; then
771 echo Disabling XPointer support
772 WITH_XPTR=0
773 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000774 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000775else
776 WITH_XPTR=1
777 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000778 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000779fi
780AC_SUBST(WITH_XPTR)
781AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000782AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000783
William M. Brack97ad4c72003-05-13 08:08:36 +0000784AC_ARG_WITH(c14n,
785[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000786if test "$with_minimum" = "yes" -a "$with_c14n" = ""
787then
788 with_c14n=no
789fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000790if test "$with_c14n" = "no" ; then
791 echo Disabling C14N support
792 WITH_C14N=0
793 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000794 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000795else
796 WITH_C14N=1
797 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000798 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000799fi
800AC_SUBST(WITH_C14N)
801AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000802AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000803
William M. Brack97ad4c72003-05-13 08:08:36 +0000804AC_ARG_WITH(xinclude,
805[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000806if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
807then
808 with_xinclude=no
809fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000810if test "$with_xinclude" = "no" ; then
811 echo Disabling XInclude support
812 WITH_XINCLUDE=0
813 XINCLUDE_OBJ=
814 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000815 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000816else
817 WITH_XINCLUDE=1
818 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000819 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000820fi
821AC_SUBST(WITH_XINCLUDE)
822AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000823AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000824
Daniel Veillard6e90d192001-07-03 16:37:49 +0000825WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000826AC_ARG_WITH(iconv,
827[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000828if test "$with_minimum" = "yes" -a "$with_iconv" = ""
829then
830 with_iconv=no
831fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000832if test "$with_iconv" = "no" ; then
833 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000834else
Daniel Veillard220346d2001-12-07 11:33:54 +0000835 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000836 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000837 # Export this since our headers include iconv.h
838 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000839 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000840 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000841
842 AC_CHECK_HEADER(iconv.h,
843 AC_MSG_CHECKING(for iconv)
844 AC_TRY_LINK([#include <stdlib.h>
845#include <iconv.h>],[
846iconv_t cd = iconv_open ("","");
847iconv (cd, NULL, NULL, NULL, NULL);],[
848 AC_MSG_RESULT(yes)
849 WITH_ICONV=1],[
850 AC_MSG_RESULT(no)
851 AC_MSG_CHECKING(for iconv in -liconv)
852
853 _ldflags="${LDFLAGS}"
854 _libs="${LIBS}"
855 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
856 LIBS="${LIBS} -liconv"
857
858 AC_TRY_LINK([#include <stdlib.h>
859#include <iconv.h>],[
860iconv_t cd = iconv_open ("","");
861iconv (cd, NULL, NULL, NULL, NULL);],[
862 AC_MSG_RESULT(yes)
863 WITH_ICONV=1
864 ICONV_LIBS="${ICONV_LIBS} -liconv"
865 LIBS="${_libs}"
866 LDFLAGS="${_ldflags}"],[
867 AC_MSG_RESULT(no)
868 LIBS="${_libs}"
869 LDFLAGS="${_ldflags}"])]))
870fi
Daniel Veillardb82c1662001-12-09 14:00:54 +0000871M_LIBS="-lm"
872XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000873XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000874AC_SUBST(WITH_ICONV)
875
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000876WITH_ISO8859X=1
877AC_ARG_WITH(iso8859x,
878[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000879if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
880then
881 with_iso8859x=no
882fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000883if test "$WITH_ICONV" != "1" ; then
884if test "$with_iso8859x" = "no" ; then
885 echo Disabling ISO8859X support
886 WITH_ISO8859X=0
887fi
888fi
889AC_SUBST(WITH_ISO8859X)
890
William M. Brack97ad4c72003-05-13 08:08:36 +0000891AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000892[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000893if test "$with_minimum" = "yes" -a "$with_schemas" = ""
894then
895 with_schemas=no
896fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000897if test "$with_schemas" = "no" ; then
898 echo "Disabled Schemas/Relax-NG support"
899 WITH_SCHEMAS=0
900 TEST_SCHEMAS=
901else
Daniel Veillard71531f32003-02-05 13:19:53 +0000902 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000903 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000904 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard23e73572002-09-19 19:56:43 +0000905 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000906fi
907AC_SUBST(WITH_SCHEMAS)
908AC_SUBST(TEST_SCHEMAS)
909
William M. Brack97ad4c72003-05-13 08:08:36 +0000910AC_ARG_WITH(regexps,
911[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000912if test "$with_minimum" = "yes" -a "$with_regexps" = ""
913then
914 with_regexps=no
915fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000916if test "$with_regexps" = "no" ; then
917 echo Disabling Regexps support
918 WITH_REGEXPS=0
919 TEST_REGEXPS=
920else
921 WITH_REGEXPS=1
922 TEST_REGEXPS="Regexptests Automatatests"
923fi
924AC_SUBST(WITH_REGEXPS)
925AC_SUBST(TEST_REGEXPS)
926
William M. Brack97ad4c72003-05-13 08:08:36 +0000927AC_ARG_WITH(debug,
928[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000929if test "$with_minimum" = "yes" -a "$with_debug" = ""
930then
931 with_debug=no
932fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000933if test "$with_debug" = "no" ; then
934 echo Disabling DEBUG support
935 WITH_DEBUG=0
936 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000937 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000938else
939 WITH_DEBUG=1
940 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000941 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +0000942fi
943AC_SUBST(WITH_DEBUG)
944AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000945AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +0000946
William M. Brack97ad4c72003-05-13 08:08:36 +0000947AC_ARG_WITH(mem_debug,
948[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000949if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
950then
951 with_mem_debug=no
952fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000953if test "$with_mem_debug" = "yes" ; then
954 echo Enabling memory debug support
955 WITH_MEM_DEBUG=1
956else
957 WITH_MEM_DEBUG=0
958fi
959AC_SUBST(WITH_MEM_DEBUG)
960
Daniel Veillard1638a472003-08-14 01:23:25 +0000961
962WIN32_EXTRA_LIBADD=
963WIN32_EXTRA_LDFLAGS=
964case "$host" in
965 *-*-mingw*)
966 WIN32_EXTRA_LIBADD="-lwsock32"
967 WIN32_EXTRA_LDFLAGS="-no-undefined"
968 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
969 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
970 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
971 ;;
972esac
973AC_SUBST(WIN32_EXTRA_LIBADD)
974AC_SUBST(WIN32_EXTRA_LDFLAGS)
975
976
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000977AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000978AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000979
Daniel Veillardb05deb71999-08-10 19:04:08 +0000980AC_SUBST(XML_LIBDIR)
981AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +0000982AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +0000983AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000984AC_SUBST(XML_INCLUDEDIR)
985AC_SUBST(HTML_DIR)
986AC_SUBST(HAVE_ISNAN)
987AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000988AC_SUBST(PYTHON)
989AC_SUBST(PYTHON_VERSION)
990AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000991AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +0000992
Daniel Veillardb05deb71999-08-10 19:04:08 +0000993AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +0000994AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000995
Daniel Veillard9715c172002-11-25 16:33:40 +0000996dnl for the spec file
997RELDATE=`date +'%a %b %e %Y'`
998AC_SUBST(RELDATE)
999
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001000rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001001ln -s Copyright COPYING
1002
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001003AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile
1004include/libxml/Makefile doc/Makefile example/Makefile python/Makefile
1005python/tests/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc
1006libxml-2.0-uninstalled.pc xml2Conf.sh python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001007
Daniel Veillard9b731d72002-04-14 12:56:08 +00001008chmod +x xml2-config xml2Conf.sh python/setup.py