blob: 392c597c545d3eb62f6442b20fcd397e3ae16b16 [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.2)
Owen Taylor3473f882001-02-23 17:55:21 +00003AC_INIT(entities.c)
Daniel Veillard01791d51998-07-24 19:24:09 +00004AM_CONFIG_HEADER(config.h)
Daniel Veillardd2ade932000-09-30 14:39:55 +00005AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00006
Daniel Veillardcf461992000-03-14 18:30:20 +00007LIBXML_MAJOR_VERSION=2
Daniel Veillard4fc52812003-09-01 20:33:13 +00008LIBXML_MINOR_VERSION=6
Daniel Veillarde6e59cd2003-12-24 11:56:44 +00009LIBXML_MICRO_VERSION=4
Daniel Veillard3e35f8e2003-10-21 00:05:38 +000010LIBXML_MICRO_VERSION_SUFFIX=
Daniel Veillard4fc52812003-09-01 20:33:13 +000011LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
Daniel Veillard14fff061999-06-22 21:49:07 +000012LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
13
Daniel Veillard361d8452000-04-03 19:48:13 +000014LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
15
Daniel Veillard14fff061999-06-22 21:49:07 +000016AC_SUBST(LIBXML_MAJOR_VERSION)
17AC_SUBST(LIBXML_MINOR_VERSION)
18AC_SUBST(LIBXML_MICRO_VERSION)
19AC_SUBST(LIBXML_VERSION)
20AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000021AC_SUBST(LIBXML_VERSION_NUMBER)
Daniel Veillard14fff061999-06-22 21:49:07 +000022
Daniel Veillard361d8452000-04-03 19:48:13 +000023VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000024
Daniel Veillardedfb29b2000-03-14 19:59:05 +000025AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000026
William M. Brack97ad4c72003-05-13 08:08:36 +000027AC_ARG_WITH(html-dir,
28[ --with-html-dir=PATH path to installed docs ])
Daniel Veillard01791d51998-07-24 19:24:09 +000029
30dnl Checks for programs.
31AC_PROG_CC
32AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000033AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000034AC_PATH_PROG(RM, rm, /bin/rm)
35AC_PATH_PROG(MV, mv, /bin/mv)
36AC_PATH_PROG(TAR, tar, /bin/tar)
Daniel Veillard01791d51998-07-24 19:24:09 +000037
Daniel Veillard03109292000-08-14 14:58:22 +000038dnl Make sure we have an ANSI compiler
39AM_C_PROTOTYPES
40test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
41
Daniel Veillard6984e6d2003-12-09 14:20:17 +000042AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000043AM_PROG_LIBTOOL
44
Daniel Veillardd8cf9062003-11-11 21:12:36 +000045# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000046
Daniel Veillard4432df22003-09-28 18:58:27 +000047dnl
48dnl option to build a minimal libxml2 library
49dnl
50AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
51if test "$with_minimum" = "yes"
52then
53 echo "Configuring for a minimal library"
54fi
55
Daniel Veillard71b656e2000-01-05 14:46:17 +000056dnl Checks for zlib library.
Owen Taylor3473f882001-02-23 17:55:21 +000057_cppflags="${CPPFLAGS}"
58_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000059
Daniel Veillard259ff742001-10-06 13:49:59 +000060
Owen Taylor3473f882001-02-23 17:55:21 +000061AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +000062[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +000063 if test "$withval" != "no" -a "$withval" != "yes"; then
64 Z_DIR=$withval
65 CPPFLAGS="${CPPFLAGS} -I$withval/include"
66 LDFLAGS="${LDFLAGS} -L$withval/lib"
67 fi
Daniel Veillard259ff742001-10-06 13:49:59 +000068])
Daniel Veillard4432df22003-09-28 18:58:27 +000069if test "$with_minimum" = "yes" -a "$with_zlib" = ""
70then
71 with_zlib=no
72fi
Daniel Veillard259ff742001-10-06 13:49:59 +000073if test "$with_zlib" = "no"; then
74 echo "Disabling compression support"
75else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000076 AC_CHECK_HEADERS(zlib.h,
77 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +000078 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +000079 if test "x${Z_DIR}" != "x"; then
80 Z_CFLAGS="-I${Z_DIR}/include"
81 Z_LIBS="-L${Z_DIR}/lib -lz"
82 [case ${host} in
83 *-*-solaris*)
84 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
85 ;;
86 esac]
87 else
88 Z_LIBS="-lz"
89 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +000090fi
Owen Taylor3473f882001-02-23 17:55:21 +000091
Owen Taylor3473f882001-02-23 17:55:21 +000092AC_SUBST(Z_CFLAGS)
93AC_SUBST(Z_LIBS)
94
95CPPFLAGS=${_cppflags}
96LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000097
Daniel Veillard01791d51998-07-24 19:24:09 +000098dnl Checks for header files.
99AC_HEADER_DIRENT
100AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000101AC_CHECK_HEADERS([fcntl.h])
102AC_CHECK_HEADERS([unistd.h])
103AC_CHECK_HEADERS([ctype.h])
104AC_CHECK_HEADERS([dirent.h])
105AC_CHECK_HEADERS([errno.h])
106AC_CHECK_HEADERS([malloc.h])
107AC_CHECK_HEADERS([stdarg.h])
108AC_CHECK_HEADERS([sys/stat.h])
109AC_CHECK_HEADERS([sys/types.h])
110AC_CHECK_HEADERS([time.h])
111AC_CHECK_HEADERS([ansidecl.h])
112AC_CHECK_HEADERS([ieeefp.h])
113AC_CHECK_HEADERS([nan.h])
114AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000115AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000116AC_CHECK_HEADERS([fp_class.h])
117AC_CHECK_HEADERS([float.h])
118AC_CHECK_HEADERS([stdlib.h])
119AC_CHECK_HEADERS([sys/socket.h], [], [],
120[#if HAVE_SYS_TYPES_H
121# include <sys/types.h>
122# endif
123])
124AC_CHECK_HEADERS([netinet/in.h], [], [],
125[#if HAVE_SYS_TYPES_H
126# include <sys/types.h>
127# endif
128])
129AC_CHECK_HEADERS([arpa/inet.h], [], [],
130[#if HAVE_SYS_TYPES_H
131# include <sys/types.h>
132# endif
133#if HAVE_ARPA_INET_H
134# include <arpa/inet.h>
135# endif
136])
137AC_CHECK_HEADERS([netdb.h])
138AC_CHECK_HEADERS([sys/time.h])
139AC_CHECK_HEADERS([sys/select.h])
140AC_CHECK_HEADERS([sys/mman.h])
141AC_CHECK_HEADERS([sys/timeb.h])
142AC_CHECK_HEADERS([signal.h])
143AC_CHECK_HEADERS([arpa/nameser.h], [], [],
144[#if HAVE_SYS_TYPES_H
145# include <sys/types.h>
146# endif
147])
148AC_CHECK_HEADERS([resolv.h], [], [],
149[#if HAVE_SYS_TYPES_H
150# include <sys/types.h>
151# endif
152#if HAVE_NETINET_IN_H
153# include <netinet/in.h>
154# endif
155#if HAVE_ARPA_NAMESER_H
156# include <arpa/nameser.h>
157# endif
158])
Daniel Veillard01791d51998-07-24 19:24:09 +0000159
Daniel Veillard1164e751999-02-16 16:29:17 +0000160dnl Specific dir for HTML output ?
161if test "x$with_html_dir" = "x" ; then
Daniel Veillard0a6c3582001-03-14 19:15:37 +0000162 HTML_DIR='$(prefix)/doc'
Daniel Veillard1164e751999-02-16 16:29:17 +0000163else
164 HTML_DIR=$with_html_dir
165fi
166
167AC_SUBST(HTML_DIR)
168
Daniel Veillard01791d51998-07-24 19:24:09 +0000169dnl Checks for library functions.
170AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000171AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000172AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000173AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000174AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000175
Daniel Veillard92ad2102001-03-27 12:47:33 +0000176dnl Checking the standard string functions availability
177AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
178 NEED_TRIO=1)
179
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000180dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000181AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
182AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
183AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000184
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000185dnl Determine what socket length (socklen_t) data type is
186AC_MSG_CHECKING([for type of socket length (socklen_t)])
187AC_TRY_COMPILE2([
188#include <stddef.h>
189#include <sys/types.h>
190#include <sys/socket.h>],[
191(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
192 AC_MSG_RESULT(socklen_t *)
193 SOCKLEN_T=socklen_t],[
194 AC_TRY_COMPILE2([
195#include <stddef.h>
196#include <sys/types.h>
197#include <sys/socket.h>],[
198(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
199 AC_MSG_RESULT(size_t *)
200 SOCKLEN_T=size_t],[
201 AC_TRY_COMPILE2([
202#include <stddef.h>
203#include <sys/types.h>
204#include <sys/socket.h>],[
205(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
206 AC_MSG_RESULT(int *)
207 SOCKLEN_T=int],[
208 AC_MSG_WARN(could not determine)])])])
Daniel Veillardc790bf42003-10-11 10:50:10 +0000209AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000210
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000211dnl ***********************Checking for availability of IPv6*******************
212
213AC_MSG_CHECKING([whether to enable IPv6])
214AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000215if test "$with_minimum" = "yes"
216then
217 enable_ipv6=no
218fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000219if test $enable_ipv6 = yes; then
220 have_ipv6=no
221 AC_TRY_COMPILE([
222 #include <sys/socket.h>
223 #include <sys/types.h>], [
224 struct sockaddr_storage ss;
225 socket(AF_INET6, SOCK_STREAM, 0)
226 ],
227 have_ipv6=yes,
228 have_ipv6=no
229 )
230 AC_MSG_RESULT($have_ipv6)
231
William M. Brack476cd962003-08-13 11:09:42 +0000232 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000233 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000234
235 have_getaddrinfo=no
236 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
237 if test $have_getaddrinfo != yes; then
238 for lib in bsd socket inet; do
239 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
240 done
241 fi
242
William M. Brack476cd962003-08-13 11:09:42 +0000243 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000244 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000245 fi
246 fi
247fi
248
249dnl ******************************End IPv6 checks******************************
250
Daniel Veillardb05deb71999-08-10 19:04:08 +0000251dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000252AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000253 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000254
Daniel Veillardc790bf42003-10-11 10:50:10 +0000255AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
256 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000257
258XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000259XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000260
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000261dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000262dnl Extra flags
263dnl
264XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000265RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000266
Daniel Veillardd94849b2003-07-28 13:02:24 +0000267AC_ARG_WITH(fexceptions,
268[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000269if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
270then
271 with_fexceptions=no
272fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000273dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000274dnl Workaround for native compilers
275dnl HP : http://bugs.gnome.org/db/31/3163.html
276dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000277dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000278if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000279 case "${host}" in
280 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000281 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000282 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000283 *-dec-osf* )
284 CFLAGS="${CFLAGS} -ieee"
285 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000286 alpha*-*-linux* )
287 CFLAGS="${CFLAGS} -ieee"
288 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000289 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000290else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000291 if test "$with_fexceptions" = "yes"
292 then
293 #
294 # Not activated by default because this inflates the code size
295 # Used to allow propagation of C++ exceptions through the library
296 #
297 CFLAGS="${CFLAGS} -fexceptions"
298 fi
299
Daniel Veillardd574f782001-03-14 19:40:17 +0000300 CFLAGS="${CFLAGS} -Wall"
Daniel Veillard14839d52001-06-06 16:11:56 +0000301 case "${host}" in
302 alpha*-*-linux* )
303 CFLAGS="${CFLAGS} -mieee"
304 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000305 alpha*-*-osf* )
306 CFLAGS="${CFLAGS} -mieee"
307 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000308 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000309fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000310case ${host} in
311 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000312 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
313 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000314 hppa*-hp-mpeix)
315 NEED_TRIO=1
316 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000317esac
318
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000319
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000320dnl
321dnl check for python
322dnl
323
324PYTHON=
325PYTHON_VERSION=
326PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000327PYTHON_SITE_PACKAGES=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000328pythondir=
William M. Brack97ad4c72003-05-13 08:08:36 +0000329AC_ARG_WITH(python,
330[ --with-python[[=DIR]] build Python bindings if found])
Daniel Veillard4432df22003-09-28 18:58:27 +0000331if test "$with_minimum" = "yes" -a "$with_python" = ""
332then
333 with_python=no
334fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000335if test "$with_python" != "no" ; then
336 if test -x "$with_python/bin/python"
337 then
338 echo Found python in $with_python/bin/python
339 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000340 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000341 if test -x "$with_python"
342 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000343 echo Found python in $with_python
344 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000345 else
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000346 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000347 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000348 fi
349 if test "$PYTHON" != ""
350 then
351 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
352 echo Found Python version $PYTHON_VERSION
353 fi
354 if test "$PYTHON_VERSION" != ""
355 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000356 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
357 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000358 then
359 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000360 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000361 else
362 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
363 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000364 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000365 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000366 else
367 if test -r /usr/include/python$PYTHON_VERSION/Python.h
368 then
369 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000370 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000371 else
372 echo could not find python$PYTHON_VERSION/Python.h
373 fi
374 fi
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000375 if ! test -d "$PYTHON_SITE_PACKAGES"
376 then
377 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
378 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000379 fi
380 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000381 if test "$with_python" != ""
382 then
383 pythondir='$(PYTHON_SITE_PACKAGES)'
384 else
385 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
386 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000387fi
388AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000389if test "$PYTHON_INCLUDES" != ""
390then
391 PYTHON_SUBDIR=python
392else
393 PYTHON_SUBDIR=
394fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000395AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000396AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000397
Daniel Veillard437b87b2000-01-03 17:30:46 +0000398dnl
399dnl Tester makes use of readline if present
400dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000401_cppflags="${CPPFLAGS}"
402_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000403
Daniel Veillard03109292000-08-14 14:58:22 +0000404AC_ARG_WITH(readline,
405[ --with-readline=DIR use readline in DIR],[
406 if test "$withval" != "no" -a "$withval" != "yes"; then
407 RDL_DIR=$withval
408 CPPFLAGS="${CPPFLAGS} -I$withval/include"
409 LDFLAGS="${LDFLAGS} -L$withval/lib"
410 fi
411])
Daniel Veillard4432df22003-09-28 18:58:27 +0000412if test "$with_minimum" = "yes" -a "$with_readline" = ""
413then
414 with_readline=no
415fi
Daniel Veillard03109292000-08-14 14:58:22 +0000416
Daniel Veillard361d8452000-04-03 19:48:13 +0000417dnl
Daniel Veillardf6eea272001-01-18 12:17:12 +0000418dnl specific tests to setup DV's devel environment with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000419dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000420dnl
William M. Brack871611b2003-10-18 04:53:14 +0000421if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
422 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]]
423 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000424 if test "$with_minimum" != "yes"
425 then
426 if test "${with_mem_debug}" = "" ; then
427 with_mem_debug="yes"
428 fi
429 if test "${with_docbook}" = "" ; then
430 with_docbook="yes"
431 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000432 fi
Daniel Veillard0ba59232002-02-10 13:20:39 +0000433 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 +0000434 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000435dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000436else
437 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000438fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000439AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000440
441dnl
442dnl Check for trio string functions
443dnl
444
445if test "${NEED_TRIO}" = "1" ; then
446 echo Adding trio library for string functions
447 WITH_TRIO=1
448else
449 WITH_TRIO=0
450fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000451AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000452AC_SUBST(WITH_TRIO)
453
Daniel Veillardf6eea272001-01-18 12:17:12 +0000454dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000455dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000456dnl
457
Daniel Veillardb8478642001-10-12 17:29:10 +0000458THREAD_LIBS=""
459WITH_THREADS=0
460THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000461TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000462THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000463
William M. Brack97ad4c72003-05-13 08:08:36 +0000464AC_ARG_WITH(threads,
465[ --with-threads add multithread support(on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000466if test "$with_minimum" = "yes" -a "$with_threads" = ""
467then
468 with_threads=no
469fi
Daniel Veillard84942712003-04-18 14:40:05 +0000470if test "$with_threads" = "no" ; then
471 echo Disabling multithreaded support
472else
Daniel Veillardb8478642001-10-12 17:29:10 +0000473 echo Enabling multithreaded support
474
475 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000476 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000477 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000478 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
479 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000480 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000481 case $host_os in
482 *mingw32*) WITH_THREADS="1"
483 THREADS_W32="Win32"
484 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
485 ;;
486 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000487 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000488 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
489 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000490 fi
491fi
William M. Brack97ad4c72003-05-13 08:08:36 +0000492AC_ARG_WITH(thread-alloc,
493[ --with-thread-alloc add per-thread memory(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000494if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
495then
496 with_thread_alloc=no
497fi
Daniel Veillardab7488e2001-10-17 11:30:37 +0000498if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
499 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000500fi
501
Daniel Veillardb8478642001-10-12 17:29:10 +0000502AC_SUBST(THREAD_LIBS)
503AC_SUBST(WITH_THREADS)
504AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000505AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000506AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000507
William M. Brack97ad4c72003-05-13 08:08:36 +0000508AC_ARG_WITH(history,
509[ --with-history add history support to xmllint shell(off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000510if test "$with_minimum" = "yes" -a "$with_history" = ""
511then
512 with_history=no
513fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000514if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000515 echo Enabling xmllint shell history
516 dnl check for terminal library. this is a very cool solution
517 dnl from octave's configure.in
518 unset tcap
519 for termlib in ncurses curses termcap terminfo termlib; do
520 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
521 test -n "$tcap" && break
522 done
523
524 AC_CHECK_HEADER(readline/history.h,
525 AC_CHECK_LIB(history, append_history,[
526 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000527 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000528 AC_CHECK_HEADER(readline/readline.h,
529 AC_CHECK_LIB(readline, readline,[
530 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000531 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000532 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
533 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
534 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
535 else
536 CPPFLAGS=${_cppflags}
537 fi
538 LDFLAGS=${_ldflags}
539fi
540
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000541AC_ARG_WITH(output,
Daniel Veillard652327a2003-09-29 18:02:38 +0000542[ --with-output add the serialization support (on)])
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000543if test "$with_minimum" = "yes" -a "$with_output" = ""
544then
545 with_output=no
546fi
547if test "$with_output" = "no" ; then
548 echo Disabling serialization/saving support
549 WITH_OUTPUT=0
550else
551 WITH_OUTPUT=1
552fi
553AC_SUBST(WITH_OUTPUT)
554
Daniel Veillard652327a2003-09-29 18:02:38 +0000555AC_ARG_WITH(tree,
556[ --with-tree add the DOM like tree manipulation APIs (on)])
557if test "$with_minimum" = "yes" -a "$with_tree" = ""
558then
559 with_tree=no
560fi
561if test "$with_tree" = "no" ; then
562 echo Disabling DOM like tree manipulation APIs
563 WITH_TREE=0
564else
565 WITH_TREE=1
566fi
567AC_SUBST(WITH_TREE)
568
William M. Brack97ad4c72003-05-13 08:08:36 +0000569AC_ARG_WITH(ftp,
570[ --with-ftp add the FTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000571if test "$with_minimum" = "yes" -a "$with_ftp" = ""
572then
573 with_ftp=no
574fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000575if test "$with_ftp" = "no" ; then
576 echo Disabling FTP support
577 WITH_FTP=0
578 FTP_OBJ=
579else
580 WITH_FTP=1
581 FTP_OBJ=nanoftp.o
582fi
583AC_SUBST(WITH_FTP)
584AC_SUBST(FTP_OBJ)
585
William M. Brack97ad4c72003-05-13 08:08:36 +0000586AC_ARG_WITH(http,
587[ --with-http add the HTTP support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000588if test "$with_minimum" = "yes" -a "$with_http" = ""
589then
590 with_http=no
591fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000592if test "$with_http" = "no" ; then
593 echo Disabling HTTP support
594 WITH_HTTP=0
595 HTTP_OBJ=
596else
597 WITH_HTTP=1
598 HTTP_OBJ=nanohttp.o
599fi
600AC_SUBST(WITH_HTTP)
601AC_SUBST(HTTP_OBJ)
602
Daniel Veillard4432df22003-09-28 18:58:27 +0000603AC_ARG_WITH(legacy,
Daniel Veillard652327a2003-09-29 18:02:38 +0000604[ --with-legacy add deprecated APIs for compatibility (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000605if test "$with_minimum" = "yes" -a "$with_legacy" = ""
606then
607 with_legacy=no
608fi
609if test "$with_legacy" = "no" ; then
610 echo Disabling deprecated APIs
611 WITH_LEGACY=0
612else
613 WITH_LEGACY=1
614fi
615AC_SUBST(WITH_LEGACY)
616
Daniel Veillard81273902003-09-30 00:43:48 +0000617AC_ARG_WITH(reader,
618[ --with-reader add the xmlReader parsing interface (on)])
619if test "$with_minimum" = "yes" -a "$with_reader" = ""
620then
621 with_reader=no
622fi
623if test "$with_reader" = "no" ; then
624 echo Disabling the xmlReader parsing interface
625 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000626 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000627else
628 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000629 READER_TEST=Readertests
Daniel Veillard81273902003-09-30 00:43:48 +0000630fi
631AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000632AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000633
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000634AC_ARG_WITH(pattern,
635[ --with-pattern add the xmlPattern selection interface (on)])
636if test "$with_minimum" = "yes" -a "$with_pattern" = ""
637then
638 with_pattern=no
639fi
640if test "$with_pattern" = "no" ; then
641 echo Disabling the xmlPattern parsing interface
642 WITH_PATTERN=0
643 PATTERN_TEST=
644else
645 WITH_PATTERN=1
646 PATTERN_TEST=Patterntests
647fi
648AC_SUBST(WITH_PATTERN)
649AC_SUBST(PATTERN_TEST)
650
Daniel Veillard1d211e22003-10-20 22:32:39 +0000651AC_ARG_WITH(writer,
652[ --with-writer add the xmlWriter saving interface (on)])
653if test "$with_minimum" = "yes" -a "$with_writer" = ""
654then
655 with_writer=no
656fi
657if test "$with_writer" = "no" ; then
658 echo Disabling the xmlWriter saving interface
659 WITH_WRITER=0
660# WRITER_TEST=
661else
662 WITH_WRITER=1
663# WRITER_TEST=Writertests
664fi
665AC_SUBST(WITH_WRITER)
666#AC_SUBST(WRITER_TEST)
667
Daniel Veillard81273902003-09-30 00:43:48 +0000668AC_ARG_WITH(sax1,
669[ --with-sax1 add the older SAX1 interface (on)])
670if test "$with_minimum" = "yes" -a "$with_sax1" = ""
671then
672 with_sax1=no
673fi
674if test "$with_sax1" = "no" ; then
675 echo Disabling the older SAX1 interface
676 WITH_SAX1=0
677 TEST_SAX=
678else
679 WITH_SAX1=1
680 TEST_SAX=SAXtests
681fi
682AC_SUBST(WITH_SAX1)
683AC_SUBST(TEST_SAX)
684
Daniel Veillard73b013f2003-09-30 12:36:01 +0000685AC_ARG_WITH(push,
686[ --with-push add the PUSH parser interfaces (on)])
687if test "$with_minimum" = "yes" -a "$with_push" = ""
688then
689 with_push=no
690fi
691if test "$with_push" = "no" ; then
692 echo Disabling the PUSH parser interfaces
693 WITH_PUSH=0
694 TEST_PUSH=
695else
696 WITH_PUSH=1
697 TEST_PUSH="XMLPushtests"
698fi
699AC_SUBST(WITH_PUSH)
700AC_SUBST(TEST_PUSH)
701
702AC_ARG_WITH(html,
703[ --with-html add the HTML support (on)])
704if test "$with_minimum" = "yes" -a "$with_html" = ""
705then
706 with_html=no
707fi
708if test "$with_html" = "no" ; then
709 echo Disabling HTML support
710 WITH_HTML=0
711 HTML_OBJ=
712 TEST_HTML=
713else
714 WITH_HTML=1
715 HTML_OBJ="HTMLparser.o HTMLtree.o"
716 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +0000717 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +0000718 TEST_PHTML=HTMLPushtests
719 else
720 TEST_PHTML=
721 fi
722fi
723AC_SUBST(WITH_HTML)
724AC_SUBST(HTML_OBJ)
725AC_SUBST(TEST_HTML)
726AC_SUBST(TEST_PHTML)
727
Daniel Veillard4432df22003-09-28 18:58:27 +0000728AC_ARG_WITH(valid,
729[ --with-valid add the DTD validation support (on)])
730if test "$with_minimum" = "yes" -a "$with_valid" = ""
731then
732 with_valid=no
733fi
Daniel Veillard73b013f2003-09-30 12:36:01 +0000734if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +0000735 echo Disabling DTD validation support
736 WITH_VALID=0
737 TEST_VALID=
738 TEST_VTIME=
739else
740 WITH_VALID=1
741 TEST_VALID=Validtests
742 TEST_VTIME=VTimingtests
743fi
744AC_SUBST(WITH_VALID)
745AC_SUBST(TEST_VALID)
746AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +0000747
William M. Brack97ad4c72003-05-13 08:08:36 +0000748AC_ARG_WITH(catalog,
749[ --with-catalog add the Catalog support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000750if test "$with_minimum" = "yes" -a "$with_catalog" = ""
751then
752 with_catalog=no
753fi
Daniel Veillarda7374592001-05-10 14:17:55 +0000754if test "$with_catalog" = "no" ; then
755 echo Disabling Catalog support
756 WITH_CATALOG=0
757 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000758 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +0000759else
760 WITH_CATALOG=1
761 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +0000762 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +0000763fi
764AC_SUBST(WITH_CATALOG)
765AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000766AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +0000767
William M. Brack97ad4c72003-05-13 08:08:36 +0000768AC_ARG_WITH(docbook,
769[ --with-docbook add Docbook SGML support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000770if test "$with_minimum" = "yes" -a "$with_docbook" = ""
771then
772 with_docbook=no
773fi
Daniel Veillardb59076b2001-04-29 17:04:07 +0000774if test "$with_docbook" = "no" ; then
775 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +0000776 WITH_DOCB=0
777 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +0000778else
779 WITH_DOCB=1
780 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +0000781fi
782AC_SUBST(WITH_DOCB)
783AC_SUBST(DOCB_OBJ)
784
785
William M. Brack97ad4c72003-05-13 08:08:36 +0000786AC_ARG_WITH(xpath,
787[ --with-xpath add the XPATH support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000788if test "$with_minimum" = "yes" -a "$with_xpath" = ""
789then
790 with_xpath=no
791fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000792if test "$with_xpath" = "no" ; then
793 echo Disabling XPATH support
Daniel Veillard52afe802000-10-22 16:56:02 +0000794 with_xptr="no"
Daniel Veillard34de97f2002-04-30 14:29:22 +0000795 with_c14n="no"
Daniel Veillard070803b2002-05-03 07:29:38 +0000796 with_xinclude="no"
Daniel Veillard361d8452000-04-03 19:48:13 +0000797 WITH_XPATH=0
798 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000799 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +0000800else
801 WITH_XPATH=1
802 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000803 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +0000804fi
805AC_SUBST(WITH_XPATH)
806AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000807AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +0000808
William M. Brack97ad4c72003-05-13 08:08:36 +0000809AC_ARG_WITH(xptr,
810[ --with-xptr add the XPointer support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000811if test "$with_minimum" = "yes" -a "$with_xptr" = ""
812then
813 with_xptr=no
814fi
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000815if test "$with_xptr" = "no" ; then
816 echo Disabling XPointer support
817 WITH_XPTR=0
818 XPTR_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000819 TEST_XPTR=
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000820else
821 WITH_XPTR=1
822 XPTR_OBJ=xpointer.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000823 TEST_XPTR=XPtrtests
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000824fi
825AC_SUBST(WITH_XPTR)
826AC_SUBST(XPTR_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000827AC_SUBST(TEST_XPTR)
Daniel Veillardc8df0aa2000-10-10 23:50:30 +0000828
William M. Brack97ad4c72003-05-13 08:08:36 +0000829AC_ARG_WITH(c14n,
830[ --with-c14n add the Canonicalization support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000831if test "$with_minimum" = "yes" -a "$with_c14n" = ""
832then
833 with_c14n=no
834fi
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000835if test "$with_c14n" = "no" ; then
836 echo Disabling C14N support
837 WITH_C14N=0
838 C14N_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000839 TEST_C14N=
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000840else
841 WITH_C14N=1
842 C14N_OBJ="c14n.c"
Daniel Veillard4432df22003-09-28 18:58:27 +0000843 TEST_C14N=C14Ntests
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000844fi
845AC_SUBST(WITH_C14N)
846AC_SUBST(C14N_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000847AC_SUBST(TEST_C14N)
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000848
William M. Brack97ad4c72003-05-13 08:08:36 +0000849AC_ARG_WITH(xinclude,
850[ --with-xinclude add the XInclude support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000851if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
852then
853 with_xinclude=no
854fi
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000855if test "$with_xinclude" = "no" ; then
856 echo Disabling XInclude support
857 WITH_XINCLUDE=0
858 XINCLUDE_OBJ=
859 with_xinclude="no"
Daniel Veillard4432df22003-09-28 18:58:27 +0000860 TEST_XINCLUDE=
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000861else
862 WITH_XINCLUDE=1
863 XINCLUDE_OBJ=xinclude.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000864 TEST_XINCLUDE=XIncludetests
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000865fi
866AC_SUBST(WITH_XINCLUDE)
867AC_SUBST(XINCLUDE_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000868AC_SUBST(TEST_XINCLUDE)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +0000869
Daniel Veillard6e90d192001-07-03 16:37:49 +0000870WITH_ICONV=0
William M. Brack97ad4c72003-05-13 08:08:36 +0000871AC_ARG_WITH(iconv,
872[ --with-iconv[[=DIR]] add ICONV support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000873if test "$with_minimum" = "yes" -a "$with_iconv" = ""
874then
875 with_iconv=no
876fi
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000877if test "$with_iconv" = "no" ; then
878 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +0000879else
Daniel Veillard220346d2001-12-07 11:33:54 +0000880 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +0000881 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +0000882 # Export this since our headers include iconv.h
883 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +0000884 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000885 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +0000886
887 AC_CHECK_HEADER(iconv.h,
888 AC_MSG_CHECKING(for iconv)
889 AC_TRY_LINK([#include <stdlib.h>
890#include <iconv.h>],[
891iconv_t cd = iconv_open ("","");
892iconv (cd, NULL, NULL, NULL, NULL);],[
893 AC_MSG_RESULT(yes)
894 WITH_ICONV=1],[
895 AC_MSG_RESULT(no)
896 AC_MSG_CHECKING(for iconv in -liconv)
897
898 _ldflags="${LDFLAGS}"
899 _libs="${LIBS}"
900 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
901 LIBS="${LIBS} -liconv"
902
903 AC_TRY_LINK([#include <stdlib.h>
904#include <iconv.h>],[
905iconv_t cd = iconv_open ("","");
906iconv (cd, NULL, NULL, NULL, NULL);],[
907 AC_MSG_RESULT(yes)
908 WITH_ICONV=1
909 ICONV_LIBS="${ICONV_LIBS} -liconv"
910 LIBS="${_libs}"
911 LDFLAGS="${_ldflags}"],[
912 AC_MSG_RESULT(no)
913 LIBS="${_libs}"
914 LDFLAGS="${_ldflags}"])]))
915fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000916case "$host" in
917 *mingw*) M_LIBS=""
918 ;;
919 *) M_LIBS="-lm"
920 ;;
921esac
Daniel Veillardb82c1662001-12-09 14:00:54 +0000922XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +0000923XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000924AC_SUBST(WITH_ICONV)
925
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000926WITH_ISO8859X=1
927AC_ARG_WITH(iso8859x,
928[ --with-iso8859x add ISO8859X support if no iconv (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000929if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
930then
931 with_iso8859x=no
932fi
Daniel Veillard01fc1a92003-07-30 15:12:01 +0000933if test "$WITH_ICONV" != "1" ; then
934if test "$with_iso8859x" = "no" ; then
935 echo Disabling ISO8859X support
936 WITH_ISO8859X=0
937fi
938fi
939AC_SUBST(WITH_ISO8859X)
940
William M. Brack97ad4c72003-05-13 08:08:36 +0000941AC_ARG_WITH(schemas,
Daniel Veillard73b013f2003-09-30 12:36:01 +0000942[ --with-schemas add Relax-NG and experimental Schemas support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000943if test "$with_minimum" = "yes" -a "$with_schemas" = ""
944then
945 with_schemas=no
946fi
Daniel Veillardef4d3bc2003-02-07 12:38:22 +0000947if test "$with_schemas" = "no" ; then
948 echo "Disabled Schemas/Relax-NG support"
949 WITH_SCHEMAS=0
950 TEST_SCHEMAS=
951else
Daniel Veillard71531f32003-02-05 13:19:53 +0000952 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +0000953 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +0000954 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard23e73572002-09-19 19:56:43 +0000955 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +0000956fi
957AC_SUBST(WITH_SCHEMAS)
958AC_SUBST(TEST_SCHEMAS)
959
William M. Brack97ad4c72003-05-13 08:08:36 +0000960AC_ARG_WITH(regexps,
961[ --with-regexps add Regular Expressions support (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000962if test "$with_minimum" = "yes" -a "$with_regexps" = ""
963then
964 with_regexps=no
965fi
Daniel Veillard23e73572002-09-19 19:56:43 +0000966if test "$with_regexps" = "no" ; then
967 echo Disabling Regexps support
968 WITH_REGEXPS=0
969 TEST_REGEXPS=
970else
971 WITH_REGEXPS=1
972 TEST_REGEXPS="Regexptests Automatatests"
973fi
974AC_SUBST(WITH_REGEXPS)
975AC_SUBST(TEST_REGEXPS)
976
William M. Brack97ad4c72003-05-13 08:08:36 +0000977AC_ARG_WITH(debug,
978[ --with-debug add the debugging module (on)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000979if test "$with_minimum" = "yes" -a "$with_debug" = ""
980then
981 with_debug=no
982fi
Daniel Veillard361d8452000-04-03 19:48:13 +0000983if test "$with_debug" = "no" ; then
984 echo Disabling DEBUG support
985 WITH_DEBUG=0
986 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +0000987 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +0000988else
989 WITH_DEBUG=1
990 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +0000991 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +0000992fi
993AC_SUBST(WITH_DEBUG)
994AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +0000995AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +0000996
William M. Brack97ad4c72003-05-13 08:08:36 +0000997AC_ARG_WITH(mem_debug,
998[ --with-mem-debug add the memory debugging module (off)])
Daniel Veillard4432df22003-09-28 18:58:27 +0000999if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
1000then
1001 with_mem_debug=no
1002fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001003if test "$with_mem_debug" = "yes" ; then
1004 echo Enabling memory debug support
1005 WITH_MEM_DEBUG=1
1006else
1007 WITH_MEM_DEBUG=0
1008fi
1009AC_SUBST(WITH_MEM_DEBUG)
1010
Daniel Veillard1638a472003-08-14 01:23:25 +00001011
1012WIN32_EXTRA_LIBADD=
1013WIN32_EXTRA_LDFLAGS=
1014case "$host" in
1015 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001016 CPPFLAGS="$CPPFLAGS -DWIN32"
1017 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001018 WIN32_EXTRA_LDFLAGS="-no-undefined"
1019 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1020 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1021 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1022 ;;
1023esac
1024AC_SUBST(WIN32_EXTRA_LIBADD)
1025AC_SUBST(WIN32_EXTRA_LDFLAGS)
1026
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001027AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001028AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001029AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001030
Daniel Veillardb05deb71999-08-10 19:04:08 +00001031AC_SUBST(XML_LIBDIR)
1032AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001033AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001034AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001035AC_SUBST(XML_INCLUDEDIR)
1036AC_SUBST(HTML_DIR)
1037AC_SUBST(HAVE_ISNAN)
1038AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001039AC_SUBST(PYTHON)
1040AC_SUBST(PYTHON_VERSION)
1041AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001042AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001043
Daniel Veillardb05deb71999-08-10 19:04:08 +00001044AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001045AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001046
Daniel Veillard9715c172002-11-25 16:33:40 +00001047dnl for the spec file
1048RELDATE=`date +'%a %b %e %Y'`
1049AC_SUBST(RELDATE)
1050
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001051rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001052ln -s Copyright COPYING
1053
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001054AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile
Daniel Veillardd8cf9062003-11-11 21:12:36 +00001055include/libxml/Makefile doc/Makefile doc/examples/Makefile
1056example/Makefile python/Makefile python/tests/Makefile
1057include/libxml/xmlversion.h xml2-config libxml-2.0.pc
AEST 2003 Malcolm Tredinnick06431122003-09-30 02:36:08 +00001058libxml-2.0-uninstalled.pc xml2Conf.sh python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001059
Daniel Veillard9b731d72002-04-14 12:56:08 +00001060chmod +x xml2-config xml2Conf.sh python/setup.py