1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT(entities.c) |
---|
3 | AM_CONFIG_HEADER(config.h) |
---|
4 | AC_CANONICAL_HOST |
---|
5 | |
---|
6 | LIBXML_MAJOR_VERSION=2 |
---|
7 | LIBXML_MINOR_VERSION=6 |
---|
8 | LIBXML_MICRO_VERSION=17 |
---|
9 | LIBXML_MICRO_VERSION_SUFFIX= |
---|
10 | LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX |
---|
11 | LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION |
---|
12 | |
---|
13 | LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` |
---|
14 | |
---|
15 | if test -f CVS/Entries; then |
---|
16 | 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 |
---|
22 | fi |
---|
23 | AC_SUBST(LIBXML_MAJOR_VERSION) |
---|
24 | AC_SUBST(LIBXML_MINOR_VERSION) |
---|
25 | AC_SUBST(LIBXML_MICRO_VERSION) |
---|
26 | AC_SUBST(LIBXML_VERSION) |
---|
27 | AC_SUBST(LIBXML_VERSION_INFO) |
---|
28 | AC_SUBST(LIBXML_VERSION_NUMBER) |
---|
29 | AC_SUBST(LIBXML_VERSION_EXTRA) |
---|
30 | |
---|
31 | VERSION=${LIBXML_VERSION} |
---|
32 | |
---|
33 | AM_INIT_AUTOMAKE(libxml2, $VERSION) |
---|
34 | |
---|
35 | dnl Checks for programs. |
---|
36 | AC_PROG_CC |
---|
37 | AC_PROG_INSTALL |
---|
38 | AC_PROG_CPP |
---|
39 | AC_PATH_PROG(RM, rm, /bin/rm) |
---|
40 | AC_PATH_PROG(MV, mv, /bin/mv) |
---|
41 | AC_PATH_PROG(TAR, tar, /bin/tar) |
---|
42 | AC_PATH_PROG(PERL, perl, /usr/bin/perl) |
---|
43 | AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint) |
---|
44 | AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) |
---|
45 | |
---|
46 | dnl Make sure we have an ANSI compiler |
---|
47 | AM_C_PROTOTYPES |
---|
48 | test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) |
---|
49 | |
---|
50 | AC_LIBTOOL_WIN32_DLL |
---|
51 | AM_PROG_LIBTOOL |
---|
52 | |
---|
53 | # AM_MAINTAINER_MODE |
---|
54 | |
---|
55 | dnl |
---|
56 | dnl We process the AC_ARG_WITH first so that later we can modify |
---|
57 | dnl some of them to try to prevent impossible combinations. This |
---|
58 | dnl also allows up so alphabetize the choices |
---|
59 | dnl |
---|
60 | |
---|
61 | dnl |
---|
62 | dnl zlib option might change flags, so we save them initially |
---|
63 | dnl |
---|
64 | _cppflags="${CPPFLAGS}" |
---|
65 | _ldflags="${LDFLAGS}" |
---|
66 | |
---|
67 | AC_ARG_WITH(c14n, |
---|
68 | [ --with-c14n add the Canonicalization support (on)]) |
---|
69 | AC_ARG_WITH(catalog, |
---|
70 | [ --with-catalog add the Catalog support (on)]) |
---|
71 | AC_ARG_WITH(debug, |
---|
72 | [ --with-debug add the debugging module (on)]) |
---|
73 | AC_ARG_WITH(docbook, |
---|
74 | [ --with-docbook add Docbook SGML support (on)]) |
---|
75 | AC_ARG_WITH(fexceptions, |
---|
76 | [ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)]) |
---|
77 | AC_ARG_WITH(ftp, |
---|
78 | [ --with-ftp add the FTP support (on)]) |
---|
79 | AC_ARG_WITH(history, |
---|
80 | [ --with-history add history support to xmllint shell(off)]) |
---|
81 | AC_ARG_WITH(html, |
---|
82 | [ --with-html add the HTML support (on)]) |
---|
83 | dnl Specific dir for HTML output ? |
---|
84 | AC_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']) |
---|
87 | |
---|
88 | AC_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"]) |
---|
92 | AC_SUBST(HTML_DIR) |
---|
93 | AC_ARG_WITH(http, |
---|
94 | [ --with-http add the HTTP support (on)]) |
---|
95 | AC_ARG_WITH(iconv, |
---|
96 | [ --with-iconv[[=DIR]] add ICONV support (on)]) |
---|
97 | AC_ARG_WITH(iso8859x, |
---|
98 | [ --with-iso8859x add ISO8859X support if no iconv (on)]) |
---|
99 | AC_ARG_WITH(legacy, |
---|
100 | [ --with-legacy add deprecated APIs for compatibility (on)]) |
---|
101 | AC_ARG_WITH(mem_debug, |
---|
102 | [ --with-mem-debug add the memory debugging module (off)]) |
---|
103 | AC_ARG_WITH(minimum, |
---|
104 | [ --with-minimum build a minimally sized library (off)]) |
---|
105 | AC_ARG_WITH(output, |
---|
106 | [ --with-output add the serialization support (on)]) |
---|
107 | AC_ARG_WITH(pattern, |
---|
108 | [ --with-pattern add the xmlPattern selection interface (on)]) |
---|
109 | AC_ARG_WITH(push, |
---|
110 | [ --with-push add the PUSH parser interfaces (on)]) |
---|
111 | AC_ARG_WITH(python, |
---|
112 | [ --with-python[[=DIR]] build Python bindings if found]) |
---|
113 | AC_ARG_WITH(reader, |
---|
114 | [ --with-reader add the xmlReader parsing interface (on)]) |
---|
115 | AC_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 | ]) |
---|
123 | AC_ARG_WITH(regexps, |
---|
124 | [ --with-regexps add Regular Expressions support (on)]) |
---|
125 | AC_ARG_WITH(run_debug, |
---|
126 | [ --with-run-debug add the runtime debugging module (off)]) |
---|
127 | AC_ARG_WITH(sax1, |
---|
128 | [ --with-sax1 add the older SAX1 interface (on)]) |
---|
129 | AC_ARG_WITH(schemas, |
---|
130 | [ --with-schemas add Relax-NG and experimental Schemas support (on)]) |
---|
131 | AC_ARG_WITH(threads, |
---|
132 | [ --with-threads add multithread support(on)]) |
---|
133 | AC_ARG_WITH(thread-alloc, |
---|
134 | [ --with-thread-alloc add per-thread memory(off)]) |
---|
135 | AC_ARG_WITH(tree, |
---|
136 | [ --with-tree add the DOM like tree manipulation APIs (on)]) |
---|
137 | AC_ARG_WITH(valid, |
---|
138 | [ --with-valid add the DTD validation support (on)]) |
---|
139 | AC_ARG_WITH(writer, |
---|
140 | [ --with-writer add the xmlWriter saving interface (on)]) |
---|
141 | AC_ARG_WITH(xinclude, |
---|
142 | [ --with-xinclude add the XInclude support (on)]) |
---|
143 | AC_ARG_WITH(xpath, |
---|
144 | [ --with-xpath add the XPATH support (on)]) |
---|
145 | AC_ARG_WITH(xptr, |
---|
146 | [ --with-xptr add the XPointer support (on)]) |
---|
147 | AC_ARG_WITH(modules, |
---|
148 | [ --with-modules add the dynamic modules support (on)]) |
---|
149 | AC_ARG_WITH(zlib, |
---|
150 | [ --with-zlib[[=DIR]] use libz in DIR],[ |
---|
151 | if test "$withval" != "no" -a "$withval" != "yes"; then |
---|
152 | Z_DIR=$withval |
---|
153 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
---|
154 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
---|
155 | fi |
---|
156 | ]) |
---|
157 | |
---|
158 | dnl |
---|
159 | dnl option to build a minimal libxml2 library |
---|
160 | dnl |
---|
161 | if test "$with_minimum" = "yes" |
---|
162 | then |
---|
163 | echo "Configuring for a minimal library" |
---|
164 | if test "$with_c14n" = "" |
---|
165 | then |
---|
166 | with_c14n=no |
---|
167 | fi |
---|
168 | if test "$with_catalog" = "" |
---|
169 | then |
---|
170 | with_catalog=no |
---|
171 | fi |
---|
172 | echo So far so good! |
---|
173 | if test "$with_debug" = "" |
---|
174 | then |
---|
175 | with_debug=no |
---|
176 | fi |
---|
177 | if test "$with_docbook" = "" |
---|
178 | then |
---|
179 | with_docbook=no |
---|
180 | fi |
---|
181 | if test "$with_fexceptions" = "" |
---|
182 | then |
---|
183 | with_fexceptions=no |
---|
184 | fi |
---|
185 | if test "$with_ftp" = "" |
---|
186 | then |
---|
187 | with_ftp=no |
---|
188 | fi |
---|
189 | if test "$with_history" = "" |
---|
190 | then |
---|
191 | with_history=no |
---|
192 | fi |
---|
193 | if test "$with_html" = "" |
---|
194 | then |
---|
195 | with_html=no |
---|
196 | fi |
---|
197 | if test "$with_http" = "" |
---|
198 | then |
---|
199 | with_http=no |
---|
200 | fi |
---|
201 | if test "$with_iconv" = "" |
---|
202 | then |
---|
203 | with_iconv=no |
---|
204 | fi |
---|
205 | if test "$with_iso8859x" = "" |
---|
206 | then |
---|
207 | with_iso8859x=no |
---|
208 | fi |
---|
209 | if test "$with_legacy" = "" |
---|
210 | then |
---|
211 | with_legacy=no |
---|
212 | fi |
---|
213 | if test "$with_mem_debug" = "" |
---|
214 | then |
---|
215 | with_mem_debug=no |
---|
216 | fi |
---|
217 | if test "$with_output" = "" |
---|
218 | then |
---|
219 | with_output=no |
---|
220 | fi |
---|
221 | if test "$with_pattern" = "" |
---|
222 | then |
---|
223 | with_pattern=no |
---|
224 | fi |
---|
225 | if test "$with_push" = "" |
---|
226 | then |
---|
227 | with_push=no |
---|
228 | fi |
---|
229 | if test "$with_python" = "" |
---|
230 | then |
---|
231 | with_python=no |
---|
232 | fi |
---|
233 | if test "$with_reader" = "" |
---|
234 | then |
---|
235 | with_reader=no |
---|
236 | fi |
---|
237 | if test "$with_readline" = "" |
---|
238 | then |
---|
239 | with_readline=no |
---|
240 | fi |
---|
241 | if test "$with_regexp" = "" |
---|
242 | then |
---|
243 | with_regexp=no |
---|
244 | fi |
---|
245 | if test "$with_run_debug" = "" |
---|
246 | then |
---|
247 | with_run_debug=no |
---|
248 | fi |
---|
249 | if test "$with_sax1" = "" |
---|
250 | then |
---|
251 | with_sax1=no |
---|
252 | fi |
---|
253 | if test "$with_schemas" = "" |
---|
254 | then |
---|
255 | with_schemas=no |
---|
256 | fi |
---|
257 | if test "$with_threads" = "" |
---|
258 | then |
---|
259 | with_threads=no |
---|
260 | fi |
---|
261 | if test "$with_thread_alloc" = "" |
---|
262 | then |
---|
263 | with_thread_alloc=no |
---|
264 | fi |
---|
265 | if test "$with_tree" = "" |
---|
266 | then |
---|
267 | with_tree=no |
---|
268 | fi |
---|
269 | if test "$with_valid" = "" |
---|
270 | then |
---|
271 | with_valid=no |
---|
272 | fi |
---|
273 | if test "$with_writer" = "" |
---|
274 | then |
---|
275 | with_writer=no |
---|
276 | fi |
---|
277 | if test "$with_xinclude" = "" |
---|
278 | then |
---|
279 | with_xinclude=no |
---|
280 | fi |
---|
281 | if test "$with_xpath" = "" |
---|
282 | then |
---|
283 | with_xpath=no |
---|
284 | fi |
---|
285 | if test "$with_xptr" = "" |
---|
286 | then |
---|
287 | with_xptr=no |
---|
288 | fi |
---|
289 | if test "$with_zlib" = "" |
---|
290 | then |
---|
291 | with_zlib=no |
---|
292 | fi |
---|
293 | if test "$with_modules" = "" |
---|
294 | then |
---|
295 | with_modules=no |
---|
296 | fi |
---|
297 | fi |
---|
298 | |
---|
299 | echo Checking zlib |
---|
300 | |
---|
301 | dnl Checks for zlib library. |
---|
302 | |
---|
303 | if test "$with_zlib" = "no"; then |
---|
304 | echo "Disabling compression support" |
---|
305 | else |
---|
306 | AC_CHECK_HEADERS(zlib.h, |
---|
307 | AC_CHECK_LIB(z, gzread,[ |
---|
308 | AC_DEFINE([HAVE_LIBZ], [], [Have compression library]) |
---|
309 | if test "x${Z_DIR}" != "x"; then |
---|
310 | Z_CFLAGS="-I${Z_DIR}/include" |
---|
311 | Z_LIBS="-L${Z_DIR}/lib -lz" |
---|
312 | [case ${host} in |
---|
313 | *-*-solaris*) |
---|
314 | Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" |
---|
315 | ;; |
---|
316 | esac] |
---|
317 | else |
---|
318 | Z_LIBS="-lz" |
---|
319 | fi])) |
---|
320 | fi |
---|
321 | |
---|
322 | AC_SUBST(Z_CFLAGS) |
---|
323 | AC_SUBST(Z_LIBS) |
---|
324 | |
---|
325 | CPPFLAGS=${_cppflags} |
---|
326 | LDFLAGS=${_ldflags} |
---|
327 | |
---|
328 | echo Checking headers |
---|
329 | |
---|
330 | dnl Checks for header files. |
---|
331 | AC_HEADER_DIRENT |
---|
332 | AC_HEADER_STDC |
---|
333 | AC_CHECK_HEADERS([fcntl.h]) |
---|
334 | AC_CHECK_HEADERS([unistd.h]) |
---|
335 | AC_CHECK_HEADERS([ctype.h]) |
---|
336 | AC_CHECK_HEADERS([dirent.h]) |
---|
337 | AC_CHECK_HEADERS([errno.h]) |
---|
338 | AC_CHECK_HEADERS([malloc.h]) |
---|
339 | AC_CHECK_HEADERS([stdarg.h]) |
---|
340 | AC_CHECK_HEADERS([sys/stat.h]) |
---|
341 | AC_CHECK_HEADERS([sys/types.h]) |
---|
342 | AC_CHECK_HEADERS([time.h]) |
---|
343 | AC_CHECK_HEADERS([ansidecl.h]) |
---|
344 | AC_CHECK_HEADERS([ieeefp.h]) |
---|
345 | AC_CHECK_HEADERS([nan.h]) |
---|
346 | AC_CHECK_HEADERS([math.h]) |
---|
347 | AC_CHECK_HEADERS([limits.h]) |
---|
348 | AC_CHECK_HEADERS([fp_class.h]) |
---|
349 | AC_CHECK_HEADERS([float.h]) |
---|
350 | AC_CHECK_HEADERS([stdlib.h]) |
---|
351 | AC_CHECK_HEADERS([sys/socket.h], [], [], |
---|
352 | [#if HAVE_SYS_TYPES_H |
---|
353 | # include <sys/types.h> |
---|
354 | # endif |
---|
355 | ]) |
---|
356 | AC_CHECK_HEADERS([netinet/in.h], [], [], |
---|
357 | [#if HAVE_SYS_TYPES_H |
---|
358 | # include <sys/types.h> |
---|
359 | # endif |
---|
360 | ]) |
---|
361 | AC_CHECK_HEADERS([arpa/inet.h], [], [], |
---|
362 | [#if HAVE_SYS_TYPES_H |
---|
363 | # include <sys/types.h> |
---|
364 | # endif |
---|
365 | #if HAVE_ARPA_INET_H |
---|
366 | # include <arpa/inet.h> |
---|
367 | # endif |
---|
368 | ]) |
---|
369 | AC_CHECK_HEADERS([netdb.h]) |
---|
370 | AC_CHECK_HEADERS([sys/time.h]) |
---|
371 | AC_CHECK_HEADERS([sys/select.h]) |
---|
372 | AC_CHECK_HEADERS([sys/mman.h]) |
---|
373 | AC_CHECK_HEADERS([sys/timeb.h]) |
---|
374 | AC_CHECK_HEADERS([signal.h]) |
---|
375 | AC_CHECK_HEADERS([arpa/nameser.h], [], [], |
---|
376 | [#if HAVE_SYS_TYPES_H |
---|
377 | # include <sys/types.h> |
---|
378 | # endif |
---|
379 | ]) |
---|
380 | AC_CHECK_HEADERS([resolv.h], [], [], |
---|
381 | [#if HAVE_SYS_TYPES_H |
---|
382 | # include <sys/types.h> |
---|
383 | # endif |
---|
384 | #if HAVE_NETINET_IN_H |
---|
385 | # include <netinet/in.h> |
---|
386 | # endif |
---|
387 | #if HAVE_ARPA_NAMESER_H |
---|
388 | # include <arpa/nameser.h> |
---|
389 | # endif |
---|
390 | ]) |
---|
391 | AC_CHECK_HEADERS([dl.h]) |
---|
392 | AC_CHECK_HEADERS([dlfcn.h]) |
---|
393 | |
---|
394 | |
---|
395 | echo Checking libraries |
---|
396 | |
---|
397 | dnl Checks for library functions. |
---|
398 | AC_FUNC_STRFTIME |
---|
399 | AC_CHECK_FUNCS(strdup strndup strerror) |
---|
400 | AC_CHECK_FUNCS(finite isnand fp_class class fpclass) |
---|
401 | AC_CHECK_FUNCS(strftime localtime gettimeofday ftime) |
---|
402 | AC_CHECK_FUNCS(stat _stat signal) |
---|
403 | |
---|
404 | dnl Checking the standard string functions availability |
---|
405 | AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, |
---|
406 | NEED_TRIO=1) |
---|
407 | |
---|
408 | dnl Checks for inet libraries: |
---|
409 | AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) |
---|
410 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
---|
411 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(net, setsockopt)) |
---|
412 | AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect)) |
---|
413 | |
---|
414 | dnl Determine what socket length (socklen_t) data type is |
---|
415 | AC_MSG_CHECKING([for type of socket length (socklen_t)]) |
---|
416 | AC_TRY_COMPILE2([ |
---|
417 | #include <stddef.h> |
---|
418 | #include <sys/types.h> |
---|
419 | #include <sys/socket.h>],[ |
---|
420 | (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[ |
---|
421 | AC_MSG_RESULT(socklen_t *) |
---|
422 | SOCKLEN_T=socklen_t],[ |
---|
423 | AC_TRY_COMPILE2([ |
---|
424 | #include <stddef.h> |
---|
425 | #include <sys/types.h> |
---|
426 | #include <sys/socket.h>],[ |
---|
427 | (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[ |
---|
428 | AC_MSG_RESULT(size_t *) |
---|
429 | SOCKLEN_T=size_t],[ |
---|
430 | AC_TRY_COMPILE2([ |
---|
431 | #include <stddef.h> |
---|
432 | #include <sys/types.h> |
---|
433 | #include <sys/socket.h>],[ |
---|
434 | (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[ |
---|
435 | AC_MSG_RESULT(int *) |
---|
436 | SOCKLEN_T=int],[ |
---|
437 | AC_MSG_WARN(could not determine) |
---|
438 | SOCKLEN_T="int"])])]) |
---|
439 | AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is]) |
---|
440 | |
---|
441 | dnl ***********************Checking for availability of IPv6******************* |
---|
442 | |
---|
443 | AC_MSG_CHECKING([whether to enable IPv6]) |
---|
444 | AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes) |
---|
445 | if test "$with_minimum" = "yes" |
---|
446 | then |
---|
447 | enable_ipv6=no |
---|
448 | fi |
---|
449 | if test $enable_ipv6 = yes; then |
---|
450 | have_ipv6=no |
---|
451 | AC_TRY_COMPILE([ |
---|
452 | #include <sys/socket.h> |
---|
453 | #include <sys/types.h>], [ |
---|
454 | struct sockaddr_storage ss; |
---|
455 | socket(AF_INET6, SOCK_STREAM, 0) |
---|
456 | ], |
---|
457 | have_ipv6=yes, |
---|
458 | have_ipv6=no |
---|
459 | ) |
---|
460 | AC_MSG_RESULT($have_ipv6) |
---|
461 | |
---|
462 | if test $have_ipv6 = yes; then |
---|
463 | AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6]) |
---|
464 | have_broken_ss_family=no |
---|
465 | |
---|
466 | dnl ********************************************************************* |
---|
467 | dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have |
---|
468 | dnl a ss_family member, but rather __ss_family. Let's detect that |
---|
469 | dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these platforms. |
---|
470 | dnl ******************************************************************** |
---|
471 | AC_MSG_CHECKING([broken struct sockaddr::ss_family]) |
---|
472 | AC_TRY_COMPILE([ |
---|
473 | #include <sys/socket.h> |
---|
474 | #include <sys/types.h>], [ |
---|
475 | struct sockaddr_storage ss ; |
---|
476 | ss.__ss_family = 0 ; |
---|
477 | ], |
---|
478 | have_broken_ss_family=yes, |
---|
479 | have_broken_ss_family=no |
---|
480 | ) |
---|
481 | AC_MSG_RESULT($have_broken_ss_family) |
---|
482 | if test x$have_broken_ss_family = xyes ; then |
---|
483 | AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [], [Whether struct sockaddr::__ss_family exists]) |
---|
484 | AC_DEFINE(ss_family, __ss_family, [ss_family is not defined here, use __ss_family instead]) |
---|
485 | fi |
---|
486 | |
---|
487 | have_getaddrinfo=no |
---|
488 | AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes) |
---|
489 | if test $have_getaddrinfo != yes; then |
---|
490 | for lib in bsd socket inet; do |
---|
491 | AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break]) |
---|
492 | done |
---|
493 | fi |
---|
494 | |
---|
495 | if test $have_getaddrinfo = yes; then |
---|
496 | AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there]) |
---|
497 | fi |
---|
498 | fi |
---|
499 | fi |
---|
500 | |
---|
501 | dnl ******************************End IPv6 checks****************************** |
---|
502 | |
---|
503 | dnl Checks for isnan in libm if not in libc |
---|
504 | AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan, |
---|
505 | [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])])) |
---|
506 | |
---|
507 | AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf, |
---|
508 | [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])])) |
---|
509 | |
---|
510 | XML_LIBDIR='-L${libdir}' |
---|
511 | XML_INCLUDEDIR='-I${includedir}/libxml2' |
---|
512 | |
---|
513 | dnl |
---|
514 | dnl Extra flags |
---|
515 | dnl |
---|
516 | XML_CFLAGS="" |
---|
517 | RDL_LIBS="" |
---|
518 | |
---|
519 | dnl |
---|
520 | dnl Workaround for native compilers |
---|
521 | dnl HP : http://bugs.gnome.org/db/31/3163.html |
---|
522 | dnl DEC : Enable NaN/Inf |
---|
523 | dnl |
---|
524 | if test "${GCC}" != "yes" ; then |
---|
525 | case "${host}" in |
---|
526 | *-*-hpux* ) |
---|
527 | CFLAGS="${CFLAGS} -Wp,-H30000" |
---|
528 | ;; |
---|
529 | *-dec-osf* ) |
---|
530 | CFLAGS="${CFLAGS} -ieee" |
---|
531 | ;; |
---|
532 | alpha*-*-linux* ) |
---|
533 | CFLAGS="${CFLAGS} -ieee" |
---|
534 | ;; |
---|
535 | esac |
---|
536 | else |
---|
537 | if test "$with_fexceptions" = "yes" |
---|
538 | then |
---|
539 | # |
---|
540 | # Not activated by default because this inflates the code size |
---|
541 | # Used to allow propagation of C++ exceptions through the library |
---|
542 | # |
---|
543 | CFLAGS="${CFLAGS} -fexceptions" |
---|
544 | fi |
---|
545 | |
---|
546 | 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" |
---|
547 | case "${host}" in |
---|
548 | alpha*-*-linux* ) |
---|
549 | CFLAGS="${CFLAGS} -mieee" |
---|
550 | ;; |
---|
551 | alpha*-*-osf* ) |
---|
552 | CFLAGS="${CFLAGS} -mieee" |
---|
553 | ;; |
---|
554 | esac |
---|
555 | fi |
---|
556 | case ${host} in |
---|
557 | *-*-solaris*) |
---|
558 | XML_LIBDIR="${XML_LIBDIR} -R${libdir}" |
---|
559 | ;; |
---|
560 | hppa*-hp-mpeix) |
---|
561 | NEED_TRIO=1 |
---|
562 | ;; |
---|
563 | esac |
---|
564 | |
---|
565 | |
---|
566 | dnl |
---|
567 | dnl check for python |
---|
568 | dnl |
---|
569 | |
---|
570 | PYTHON= |
---|
571 | PYTHON_VERSION= |
---|
572 | PYTHON_INCLUDES= |
---|
573 | PYTHON_SITE_PACKAGES= |
---|
574 | PYTHON_TESTS= |
---|
575 | pythondir= |
---|
576 | if test "$with_python" != "no" ; then |
---|
577 | if test -x "$with_python/bin/python" |
---|
578 | then |
---|
579 | echo Found python in $with_python/bin/python |
---|
580 | PYTHON="$with_python/bin/python" |
---|
581 | else |
---|
582 | if test -x "$with_python" |
---|
583 | then |
---|
584 | echo Found python in $with_python |
---|
585 | PYTHON="$with_python" |
---|
586 | else |
---|
587 | AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) |
---|
588 | fi |
---|
589 | fi |
---|
590 | if test "$PYTHON" != "" |
---|
591 | then |
---|
592 | PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` |
---|
593 | echo Found Python version $PYTHON_VERSION |
---|
594 | fi |
---|
595 | if test "$PYTHON_VERSION" != "" |
---|
596 | then |
---|
597 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ |
---|
598 | -d $with_python/lib/python$PYTHON_VERSION/site-packages |
---|
599 | then |
---|
600 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
---|
601 | PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages |
---|
602 | else |
---|
603 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h |
---|
604 | then |
---|
605 | PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' |
---|
606 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
607 | else |
---|
608 | if test -r /usr/include/python$PYTHON_VERSION/Python.h |
---|
609 | then |
---|
610 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
---|
611 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
612 | else |
---|
613 | echo could not find python$PYTHON_VERSION/Python.h |
---|
614 | fi |
---|
615 | fi |
---|
616 | if test ! -d "$PYTHON_SITE_PACKAGES" |
---|
617 | then |
---|
618 | PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` |
---|
619 | fi |
---|
620 | fi |
---|
621 | fi |
---|
622 | if test "$with_python" != "" |
---|
623 | then |
---|
624 | pythondir='$(PYTHON_SITE_PACKAGES)' |
---|
625 | else |
---|
626 | pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' |
---|
627 | fi |
---|
628 | fi |
---|
629 | AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") |
---|
630 | if test "$PYTHON_INCLUDES" != "" |
---|
631 | then |
---|
632 | PYTHON_SUBDIR=python |
---|
633 | else |
---|
634 | PYTHON_SUBDIR= |
---|
635 | fi |
---|
636 | AC_SUBST(pythondir) |
---|
637 | AC_SUBST(PYTHON_SUBDIR) |
---|
638 | |
---|
639 | dnl check for dso support |
---|
640 | WITH_MODULES=0 |
---|
641 | MODULE_EXTENSION=".so" |
---|
642 | TEST_MODULES= |
---|
643 | |
---|
644 | if test "$with_modules" != "no" ; then |
---|
645 | AC_CHECK_LIB(dld, shl_load, [ |
---|
646 | WITH_MODULES=1 |
---|
647 | MODULE_PLATFORM_LIBS="-ldld" |
---|
648 | AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso]) |
---|
649 | ]) |
---|
650 | |
---|
651 | AC_CHECK_LIB(dl, dlopen, [ |
---|
652 | WITH_MODULES=1 |
---|
653 | MODULE_PLATFORM_LIBS="-ldl" |
---|
654 | AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) |
---|
655 | ]) |
---|
656 | fi |
---|
657 | |
---|
658 | if test "${WITH_MODULES}" = "1"; then |
---|
659 | TEST_MODULES="ModuleTests" |
---|
660 | fi |
---|
661 | |
---|
662 | AC_SUBST(WITH_MODULES) |
---|
663 | AC_SUBST(MODULE_PLATFORM_LIBS) |
---|
664 | AC_SUBST(MODULE_EXTENSION) |
---|
665 | AC_SUBST(TEST_MODULES) |
---|
666 | |
---|
667 | dnl |
---|
668 | dnl Tester makes use of readline if present |
---|
669 | dnl |
---|
670 | |
---|
671 | dnl |
---|
672 | dnl specific tests to setup DV and Bill's devel environments with debug etc ... |
---|
673 | dnl (-Wunreachable-code) |
---|
674 | dnl |
---|
675 | if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \ |
---|
676 | [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \ |
---|
677 | [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xmltest" ]] || \ |
---|
678 | [[ "${LOGNAME}" = "wbrack" -a "`pwd`" = "/Users/wbrack/gnomecvs/xmltest" ]] |
---|
679 | then |
---|
680 | if test "$with_minimum" != "yes" |
---|
681 | then |
---|
682 | if test "${with_mem_debug}" = "" ; then |
---|
683 | with_mem_debug="yes" |
---|
684 | with_run_debug="yes" |
---|
685 | fi |
---|
686 | if test "${with_docbook}" = "" ; then |
---|
687 | with_docbook="yes" |
---|
688 | fi |
---|
689 | fi |
---|
690 | if test "${CC}" = "gcc" ; then |
---|
691 | 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" |
---|
692 | fi |
---|
693 | STATIC_BINARIES="-static" |
---|
694 | dnl -Wcast-qual -ansi |
---|
695 | else |
---|
696 | STATIC_BINARIES= |
---|
697 | fi |
---|
698 | AC_SUBST(STATIC_BINARIES) |
---|
699 | |
---|
700 | dnl |
---|
701 | dnl Check for trio string functions |
---|
702 | dnl |
---|
703 | |
---|
704 | if test "${NEED_TRIO}" = "1" ; then |
---|
705 | echo Adding trio library for string functions |
---|
706 | WITH_TRIO=1 |
---|
707 | else |
---|
708 | WITH_TRIO=0 |
---|
709 | fi |
---|
710 | AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1") |
---|
711 | AC_SUBST(WITH_TRIO) |
---|
712 | |
---|
713 | dnl |
---|
714 | dnl Allow to enable/disable various pieces |
---|
715 | dnl |
---|
716 | echo Checking configuration requirements |
---|
717 | |
---|
718 | dnl |
---|
719 | dnl Thread-related stuff |
---|
720 | dnl |
---|
721 | THREAD_LIBS="" |
---|
722 | WITH_THREADS=0 |
---|
723 | THREAD_CFLAGS="" |
---|
724 | TEST_THREADS="" |
---|
725 | THREADS_W32="" |
---|
726 | |
---|
727 | if test "$with_threads" = "no" ; then |
---|
728 | echo Disabling multithreaded support |
---|
729 | else |
---|
730 | echo Enabling multithreaded support |
---|
731 | |
---|
732 | AC_CHECK_HEADER(pthread.h, |
---|
733 | AC_CHECK_LIB(pthread, pthread_join,[ |
---|
734 | THREAD_LIBS="-lpthread" |
---|
735 | AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)]) |
---|
736 | AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there]) |
---|
737 | WITH_THREADS="1"])) |
---|
738 | case $host_os in |
---|
739 | *mingw32*) WITH_THREADS="1" |
---|
740 | THREADS_W32="Win32" |
---|
741 | THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" |
---|
742 | ;; |
---|
743 | *cygwin*) THREAD_LIBS="" |
---|
744 | ;; |
---|
745 | *beos*) WITH_THREADS="1" |
---|
746 | THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" |
---|
747 | ;; |
---|
748 | esac |
---|
749 | if test "$WITH_THREADS" = "1" ; then |
---|
750 | THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" |
---|
751 | TEST_THREADS="Threadtests" |
---|
752 | fi |
---|
753 | fi |
---|
754 | if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then |
---|
755 | THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED" |
---|
756 | fi |
---|
757 | |
---|
758 | AC_SUBST(THREAD_LIBS) |
---|
759 | AC_SUBST(WITH_THREADS) |
---|
760 | AC_SUBST(THREAD_CFLAGS) |
---|
761 | AC_SUBST(TEST_THREADS) |
---|
762 | AC_SUBST(THREADS_W32) |
---|
763 | |
---|
764 | dnl |
---|
765 | dnl xmllint shell history |
---|
766 | dnl |
---|
767 | if test "$with_history" = "yes" ; then |
---|
768 | echo Enabling xmllint shell history |
---|
769 | dnl check for terminal library. this is a very cool solution |
---|
770 | dnl from octave's configure.in |
---|
771 | unset tcap |
---|
772 | for termlib in ncurses curses termcap terminfo termlib; do |
---|
773 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) |
---|
774 | test -n "$tcap" && break |
---|
775 | done |
---|
776 | |
---|
777 | AC_CHECK_HEADER(readline/history.h, |
---|
778 | AC_CHECK_LIB(history, append_history,[ |
---|
779 | RDL_LIBS="-lhistory" |
---|
780 | AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])])) |
---|
781 | AC_CHECK_HEADER(readline/readline.h, |
---|
782 | AC_CHECK_LIB(readline, readline,[ |
---|
783 | RDL_LIBS="-lreadline $RDL_LIBS $tcap" |
---|
784 | AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap)) |
---|
785 | if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then |
---|
786 | CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" |
---|
787 | RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" |
---|
788 | fi |
---|
789 | fi |
---|
790 | |
---|
791 | dnl |
---|
792 | dnl Tree functions |
---|
793 | dnl |
---|
794 | if test "$with_tree" = "no" ; then |
---|
795 | echo Disabling DOM like tree manipulation APIs |
---|
796 | WITH_TREE=0 |
---|
797 | else |
---|
798 | WITH_TREE=1 |
---|
799 | fi |
---|
800 | AC_SUBST(WITH_TREE) |
---|
801 | |
---|
802 | if test "$with_ftp" = "no" ; then |
---|
803 | echo Disabling FTP support |
---|
804 | WITH_FTP=0 |
---|
805 | FTP_OBJ= |
---|
806 | else |
---|
807 | WITH_FTP=1 |
---|
808 | FTP_OBJ=nanoftp.o |
---|
809 | fi |
---|
810 | AC_SUBST(WITH_FTP) |
---|
811 | AC_SUBST(FTP_OBJ) |
---|
812 | |
---|
813 | if test "$with_http" = "no" ; then |
---|
814 | echo Disabling HTTP support |
---|
815 | WITH_HTTP=0 |
---|
816 | HTTP_OBJ= |
---|
817 | else |
---|
818 | WITH_HTTP=1 |
---|
819 | HTTP_OBJ=nanohttp.o |
---|
820 | fi |
---|
821 | AC_SUBST(WITH_HTTP) |
---|
822 | AC_SUBST(HTTP_OBJ) |
---|
823 | |
---|
824 | if test "$with_legacy" = "no" ; then |
---|
825 | echo Disabling deprecated APIs |
---|
826 | WITH_LEGACY=0 |
---|
827 | else |
---|
828 | WITH_LEGACY=1 |
---|
829 | fi |
---|
830 | AC_SUBST(WITH_LEGACY) |
---|
831 | |
---|
832 | if test "$with_reader" = "no" ; then |
---|
833 | echo Disabling the xmlReader parsing interface |
---|
834 | WITH_READER=0 |
---|
835 | READER_TEST= |
---|
836 | else |
---|
837 | WITH_READER=1 |
---|
838 | READER_TEST=Readertests |
---|
839 | if test "$with_push" = "no" ; then |
---|
840 | echo xmlReader requires Push interface - enabling it |
---|
841 | with_push=yes |
---|
842 | fi |
---|
843 | fi |
---|
844 | AC_SUBST(WITH_READER) |
---|
845 | AC_SUBST(READER_TEST) |
---|
846 | |
---|
847 | if test "$with_writer" = "no" ; then |
---|
848 | echo Disabling the xmlWriter saving interface |
---|
849 | WITH_WRITER=0 |
---|
850 | # WRITER_TEST= |
---|
851 | else |
---|
852 | WITH_WRITER=1 |
---|
853 | # WRITER_TEST=Writertests |
---|
854 | if test "$with_push" = "no" ; then |
---|
855 | echo xmlWriter requires Push interface - enabling it |
---|
856 | with_push=yes |
---|
857 | fi |
---|
858 | if test "$with_output" = "no" ; then |
---|
859 | echo xmlWriter requires Output interface - enabling it |
---|
860 | with_output=yes |
---|
861 | fi |
---|
862 | fi |
---|
863 | AC_SUBST(WITH_WRITER) |
---|
864 | #AC_SUBST(WRITER_TEST) |
---|
865 | |
---|
866 | if test "$with_pattern" = "no" ; then |
---|
867 | echo Disabling the xmlPattern parsing interface |
---|
868 | WITH_PATTERN=0 |
---|
869 | PATTERN_TEST= |
---|
870 | else |
---|
871 | WITH_PATTERN=1 |
---|
872 | PATTERN_TEST=Patterntests |
---|
873 | fi |
---|
874 | AC_SUBST(WITH_PATTERN) |
---|
875 | AC_SUBST(PATTERN_TEST) |
---|
876 | |
---|
877 | if test "$with_sax1" = "no" ; then |
---|
878 | echo Disabling the older SAX1 interface |
---|
879 | WITH_SAX1=0 |
---|
880 | TEST_SAX= |
---|
881 | else |
---|
882 | WITH_SAX1=1 |
---|
883 | TEST_SAX=SAXtests |
---|
884 | fi |
---|
885 | AC_SUBST(WITH_SAX1) |
---|
886 | AC_SUBST(TEST_SAX) |
---|
887 | |
---|
888 | if test "$with_push" = "no" ; then |
---|
889 | echo Disabling the PUSH parser interfaces |
---|
890 | WITH_PUSH=0 |
---|
891 | TEST_PUSH= |
---|
892 | else |
---|
893 | WITH_PUSH=1 |
---|
894 | TEST_PUSH="XMLPushtests" |
---|
895 | fi |
---|
896 | AC_SUBST(WITH_PUSH) |
---|
897 | AC_SUBST(TEST_PUSH) |
---|
898 | |
---|
899 | if test "$with_html" = "no" ; then |
---|
900 | echo Disabling HTML support |
---|
901 | WITH_HTML=0 |
---|
902 | HTML_OBJ= |
---|
903 | TEST_HTML= |
---|
904 | else |
---|
905 | WITH_HTML=1 |
---|
906 | HTML_OBJ="HTMLparser.o HTMLtree.o" |
---|
907 | TEST_HTML=HTMLtests |
---|
908 | if test "$with_push" != "no" ; then |
---|
909 | TEST_PHTML=HTMLPushtests |
---|
910 | else |
---|
911 | TEST_PHTML= |
---|
912 | fi |
---|
913 | fi |
---|
914 | AC_SUBST(WITH_HTML) |
---|
915 | AC_SUBST(HTML_OBJ) |
---|
916 | AC_SUBST(TEST_HTML) |
---|
917 | AC_SUBST(TEST_PHTML) |
---|
918 | |
---|
919 | if test "$with_valid" = "no" ; then |
---|
920 | echo Disabling DTD validation support |
---|
921 | WITH_VALID=0 |
---|
922 | TEST_VALID= |
---|
923 | TEST_VTIME= |
---|
924 | else |
---|
925 | WITH_VALID=1 |
---|
926 | TEST_VALID=Validtests |
---|
927 | TEST_VTIME=VTimingtests |
---|
928 | fi |
---|
929 | AC_SUBST(WITH_VALID) |
---|
930 | AC_SUBST(TEST_VALID) |
---|
931 | AC_SUBST(TEST_VTIME) |
---|
932 | |
---|
933 | if test "$with_catalog" = "no" ; then |
---|
934 | echo Disabling Catalog support |
---|
935 | WITH_CATALOG=0 |
---|
936 | CATALOG_OBJ= |
---|
937 | TEST_CATALOG= |
---|
938 | else |
---|
939 | WITH_CATALOG=1 |
---|
940 | CATALOG_OBJ="catalog.o" |
---|
941 | TEST_CATALOG=Catatests |
---|
942 | fi |
---|
943 | AC_SUBST(WITH_CATALOG) |
---|
944 | AC_SUBST(CATALOG_OBJ) |
---|
945 | AC_SUBST(TEST_CATALOG) |
---|
946 | |
---|
947 | if test "$with_docbook" = "no" ; then |
---|
948 | echo Disabling Docbook support |
---|
949 | WITH_DOCB=0 |
---|
950 | DOCB_OBJ= |
---|
951 | else |
---|
952 | WITH_DOCB=1 |
---|
953 | DOCB_OBJ="DOCBparser.o" |
---|
954 | fi |
---|
955 | AC_SUBST(WITH_DOCB) |
---|
956 | AC_SUBST(DOCB_OBJ) |
---|
957 | |
---|
958 | |
---|
959 | if test "$with_xptr" = "no" ; then |
---|
960 | echo Disabling XPointer support |
---|
961 | WITH_XPTR=0 |
---|
962 | XPTR_OBJ= |
---|
963 | TEST_XPTR= |
---|
964 | else |
---|
965 | WITH_XPTR=1 |
---|
966 | XPTR_OBJ=xpointer.o |
---|
967 | TEST_XPTR=XPtrtests |
---|
968 | if test "$with_xpath" = "no" ; then |
---|
969 | echo XPointer requires XPath support - enabling it |
---|
970 | with_xpath=yes |
---|
971 | fi |
---|
972 | fi |
---|
973 | AC_SUBST(WITH_XPTR) |
---|
974 | AC_SUBST(XPTR_OBJ) |
---|
975 | AC_SUBST(TEST_XPTR) |
---|
976 | |
---|
977 | if test "$with_c14n" = "no" ; then |
---|
978 | echo Disabling C14N support |
---|
979 | WITH_C14N=0 |
---|
980 | C14N_OBJ= |
---|
981 | TEST_C14N= |
---|
982 | else |
---|
983 | WITH_C14N=1 |
---|
984 | C14N_OBJ="c14n.c" |
---|
985 | TEST_C14N=C14Ntests |
---|
986 | if test "$with_xpath" = "no" ; then |
---|
987 | echo C14N requires XPath support - enabling it |
---|
988 | with_xpath=yes |
---|
989 | fi |
---|
990 | fi |
---|
991 | AC_SUBST(WITH_C14N) |
---|
992 | AC_SUBST(C14N_OBJ) |
---|
993 | AC_SUBST(TEST_C14N) |
---|
994 | |
---|
995 | if test "$with_xinclude" = "no" ; then |
---|
996 | echo Disabling XInclude support |
---|
997 | WITH_XINCLUDE=0 |
---|
998 | XINCLUDE_OBJ= |
---|
999 | with_xinclude="no" |
---|
1000 | TEST_XINCLUDE= |
---|
1001 | else |
---|
1002 | WITH_XINCLUDE=1 |
---|
1003 | XINCLUDE_OBJ=xinclude.o |
---|
1004 | TEST_XINCLUDE=XIncludetests |
---|
1005 | if test "$with_xpath" = "no" ; then |
---|
1006 | echo XInclude requires XPath support - enabling it |
---|
1007 | with_xpath=yes |
---|
1008 | fi |
---|
1009 | fi |
---|
1010 | AC_SUBST(WITH_XINCLUDE) |
---|
1011 | AC_SUBST(XINCLUDE_OBJ) |
---|
1012 | AC_SUBST(TEST_XINCLUDE) |
---|
1013 | |
---|
1014 | if test "$with_xpath" = "no" ; then |
---|
1015 | echo Disabling XPATH support |
---|
1016 | WITH_XPATH=0 |
---|
1017 | XPATH_OBJ= |
---|
1018 | TEST_XPATH= |
---|
1019 | else |
---|
1020 | WITH_XPATH=1 |
---|
1021 | XPATH_OBJ=xpath.o |
---|
1022 | TEST_XPATH=XPathtests |
---|
1023 | fi |
---|
1024 | AC_SUBST(WITH_XPATH) |
---|
1025 | AC_SUBST(XPATH_OBJ) |
---|
1026 | AC_SUBST(TEST_XPATH) |
---|
1027 | |
---|
1028 | dnl |
---|
1029 | dnl output functions |
---|
1030 | dnl |
---|
1031 | if test "$with_output" = "no" ; then |
---|
1032 | echo Disabling serialization/saving support |
---|
1033 | WITH_OUTPUT=0 |
---|
1034 | else |
---|
1035 | WITH_OUTPUT=1 |
---|
1036 | fi |
---|
1037 | AC_SUBST(WITH_OUTPUT) |
---|
1038 | |
---|
1039 | WITH_ICONV=0 |
---|
1040 | if test "$with_iconv" = "no" ; then |
---|
1041 | echo Disabling ICONV support |
---|
1042 | else |
---|
1043 | if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then |
---|
1044 | CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" |
---|
1045 | # Export this since our headers include iconv.h |
---|
1046 | XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" |
---|
1047 | ICONV_LIBS="-L$with_iconv/lib" |
---|
1048 | fi |
---|
1049 | |
---|
1050 | AC_CHECK_HEADER(iconv.h, |
---|
1051 | AC_MSG_CHECKING(for iconv) |
---|
1052 | AC_TRY_LINK([#include <stdlib.h> |
---|
1053 | #include <iconv.h>],[ |
---|
1054 | iconv_t cd = iconv_open ("",""); |
---|
1055 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
---|
1056 | AC_MSG_RESULT(yes) |
---|
1057 | WITH_ICONV=1],[ |
---|
1058 | AC_MSG_RESULT(no) |
---|
1059 | AC_MSG_CHECKING(for iconv in -liconv) |
---|
1060 | |
---|
1061 | _ldflags="${LDFLAGS}" |
---|
1062 | _libs="${LIBS}" |
---|
1063 | LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" |
---|
1064 | LIBS="${LIBS} -liconv" |
---|
1065 | |
---|
1066 | AC_TRY_LINK([#include <stdlib.h> |
---|
1067 | #include <iconv.h>],[ |
---|
1068 | iconv_t cd = iconv_open ("",""); |
---|
1069 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
---|
1070 | AC_MSG_RESULT(yes) |
---|
1071 | WITH_ICONV=1 |
---|
1072 | ICONV_LIBS="${ICONV_LIBS} -liconv" |
---|
1073 | LIBS="${_libs}" |
---|
1074 | LDFLAGS="${_ldflags}"],[ |
---|
1075 | AC_MSG_RESULT(no) |
---|
1076 | LIBS="${_libs}" |
---|
1077 | LDFLAGS="${_ldflags}"])])) |
---|
1078 | fi |
---|
1079 | case "$host" in |
---|
1080 | *mingw*) M_LIBS="" |
---|
1081 | ;; |
---|
1082 | *beos*) M_LIBS="" |
---|
1083 | ;; |
---|
1084 | *) M_LIBS="-lm" |
---|
1085 | ;; |
---|
1086 | esac |
---|
1087 | XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" |
---|
1088 | XML_LIBTOOLLIBS="libxml2.la" |
---|
1089 | AC_SUBST(WITH_ICONV) |
---|
1090 | |
---|
1091 | WITH_ISO8859X=1 |
---|
1092 | if test "$WITH_ICONV" != "1" ; then |
---|
1093 | if test "$with_iso8859x" = "no" ; then |
---|
1094 | echo Disabling ISO8859X support |
---|
1095 | WITH_ISO8859X=0 |
---|
1096 | fi |
---|
1097 | fi |
---|
1098 | AC_SUBST(WITH_ISO8859X) |
---|
1099 | |
---|
1100 | if test "$with_schemas" = "no" ; then |
---|
1101 | echo "Disabling Schemas/Relax-NG support" |
---|
1102 | WITH_SCHEMAS=0 |
---|
1103 | TEST_SCHEMAS= |
---|
1104 | else |
---|
1105 | echo "Enabled Schemas/Relax-NG support" |
---|
1106 | WITH_SCHEMAS=1 |
---|
1107 | TEST_SCHEMAS="Schemastests Relaxtests" |
---|
1108 | if test "$PYTHON_INCLUDES" != "" ; then |
---|
1109 | PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests" |
---|
1110 | fi |
---|
1111 | with_regexps=yes |
---|
1112 | fi |
---|
1113 | AC_SUBST(WITH_SCHEMAS) |
---|
1114 | AC_SUBST(TEST_SCHEMAS) |
---|
1115 | |
---|
1116 | if test "$with_regexps" = "no" ; then |
---|
1117 | echo Disabling Regexps support |
---|
1118 | WITH_REGEXPS=0 |
---|
1119 | TEST_REGEXPS= |
---|
1120 | else |
---|
1121 | WITH_REGEXPS=1 |
---|
1122 | TEST_REGEXPS="Regexptests Automatatests" |
---|
1123 | fi |
---|
1124 | AC_SUBST(WITH_REGEXPS) |
---|
1125 | AC_SUBST(TEST_REGEXPS) |
---|
1126 | |
---|
1127 | if test "$with_debug" = "no" ; then |
---|
1128 | echo Disabling DEBUG support |
---|
1129 | WITH_DEBUG=0 |
---|
1130 | DEBUG_OBJ= |
---|
1131 | TEST_DEBUG= |
---|
1132 | else |
---|
1133 | WITH_DEBUG=1 |
---|
1134 | DEBUG_OBJ=debugXML.o |
---|
1135 | TEST_DEBUG=Scripttests |
---|
1136 | fi |
---|
1137 | AC_SUBST(WITH_DEBUG) |
---|
1138 | AC_SUBST(DEBUG_OBJ) |
---|
1139 | AC_SUBST(TEST_DEBUG) |
---|
1140 | |
---|
1141 | if test "$with_mem_debug" = "yes" ; then |
---|
1142 | if test "$with_thread_alloc" = "yes" ; then |
---|
1143 | echo Disabling memory debug - cannot use mem-debug with thread-alloc! |
---|
1144 | WITH_MEM_DEBUG=0 |
---|
1145 | else |
---|
1146 | echo Enabling memory debug support |
---|
1147 | WITH_MEM_DEBUG=1 |
---|
1148 | fi |
---|
1149 | else |
---|
1150 | WITH_MEM_DEBUG=0 |
---|
1151 | fi |
---|
1152 | AC_SUBST(WITH_MEM_DEBUG) |
---|
1153 | |
---|
1154 | if test "$with_run_debug" = "yes" ; then |
---|
1155 | echo Enabling runtime debug support |
---|
1156 | WITH_RUN_DEBUG=1 |
---|
1157 | else |
---|
1158 | WITH_RUN_DEBUG=0 |
---|
1159 | fi |
---|
1160 | AC_SUBST(WITH_RUN_DEBUG) |
---|
1161 | |
---|
1162 | WIN32_EXTRA_LIBADD= |
---|
1163 | WIN32_EXTRA_LDFLAGS= |
---|
1164 | CYGWIN_EXTRA_LDFLAGS= |
---|
1165 | CYGWIN_EXTRA_PYTHON_LIBADD= |
---|
1166 | case "$host" in |
---|
1167 | *-*-mingw*) |
---|
1168 | CPPFLAGS="$CPPFLAGS -DWIN32" |
---|
1169 | WIN32_EXTRA_LIBADD="-lws2_32" |
---|
1170 | WIN32_EXTRA_LDFLAGS="-no-undefined" |
---|
1171 | AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation]) |
---|
1172 | AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around]) |
---|
1173 | AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around]) |
---|
1174 | ;; |
---|
1175 | *-*-cygwin*) |
---|
1176 | CYGWIN_EXTRA_LDFLAGS="-no-undefined" |
---|
1177 | if test "${PYTHON}" != "" |
---|
1178 | then |
---|
1179 | CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}" |
---|
1180 | fi |
---|
1181 | ;; |
---|
1182 | esac |
---|
1183 | AC_SUBST(WIN32_EXTRA_LIBADD) |
---|
1184 | AC_SUBST(WIN32_EXTRA_LDFLAGS) |
---|
1185 | AC_SUBST(CYGWIN_EXTRA_LDFLAGS) |
---|
1186 | AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD) |
---|
1187 | |
---|
1188 | AC_SUBST(CPPFLAGS) |
---|
1189 | AC_SUBST(CFLAGS) |
---|
1190 | AC_SUBST(XML_CFLAGS) |
---|
1191 | |
---|
1192 | AC_SUBST(XML_LIBDIR) |
---|
1193 | AC_SUBST(XML_LIBS) |
---|
1194 | AC_SUBST(XML_LIBTOOLLIBS) |
---|
1195 | AC_SUBST(ICONV_LIBS) |
---|
1196 | AC_SUBST(XML_INCLUDEDIR) |
---|
1197 | AC_SUBST(HTML_DIR) |
---|
1198 | AC_SUBST(HAVE_ISNAN) |
---|
1199 | AC_SUBST(HAVE_ISINF) |
---|
1200 | AC_SUBST(PYTHON) |
---|
1201 | AC_SUBST(PYTHON_VERSION) |
---|
1202 | AC_SUBST(PYTHON_INCLUDES) |
---|
1203 | AC_SUBST(PYTHON_SITE_PACKAGES) |
---|
1204 | |
---|
1205 | AC_SUBST(M_LIBS) |
---|
1206 | AC_SUBST(RDL_LIBS) |
---|
1207 | |
---|
1208 | dnl for the spec file |
---|
1209 | RELDATE=`date +'%a %b %e %Y'` |
---|
1210 | AC_SUBST(RELDATE) |
---|
1211 | AC_SUBST(PYTHON_TESTS) |
---|
1212 | |
---|
1213 | rm -f COPYING.LIB COPYING |
---|
1214 | ln -s Copyright COPYING |
---|
1215 | |
---|
1216 | # keep on one line for cygwin c.f. #130896 |
---|
1217 | AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/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) |
---|
1218 | |
---|
1219 | chmod +x xml2-config python/setup.py |
---|