blob: f3af76ef5675665916b285d693a860ab0dba7f4c [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
Owen Taylor3473f882001-02-23 17:55:21 +00002AC_INIT(entities.c)
Daniel Veillard01791d51998-07-24 19:24:09 +00003AM_CONFIG_HEADER(config.h)
Daniel Veillardd2ade932000-09-30 14:39:55 +00004AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00005
Daniel Veillardcf461992000-03-14 18:30:20 +00006LIBXML_MAJOR_VERSION=2
Daniel Veillard4fc52812003-09-01 20:33:13 +00007LIBXML_MINOR_VERSION=6
Daniel Veillard33b20b72005-09-12 21:43:20 +00008LIBXML_MICRO_VERSION=22
Daniel Veillard3e35f8e2003-10-21 00:05:38 +00009LIBXML_MICRO_VERSION_SUFFIX=
Daniel Veillard4fc52812003-09-01 20:33:13 +000010LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
Daniel Veillard14fff061999-06-22 21:49:07 +000011LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
12
Daniel Veillard361d8452000-04-03 19:48:13 +000013LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
14
William M. Brackf4025492004-08-18 21:08:46 +000015if test -f CVS/Entries; then
Daniel Veillarddab93ea2004-08-20 16:47:10 +000016 extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
17 echo extra=$extra
18 if test "$extra" != ""
19 then
20 LIBXML_VERSION_EXTRA="-CVS$extra"
21 fi
William M. Brackf4025492004-08-18 21:08:46 +000022fi
Daniel Veillard14fff061999-06-22 21:49:07 +000023AC_SUBST(LIBXML_MAJOR_VERSION)
24AC_SUBST(LIBXML_MINOR_VERSION)
25AC_SUBST(LIBXML_MICRO_VERSION)
26AC_SUBST(LIBXML_VERSION)
27AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000028AC_SUBST(LIBXML_VERSION_NUMBER)
William M. Brackf4025492004-08-18 21:08:46 +000029AC_SUBST(LIBXML_VERSION_EXTRA)
Daniel Veillard14fff061999-06-22 21:49:07 +000030
Daniel Veillard361d8452000-04-03 19:48:13 +000031VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000032
Daniel Veillardedfb29b2000-03-14 19:59:05 +000033AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000034
Daniel Veillard01791d51998-07-24 19:24:09 +000035dnl Checks for programs.
36AC_PROG_CC
37AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000038AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000039AC_PATH_PROG(RM, rm, /bin/rm)
40AC_PATH_PROG(MV, mv, /bin/mv)
41AC_PATH_PROG(TAR, tar, /bin/tar)
William M. Brack1826d0a2004-07-21 09:03:57 +000042AC_PATH_PROG(PERL, perl, /usr/bin/perl)
Daniel Veillard8b817da2004-09-30 09:19:33 +000043AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
Daniel Veillard06500c82004-09-07 09:12:44 +000044AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
Daniel Veillard01791d51998-07-24 19:24:09 +000045
Daniel Veillard03109292000-08-14 14:58:22 +000046dnl Make sure we have an ANSI compiler
47AM_C_PROTOTYPES
48test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
49
Daniel Veillard6984e6d2003-12-09 14:20:17 +000050AC_LIBTOOL_WIN32_DLL
Daniel Veillard01791d51998-07-24 19:24:09 +000051AM_PROG_LIBTOOL
52
Daniel Veillardd8cf9062003-11-11 21:12:36 +000053# AM_MAINTAINER_MODE
Daniel Veillard01791d51998-07-24 19:24:09 +000054
Daniel Veillard4432df22003-09-28 18:58:27 +000055dnl
William M. Brack21e4ef22005-01-02 09:53:13 +000056dnl We process the AC_ARG_WITH first so that later we can modify
57dnl some of them to try to prevent impossible combinations. This
58dnl also allows up so alphabetize the choices
Daniel Veillard4432df22003-09-28 18:58:27 +000059dnl
Daniel Veillard4432df22003-09-28 18:58:27 +000060
William M. Brack21e4ef22005-01-02 09:53:13 +000061dnl
62dnl zlib option might change flags, so we save them initially
63dnl
Owen Taylor3473f882001-02-23 17:55:21 +000064_cppflags="${CPPFLAGS}"
65_ldflags="${LDFLAGS}"
Daniel Veillard71b656e2000-01-05 14:46:17 +000066
William M. Brack21e4ef22005-01-02 09:53:13 +000067AC_ARG_WITH(c14n,
68[ --with-c14n add the Canonicalization support (on)])
69AC_ARG_WITH(catalog,
70[ --with-catalog add the Catalog support (on)])
71AC_ARG_WITH(debug,
72[ --with-debug add the debugging module (on)])
73AC_ARG_WITH(docbook,
74[ --with-docbook add Docbook SGML support (on)])
75AC_ARG_WITH(fexceptions,
76[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
77AC_ARG_WITH(ftp,
78[ --with-ftp add the FTP support (on)])
79AC_ARG_WITH(history,
80[ --with-history add history support to xmllint shell(off)])
81AC_ARG_WITH(html,
82[ --with-html add the HTML support (on)])
83dnl Specific dir for HTML output ?
84AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
85 [path to base html directory, default $datadir/doc/html]),
86 [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
Daniel Veillard259ff742001-10-06 13:49:59 +000087
William M. Brack21e4ef22005-01-02 09:53:13 +000088AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
89 [directory used under html-dir, default $PACKAGE-$VERSION/html]),
90 [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
91 [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
92AC_SUBST(HTML_DIR)
93AC_ARG_WITH(http,
94[ --with-http add the HTTP support (on)])
95AC_ARG_WITH(iconv,
96[ --with-iconv[[=DIR]] add ICONV support (on)])
97AC_ARG_WITH(iso8859x,
98[ --with-iso8859x add ISO8859X support if no iconv (on)])
99AC_ARG_WITH(legacy,
100[ --with-legacy add deprecated APIs for compatibility (on)])
101AC_ARG_WITH(mem_debug,
102[ --with-mem-debug add the memory debugging module (off)])
103AC_ARG_WITH(minimum,
104[ --with-minimum build a minimally sized library (off)])
105AC_ARG_WITH(output,
106[ --with-output add the serialization support (on)])
107AC_ARG_WITH(pattern,
108[ --with-pattern add the xmlPattern selection interface (on)])
109AC_ARG_WITH(push,
110[ --with-push add the PUSH parser interfaces (on)])
111AC_ARG_WITH(python,
112[ --with-python[[=DIR]] build Python bindings if found])
113AC_ARG_WITH(reader,
114[ --with-reader add the xmlReader parsing interface (on)])
115AC_ARG_WITH(readline,
116[ --with-readline=DIR use readline in DIR],[
117 if test "$withval" != "no" -a "$withval" != "yes"; then
118 RDL_DIR=$withval
119 CPPFLAGS="${CPPFLAGS} -I$withval/include"
120 LDFLAGS="${LDFLAGS} -L$withval/lib"
121 fi
122])
123AC_ARG_WITH(regexps,
124[ --with-regexps add Regular Expressions support (on)])
125AC_ARG_WITH(run_debug,
126[ --with-run-debug add the runtime debugging module (off)])
127AC_ARG_WITH(sax1,
128[ --with-sax1 add the older SAX1 interface (on)])
129AC_ARG_WITH(schemas,
Daniel Veillard39e5c892005-07-03 22:48:50 +0000130[ --with-schemas add Relax-NG and Schemas support (on)])
Daniel Veillarded6c5492005-07-23 15:00:22 +0000131AC_ARG_WITH(schematron,
132[ --with-schematron add Schematron support (on)])
William M. Brack21e4ef22005-01-02 09:53:13 +0000133AC_ARG_WITH(threads,
134[ --with-threads add multithread support(on)])
135AC_ARG_WITH(thread-alloc,
136[ --with-thread-alloc add per-thread memory(off)])
137AC_ARG_WITH(tree,
138[ --with-tree add the DOM like tree manipulation APIs (on)])
139AC_ARG_WITH(valid,
140[ --with-valid add the DTD validation support (on)])
141AC_ARG_WITH(writer,
142[ --with-writer add the xmlWriter saving interface (on)])
143AC_ARG_WITH(xinclude,
144[ --with-xinclude add the XInclude support (on)])
145AC_ARG_WITH(xpath,
146[ --with-xpath add the XPATH support (on)])
147AC_ARG_WITH(xptr,
148[ --with-xptr add the XPointer support (on)])
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000149AC_ARG_WITH(modules,
150[ --with-modules add the dynamic modules support (on)])
Owen Taylor3473f882001-02-23 17:55:21 +0000151AC_ARG_WITH(zlib,
William M. Brack97ad4c72003-05-13 08:08:36 +0000152[ --with-zlib[[=DIR]] use libz in DIR],[
Owen Taylor3473f882001-02-23 17:55:21 +0000153 if test "$withval" != "no" -a "$withval" != "yes"; then
154 Z_DIR=$withval
155 CPPFLAGS="${CPPFLAGS} -I$withval/include"
156 LDFLAGS="${LDFLAGS} -L$withval/lib"
157 fi
Daniel Veillard259ff742001-10-06 13:49:59 +0000158])
William M. Brack21e4ef22005-01-02 09:53:13 +0000159
160dnl
Daniel Veillard39e5c892005-07-03 22:48:50 +0000161dnl hard dependancies on options
162dnl
163if test "$with_schemas" = "yes"
164then
165 with_pattern=yes
166 with_regexp=yes
167fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000168if test "$with_schematron" = "yes"
169then
170 with_pattern=yes
171 with_xpath=yes
172fi
Daniel Veillard39e5c892005-07-03 22:48:50 +0000173if test "$with_reader" = "yes"
174then
175 with_push=yes
176fi
177if test "$with_xptr" = "yes"
178then
179 with_xpath=yes
180fi
181dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000182dnl option to build a minimal libxml2 library
183dnl
184if test "$with_minimum" = "yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000185then
William M. Brack21e4ef22005-01-02 09:53:13 +0000186 echo "Configuring for a minimal library"
187 if test "$with_c14n" = ""
188 then
189 with_c14n=no
190 fi
191 if test "$with_catalog" = ""
192 then
193 with_catalog=no
194 fi
195 echo So far so good!
196 if test "$with_debug" = ""
197 then
198 with_debug=no
199 fi
200 if test "$with_docbook" = ""
201 then
202 with_docbook=no
203 fi
204 if test "$with_fexceptions" = ""
205 then
206 with_fexceptions=no
207 fi
208 if test "$with_ftp" = ""
209 then
210 with_ftp=no
211 fi
212 if test "$with_history" = ""
213 then
214 with_history=no
215 fi
216 if test "$with_html" = ""
217 then
218 with_html=no
219 fi
220 if test "$with_http" = ""
221 then
222 with_http=no
223 fi
224 if test "$with_iconv" = ""
225 then
226 with_iconv=no
227 fi
228 if test "$with_iso8859x" = ""
229 then
230 with_iso8859x=no
231 fi
232 if test "$with_legacy" = ""
233 then
234 with_legacy=no
235 fi
236 if test "$with_mem_debug" = ""
237 then
238 with_mem_debug=no
239 fi
240 if test "$with_output" = ""
241 then
242 with_output=no
243 fi
244 if test "$with_pattern" = ""
245 then
246 with_pattern=no
247 fi
248 if test "$with_push" = ""
249 then
250 with_push=no
251 fi
252 if test "$with_python" = ""
253 then
254 with_python=no
255 fi
256 if test "$with_reader" = ""
257 then
258 with_reader=no
259 fi
260 if test "$with_readline" = ""
261 then
262 with_readline=no
263 fi
264 if test "$with_regexp" = ""
265 then
266 with_regexp=no
267 fi
268 if test "$with_run_debug" = ""
269 then
270 with_run_debug=no
271 fi
272 if test "$with_sax1" = ""
273 then
274 with_sax1=no
275 fi
276 if test "$with_schemas" = ""
277 then
278 with_schemas=no
279 fi
Daniel Veillarded6c5492005-07-23 15:00:22 +0000280 if test "$with_schematron" = ""
281 then
282 with_schematron=no
283 fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000284 if test "$with_threads" = ""
285 then
286 with_threads=no
287 fi
288 if test "$with_thread_alloc" = ""
289 then
290 with_thread_alloc=no
291 fi
292 if test "$with_tree" = ""
293 then
294 with_tree=no
295 fi
296 if test "$with_valid" = ""
297 then
298 with_valid=no
299 fi
300 if test "$with_writer" = ""
301 then
302 with_writer=no
303 fi
304 if test "$with_xinclude" = ""
305 then
306 with_xinclude=no
307 fi
308 if test "$with_xpath" = ""
309 then
310 with_xpath=no
311 fi
312 if test "$with_xptr" = ""
313 then
314 with_xptr=no
315 fi
316 if test "$with_zlib" = ""
317 then
318 with_zlib=no
319 fi
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000320 if test "$with_modules" = ""
321 then
322 with_modules=no
323 fi
Daniel Veillard4432df22003-09-28 18:58:27 +0000324fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000325
326echo Checking zlib
327
328dnl Checks for zlib library.
329
Daniel Veillard259ff742001-10-06 13:49:59 +0000330if test "$with_zlib" = "no"; then
331 echo "Disabling compression support"
332else
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000333 AC_CHECK_HEADERS(zlib.h,
334 AC_CHECK_LIB(z, gzread,[
Daniel Veillardc790bf42003-10-11 10:50:10 +0000335 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
Daniel Veillard3fbe8e32001-10-06 13:30:33 +0000336 if test "x${Z_DIR}" != "x"; then
337 Z_CFLAGS="-I${Z_DIR}/include"
338 Z_LIBS="-L${Z_DIR}/lib -lz"
339 [case ${host} in
340 *-*-solaris*)
341 Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
342 ;;
343 esac]
344 else
345 Z_LIBS="-lz"
346 fi]))
Daniel Veillard259ff742001-10-06 13:49:59 +0000347fi
Owen Taylor3473f882001-02-23 17:55:21 +0000348
Owen Taylor3473f882001-02-23 17:55:21 +0000349AC_SUBST(Z_CFLAGS)
350AC_SUBST(Z_LIBS)
351
352CPPFLAGS=${_cppflags}
353LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +0000354
William M. Brack21e4ef22005-01-02 09:53:13 +0000355echo Checking headers
356
Daniel Veillard01791d51998-07-24 19:24:09 +0000357dnl Checks for header files.
358AC_HEADER_DIRENT
359AC_HEADER_STDC
Daniel Veillard817e70b2002-11-19 22:28:48 +0000360AC_CHECK_HEADERS([fcntl.h])
361AC_CHECK_HEADERS([unistd.h])
362AC_CHECK_HEADERS([ctype.h])
363AC_CHECK_HEADERS([dirent.h])
364AC_CHECK_HEADERS([errno.h])
365AC_CHECK_HEADERS([malloc.h])
366AC_CHECK_HEADERS([stdarg.h])
367AC_CHECK_HEADERS([sys/stat.h])
368AC_CHECK_HEADERS([sys/types.h])
369AC_CHECK_HEADERS([time.h])
370AC_CHECK_HEADERS([ansidecl.h])
371AC_CHECK_HEADERS([ieeefp.h])
372AC_CHECK_HEADERS([nan.h])
373AC_CHECK_HEADERS([math.h])
Daniel Veillardebe48c62003-12-03 12:12:27 +0000374AC_CHECK_HEADERS([limits.h])
Daniel Veillard817e70b2002-11-19 22:28:48 +0000375AC_CHECK_HEADERS([fp_class.h])
376AC_CHECK_HEADERS([float.h])
377AC_CHECK_HEADERS([stdlib.h])
378AC_CHECK_HEADERS([sys/socket.h], [], [],
379[#if HAVE_SYS_TYPES_H
380# include <sys/types.h>
381# endif
382])
383AC_CHECK_HEADERS([netinet/in.h], [], [],
384[#if HAVE_SYS_TYPES_H
385# include <sys/types.h>
386# endif
387])
388AC_CHECK_HEADERS([arpa/inet.h], [], [],
389[#if HAVE_SYS_TYPES_H
390# include <sys/types.h>
391# endif
392#if HAVE_ARPA_INET_H
393# include <arpa/inet.h>
394# endif
395])
396AC_CHECK_HEADERS([netdb.h])
397AC_CHECK_HEADERS([sys/time.h])
398AC_CHECK_HEADERS([sys/select.h])
399AC_CHECK_HEADERS([sys/mman.h])
400AC_CHECK_HEADERS([sys/timeb.h])
401AC_CHECK_HEADERS([signal.h])
402AC_CHECK_HEADERS([arpa/nameser.h], [], [],
403[#if HAVE_SYS_TYPES_H
404# include <sys/types.h>
405# endif
406])
407AC_CHECK_HEADERS([resolv.h], [], [],
408[#if HAVE_SYS_TYPES_H
409# include <sys/types.h>
410# endif
411#if HAVE_NETINET_IN_H
412# include <netinet/in.h>
413# endif
414#if HAVE_ARPA_NAMESER_H
415# include <arpa/nameser.h>
416# endif
417])
Daniel Veillarddcd93902005-01-13 11:25:15 +0000418AC_CHECK_HEADERS([dl.h])
419AC_CHECK_HEADERS([dlfcn.h])
Daniel Veillard01791d51998-07-24 19:24:09 +0000420
Daniel Veillardfc979062004-03-04 22:07:16 +0000421
William M. Brack21e4ef22005-01-02 09:53:13 +0000422echo Checking libraries
Daniel Veillard1164e751999-02-16 16:29:17 +0000423
Daniel Veillard01791d51998-07-24 19:24:09 +0000424dnl Checks for library functions.
425AC_FUNC_STRFTIME
Daniel Veillard92ad2102001-03-27 12:47:33 +0000426AC_CHECK_FUNCS(strdup strndup strerror)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000427AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard90bc3712002-03-07 15:12:58 +0000428AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
Daniel Veillard068a9652001-06-07 15:30:26 +0000429AC_CHECK_FUNCS(stat _stat signal)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000430
Daniel Veillard92ad2102001-03-27 12:47:33 +0000431dnl Checking the standard string functions availability
432AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
433 NEED_TRIO=1)
434
William M. Brackf4caa5e2005-10-20 09:04:05 +0000435dnl Checking for va_copy availability
436AC_MSG_CHECKING([for va_copy])
437AC_TRY_LINK([#include <stdarg.h>
438va_list ap1,ap2;], [va_copy(ap1,ap2);],
439have_va_copy=yes,
440have_va_copy=no)
441AC_MSG_RESULT($have_va_copy)
442if test x"$have_va_copy" = x"yes"; then
443 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
444else
445 AC_MSG_CHECKING([for __va_copy])
446 AC_TRY_LINK([#include <stdarg.h>
447 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
448 have___va_copy=yes,
449 have___va_copy=no)
450 AC_MSG_RESULT($have___va_copy)
451 if test x"$have___va_copy" = x"yes"; then
452 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
453 fi
454fi
455
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000456dnl Checks for inet libraries:
Daniel Veillardd4e39ae2005-10-28 15:59:14 +0000457AC_SEARCH_LIBS(gethostent, [nsl])
458AC_SEARCH_LIBS(setsockopt, [socket net])
459AC_SEARCH_LIBS(connect, [inet])
Daniel Veillardb05deb71999-08-10 19:04:08 +0000460
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000461dnl Determine what socket length (socklen_t) data type is
462AC_MSG_CHECKING([for type of socket length (socklen_t)])
463AC_TRY_COMPILE2([
464#include <stddef.h>
465#include <sys/types.h>
466#include <sys/socket.h>],[
467(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
468 AC_MSG_RESULT(socklen_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000469 XML_SOCKLEN_T=socklen_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000470 AC_TRY_COMPILE2([
471#include <stddef.h>
472#include <sys/types.h>
473#include <sys/socket.h>],[
474(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
475 AC_MSG_RESULT(size_t *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000476 XML_SOCKLEN_T=size_t],[
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000477 AC_TRY_COMPILE2([
478#include <stddef.h>
479#include <sys/types.h>
480#include <sys/socket.h>],[
481(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
482 AC_MSG_RESULT(int *)
Daniel Veillardc284c642005-03-31 10:24:24 +0000483 XML_SOCKLEN_T=int],[
William M. Brack2e6b1432004-02-09 15:10:28 +0000484 AC_MSG_WARN(could not determine)
Daniel Veillardc284c642005-03-31 10:24:24 +0000485 XML_SOCKLEN_T="int"])])])
486AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000487
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000488dnl ***********************Checking for availability of IPv6*******************
489
490AC_MSG_CHECKING([whether to enable IPv6])
William M. Brack21e4ef22005-01-02 09:53:13 +0000491AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
Daniel Veillard4432df22003-09-28 18:58:27 +0000492if test "$with_minimum" = "yes"
493then
494 enable_ipv6=no
495fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000496if test $enable_ipv6 = yes; then
497 have_ipv6=no
498 AC_TRY_COMPILE([
499 #include <sys/socket.h>
500 #include <sys/types.h>], [
501 struct sockaddr_storage ss;
502 socket(AF_INET6, SOCK_STREAM, 0)
503 ],
504 have_ipv6=yes,
505 have_ipv6=no
506 )
507 AC_MSG_RESULT($have_ipv6)
508
William M. Brack476cd962003-08-13 11:09:42 +0000509 if test $have_ipv6 = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000510 AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000511 have_broken_ss_family=no
512
513 dnl *********************************************************************
514 dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
515 dnl a ss_family member, but rather __ss_family. Let's detect that
William M. Brack7d8b36b2005-06-25 07:30:50 +0000516 dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
517 dnl platforms. However, we should only do this if ss_family is not
518 dnl present.
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000519 dnl ********************************************************************
William M. Brack7d8b36b2005-06-25 07:30:50 +0000520 AC_MSG_CHECKING([struct sockaddr::ss_family])
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000521 AC_TRY_COMPILE([
522 #include <sys/socket.h>
523 #include <sys/types.h>], [
524 struct sockaddr_storage ss ;
William M. Brack7d8b36b2005-06-25 07:30:50 +0000525 ss.ss_family = 0 ;
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000526 ],
William M. Brack7d8b36b2005-06-25 07:30:50 +0000527 have_ss_family=yes,
528 have_ss_family=no
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000529 )
William M. Brack7d8b36b2005-06-25 07:30:50 +0000530 AC_MSG_RESULT($have_ss_family)
531 if test x$have_ss_family = xno ; then
532 AC_MSG_CHECKING([broken struct sockaddr::ss_family])
533 AC_TRY_COMPILE([
534 #include <sys/socket.h>
535 #include <sys/types.h>], [
536 struct sockaddr_storage ss ;
537 ss.__ss_family = 0 ;
538 ],
539 have_broken_ss_family=yes,
540 have_broken_ss_family=no
541 )
542 AC_MSG_RESULT($have_broken_ss_family)
543 if test x$have_broken_ss_family = xyes ; then
544 AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
545 [Whether struct sockaddr::__ss_family exists])
546 AC_DEFINE(ss_family, __ss_family,
547 [ss_family is not defined here, use __ss_family instead])
548 else
549 AC_MSG_WARN(ss_family and __ss_family not found)
550 fi
Dodji Seketeli8eba3f32004-11-09 18:30:30 +0000551 fi
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000552
553 have_getaddrinfo=no
554 AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
555 if test $have_getaddrinfo != yes; then
556 for lib in bsd socket inet; do
557 AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
558 done
559 fi
560
William M. Brack476cd962003-08-13 11:09:42 +0000561 if test $have_getaddrinfo = yes; then
Daniel Veillardc790bf42003-10-11 10:50:10 +0000562 AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
Daniel Veillardde2a67b2003-06-21 14:20:04 +0000563 fi
564 fi
565fi
566
567dnl ******************************End IPv6 checks******************************
568
Daniel Veillardb05deb71999-08-10 19:04:08 +0000569dnl Checks for isnan in libm if not in libc
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000570AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
Daniel Veillardc790bf42003-10-11 10:50:10 +0000571 [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000572
Daniel Veillardc790bf42003-10-11 10:50:10 +0000573AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
574 [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000575
576XML_LIBDIR='-L${libdir}'
Daniel Veillarde7dd2b82002-03-15 18:44:02 +0000577XML_INCLUDEDIR='-I${includedir}/libxml2'
Daniel Veillardb05deb71999-08-10 19:04:08 +0000578
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000579dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000580dnl Extra flags
581dnl
582XML_CFLAGS=""
Daniel Veillard357c9602001-05-03 10:49:20 +0000583RDL_LIBS=""
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000584
585dnl
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000586dnl Workaround for native compilers
587dnl HP : http://bugs.gnome.org/db/31/3163.html
588dnl DEC : Enable NaN/Inf
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000589dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000590if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000591 case "${host}" in
592 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000593 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000594 ;;
Daniel Veillardb45c43b2001-04-28 17:02:11 +0000595 *-dec-osf* )
596 CFLAGS="${CFLAGS} -ieee"
597 ;;
William M. Brack476cd962003-08-13 11:09:42 +0000598 alpha*-*-linux* )
599 CFLAGS="${CFLAGS} -ieee"
600 ;;
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000601 esac
Daniel Veillardd574f782001-03-14 19:40:17 +0000602else
Daniel Veillardd94849b2003-07-28 13:02:24 +0000603 if test "$with_fexceptions" = "yes"
604 then
605 #
606 # Not activated by default because this inflates the code size
607 # Used to allow propagation of C++ exceptions through the library
608 #
609 CFLAGS="${CFLAGS} -fexceptions"
610 fi
611
Daniel Veillard05f97352004-10-31 15:35:32 +0000612 CFLAGS="${CFLAGS} -pedantic -W -Wformat -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 Veillard14839d52001-06-06 16:11:56 +0000613 case "${host}" in
614 alpha*-*-linux* )
615 CFLAGS="${CFLAGS} -mieee"
616 ;;
Daniel Veillardcb5b4d62002-04-11 08:24:26 +0000617 alpha*-*-osf* )
618 CFLAGS="${CFLAGS} -mieee"
619 ;;
Daniel Veillard14839d52001-06-06 16:11:56 +0000620 esac
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000621fi
Daniel Veillardb0426ca2000-10-11 23:39:43 +0000622case ${host} in
623 *-*-solaris*)
Daniel Veillardd2ade932000-09-30 14:39:55 +0000624 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
625 ;;
Daniel Veillardd30be4a2002-03-28 18:25:31 +0000626 hppa*-hp-mpeix)
627 NEED_TRIO=1
628 ;;
Daniel Veillardd2ade932000-09-30 14:39:55 +0000629esac
630
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000631
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000632dnl
633dnl check for python
634dnl
635
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000636PYTHON_VERSION=
637PYTHON_INCLUDES=
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000638PYTHON_SITE_PACKAGES=
Daniel Veillard6dc91962004-03-22 19:10:02 +0000639PYTHON_TESTS=
Daniel Veillard38b80a82003-05-14 18:59:00 +0000640pythondir=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000641if test "$with_python" != "no" ; then
642 if test -x "$with_python/bin/python"
643 then
644 echo Found python in $with_python/bin/python
645 PYTHON="$with_python/bin/python"
Daniel Veillard9b731d72002-04-14 12:56:08 +0000646 else
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000647 if test -x "$with_python"
648 then
Daniel Veillard4efd3be2002-11-18 09:11:13 +0000649 echo Found python in $with_python
650 PYTHON="$with_python"
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000651 else
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000652 if test -x "$PYTHON"
653 then
654 echo Found python in environment PYTHON=$PYTHON
655 else
Daniel Veillardc2f70562005-09-01 12:45:26 +0000656 AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000657 fi
Daniel Veillarda8a89fe2002-04-12 21:03:34 +0000658 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000659 fi
660 if test "$PYTHON" != ""
661 then
662 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
663 echo Found Python version $PYTHON_VERSION
664 fi
665 if test "$PYTHON_VERSION" != ""
666 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000667 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
668 -d $with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000669 then
670 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000671 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000672 else
673 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
674 then
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000675 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000676 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000677 else
678 if test -r /usr/include/python$PYTHON_VERSION/Python.h
679 then
680 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
Daniel Veillarde3b7d9a2002-08-14 14:11:30 +0000681 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000682 else
683 echo could not find python$PYTHON_VERSION/Python.h
684 fi
685 fi
William M. Brack5d4cba42004-01-06 15:19:12 +0000686 if test ! -d "$PYTHON_SITE_PACKAGES"
Daniel Veillardb6984ef2002-08-14 16:55:31 +0000687 then
688 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
689 fi
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000690 fi
691 fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000692 if test "$with_python" != ""
693 then
694 pythondir='$(PYTHON_SITE_PACKAGES)'
695 else
696 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
697 fi
Daniel Veillard4f69eb62005-08-24 22:19:10 +0000698else
699 PYTHON=
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000700fi
701AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
Daniel Veillard40b11342002-09-20 12:01:39 +0000702if test "$PYTHON_INCLUDES" != ""
703then
704 PYTHON_SUBDIR=python
705else
706 PYTHON_SUBDIR=
707fi
Daniel Veillard38b80a82003-05-14 18:59:00 +0000708AC_SUBST(pythondir)
Daniel Veillard40b11342002-09-20 12:01:39 +0000709AC_SUBST(PYTHON_SUBDIR)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +0000710
Daniel Veillardce1648b2005-01-04 15:10:22 +0000711dnl check for dso support
712WITH_MODULES=0
Daniel Veillardce1648b2005-01-04 15:10:22 +0000713TEST_MODULES=
714
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000715if test "$with_modules" != "no" ; then
Daniel Veillard9202b672005-07-14 09:31:14 +0000716 case "$host" in
717 *-*-cygwin*)
718 MODULE_EXTENSION=".dll"
719 AC_CHECK_LIB(cygwin, dlopen, [
720 WITH_MODULES=1
721 MODULE_PLATFORM_LIBS=
722 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
723 ])
724 ;;
725 *)
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000726 AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
727 AC_CHECK_LIB(dld, shl_load, [
728 MODULE_PLATFORM_LIBS="-ldld"
729 libxml_have_shl_load=yes], [
730 AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
731 AC_CHECK_LIB(dl, dlopen, [
732 MODULE_PLATFORM_LIBS="-ldl"
733 libxml_have_dlopen=yes])])])])
734
735 if test "${libxml_have_shl_load}" = "yes"; then
736 MODULE_EXTENSION=".sl"
Daniel Veillard9202b672005-07-14 09:31:14 +0000737 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000738 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000739 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000740
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000741 if test "${libxml_have_dlopen}" = "yes"; then
742 case "${host}" in
743 *-*-hpux* )
744 MODULE_EXTENSION=".sl"
745 ;;
746 * )
747 MODULE_EXTENSION=".so"
748 ;;
749 esac
750
Daniel Veillard9202b672005-07-14 09:31:14 +0000751 WITH_MODULES=1
Daniel Veillard9202b672005-07-14 09:31:14 +0000752 AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
Daniel Veillard1d96f5a2005-10-28 08:44:48 +0000753 fi
Daniel Veillard9202b672005-07-14 09:31:14 +0000754 ;;
755 esac
Daniel Veillardf6b71bd2005-01-04 17:50:14 +0000756fi
Daniel Veillardce1648b2005-01-04 15:10:22 +0000757
758if test "${WITH_MODULES}" = "1"; then
759 TEST_MODULES="ModuleTests"
760fi
761
762AC_SUBST(WITH_MODULES)
763AC_SUBST(MODULE_PLATFORM_LIBS)
764AC_SUBST(MODULE_EXTENSION)
765AC_SUBST(TEST_MODULES)
766
Daniel Veillard437b87b2000-01-03 17:30:46 +0000767dnl
768dnl Tester makes use of readline if present
769dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000770
Daniel Veillard361d8452000-04-03 19:48:13 +0000771dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000772dnl specific tests to setup DV and Bill's devel environments with debug etc ...
Daniel Veillard81418e32001-05-22 15:08:55 +0000773dnl (-Wunreachable-code)
Daniel Veillardf6eea272001-01-18 12:17:12 +0000774dnl
William M. Brack871611b2003-10-18 04:53:14 +0000775if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
Daniel Veillardb7c6ac42004-06-29 22:01:27 +0000776 [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
William M. Bracka2e844a2004-01-06 11:52:13 +0000777 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \
William M. Brack4119d1c2004-06-24 02:24:44 +0000778 [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]]
William M. Brack871611b2003-10-18 04:53:14 +0000779 then
Daniel Veillard4432df22003-09-28 18:58:27 +0000780 if test "$with_minimum" != "yes"
781 then
782 if test "${with_mem_debug}" = "" ; then
Daniel Veillard379a3b72005-08-12 10:18:14 +0000783 echo Activating memory debugging
Daniel Veillard4432df22003-09-28 18:58:27 +0000784 with_mem_debug="yes"
Daniel Veillard22cdb842004-10-04 14:09:17 +0000785 with_run_debug="yes"
Daniel Veillard4432df22003-09-28 18:58:27 +0000786 fi
787 if test "${with_docbook}" = "" ; then
788 with_docbook="yes"
789 fi
Daniel Veillardeae522a2001-04-23 13:41:34 +0000790 fi
Daniel Veillard3854c572005-08-25 10:17:45 +0000791 if test "${GCC}" = "yes" ; then
Daniel Veillard05f97352004-10-31 15:35:32 +0000792 CFLAGS="-g -O -pedantic -W -Wformat -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 -Wall"
Daniel Veillardeff45a92004-10-29 12:10:55 +0000793 fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000794 STATIC_BINARIES="-static"
Daniel Veillardc86a4fa2001-03-26 16:28:29 +0000795dnl -Wcast-qual -ansi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000796else
797 STATIC_BINARIES=
Daniel Veillardf6eea272001-01-18 12:17:12 +0000798fi
Daniel Veillard2e9b1652003-02-19 13:29:45 +0000799AC_SUBST(STATIC_BINARIES)
Daniel Veillard92ad2102001-03-27 12:47:33 +0000800
801dnl
802dnl Check for trio string functions
803dnl
804
805if test "${NEED_TRIO}" = "1" ; then
806 echo Adding trio library for string functions
807 WITH_TRIO=1
808else
809 WITH_TRIO=0
810fi
Daniel Veillard01ef7382001-05-08 07:31:43 +0000811AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
Daniel Veillard92ad2102001-03-27 12:47:33 +0000812AC_SUBST(WITH_TRIO)
813
Daniel Veillardf6eea272001-01-18 12:17:12 +0000814dnl
William M. Brack97ad4c72003-05-13 08:08:36 +0000815dnl Allow to enable/disable various pieces
Daniel Veillard361d8452000-04-03 19:48:13 +0000816dnl
William M. Brack21e4ef22005-01-02 09:53:13 +0000817echo Checking configuration requirements
Daniel Veillard361d8452000-04-03 19:48:13 +0000818
William M. Brack21e4ef22005-01-02 09:53:13 +0000819dnl
820dnl Thread-related stuff
821dnl
Daniel Veillardb8478642001-10-12 17:29:10 +0000822THREAD_LIBS=""
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000823BASE_THREAD_LIBS=""
Daniel Veillardb8478642001-10-12 17:29:10 +0000824WITH_THREADS=0
825THREAD_CFLAGS=""
Daniel Veillardab7488e2001-10-17 11:30:37 +0000826TEST_THREADS=""
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000827THREADS_W32=""
Daniel Veillard64a411c2001-10-15 12:32:07 +0000828
Daniel Veillard84942712003-04-18 14:40:05 +0000829if test "$with_threads" = "no" ; then
830 echo Disabling multithreaded support
831else
Daniel Veillardb8478642001-10-12 17:29:10 +0000832 echo Enabling multithreaded support
833
834 AC_CHECK_HEADER(pthread.h,
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000835 AC_CHECK_LIB(pthread, pthread_join,[
Daniel Veillardb8478642001-10-12 17:29:10 +0000836 THREAD_LIBS="-lpthread"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000837 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
838 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
Daniel Veillardab7488e2001-10-17 11:30:37 +0000839 WITH_THREADS="1"]))
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000840 case $host_os in
841 *mingw32*) WITH_THREADS="1"
842 THREADS_W32="Win32"
843 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
844 ;;
William M. Bracka73f45b2005-01-11 02:21:33 +0000845 *cygwin*) THREAD_LIBS=""
846 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +0000847 *beos*) WITH_THREADS="1"
848 THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
849 ;;
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000850 *linux*)
Daniel Veillard32a461f2005-08-25 21:48:54 +0000851 if test "${GCC}" = "yes" ; then
852 GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
853 GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
854 GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
855 if test "${THREAD_LIBS}" = "-lpthread" ; then
856 if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
857 then
858 THREAD_LIBS=""
859 BASE_THREAD_LIBS="-lpthread"
860 else
861 if expr ${GCC_MAJOR} \> 3 > /dev/null
862 then
863 THREAD_LIBS=""
864 BASE_THREAD_LIBS="-lpthread"
865 else
866 echo old GCC disabling weak symbols for pthread
867 fi
868 fi
869 fi
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000870 fi
871 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000872 esac
Daniel Veillardb8478642001-10-12 17:29:10 +0000873 if test "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000874 THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
875 TEST_THREADS="Threadtests"
Daniel Veillardb8478642001-10-12 17:29:10 +0000876 fi
877fi
William M. Brack306e33c2004-06-12 01:01:22 +0000878if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
Daniel Veillardab7488e2001-10-17 11:30:37 +0000879 THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
Daniel Veillard64a411c2001-10-15 12:32:07 +0000880fi
881
Daniel Veillardb8478642001-10-12 17:29:10 +0000882AC_SUBST(THREAD_LIBS)
Daniel Veillarddbfe05a2005-05-04 09:18:00 +0000883AC_SUBST(BASE_THREAD_LIBS)
Daniel Veillardb8478642001-10-12 17:29:10 +0000884AC_SUBST(WITH_THREADS)
885AC_SUBST(THREAD_CFLAGS)
Daniel Veillardab7488e2001-10-17 11:30:37 +0000886AC_SUBST(TEST_THREADS)
Daniel Veillard6984e6d2003-12-09 14:20:17 +0000887AC_SUBST(THREADS_W32)
Daniel Veillardb8478642001-10-12 17:29:10 +0000888
William M. Brack21e4ef22005-01-02 09:53:13 +0000889dnl
890dnl xmllint shell history
891dnl
Daniel Veillard259ff742001-10-06 13:49:59 +0000892if test "$with_history" = "yes" ; then
Daniel Veillardf012a642001-07-23 19:10:52 +0000893 echo Enabling xmllint shell history
894 dnl check for terminal library. this is a very cool solution
895 dnl from octave's configure.in
896 unset tcap
897 for termlib in ncurses curses termcap terminfo termlib; do
898 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
899 test -n "$tcap" && break
900 done
901
902 AC_CHECK_HEADER(readline/history.h,
903 AC_CHECK_LIB(history, append_history,[
904 RDL_LIBS="-lhistory"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000905 AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
Daniel Veillardf012a642001-07-23 19:10:52 +0000906 AC_CHECK_HEADER(readline/readline.h,
907 AC_CHECK_LIB(readline, readline,[
908 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
Daniel Veillardc790bf42003-10-11 10:50:10 +0000909 AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
Daniel Veillardf012a642001-07-23 19:10:52 +0000910 if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
911 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
912 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
Daniel Veillardf012a642001-07-23 19:10:52 +0000913 fi
Daniel Veillardf012a642001-07-23 19:10:52 +0000914fi
915
William M. Brack21e4ef22005-01-02 09:53:13 +0000916dnl
917dnl Tree functions
918dnl
Daniel Veillard652327a2003-09-29 18:02:38 +0000919if test "$with_tree" = "no" ; then
920 echo Disabling DOM like tree manipulation APIs
921 WITH_TREE=0
922else
923 WITH_TREE=1
924fi
925AC_SUBST(WITH_TREE)
926
Daniel Veillard361d8452000-04-03 19:48:13 +0000927if test "$with_ftp" = "no" ; then
928 echo Disabling FTP support
929 WITH_FTP=0
930 FTP_OBJ=
931else
932 WITH_FTP=1
933 FTP_OBJ=nanoftp.o
934fi
935AC_SUBST(WITH_FTP)
936AC_SUBST(FTP_OBJ)
937
Daniel Veillard361d8452000-04-03 19:48:13 +0000938if test "$with_http" = "no" ; then
939 echo Disabling HTTP support
940 WITH_HTTP=0
941 HTTP_OBJ=
942else
943 WITH_HTTP=1
944 HTTP_OBJ=nanohttp.o
945fi
946AC_SUBST(WITH_HTTP)
947AC_SUBST(HTTP_OBJ)
948
Daniel Veillard4432df22003-09-28 18:58:27 +0000949if test "$with_legacy" = "no" ; then
950 echo Disabling deprecated APIs
951 WITH_LEGACY=0
952else
953 WITH_LEGACY=1
954fi
955AC_SUBST(WITH_LEGACY)
956
Daniel Veillard81273902003-09-30 00:43:48 +0000957if test "$with_reader" = "no" ; then
958 echo Disabling the xmlReader parsing interface
959 WITH_READER=0
Daniel Veillard73b013f2003-09-30 12:36:01 +0000960 READER_TEST=
Daniel Veillard81273902003-09-30 00:43:48 +0000961else
962 WITH_READER=1
Daniel Veillard73b013f2003-09-30 12:36:01 +0000963 READER_TEST=Readertests
William M. Brack21e4ef22005-01-02 09:53:13 +0000964 if test "$with_push" = "no" ; then
965 echo xmlReader requires Push interface - enabling it
966 with_push=yes
967 fi
Daniel Veillard81273902003-09-30 00:43:48 +0000968fi
969AC_SUBST(WITH_READER)
Daniel Veillard73b013f2003-09-30 12:36:01 +0000970AC_SUBST(READER_TEST)
Daniel Veillard81273902003-09-30 00:43:48 +0000971
William M. Brack21e4ef22005-01-02 09:53:13 +0000972if test "$with_writer" = "no" ; then
973 echo Disabling the xmlWriter saving interface
974 WITH_WRITER=0
975# WRITER_TEST=
976else
977 WITH_WRITER=1
978# WRITER_TEST=Writertests
979 if test "$with_push" = "no" ; then
980 echo xmlWriter requires Push interface - enabling it
981 with_push=yes
982 fi
983 if test "$with_output" = "no" ; then
984 echo xmlWriter requires Output interface - enabling it
985 with_output=yes
986 fi
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000987fi
William M. Brack21e4ef22005-01-02 09:53:13 +0000988AC_SUBST(WITH_WRITER)
989#AC_SUBST(WRITER_TEST)
990
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000991if test "$with_pattern" = "no" ; then
992 echo Disabling the xmlPattern parsing interface
993 WITH_PATTERN=0
Daniel Veillardf9d16912005-01-30 22:36:30 +0000994 TEST_PATTERN=
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000995else
996 WITH_PATTERN=1
Daniel Veillardf9d16912005-01-30 22:36:30 +0000997 TEST_PATTERN=Patterntests
Daniel Veillardb3de70c2003-12-02 22:32:15 +0000998fi
999AC_SUBST(WITH_PATTERN)
Daniel Veillardf9d16912005-01-30 22:36:30 +00001000AC_SUBST(TEST_PATTERN)
Daniel Veillardb3de70c2003-12-02 22:32:15 +00001001
Daniel Veillard81273902003-09-30 00:43:48 +00001002if test "$with_sax1" = "no" ; then
1003 echo Disabling the older SAX1 interface
1004 WITH_SAX1=0
1005 TEST_SAX=
1006else
1007 WITH_SAX1=1
1008 TEST_SAX=SAXtests
1009fi
1010AC_SUBST(WITH_SAX1)
1011AC_SUBST(TEST_SAX)
1012
Daniel Veillard73b013f2003-09-30 12:36:01 +00001013if test "$with_push" = "no" ; then
1014 echo Disabling the PUSH parser interfaces
1015 WITH_PUSH=0
1016 TEST_PUSH=
1017else
1018 WITH_PUSH=1
1019 TEST_PUSH="XMLPushtests"
1020fi
1021AC_SUBST(WITH_PUSH)
1022AC_SUBST(TEST_PUSH)
1023
Daniel Veillard73b013f2003-09-30 12:36:01 +00001024if test "$with_html" = "no" ; then
1025 echo Disabling HTML support
1026 WITH_HTML=0
1027 HTML_OBJ=
1028 TEST_HTML=
1029else
1030 WITH_HTML=1
1031 HTML_OBJ="HTMLparser.o HTMLtree.o"
1032 TEST_HTML=HTMLtests
William M. Brack871611b2003-10-18 04:53:14 +00001033 if test "$with_push" != "no" ; then
Daniel Veillard73b013f2003-09-30 12:36:01 +00001034 TEST_PHTML=HTMLPushtests
1035 else
1036 TEST_PHTML=
1037 fi
1038fi
1039AC_SUBST(WITH_HTML)
1040AC_SUBST(HTML_OBJ)
1041AC_SUBST(TEST_HTML)
1042AC_SUBST(TEST_PHTML)
1043
Daniel Veillard73b013f2003-09-30 12:36:01 +00001044if test "$with_valid" = "no" ; then
Daniel Veillard4432df22003-09-28 18:58:27 +00001045 echo Disabling DTD validation support
1046 WITH_VALID=0
1047 TEST_VALID=
1048 TEST_VTIME=
1049else
1050 WITH_VALID=1
1051 TEST_VALID=Validtests
1052 TEST_VTIME=VTimingtests
1053fi
1054AC_SUBST(WITH_VALID)
1055AC_SUBST(TEST_VALID)
1056AC_SUBST(TEST_VTIME)
Daniel Veillard361d8452000-04-03 19:48:13 +00001057
Daniel Veillarda7374592001-05-10 14:17:55 +00001058if test "$with_catalog" = "no" ; then
1059 echo Disabling Catalog support
1060 WITH_CATALOG=0
1061 CATALOG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001062 TEST_CATALOG=
Daniel Veillarda7374592001-05-10 14:17:55 +00001063else
1064 WITH_CATALOG=1
1065 CATALOG_OBJ="catalog.o"
Daniel Veillard4432df22003-09-28 18:58:27 +00001066 TEST_CATALOG=Catatests
Daniel Veillarda7374592001-05-10 14:17:55 +00001067fi
1068AC_SUBST(WITH_CATALOG)
1069AC_SUBST(CATALOG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001070AC_SUBST(TEST_CATALOG)
Daniel Veillarda7374592001-05-10 14:17:55 +00001071
Daniel Veillardb59076b2001-04-29 17:04:07 +00001072if test "$with_docbook" = "no" ; then
1073 echo Disabling Docbook support
Daniel Veillardeae522a2001-04-23 13:41:34 +00001074 WITH_DOCB=0
1075 DOCB_OBJ=
Daniel Veillardb59076b2001-04-29 17:04:07 +00001076else
1077 WITH_DOCB=1
1078 DOCB_OBJ="DOCBparser.o"
Daniel Veillardeae522a2001-04-23 13:41:34 +00001079fi
1080AC_SUBST(WITH_DOCB)
1081AC_SUBST(DOCB_OBJ)
1082
1083
William M. Brack21e4ef22005-01-02 09:53:13 +00001084if test "$with_xptr" = "no" ; then
1085 echo Disabling XPointer support
1086 WITH_XPTR=0
1087 XPTR_OBJ=
1088 TEST_XPTR=
1089else
1090 WITH_XPTR=1
1091 XPTR_OBJ=xpointer.o
1092 TEST_XPTR=XPtrtests
1093 if test "$with_xpath" = "no" ; then
1094 echo XPointer requires XPath support - enabling it
1095 with_xpath=yes
1096 fi
Daniel Veillard4432df22003-09-28 18:58:27 +00001097fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001098AC_SUBST(WITH_XPTR)
1099AC_SUBST(XPTR_OBJ)
1100AC_SUBST(TEST_XPTR)
1101
1102if test "$with_c14n" = "no" ; then
1103 echo Disabling C14N support
1104 WITH_C14N=0
1105 C14N_OBJ=
1106 TEST_C14N=
1107else
1108 WITH_C14N=1
1109 C14N_OBJ="c14n.c"
1110 TEST_C14N=C14Ntests
1111 if test "$with_xpath" = "no" ; then
1112 echo C14N requires XPath support - enabling it
1113 with_xpath=yes
1114 fi
1115fi
1116AC_SUBST(WITH_C14N)
1117AC_SUBST(C14N_OBJ)
1118AC_SUBST(TEST_C14N)
1119
1120if test "$with_xinclude" = "no" ; then
1121 echo Disabling XInclude support
1122 WITH_XINCLUDE=0
1123 XINCLUDE_OBJ=
1124 with_xinclude="no"
1125 TEST_XINCLUDE=
1126else
1127 WITH_XINCLUDE=1
1128 XINCLUDE_OBJ=xinclude.o
1129 TEST_XINCLUDE=XIncludetests
1130 if test "$with_xpath" = "no" ; then
1131 echo XInclude requires XPath support - enabling it
1132 with_xpath=yes
1133 fi
1134fi
1135AC_SUBST(WITH_XINCLUDE)
1136AC_SUBST(XINCLUDE_OBJ)
1137AC_SUBST(TEST_XINCLUDE)
1138
Daniel Veillard361d8452000-04-03 19:48:13 +00001139if test "$with_xpath" = "no" ; then
1140 echo Disabling XPATH support
1141 WITH_XPATH=0
1142 XPATH_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001143 TEST_XPATH=
Daniel Veillard361d8452000-04-03 19:48:13 +00001144else
1145 WITH_XPATH=1
1146 XPATH_OBJ=xpath.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001147 TEST_XPATH=XPathtests
Daniel Veillard361d8452000-04-03 19:48:13 +00001148fi
1149AC_SUBST(WITH_XPATH)
1150AC_SUBST(XPATH_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001151AC_SUBST(TEST_XPATH)
Daniel Veillard361d8452000-04-03 19:48:13 +00001152
William M. Brack21e4ef22005-01-02 09:53:13 +00001153dnl
1154dnl output functions
1155dnl
1156if test "$with_output" = "no" ; then
1157 echo Disabling serialization/saving support
1158 WITH_OUTPUT=0
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001159else
William M. Brack21e4ef22005-01-02 09:53:13 +00001160 WITH_OUTPUT=1
Daniel Veillardc8df0aa2000-10-10 23:50:30 +00001161fi
William M. Brack21e4ef22005-01-02 09:53:13 +00001162AC_SUBST(WITH_OUTPUT)
Daniel Veillard9e8bfae2000-11-06 16:43:11 +00001163
Daniel Veillard6e90d192001-07-03 16:37:49 +00001164WITH_ICONV=0
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001165if test "$with_iconv" = "no" ; then
1166 echo Disabling ICONV support
Daniel Veillardd574f782001-03-14 19:40:17 +00001167else
Daniel Veillard220346d2001-12-07 11:33:54 +00001168 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
Daniel Veillard6e90d192001-07-03 16:37:49 +00001169 CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
Daniel Veillardf5b44e42001-09-17 17:19:54 +00001170 # Export this since our headers include iconv.h
1171 XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
Daniel Veillard6e90d192001-07-03 16:37:49 +00001172 ICONV_LIBS="-L$with_iconv/lib"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001173 fi
Daniel Veillard6e90d192001-07-03 16:37:49 +00001174
1175 AC_CHECK_HEADER(iconv.h,
1176 AC_MSG_CHECKING(for iconv)
1177 AC_TRY_LINK([#include <stdlib.h>
1178#include <iconv.h>],[
1179iconv_t cd = iconv_open ("","");
1180iconv (cd, NULL, NULL, NULL, NULL);],[
1181 AC_MSG_RESULT(yes)
1182 WITH_ICONV=1],[
1183 AC_MSG_RESULT(no)
1184 AC_MSG_CHECKING(for iconv in -liconv)
1185
1186 _ldflags="${LDFLAGS}"
1187 _libs="${LIBS}"
1188 LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
1189 LIBS="${LIBS} -liconv"
1190
1191 AC_TRY_LINK([#include <stdlib.h>
1192#include <iconv.h>],[
1193iconv_t cd = iconv_open ("","");
1194iconv (cd, NULL, NULL, NULL, NULL);],[
1195 AC_MSG_RESULT(yes)
1196 WITH_ICONV=1
1197 ICONV_LIBS="${ICONV_LIBS} -liconv"
1198 LIBS="${_libs}"
1199 LDFLAGS="${_ldflags}"],[
1200 AC_MSG_RESULT(no)
1201 LIBS="${_libs}"
1202 LDFLAGS="${_ldflags}"])]))
1203fi
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001204case "$host" in
1205 *mingw*) M_LIBS=""
1206 ;;
Daniel Veillard7a3447a2005-01-04 14:31:14 +00001207 *beos*) M_LIBS=""
1208 ;;
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001209 *) M_LIBS="-lm"
1210 ;;
1211esac
Daniel Veillardb82c1662001-12-09 14:00:54 +00001212XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
Daniel Veillard90d165b2003-09-01 20:33:13 +00001213XML_LIBTOOLLIBS="libxml2.la"
Daniel Veillard496a1cf2000-05-03 14:20:55 +00001214AC_SUBST(WITH_ICONV)
1215
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001216WITH_ISO8859X=1
Daniel Veillard01fc1a92003-07-30 15:12:01 +00001217if test "$WITH_ICONV" != "1" ; then
1218if test "$with_iso8859x" = "no" ; then
1219 echo Disabling ISO8859X support
1220 WITH_ISO8859X=0
1221fi
1222fi
1223AC_SUBST(WITH_ISO8859X)
1224
Daniel Veillarded6c5492005-07-23 15:00:22 +00001225if test "$with_schematron" = "no" ; then
1226 echo "Disabling Schematron support"
1227 WITH_SCHEMATRON=0
1228 TEST_SCHEMATRON=
1229else
1230 echo "Enabled Schematron support"
1231 WITH_SCHEMATRON=1
1232 TEST_SCHEMATRON="Schematrontests"
1233 with_xpath=yes
1234 with_pattern=yes
1235fi
1236AC_SUBST(WITH_SCHEMATRON)
1237AC_SUBST(TEST_SCHEMATRON)
1238
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001239if test "$with_schemas" = "no" ; then
William M. Brack21e4ef22005-01-02 09:53:13 +00001240 echo "Disabling Schemas/Relax-NG support"
Daniel Veillardef4d3bc2003-02-07 12:38:22 +00001241 WITH_SCHEMAS=0
1242 TEST_SCHEMAS=
1243else
Daniel Veillard71531f32003-02-05 13:19:53 +00001244 echo "Enabled Schemas/Relax-NG support"
Daniel Veillard4255d502002-04-16 15:50:10 +00001245 WITH_SCHEMAS=1
Daniel Veillard6eadf632003-01-23 18:29:16 +00001246 TEST_SCHEMAS="Schemastests Relaxtests"
Daniel Veillard6dc91962004-03-22 19:10:02 +00001247 if test "$PYTHON_INCLUDES" != "" ; then
1248 PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
1249 fi
Daniel Veillard23e73572002-09-19 19:56:43 +00001250 with_regexps=yes
Daniel Veillard4255d502002-04-16 15:50:10 +00001251fi
1252AC_SUBST(WITH_SCHEMAS)
1253AC_SUBST(TEST_SCHEMAS)
1254
Daniel Veillard23e73572002-09-19 19:56:43 +00001255if test "$with_regexps" = "no" ; then
1256 echo Disabling Regexps support
1257 WITH_REGEXPS=0
1258 TEST_REGEXPS=
1259else
1260 WITH_REGEXPS=1
1261 TEST_REGEXPS="Regexptests Automatatests"
1262fi
1263AC_SUBST(WITH_REGEXPS)
1264AC_SUBST(TEST_REGEXPS)
1265
Daniel Veillard361d8452000-04-03 19:48:13 +00001266if test "$with_debug" = "no" ; then
1267 echo Disabling DEBUG support
1268 WITH_DEBUG=0
1269 DEBUG_OBJ=
Daniel Veillard4432df22003-09-28 18:58:27 +00001270 TEST_DEBUG=
Daniel Veillard361d8452000-04-03 19:48:13 +00001271else
1272 WITH_DEBUG=1
1273 DEBUG_OBJ=debugXML.o
Daniel Veillard4432df22003-09-28 18:58:27 +00001274 TEST_DEBUG=Scripttests
Daniel Veillard361d8452000-04-03 19:48:13 +00001275fi
1276AC_SUBST(WITH_DEBUG)
1277AC_SUBST(DEBUG_OBJ)
Daniel Veillard4432df22003-09-28 18:58:27 +00001278AC_SUBST(TEST_DEBUG)
Daniel Veillard361d8452000-04-03 19:48:13 +00001279
Daniel Veillard361d8452000-04-03 19:48:13 +00001280if test "$with_mem_debug" = "yes" ; then
William M. Brack306e33c2004-06-12 01:01:22 +00001281 if test "$with_thread_alloc" = "yes" ; then
1282 echo Disabling memory debug - cannot use mem-debug with thread-alloc!
1283 WITH_MEM_DEBUG=0
1284 else
1285 echo Enabling memory debug support
1286 WITH_MEM_DEBUG=1
1287 fi
Daniel Veillard361d8452000-04-03 19:48:13 +00001288else
1289 WITH_MEM_DEBUG=0
1290fi
1291AC_SUBST(WITH_MEM_DEBUG)
1292
Daniel Veillard22cdb842004-10-04 14:09:17 +00001293if test "$with_run_debug" = "yes" ; then
1294 echo Enabling runtime debug support
1295 WITH_RUN_DEBUG=1
1296else
1297 WITH_RUN_DEBUG=0
1298fi
1299AC_SUBST(WITH_RUN_DEBUG)
Daniel Veillard1638a472003-08-14 01:23:25 +00001300
1301WIN32_EXTRA_LIBADD=
1302WIN32_EXTRA_LDFLAGS=
William M. Bracka73f45b2005-01-11 02:21:33 +00001303CYGWIN_EXTRA_LDFLAGS=
1304CYGWIN_EXTRA_PYTHON_LIBADD=
Daniel Veillard1638a472003-08-14 01:23:25 +00001305case "$host" in
1306 *-*-mingw*)
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001307 CPPFLAGS="$CPPFLAGS -DWIN32"
1308 WIN32_EXTRA_LIBADD="-lws2_32"
Daniel Veillard1638a472003-08-14 01:23:25 +00001309 WIN32_EXTRA_LDFLAGS="-no-undefined"
1310 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
1311 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
1312 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
1313 ;;
Daniel Veillardd392ba72004-08-04 14:56:45 +00001314 *-*-cygwin*)
1315 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
William M. Bracka73f45b2005-01-11 02:21:33 +00001316 if test "${PYTHON}" != ""
1317 then
1318 CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
1319 fi
Daniel Veillardd392ba72004-08-04 14:56:45 +00001320 ;;
Daniel Veillard1638a472003-08-14 01:23:25 +00001321esac
1322AC_SUBST(WIN32_EXTRA_LIBADD)
1323AC_SUBST(WIN32_EXTRA_LDFLAGS)
Daniel Veillardd392ba72004-08-04 14:56:45 +00001324AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
1325AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
Daniel Veillard1638a472003-08-14 01:23:25 +00001326
Daniel Veillard6984e6d2003-12-09 14:20:17 +00001327AC_SUBST(CPPFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001328AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +00001329AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +00001330
Daniel Veillardb05deb71999-08-10 19:04:08 +00001331AC_SUBST(XML_LIBDIR)
1332AC_SUBST(XML_LIBS)
Daniel Veillard90d165b2003-09-01 20:33:13 +00001333AC_SUBST(XML_LIBTOOLLIBS)
Daniel Veillard81418e32001-05-22 15:08:55 +00001334AC_SUBST(ICONV_LIBS)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001335AC_SUBST(XML_INCLUDEDIR)
1336AC_SUBST(HTML_DIR)
1337AC_SUBST(HAVE_ISNAN)
1338AC_SUBST(HAVE_ISINF)
Daniel Veillardf1d0e6b2002-01-31 23:42:44 +00001339AC_SUBST(PYTHON)
1340AC_SUBST(PYTHON_VERSION)
1341AC_SUBST(PYTHON_INCLUDES)
Daniel Veillard253aa2c2002-02-02 09:17:16 +00001342AC_SUBST(PYTHON_SITE_PACKAGES)
Daniel Veillardb05deb71999-08-10 19:04:08 +00001343
Daniel Veillardb05deb71999-08-10 19:04:08 +00001344AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +00001345AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +00001346
Daniel Veillard9715c172002-11-25 16:33:40 +00001347dnl for the spec file
1348RELDATE=`date +'%a %b %e %Y'`
1349AC_SUBST(RELDATE)
Daniel Veillard6dc91962004-03-22 19:10:02 +00001350AC_SUBST(PYTHON_TESTS)
Daniel Veillard9715c172002-11-25 16:33:40 +00001351
Daniel Veillardc6e997c2003-01-27 12:35:42 +00001352rm -f COPYING.LIB COPYING
Daniel Veillardc575b992002-02-08 13:28:40 +00001353ln -s Copyright COPYING
1354
Daniel Veillarde4177a52004-01-08 16:43:57 +00001355# keep on one line for cygwin c.f. #130896
Daniel Veillard99b78502005-09-11 22:04:08 +00001356AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +00001357
Daniel Veillard06d25242004-02-25 13:01:42 +00001358chmod +x xml2-config python/setup.py