1 | dnl Process this file with autoconf to produce a configure script.
|
---|
2 | AC_PREREQ([2.63])
|
---|
3 |
|
---|
4 | m4_define([MAJOR_VERSION], 2)
|
---|
5 | m4_define([MINOR_VERSION], 9)
|
---|
6 | m4_define([MICRO_VERSION], 14)
|
---|
7 |
|
---|
8 | AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
|
---|
9 | AC_CONFIG_SRCDIR([entities.c])
|
---|
10 | AC_CONFIG_HEADERS([config.h])
|
---|
11 | AM_MAINTAINER_MODE([enable])
|
---|
12 | AC_CONFIG_MACRO_DIR([m4])
|
---|
13 | AC_CANONICAL_HOST
|
---|
14 |
|
---|
15 | LIBXML_MAJOR_VERSION=MAJOR_VERSION
|
---|
16 | LIBXML_MINOR_VERSION=MINOR_VERSION
|
---|
17 | LIBXML_MICRO_VERSION=MICRO_VERSION
|
---|
18 | LIBXML_MICRO_VERSION_SUFFIX=
|
---|
19 | LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
|
---|
20 | LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
|
---|
21 |
|
---|
22 | LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
|
---|
23 |
|
---|
24 | if test -d .git ; then
|
---|
25 | extra=`git describe 2>/dev/null | sed 's+LIBXML[[0-9.]]*-++'`
|
---|
26 | echo extra=$extra
|
---|
27 | if test "$extra" != ""
|
---|
28 | then
|
---|
29 | LIBXML_VERSION_EXTRA="-GIT$extra"
|
---|
30 | fi
|
---|
31 | fi
|
---|
32 |
|
---|
33 | AC_SUBST(LIBXML_MAJOR_VERSION)
|
---|
34 | AC_SUBST(LIBXML_MINOR_VERSION)
|
---|
35 | AC_SUBST(LIBXML_MICRO_VERSION)
|
---|
36 | AC_SUBST(LIBXML_VERSION)
|
---|
37 | AC_SUBST(LIBXML_VERSION_INFO)
|
---|
38 | AC_SUBST(LIBXML_VERSION_NUMBER)
|
---|
39 | AC_SUBST(LIBXML_VERSION_EXTRA)
|
---|
40 |
|
---|
41 | VERSION=${LIBXML_VERSION}
|
---|
42 |
|
---|
43 | AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz])
|
---|
44 |
|
---|
45 | # Support silent build rules, requires at least automake-1.11. Disable
|
---|
46 | # by either passing --disable-silent-rules to configure or passing V=1
|
---|
47 | # to make
|
---|
48 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
---|
49 |
|
---|
50 | dnl Checks for programs.
|
---|
51 | AC_PROG_CC
|
---|
52 | AC_PROG_INSTALL
|
---|
53 | AC_PROG_LN_S
|
---|
54 | AC_PROG_MKDIR_P
|
---|
55 | AC_PROG_CPP
|
---|
56 | AC_PATH_PROG(MV, mv, /bin/mv)
|
---|
57 | AC_PATH_PROG(TAR, tar, /bin/tar)
|
---|
58 | AC_PATH_PROG(PERL, perl, /usr/bin/perl)
|
---|
59 | AC_PATH_PROG(WGET, wget, /usr/bin/wget)
|
---|
60 | AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
|
---|
61 | AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
|
---|
62 | PKG_PROG_PKG_CONFIG
|
---|
63 |
|
---|
64 | LT_INIT
|
---|
65 |
|
---|
66 | dnl
|
---|
67 | dnl if the system support linker version scripts for symbol versioning
|
---|
68 | dnl then add it
|
---|
69 | dnl
|
---|
70 | VERSION_SCRIPT_FLAGS=
|
---|
71 | # lt_cv_prog_gnu_ld is from libtool 2.+
|
---|
72 | if test "$lt_cv_prog_gnu_ld" = yes; then
|
---|
73 | VERSION_SCRIPT_FLAGS=-Wl,--version-script=
|
---|
74 | else
|
---|
75 | case $host in
|
---|
76 | *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
|
---|
77 | esac
|
---|
78 | fi
|
---|
79 | AC_SUBST(VERSION_SCRIPT_FLAGS)
|
---|
80 | AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
|
---|
81 |
|
---|
82 | dnl
|
---|
83 | dnl We process the AC_ARG_WITH first so that later we can modify
|
---|
84 | dnl some of them to try to prevent impossible combinations. This
|
---|
85 | dnl also allows up so alphabetize the choices
|
---|
86 | dnl
|
---|
87 |
|
---|
88 | dnl
|
---|
89 | dnl zlib option might change flags, so we save them initially
|
---|
90 | dnl
|
---|
91 | _cppflags="${CPPFLAGS}"
|
---|
92 | _libs="${LIBS}"
|
---|
93 |
|
---|
94 | AC_ARG_WITH(c14n,
|
---|
95 | [ --with-c14n add the Canonicalization support (on)])
|
---|
96 | AC_ARG_WITH(catalog,
|
---|
97 | [ --with-catalog add the Catalog support (on)])
|
---|
98 | AC_ARG_WITH(debug,
|
---|
99 | [ --with-debug add the debugging module (on)])
|
---|
100 | AC_ARG_WITH(docbook,
|
---|
101 | [ --with-docbook add Docbook SGML support (on)])
|
---|
102 | AC_ARG_WITH(fexceptions,
|
---|
103 | [ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
|
---|
104 | AC_ARG_WITH(ftp,
|
---|
105 | [ --with-ftp add the FTP support (on)])
|
---|
106 | AC_ARG_WITH(history,
|
---|
107 | [ --with-history add history support to xmllint shell(off)])
|
---|
108 | AC_ARG_WITH(html,
|
---|
109 | [ --with-html add the HTML support (on)])
|
---|
110 | dnl Specific dir for HTML output ?
|
---|
111 | AC_ARG_WITH(html-dir, AS_HELP_STRING([--with-html-dir=path],
|
---|
112 | [path to base html directory, default $docdir/html]),
|
---|
113 | [HTML_DIR=$withval], [HTML_DIR='$(docdir)/html'])
|
---|
114 |
|
---|
115 | AC_ARG_WITH(html-subdir, AS_HELP_STRING([--with-html-subdir=path],
|
---|
116 | [directory used under html-dir, default '']),
|
---|
117 | [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"])
|
---|
118 | AC_SUBST(HTML_DIR)
|
---|
119 | AC_ARG_WITH(http,
|
---|
120 | [ --with-http add the HTTP support (on)])
|
---|
121 | AC_ARG_WITH(iconv,
|
---|
122 | [ --with-iconv[[=DIR]] add ICONV support (on)])
|
---|
123 | AC_ARG_WITH(icu,
|
---|
124 | [ --with-icu add ICU support (off)])
|
---|
125 | AC_ARG_WITH(iso8859x,
|
---|
126 | [ --with-iso8859x add ISO8859X support if no iconv (on)])
|
---|
127 | AC_ARG_WITH(legacy,
|
---|
128 | [ --with-legacy add deprecated APIs for compatibility (on)])
|
---|
129 | AC_ARG_WITH(mem_debug,
|
---|
130 | [ --with-mem-debug add the memory debugging module (off)])
|
---|
131 | AC_ARG_WITH(minimum,
|
---|
132 | [ --with-minimum build a minimally sized library (off)])
|
---|
133 | AC_ARG_WITH(output,
|
---|
134 | [ --with-output add the serialization support (on)])
|
---|
135 | AC_ARG_WITH(pattern,
|
---|
136 | [ --with-pattern add the xmlPattern selection interface (on)])
|
---|
137 | AC_ARG_WITH(push,
|
---|
138 | [ --with-push add the PUSH parser interfaces (on)])
|
---|
139 | AC_ARG_WITH(python,
|
---|
140 | [ --with-python[[=DIR]] build Python bindings if found])
|
---|
141 | AC_ARG_WITH(python_install_dir,
|
---|
142 | [ --with-python-install-dir=DIR
|
---|
143 | install Python bindings in DIR])
|
---|
144 | AC_ARG_WITH(reader,
|
---|
145 | [ --with-reader add the xmlReader parsing interface (on)])
|
---|
146 | AC_ARG_WITH(readline,
|
---|
147 | [ --with-readline=DIR use readline in DIR],[
|
---|
148 | if test "$withval" != "no" -a "$withval" != "yes"; then
|
---|
149 | RDL_DIR=$withval
|
---|
150 | CPPFLAGS="${CPPFLAGS} -I$withval/include"
|
---|
151 | LDFLAGS="${LDFLAGS} -L$withval/lib"
|
---|
152 | fi
|
---|
153 | ])
|
---|
154 | AC_ARG_WITH(regexps,
|
---|
155 | [ --with-regexps add Regular Expressions support (on)])
|
---|
156 | AC_ARG_WITH(run_debug,
|
---|
157 | [ --with-run-debug add the runtime debugging module (off)])
|
---|
158 | AC_ARG_WITH(sax1,
|
---|
159 | [ --with-sax1 add the older SAX1 interface (on)])
|
---|
160 | AC_ARG_WITH(schemas,
|
---|
161 | [ --with-schemas add Relax-NG and Schemas support (on)])
|
---|
162 | AC_ARG_WITH(schematron,
|
---|
163 | [ --with-schematron add Schematron support (on)])
|
---|
164 | AC_ARG_WITH(threads,
|
---|
165 | [ --with-threads add multithread support(on)])
|
---|
166 | AC_ARG_WITH(thread-alloc,
|
---|
167 | [ --with-thread-alloc add per-thread memory(off)])
|
---|
168 | AC_ARG_WITH(tree,
|
---|
169 | [ --with-tree add the DOM like tree manipulation APIs (on)])
|
---|
170 | AC_ARG_WITH(valid,
|
---|
171 | [ --with-valid add the DTD validation support (on)])
|
---|
172 | AC_ARG_WITH(writer,
|
---|
173 | [ --with-writer add the xmlWriter saving interface (on)])
|
---|
174 | AC_ARG_WITH(xinclude,
|
---|
175 | [ --with-xinclude add the XInclude support (on)])
|
---|
176 | AC_ARG_WITH(xpath,
|
---|
177 | [ --with-xpath add the XPATH support (on)])
|
---|
178 | AC_ARG_WITH(xptr,
|
---|
179 | [ --with-xptr add the XPointer support (on)])
|
---|
180 | AC_ARG_WITH(modules,
|
---|
181 | [ --with-modules add the dynamic modules support (on)])
|
---|
182 | AC_ARG_WITH(zlib,
|
---|
183 | [ --with-zlib[[=DIR]] use libz in DIR],[
|
---|
184 | if test "$withval" != "no" -a "$withval" != "yes"; then
|
---|
185 | Z_DIR=$withval
|
---|
186 | CPPFLAGS="${CPPFLAGS} -I$withval/include"
|
---|
187 | LDFLAGS="${LDFLAGS} -L$withval/lib"
|
---|
188 | fi
|
---|
189 | ])
|
---|
190 | AC_ARG_WITH(lzma,
|
---|
191 | [ --with-lzma[[=DIR]] use liblzma in DIR],[
|
---|
192 | if test "$withval" != "no" -a "$withval" != "yes"; then
|
---|
193 | LZMA_DIR=$withval
|
---|
194 | CPPFLAGS="${CPPFLAGS} -I$withval/include"
|
---|
195 | LDFLAGS="${LDFLAGS} -L$withval/lib"
|
---|
196 | fi
|
---|
197 | ])
|
---|
198 | AC_ARG_WITH(coverage,
|
---|
199 | [ --with-coverage build for code coverage with GCC (off)])
|
---|
200 |
|
---|
201 | AC_ARG_ENABLE(rebuild-docs,
|
---|
202 | [ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=no]]])
|
---|
203 | if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then
|
---|
204 | AC_MSG_ERROR([cannot rebuild docs when builddir != srcdir])
|
---|
205 | fi
|
---|
206 | AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"])
|
---|
207 |
|
---|
208 | dnl
|
---|
209 | dnl hard dependencies on options
|
---|
210 | dnl
|
---|
211 | if test "$with_schemas" = "yes"
|
---|
212 | then
|
---|
213 | with_pattern=yes
|
---|
214 | with_regexps=yes
|
---|
215 | fi
|
---|
216 | if test "$with_schematron" = "yes"
|
---|
217 | then
|
---|
218 | with_pattern=yes
|
---|
219 | with_tree=yes
|
---|
220 | with_xpath=yes
|
---|
221 | fi
|
---|
222 | if test "$with_reader" = "yes"
|
---|
223 | then
|
---|
224 | with_push=yes
|
---|
225 | fi
|
---|
226 | if test "$with_xptr" = "yes"
|
---|
227 | then
|
---|
228 | with_xpath=yes
|
---|
229 | fi
|
---|
230 | dnl
|
---|
231 | dnl option to build a minimal libxml2 library
|
---|
232 | dnl
|
---|
233 | if test "$with_minimum" = "yes"
|
---|
234 | then
|
---|
235 | echo "Configuring for a minimal library"
|
---|
236 | if test "$with_c14n" = ""
|
---|
237 | then
|
---|
238 | with_c14n=no
|
---|
239 | fi
|
---|
240 | if test "$with_catalog" = ""
|
---|
241 | then
|
---|
242 | with_catalog=no
|
---|
243 | fi
|
---|
244 | echo So far so good!
|
---|
245 | if test "$with_debug" = ""
|
---|
246 | then
|
---|
247 | with_debug=no
|
---|
248 | fi
|
---|
249 | if test "$with_docbook" = ""
|
---|
250 | then
|
---|
251 | with_docbook=no
|
---|
252 | fi
|
---|
253 | if test "$with_fexceptions" = ""
|
---|
254 | then
|
---|
255 | with_fexceptions=no
|
---|
256 | fi
|
---|
257 | if test "$with_ftp" = ""
|
---|
258 | then
|
---|
259 | with_ftp=no
|
---|
260 | fi
|
---|
261 | if test "$with_history" = ""
|
---|
262 | then
|
---|
263 | with_history=no
|
---|
264 | fi
|
---|
265 | if test "$with_html" = ""
|
---|
266 | then
|
---|
267 | with_html=no
|
---|
268 | fi
|
---|
269 | if test "$with_http" = ""
|
---|
270 | then
|
---|
271 | with_http=no
|
---|
272 | fi
|
---|
273 | if test "$with_iconv" = ""
|
---|
274 | then
|
---|
275 | with_iconv=no
|
---|
276 | fi
|
---|
277 | if test "$with_iso8859x" = ""
|
---|
278 | then
|
---|
279 | with_iso8859x=no
|
---|
280 | fi
|
---|
281 | if test "$with_legacy" = ""
|
---|
282 | then
|
---|
283 | with_legacy=no
|
---|
284 | fi
|
---|
285 | if test "$with_mem_debug" = ""
|
---|
286 | then
|
---|
287 | with_mem_debug=no
|
---|
288 | fi
|
---|
289 | if test "$with_output" = ""
|
---|
290 | then
|
---|
291 | with_output=no
|
---|
292 | fi
|
---|
293 | if test "$with_pattern" = ""
|
---|
294 | then
|
---|
295 | with_pattern=no
|
---|
296 | fi
|
---|
297 | if test "$with_push" = ""
|
---|
298 | then
|
---|
299 | with_push=no
|
---|
300 | fi
|
---|
301 | if test "$with_python" = ""
|
---|
302 | then
|
---|
303 | with_python=no
|
---|
304 | fi
|
---|
305 | if test "$with_reader" = ""
|
---|
306 | then
|
---|
307 | with_reader=no
|
---|
308 | fi
|
---|
309 | if test "$with_readline" = ""
|
---|
310 | then
|
---|
311 | with_readline=no
|
---|
312 | fi
|
---|
313 | if test "$with_regexps" = ""
|
---|
314 | then
|
---|
315 | with_regexps=no
|
---|
316 | fi
|
---|
317 | if test "$with_run_debug" = ""
|
---|
318 | then
|
---|
319 | with_run_debug=no
|
---|
320 | fi
|
---|
321 | if test "$with_sax1" = ""
|
---|
322 | then
|
---|
323 | with_sax1=no
|
---|
324 | fi
|
---|
325 | if test "$with_schemas" = ""
|
---|
326 | then
|
---|
327 | with_schemas=no
|
---|
328 | fi
|
---|
329 | if test "$with_schematron" = ""
|
---|
330 | then
|
---|
331 | with_schematron=no
|
---|
332 | fi
|
---|
333 | if test "$with_threads" = ""
|
---|
334 | then
|
---|
335 | with_threads=no
|
---|
336 | fi
|
---|
337 | if test "$with_thread_alloc" = ""
|
---|
338 | then
|
---|
339 | with_thread_alloc=no
|
---|
340 | fi
|
---|
341 | if test "$with_tree" = ""
|
---|
342 | then
|
---|
343 | with_tree=no
|
---|
344 | fi
|
---|
345 | if test "$with_valid" = ""
|
---|
346 | then
|
---|
347 | with_valid=no
|
---|
348 | fi
|
---|
349 | if test "$with_writer" = ""
|
---|
350 | then
|
---|
351 | with_writer=no
|
---|
352 | fi
|
---|
353 | if test "$with_xinclude" = ""
|
---|
354 | then
|
---|
355 | with_xinclude=no
|
---|
356 | fi
|
---|
357 | if test "$with_xpath" = ""
|
---|
358 | then
|
---|
359 | with_xpath=no
|
---|
360 | fi
|
---|
361 | if test "$with_xptr" = ""
|
---|
362 | then
|
---|
363 | with_xptr=no
|
---|
364 | fi
|
---|
365 | if test "$with_zlib" = ""
|
---|
366 | then
|
---|
367 | with_zlib=no
|
---|
368 | fi
|
---|
369 | if test "$with_modules" = ""
|
---|
370 | then
|
---|
371 | with_modules=no
|
---|
372 | fi
|
---|
373 | fi
|
---|
374 |
|
---|
375 | echo Checking zlib
|
---|
376 |
|
---|
377 | dnl Checks for zlib library.
|
---|
378 |
|
---|
379 | WITH_ZLIB=0
|
---|
380 | if test "$with_zlib" = "no"; then
|
---|
381 | echo "Disabling zlib compression support"
|
---|
382 | else
|
---|
383 | # Don't run pkg-config if with_zlib contains a path.
|
---|
384 | if test "x$Z_DIR" = "x"; then
|
---|
385 | # Try pkg-config first so that static linking works.
|
---|
386 | PKG_CHECK_MODULES([Z],[zlib],
|
---|
387 | [WITH_ZLIB=1],
|
---|
388 | [:])
|
---|
389 | fi
|
---|
390 |
|
---|
391 | if test "$WITH_ZLIB" = "0"; then
|
---|
392 | AC_CHECK_HEADERS(zlib.h,
|
---|
393 | AC_CHECK_LIB(z, gzread,[
|
---|
394 | WITH_ZLIB=1
|
---|
395 | if test "x${Z_DIR}" != "x"; then
|
---|
396 | Z_CFLAGS="-I${Z_DIR}/include"
|
---|
397 | Z_LIBS="-L${Z_DIR}/lib -lz"
|
---|
398 | [case ${host} in
|
---|
399 | *-*-solaris*)
|
---|
400 | Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
|
---|
401 | ;;
|
---|
402 | esac]
|
---|
403 | else
|
---|
404 | Z_LIBS="-lz"
|
---|
405 | fi])
|
---|
406 | )
|
---|
407 | fi
|
---|
408 | fi
|
---|
409 |
|
---|
410 | AC_SUBST(Z_CFLAGS)
|
---|
411 | AC_SUBST(Z_LIBS)
|
---|
412 | AC_SUBST(WITH_ZLIB)
|
---|
413 |
|
---|
414 | echo Checking lzma
|
---|
415 |
|
---|
416 | dnl Checks for lzma library.
|
---|
417 |
|
---|
418 | WITH_LZMA=0
|
---|
419 | if test "$with_lzma" = "no"; then
|
---|
420 | echo "Disabling lzma compression support"
|
---|
421 | else
|
---|
422 | # Don't run pkg-config if with_lzma contains a path.
|
---|
423 | if test "x$LZMA_DIR" = "x"; then
|
---|
424 | # Try pkg-config first so that static linking works.
|
---|
425 | PKG_CHECK_MODULES([LZMA],[liblzma],
|
---|
426 | [WITH_LZMA=1],
|
---|
427 | [:])
|
---|
428 | fi
|
---|
429 |
|
---|
430 | # If pkg-config failed, fall back to AC_CHECK_LIB. This
|
---|
431 | # will not pick up the necessary LIBS flags for liblzma's
|
---|
432 | # private dependencies, though, so static linking may fail.
|
---|
433 | if test "$WITH_LZMA" = "0"; then
|
---|
434 | AC_CHECK_HEADERS(lzma.h,
|
---|
435 | AC_CHECK_LIB(lzma, lzma_code,[
|
---|
436 | WITH_LZMA=1
|
---|
437 | if test "x${LZMA_DIR}" != "x"; then
|
---|
438 | LZMA_CFLAGS="-I${LZMA_DIR}/include"
|
---|
439 | LZMA_LIBS="-L${LZMA_DIR}/lib -llzma"
|
---|
440 | else
|
---|
441 | LZMA_LIBS="-llzma"
|
---|
442 | fi])
|
---|
443 | )
|
---|
444 | fi
|
---|
445 | fi
|
---|
446 |
|
---|
447 | AC_SUBST(LZMA_CFLAGS)
|
---|
448 | AC_SUBST(LZMA_LIBS)
|
---|
449 | AC_SUBST(WITH_LZMA)
|
---|
450 |
|
---|
451 | CPPFLAGS=${_cppflags}
|
---|
452 | LIBS=${_libs}
|
---|
453 |
|
---|
454 | echo Checking headers
|
---|
455 |
|
---|
456 | dnl Checks for header files.
|
---|
457 | AC_HEADER_DIRENT
|
---|
458 | AC_HEADER_STDC
|
---|
459 | AC_CHECK_HEADERS([fcntl.h])
|
---|
460 | AC_CHECK_HEADERS([unistd.h])
|
---|
461 | AC_CHECK_HEADERS([ctype.h])
|
---|
462 | AC_CHECK_HEADERS([errno.h])
|
---|
463 | AC_CHECK_HEADERS([malloc.h])
|
---|
464 | AC_CHECK_HEADERS([stdarg.h])
|
---|
465 | AC_CHECK_HEADERS([sys/stat.h])
|
---|
466 | AC_CHECK_HEADERS([sys/types.h])
|
---|
467 | AC_CHECK_HEADERS([stdint.h])
|
---|
468 | AC_CHECK_HEADERS([inttypes.h])
|
---|
469 | AC_CHECK_HEADERS([time.h])
|
---|
470 | AC_CHECK_HEADERS([math.h])
|
---|
471 | AC_CHECK_HEADERS([limits.h])
|
---|
472 | AC_CHECK_HEADERS([float.h])
|
---|
473 | AC_CHECK_HEADERS([stdlib.h])
|
---|
474 | AC_CHECK_HEADERS([sys/socket.h], [], [],
|
---|
475 | [#if HAVE_SYS_TYPES_H
|
---|
476 | # include <sys/types.h>
|
---|
477 | # endif
|
---|
478 | ])
|
---|
479 | AC_CHECK_HEADERS([netinet/in.h], [], [],
|
---|
480 | [#if HAVE_SYS_TYPES_H
|
---|
481 | # include <sys/types.h>
|
---|
482 | # endif
|
---|
483 | ])
|
---|
484 | AC_CHECK_HEADERS([arpa/inet.h], [], [],
|
---|
485 | [#if HAVE_SYS_TYPES_H
|
---|
486 | # include <sys/types.h>
|
---|
487 | # endif
|
---|
488 | #if HAVE_ARPA_INET_H
|
---|
489 | # include <arpa/inet.h>
|
---|
490 | # endif
|
---|
491 | ])
|
---|
492 | AC_CHECK_HEADERS([netdb.h])
|
---|
493 | AC_CHECK_HEADERS([sys/time.h])
|
---|
494 | AC_CHECK_HEADERS([sys/select.h])
|
---|
495 | AC_CHECK_HEADERS([poll.h])
|
---|
496 | AC_CHECK_HEADERS([sys/mman.h])
|
---|
497 | AC_CHECK_HEADERS([sys/timeb.h])
|
---|
498 | AC_CHECK_HEADERS([signal.h])
|
---|
499 | AC_CHECK_HEADERS([arpa/nameser.h], [], [],
|
---|
500 | [#if HAVE_SYS_TYPES_H
|
---|
501 | # include <sys/types.h>
|
---|
502 | # endif
|
---|
503 | ])
|
---|
504 | AC_CHECK_HEADERS([resolv.h], [], [],
|
---|
505 | [#if HAVE_SYS_TYPES_H
|
---|
506 | # include <sys/types.h>
|
---|
507 | # endif
|
---|
508 | #if HAVE_NETINET_IN_H
|
---|
509 | # include <netinet/in.h>
|
---|
510 | # endif
|
---|
511 | #if HAVE_ARPA_NAMESER_H
|
---|
512 | # include <arpa/nameser.h>
|
---|
513 | # endif
|
---|
514 | ])
|
---|
515 | AC_CHECK_HEADERS([dl.h])
|
---|
516 | AC_CHECK_HEADERS([dlfcn.h])
|
---|
517 |
|
---|
518 |
|
---|
519 | echo Checking types
|
---|
520 |
|
---|
521 | AC_TYPE_UINT32_T
|
---|
522 |
|
---|
523 |
|
---|
524 | echo Checking libraries
|
---|
525 |
|
---|
526 | dnl Checks for library functions.
|
---|
527 | AC_FUNC_STRFTIME
|
---|
528 | AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
|
---|
529 | AC_CHECK_FUNCS(stat signal)
|
---|
530 | AC_CHECK_FUNCS(rand rand_r srand time)
|
---|
531 | AC_CHECK_FUNCS(isascii mmap munmap putenv)
|
---|
532 |
|
---|
533 | AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */
|
---|
534 | #if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
|
---|
535 | # undef /**/ HAVE_MMAP
|
---|
536 | #endif])
|
---|
537 |
|
---|
538 | dnl Checking for va_copy availability
|
---|
539 | AC_MSG_CHECKING([for va_copy])
|
---|
540 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
|
---|
541 | va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])],
|
---|
542 | have_va_copy=yes,
|
---|
543 | have_va_copy=no)
|
---|
544 | AC_MSG_RESULT($have_va_copy)
|
---|
545 | if test x"$have_va_copy" = x"yes"; then
|
---|
546 | AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
|
---|
547 | else
|
---|
548 | AC_MSG_CHECKING([for __va_copy])
|
---|
549 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
|
---|
550 | va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],
|
---|
551 | have___va_copy=yes,
|
---|
552 | have___va_copy=no)
|
---|
553 | AC_MSG_RESULT($have___va_copy)
|
---|
554 | if test x"$have___va_copy" = x"yes"; then
|
---|
555 | AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
|
---|
556 | fi
|
---|
557 | fi
|
---|
558 |
|
---|
559 | dnl Checking whether va_list is an array type
|
---|
560 | AC_MSG_CHECKING([whether va_list is an array type])
|
---|
561 | AC_TRY_COMPILE2([
|
---|
562 | #include <stdarg.h>
|
---|
563 | void a(va_list * ap) {}],[
|
---|
564 | va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1],[
|
---|
565 | AC_MSG_RESULT(no)],[
|
---|
566 | AC_MSG_RESULT(yes)
|
---|
567 | AC_DEFINE([VA_LIST_IS_ARRAY], [1],[Define if va_list is an array type])])
|
---|
568 |
|
---|
569 | dnl Checks for inet libraries:
|
---|
570 | AC_SEARCH_LIBS(gethostent, [nsl])
|
---|
571 | AC_SEARCH_LIBS(setsockopt, [socket net network])
|
---|
572 | AC_SEARCH_LIBS(connect, [inet])
|
---|
573 |
|
---|
574 | dnl Determine what socket length (socklen_t) data type is
|
---|
575 | AC_MSG_CHECKING([for type of socket length (socklen_t)])
|
---|
576 | AC_TRY_COMPILE2([
|
---|
577 | #include <stddef.h>
|
---|
578 | #include <sys/types.h>
|
---|
579 | #include <sys/socket.h>],[
|
---|
580 | (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
|
---|
581 | AC_MSG_RESULT(socklen_t *)
|
---|
582 | XML_SOCKLEN_T=socklen_t],[
|
---|
583 | AC_TRY_COMPILE2([
|
---|
584 | #include <stddef.h>
|
---|
585 | #include <sys/types.h>
|
---|
586 | #include <sys/socket.h>],[
|
---|
587 | (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
|
---|
588 | AC_MSG_RESULT(size_t *)
|
---|
589 | XML_SOCKLEN_T=size_t],[
|
---|
590 | AC_TRY_COMPILE2([
|
---|
591 | #include <stddef.h>
|
---|
592 | #include <sys/types.h>
|
---|
593 | #include <sys/socket.h>],[
|
---|
594 | (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
|
---|
595 | AC_MSG_RESULT(int *)
|
---|
596 | XML_SOCKLEN_T=int],[
|
---|
597 | AC_MSG_WARN(could not determine)
|
---|
598 | XML_SOCKLEN_T="int"])])])
|
---|
599 | AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
|
---|
600 |
|
---|
601 | dnl Checking if gethostbyname() argument is const.
|
---|
602 | AC_MSG_CHECKING([for const gethostbyname() argument])
|
---|
603 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
|
---|
604 | [[(void)gethostbyname((const char *)"");]])],
|
---|
605 | have_gethostbyname_const_arg=yes,
|
---|
606 | have_gethostbyname_const_arg=no)
|
---|
607 | AC_MSG_RESULT($have_gethostbyname_const_arg)
|
---|
608 | if test x"$have_gethostbyname_const_arg" = x"yes"; then
|
---|
609 | AC_DEFINE([GETHOSTBYNAME_ARG_CAST], [],
|
---|
610 | [Type cast for the gethostbyname() argument])
|
---|
611 | else
|
---|
612 | AC_DEFINE([GETHOSTBYNAME_ARG_CAST], [(char *)],
|
---|
613 | [Type cast for the gethostbyname() argument])
|
---|
614 | fi
|
---|
615 |
|
---|
616 | dnl Checking if send() second argument is const.
|
---|
617 | AC_MSG_CHECKING([for const send() second argument])
|
---|
618 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
---|
619 | #include <sys/socket.h>]],
|
---|
620 | [[(void)send(1,(const char *)"",1,1);]])],
|
---|
621 | have_send_const_arg2=yes,
|
---|
622 | have_send_const_arg2=no)
|
---|
623 | AC_MSG_RESULT($have_send_const_arg2)
|
---|
624 | if test x"$have_send_const_arg2" = x"yes"; then
|
---|
625 | AC_DEFINE([SEND_ARG2_CAST], [],
|
---|
626 | [Type cast for the send() function 2nd arg])
|
---|
627 | else
|
---|
628 | AC_DEFINE([SEND_ARG2_CAST], [(char *)],
|
---|
629 | [Type cast for the send() function 2nd arg])
|
---|
630 | fi
|
---|
631 |
|
---|
632 | dnl Checking whether __attribute__((destructor)) is accepted by the compiler
|
---|
633 | AC_MSG_CHECKING([whether __attribute__((destructor)) is accepted])
|
---|
634 | AC_TRY_COMPILE2([
|
---|
635 | void __attribute__((destructor))
|
---|
636 | f(void) {}], [], [
|
---|
637 | AC_MSG_RESULT(yes)
|
---|
638 | AC_DEFINE([HAVE_ATTRIBUTE_DESTRUCTOR], [1],[Define if __attribute__((destructor)) is accepted])
|
---|
639 | AC_DEFINE([ATTRIBUTE_DESTRUCTOR], [__attribute__((destructor))],[A form that will not confuse apibuild.py])],[
|
---|
640 | AC_MSG_RESULT(no)])
|
---|
641 |
|
---|
642 |
|
---|
643 | dnl ***********************Checking for availability of IPv6*******************
|
---|
644 |
|
---|
645 | AC_MSG_CHECKING([whether to enable IPv6])
|
---|
646 | AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
|
---|
647 | if test "$with_minimum" = "yes"
|
---|
648 | then
|
---|
649 | enable_ipv6=no
|
---|
650 | fi
|
---|
651 | if test $enable_ipv6 = yes; then
|
---|
652 | have_ipv6=no
|
---|
653 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
654 | # include <sys/types.h>
|
---|
655 | # include <sys/socket.h>
|
---|
656 | ]], [[
|
---|
657 | struct sockaddr_storage ss;
|
---|
658 | socket(AF_INET6, SOCK_STREAM, 0)
|
---|
659 | ]])],
|
---|
660 | have_ipv6=yes,
|
---|
661 | have_ipv6=no
|
---|
662 | )
|
---|
663 | AC_MSG_RESULT($have_ipv6)
|
---|
664 |
|
---|
665 | if test $have_ipv6 = yes; then
|
---|
666 | AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
|
---|
667 | have_broken_ss_family=no
|
---|
668 |
|
---|
669 | dnl *********************************************************************
|
---|
670 | dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
|
---|
671 | dnl a ss_family member, but rather __ss_family. Let's detect that
|
---|
672 | dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
|
---|
673 | dnl platforms. However, we should only do this if ss_family is not
|
---|
674 | dnl present.
|
---|
675 | dnl ********************************************************************
|
---|
676 | AC_MSG_CHECKING([struct sockaddr::ss_family])
|
---|
677 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
678 | # include <sys/types.h>
|
---|
679 | # include <sys/socket.h>
|
---|
680 | ]], [[
|
---|
681 | struct sockaddr_storage ss ;
|
---|
682 | ss.ss_family = 0 ;
|
---|
683 | ]])],
|
---|
684 | have_ss_family=yes,
|
---|
685 | have_ss_family=no
|
---|
686 | )
|
---|
687 | AC_MSG_RESULT($have_ss_family)
|
---|
688 | if test x$have_ss_family = xno ; then
|
---|
689 | AC_MSG_CHECKING([broken struct sockaddr::ss_family])
|
---|
690 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
691 | # include <sys/types.h>
|
---|
692 | # include <sys/socket.h>
|
---|
693 | ]], [[
|
---|
694 | struct sockaddr_storage ss ;
|
---|
695 | ss.__ss_family = 0 ;
|
---|
696 | ]])],
|
---|
697 | have_broken_ss_family=yes,
|
---|
698 | have_broken_ss_family=no
|
---|
699 | )
|
---|
700 | AC_MSG_RESULT($have_broken_ss_family)
|
---|
701 | if test x$have_broken_ss_family = xyes ; then
|
---|
702 | AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
|
---|
703 | [Whether struct sockaddr::__ss_family exists])
|
---|
704 | AC_DEFINE(ss_family, __ss_family,
|
---|
705 | [ss_family is not defined here, use __ss_family instead])
|
---|
706 | else
|
---|
707 | AC_MSG_WARN(ss_family and __ss_family not found)
|
---|
708 | fi
|
---|
709 | fi
|
---|
710 |
|
---|
711 | have_getaddrinfo=no
|
---|
712 | AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
|
---|
713 | if test $have_getaddrinfo != yes; then
|
---|
714 | for lib in bsd socket inet; do
|
---|
715 | AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
|
---|
716 | done
|
---|
717 | fi
|
---|
718 |
|
---|
719 | if test $have_getaddrinfo = yes; then
|
---|
720 | AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
|
---|
721 | fi
|
---|
722 | fi
|
---|
723 | fi
|
---|
724 |
|
---|
725 | dnl ******************************End IPv6 checks******************************
|
---|
726 |
|
---|
727 | XML_LIBDIR='-L${libdir}'
|
---|
728 | XML_INCLUDEDIR='-I${includedir}/libxml2'
|
---|
729 |
|
---|
730 | dnl
|
---|
731 | dnl Extra flags
|
---|
732 | dnl
|
---|
733 | XML_CFLAGS=""
|
---|
734 | RDL_LIBS=""
|
---|
735 |
|
---|
736 | dnl
|
---|
737 | dnl Workaround for native compilers
|
---|
738 | dnl HP : http://bugs.gnome.org/db/31/3163.html
|
---|
739 | dnl DEC : Enable NaN/Inf
|
---|
740 | dnl
|
---|
741 | if test "${GCC}" != "yes" ; then
|
---|
742 | case "${host}" in
|
---|
743 | hppa*-*-hpux* )
|
---|
744 | EXTRA_CFLAGS="${EXTRA_CFLAGS} -Wp,-H30000"
|
---|
745 | ;;
|
---|
746 | *-dec-osf* )
|
---|
747 | EXTRA_CFLAGS="${EXTRA_CFLAGS} -ieee"
|
---|
748 | ;;
|
---|
749 | alpha*-*-linux* )
|
---|
750 | EXTRA_CFLAGS="${EXTRA_CFLAGS} -ieee"
|
---|
751 | ;;
|
---|
752 | esac
|
---|
753 | else
|
---|
754 | if test "$with_fexceptions" = "yes"
|
---|
755 | then
|
---|
756 | #
|
---|
757 | # Not activated by default because this inflates the code size
|
---|
758 | # Used to allow propagation of C++ exceptions through the library
|
---|
759 | #
|
---|
760 | EXTRA_CFLAGS="${EXTRA_CFLAGS} -fexceptions"
|
---|
761 | fi
|
---|
762 |
|
---|
763 | # warnings we'd like to see
|
---|
764 | EXTRA_CFLAGS="${EXTRA_CFLAGS} -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
|
---|
765 | # warnings we'd like to suppress
|
---|
766 | EXTRA_CFLAGS="${EXTRA_CFLAGS} -Wno-long-long -Wno-format-extra-args"
|
---|
767 | case "${host}" in
|
---|
768 | alpha*-*-linux* )
|
---|
769 | EXTRA_CFLAGS="${EXTRA_CFLAGS} -mieee"
|
---|
770 | ;;
|
---|
771 | alpha*-*-osf* )
|
---|
772 | EXTRA_CFLAGS="${EXTRA_CFLAGS} -mieee"
|
---|
773 | ;;
|
---|
774 | esac
|
---|
775 | fi
|
---|
776 | case ${host} in
|
---|
777 | *-*-solaris*)
|
---|
778 | XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
|
---|
779 | ;;
|
---|
780 | hppa*-hp-mpeix)
|
---|
781 | NEED_TRIO=1
|
---|
782 | ;;
|
---|
783 | *-*-mingw* | *-*-cygwin* | *-*-msvc* )
|
---|
784 | # If the host is Windows, and shared libraries are disabled, we
|
---|
785 | # need to add -DLIBXML_STATIC to EXTRA_CFLAGS in order for linking to
|
---|
786 | # work properly (without it, xmlexports.h would force the use of
|
---|
787 | # DLL imports, which obviously aren't present in a static
|
---|
788 | # library).
|
---|
789 | if test "x$enable_shared" = "xno"; then
|
---|
790 | XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
|
---|
791 | EXTRA_CFLAGS="$EXTRA_CFLAGS -DLIBXML_STATIC"
|
---|
792 | fi
|
---|
793 | ;;
|
---|
794 | esac
|
---|
795 |
|
---|
796 |
|
---|
797 | dnl
|
---|
798 | dnl check for python
|
---|
799 | dnl
|
---|
800 |
|
---|
801 | PYTHON_VERSION=
|
---|
802 | PYTHON_INCLUDES=
|
---|
803 | PYTHON_SITE_PACKAGES=
|
---|
804 | PYTHON_TESTS=
|
---|
805 | pythondir=
|
---|
806 | if test "$with_python" != "no" ; then
|
---|
807 | if test -x "$with_python/bin/python"
|
---|
808 | then
|
---|
809 | echo Found python in $with_python/bin/python
|
---|
810 | PYTHON="$with_python/bin/python"
|
---|
811 | else
|
---|
812 | if test -x "$with_python/python.exe"
|
---|
813 | then
|
---|
814 | echo Found python in $with_python/python.exe
|
---|
815 | PYTHON="$with_python/python.exe"
|
---|
816 | else
|
---|
817 | if test -x "$with_python"
|
---|
818 | then
|
---|
819 | echo Found python in $with_python
|
---|
820 | PYTHON="$with_python"
|
---|
821 | else
|
---|
822 | if test -x "$PYTHON"
|
---|
823 | then
|
---|
824 | echo Found python in environment PYTHON=$PYTHON
|
---|
825 | with_python=`$PYTHON -c "import sys; print(sys.exec_prefix)"`
|
---|
826 | else
|
---|
827 | AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
|
---|
828 | fi
|
---|
829 | fi
|
---|
830 | fi
|
---|
831 | fi
|
---|
832 | if test "$PYTHON" != ""
|
---|
833 | then
|
---|
834 | PYTHON_VERSION=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_version())"`
|
---|
835 | PYTHON_INCLUDES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`
|
---|
836 | # does not work as it produce a /usr/lib/python path instead of/usr/lib64/python
|
---|
837 | #
|
---|
838 | # PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"`
|
---|
839 | echo Found Python version $PYTHON_VERSION
|
---|
840 | fi
|
---|
841 | if test "$PYTHON_VERSION" != "" -a "$PYTHON_INCLUDES" = ""
|
---|
842 | then
|
---|
843 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h
|
---|
844 | then
|
---|
845 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
|
---|
846 | else
|
---|
847 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h
|
---|
848 | then
|
---|
849 | PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
|
---|
850 | else
|
---|
851 | if test -r /usr/include/python$PYTHON_VERSION/Python.h
|
---|
852 | then
|
---|
853 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
|
---|
854 | else
|
---|
855 | if test -r $with_python/include/Python.h
|
---|
856 | then
|
---|
857 | PYTHON_INCLUDES=$with_python/include
|
---|
858 | else
|
---|
859 | echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h
|
---|
860 | fi
|
---|
861 | fi
|
---|
862 | fi
|
---|
863 | fi
|
---|
864 | fi
|
---|
865 | if test "$with_python_install_dir" != ""
|
---|
866 | then
|
---|
867 | PYTHON_SITE_PACKAGES="$with_python_install_dir"
|
---|
868 | fi
|
---|
869 | if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = ""
|
---|
870 | then
|
---|
871 | if test -d $libdir/python$PYTHON_VERSION/site-packages
|
---|
872 | then
|
---|
873 | PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
|
---|
874 | else
|
---|
875 | if test -d $with_python/lib/site-packages
|
---|
876 | then
|
---|
877 | PYTHON_SITE_PACKAGES=$with_python/lib/site-packages
|
---|
878 | else
|
---|
879 | PYTHON_SITE_PACKAGES=$($PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(True,False,"${exec_prefix}"))')
|
---|
880 | fi
|
---|
881 | fi
|
---|
882 | fi
|
---|
883 | pythondir='$(PYTHON_SITE_PACKAGES)'
|
---|
884 | PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
|
---|
885 | else
|
---|
886 | PYTHON=
|
---|
887 | fi
|
---|
888 | AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
|
---|
889 | if test "$PYTHON_INCLUDES" != ""
|
---|
890 | then
|
---|
891 | PYTHON_SUBDIR=python
|
---|
892 | else
|
---|
893 | PYTHON_SUBDIR=
|
---|
894 | fi
|
---|
895 | AC_SUBST(pythondir)
|
---|
896 | AC_SUBST(PYTHON_SUBDIR)
|
---|
897 | AC_SUBST(PYTHON_LIBS)
|
---|
898 |
|
---|
899 | dnl check for dso support
|
---|
900 | WITH_MODULES=0
|
---|
901 | TEST_MODULES=
|
---|
902 |
|
---|
903 | if test "$with_modules" != "no" ; then
|
---|
904 | case "$host" in
|
---|
905 | *-*-cygwin*)
|
---|
906 | MODULE_EXTENSION=".dll"
|
---|
907 | AC_CHECK_LIB(cygwin, dlopen, [
|
---|
908 | WITH_MODULES=1
|
---|
909 | MODULE_PLATFORM_LIBS=
|
---|
910 | AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
|
---|
911 | ])
|
---|
912 | ;;
|
---|
913 | *-*-mingw*)
|
---|
914 | MODULE_EXTENSION=".dll"
|
---|
915 | WITH_MODULES=1
|
---|
916 | ;;
|
---|
917 | *)
|
---|
918 | AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
|
---|
919 | AC_CHECK_LIB(dld, shl_load, [
|
---|
920 | MODULE_PLATFORM_LIBS="-ldld"
|
---|
921 | libxml_have_shl_load=yes], [
|
---|
922 | AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
|
---|
923 | AC_CHECK_LIB(dl, dlopen, [
|
---|
924 | MODULE_PLATFORM_LIBS="-ldl"
|
---|
925 | libxml_have_dlopen=yes])])])])
|
---|
926 |
|
---|
927 | if test "${libxml_have_shl_load}" = "yes"; then
|
---|
928 | MODULE_EXTENSION=".sl"
|
---|
929 | WITH_MODULES=1
|
---|
930 | AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
|
---|
931 | fi
|
---|
932 |
|
---|
933 | if test "${libxml_have_dlopen}" = "yes"; then
|
---|
934 | case "${host}" in
|
---|
935 | *-*-hpux* )
|
---|
936 | MODULE_EXTENSION=".sl"
|
---|
937 | ;;
|
---|
938 | * )
|
---|
939 | MODULE_EXTENSION=".so"
|
---|
940 | ;;
|
---|
941 | esac
|
---|
942 |
|
---|
943 | WITH_MODULES=1
|
---|
944 | AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
|
---|
945 | fi
|
---|
946 | ;;
|
---|
947 | esac
|
---|
948 | fi
|
---|
949 |
|
---|
950 | if test "${WITH_MODULES}" = "1"; then
|
---|
951 | TEST_MODULES="ModuleTests"
|
---|
952 | fi
|
---|
953 |
|
---|
954 | AC_SUBST(WITH_MODULES)
|
---|
955 | AC_SUBST(MODULE_PLATFORM_LIBS)
|
---|
956 | AC_SUBST(MODULE_EXTENSION)
|
---|
957 | AC_SUBST(TEST_MODULES)
|
---|
958 |
|
---|
959 | dnl
|
---|
960 | dnl Tester makes use of readline if present
|
---|
961 | dnl
|
---|
962 |
|
---|
963 | dnl
|
---|
964 | dnl specific tests to setup DV and Bill's devel environments with debug etc ...
|
---|
965 | dnl (-Wunreachable-code)
|
---|
966 | dnl
|
---|
967 | if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
|
---|
968 | [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
|
---|
969 | [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
|
---|
970 | then
|
---|
971 | if test "$with_minimum" != "yes"
|
---|
972 | then
|
---|
973 | if test "${with_mem_debug}" = "" ; then
|
---|
974 | echo Activating memory debugging
|
---|
975 | with_mem_debug="yes"
|
---|
976 | with_run_debug="yes"
|
---|
977 | fi
|
---|
978 | if test "${with_docbook}" = "" ; then
|
---|
979 | with_docbook="yes"
|
---|
980 | fi
|
---|
981 | fi
|
---|
982 | if test "${GCC}" = "yes" ; then
|
---|
983 | EXTRA_CFLAGS="-g -O -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
|
---|
984 | fi
|
---|
985 | STATIC_BINARIES="-static"
|
---|
986 | dnl -Wcast-qual -ansi
|
---|
987 | else
|
---|
988 | STATIC_BINARIES=
|
---|
989 | fi
|
---|
990 | AC_SUBST(STATIC_BINARIES)
|
---|
991 |
|
---|
992 | dnl
|
---|
993 | dnl Check for trio string functions
|
---|
994 | dnl
|
---|
995 |
|
---|
996 | if test "${NEED_TRIO}" = "1" ; then
|
---|
997 | echo Adding trio library for string functions
|
---|
998 | WITH_TRIO=1
|
---|
999 | else
|
---|
1000 | WITH_TRIO=0
|
---|
1001 | fi
|
---|
1002 | AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
|
---|
1003 | AC_SUBST(WITH_TRIO)
|
---|
1004 |
|
---|
1005 | dnl
|
---|
1006 | dnl Allow to enable/disable various pieces
|
---|
1007 | dnl
|
---|
1008 | echo Checking configuration requirements
|
---|
1009 |
|
---|
1010 | dnl
|
---|
1011 | dnl Thread-related stuff
|
---|
1012 | dnl
|
---|
1013 | THREAD_LIBS=""
|
---|
1014 | BASE_THREAD_LIBS=""
|
---|
1015 | WITH_THREADS=0
|
---|
1016 | THREAD_CFLAGS=""
|
---|
1017 | TEST_THREADS=""
|
---|
1018 | THREADS_W32=""
|
---|
1019 | WITH_THREAD_ALLOC=0
|
---|
1020 |
|
---|
1021 | if test "$with_threads" = "no" ; then
|
---|
1022 | echo Disabling multithreaded support
|
---|
1023 | else
|
---|
1024 | echo Enabling multithreaded support
|
---|
1025 |
|
---|
1026 | dnl Default to native threads on Windows
|
---|
1027 | case $host_os in
|
---|
1028 | *mingw*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then
|
---|
1029 | WITH_THREADS="1"
|
---|
1030 | THREADS_W32="1"
|
---|
1031 | THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
|
---|
1032 | fi
|
---|
1033 | ;;
|
---|
1034 | esac
|
---|
1035 |
|
---|
1036 | dnl Use pthread by default in other cases
|
---|
1037 | if test -z "$THREADS_W32"; then
|
---|
1038 | if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then
|
---|
1039 | AC_CHECK_HEADER(pthread.h,
|
---|
1040 | AC_CHECK_LIB(pthread, pthread_join,[
|
---|
1041 | THREAD_LIBS="-lpthread"
|
---|
1042 | AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
|
---|
1043 | WITH_THREADS="1"]))
|
---|
1044 | fi
|
---|
1045 | fi
|
---|
1046 |
|
---|
1047 | case $host_os in
|
---|
1048 | *cygwin*) THREAD_LIBS=""
|
---|
1049 | ;;
|
---|
1050 | *beos*) WITH_THREADS="1"
|
---|
1051 | THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
|
---|
1052 | ;;
|
---|
1053 | *linux*)
|
---|
1054 | if test "${GCC}" = "yes" ; then
|
---|
1055 | GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
|
---|
1056 | GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
|
---|
1057 | GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
|
---|
1058 | if test "${THREAD_LIBS}" = "-lpthread" ; then
|
---|
1059 | if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
|
---|
1060 | then
|
---|
1061 | THREAD_LIBS=""
|
---|
1062 | BASE_THREAD_LIBS="-lpthread"
|
---|
1063 | else
|
---|
1064 | if expr ${GCC_MAJOR} \> 3 > /dev/null
|
---|
1065 | then
|
---|
1066 | THREAD_LIBS=""
|
---|
1067 | BASE_THREAD_LIBS="-lpthread"
|
---|
1068 | else
|
---|
1069 | echo old GCC disabling weak symbols for pthread
|
---|
1070 | fi
|
---|
1071 | fi
|
---|
1072 | fi
|
---|
1073 | fi
|
---|
1074 | ;;
|
---|
1075 | esac
|
---|
1076 | if test "$WITH_THREADS" = "1" ; then
|
---|
1077 | THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
|
---|
1078 | TEST_THREADS="Threadtests"
|
---|
1079 | fi
|
---|
1080 | fi
|
---|
1081 | if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
|
---|
1082 | WITH_THREAD_ALLOC=1
|
---|
1083 | fi
|
---|
1084 |
|
---|
1085 | AC_SUBST(THREAD_LIBS)
|
---|
1086 | AC_SUBST(BASE_THREAD_LIBS)
|
---|
1087 | AC_SUBST(WITH_THREADS)
|
---|
1088 | AC_SUBST(THREAD_CFLAGS)
|
---|
1089 | AC_SUBST(TEST_THREADS)
|
---|
1090 | AC_SUBST(WITH_THREAD_ALLOC)
|
---|
1091 | AM_CONDITIONAL([THREADS_W32],[test -n "$THREADS_W32"])
|
---|
1092 |
|
---|
1093 | dnl
|
---|
1094 | dnl xmllint shell history
|
---|
1095 | dnl
|
---|
1096 | if test "$with_history" = "yes" ; then
|
---|
1097 | echo Enabling xmllint shell history
|
---|
1098 | dnl check for terminal library. this is a very cool solution
|
---|
1099 | dnl from octave's configure.in
|
---|
1100 | unset tcap
|
---|
1101 | for termlib in ncurses curses termcap terminfo termlib; do
|
---|
1102 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
|
---|
1103 | test -n "$tcap" && break
|
---|
1104 | done
|
---|
1105 |
|
---|
1106 | AC_CHECK_HEADER(readline/history.h,
|
---|
1107 | AC_CHECK_LIB(history, append_history,[
|
---|
1108 | RDL_LIBS="-lhistory"
|
---|
1109 | AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
|
---|
1110 | AC_CHECK_HEADER(readline/readline.h,
|
---|
1111 | AC_CHECK_LIB(readline, readline,[
|
---|
1112 | RDL_LIBS="-lreadline $RDL_LIBS $tcap"
|
---|
1113 | AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
|
---|
1114 | if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
|
---|
1115 | CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
|
---|
1116 | RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
|
---|
1117 | fi
|
---|
1118 | fi
|
---|
1119 |
|
---|
1120 | dnl
|
---|
1121 | dnl Tree functions
|
---|
1122 | dnl
|
---|
1123 | if test "$with_tree" = "no" ; then
|
---|
1124 | echo Disabling DOM like tree manipulation APIs
|
---|
1125 | WITH_TREE=0
|
---|
1126 | else
|
---|
1127 | WITH_TREE=1
|
---|
1128 | fi
|
---|
1129 | AC_SUBST(WITH_TREE)
|
---|
1130 |
|
---|
1131 | if test "$with_ftp" = "no" ; then
|
---|
1132 | echo Disabling FTP support
|
---|
1133 | WITH_FTP=0
|
---|
1134 | FTP_OBJ=
|
---|
1135 | else
|
---|
1136 | WITH_FTP=1
|
---|
1137 | FTP_OBJ=nanoftp.o
|
---|
1138 | fi
|
---|
1139 | AC_SUBST(WITH_FTP)
|
---|
1140 | AC_SUBST(FTP_OBJ)
|
---|
1141 |
|
---|
1142 | if test "$with_http" = "no" ; then
|
---|
1143 | echo Disabling HTTP support
|
---|
1144 | WITH_HTTP=0
|
---|
1145 | HTTP_OBJ=
|
---|
1146 | else
|
---|
1147 | WITH_HTTP=1
|
---|
1148 | HTTP_OBJ=nanohttp.o
|
---|
1149 | fi
|
---|
1150 | AC_SUBST(WITH_HTTP)
|
---|
1151 | AC_SUBST(HTTP_OBJ)
|
---|
1152 |
|
---|
1153 | if test "$with_legacy" = "no" ; then
|
---|
1154 | echo Disabling deprecated APIs
|
---|
1155 | WITH_LEGACY=0
|
---|
1156 | else
|
---|
1157 | WITH_LEGACY=1
|
---|
1158 | fi
|
---|
1159 | AC_SUBST(WITH_LEGACY)
|
---|
1160 |
|
---|
1161 | if test "$with_reader" = "no" ; then
|
---|
1162 | echo Disabling the xmlReader parsing interface
|
---|
1163 | WITH_READER=0
|
---|
1164 | READER_TEST=
|
---|
1165 | else
|
---|
1166 | WITH_READER=1
|
---|
1167 | READER_TEST=Readertests
|
---|
1168 | if test "$with_push" = "no" ; then
|
---|
1169 | echo xmlReader requires Push interface - enabling it
|
---|
1170 | with_push=yes
|
---|
1171 | fi
|
---|
1172 | fi
|
---|
1173 | AC_SUBST(WITH_READER)
|
---|
1174 | AC_SUBST(READER_TEST)
|
---|
1175 |
|
---|
1176 | if test "$with_writer" = "no" ; then
|
---|
1177 | echo Disabling the xmlWriter saving interface
|
---|
1178 | WITH_WRITER=0
|
---|
1179 | # WRITER_TEST=
|
---|
1180 | else
|
---|
1181 | WITH_WRITER=1
|
---|
1182 | # WRITER_TEST=Writertests
|
---|
1183 | if test "$with_push" = "no" ; then
|
---|
1184 | echo xmlWriter requires Push interface - enabling it
|
---|
1185 | with_push=yes
|
---|
1186 | fi
|
---|
1187 | if test "$with_output" = "no" ; then
|
---|
1188 | echo xmlWriter requires Output interface - enabling it
|
---|
1189 | with_output=yes
|
---|
1190 | fi
|
---|
1191 | fi
|
---|
1192 | AC_SUBST(WITH_WRITER)
|
---|
1193 | #AC_SUBST(WRITER_TEST)
|
---|
1194 |
|
---|
1195 | if test "$with_pattern" = "no" ; then
|
---|
1196 | echo Disabling the xmlPattern parsing interface
|
---|
1197 | WITH_PATTERN=0
|
---|
1198 | TEST_PATTERN=
|
---|
1199 | else
|
---|
1200 | WITH_PATTERN=1
|
---|
1201 | TEST_PATTERN=Patterntests
|
---|
1202 | fi
|
---|
1203 | AC_SUBST(WITH_PATTERN)
|
---|
1204 | AC_SUBST(TEST_PATTERN)
|
---|
1205 |
|
---|
1206 | if test "$with_sax1" = "no" ; then
|
---|
1207 | echo Disabling the older SAX1 interface
|
---|
1208 | WITH_SAX1=0
|
---|
1209 | TEST_SAX=
|
---|
1210 | else
|
---|
1211 | WITH_SAX1=1
|
---|
1212 | TEST_SAX=SAXtests
|
---|
1213 | fi
|
---|
1214 | AC_SUBST(WITH_SAX1)
|
---|
1215 | AM_CONDITIONAL(WITH_SAX1_SOURCES, test "${WITH_TRIO}" = "1")
|
---|
1216 | AC_SUBST(TEST_SAX)
|
---|
1217 |
|
---|
1218 | if test "$with_push" = "no" ; then
|
---|
1219 | echo Disabling the PUSH parser interfaces
|
---|
1220 | WITH_PUSH=0
|
---|
1221 | TEST_PUSH=
|
---|
1222 | else
|
---|
1223 | WITH_PUSH=1
|
---|
1224 | TEST_PUSH="XMLPushtests"
|
---|
1225 | fi
|
---|
1226 | AC_SUBST(WITH_PUSH)
|
---|
1227 | AC_SUBST(TEST_PUSH)
|
---|
1228 |
|
---|
1229 | if test "$with_html" = "no" ; then
|
---|
1230 | echo Disabling HTML support
|
---|
1231 | WITH_HTML=0
|
---|
1232 | HTML_OBJ=
|
---|
1233 | TEST_HTML=
|
---|
1234 | else
|
---|
1235 | WITH_HTML=1
|
---|
1236 | HTML_OBJ="HTMLparser.o HTMLtree.o"
|
---|
1237 | TEST_HTML=HTMLtests
|
---|
1238 | if test "$with_push" != "no" ; then
|
---|
1239 | TEST_PHTML=HTMLPushtests
|
---|
1240 | else
|
---|
1241 | TEST_PHTML=
|
---|
1242 | fi
|
---|
1243 | fi
|
---|
1244 | AC_SUBST(WITH_HTML)
|
---|
1245 | AC_SUBST(HTML_OBJ)
|
---|
1246 | AC_SUBST(TEST_HTML)
|
---|
1247 | AC_SUBST(TEST_PHTML)
|
---|
1248 |
|
---|
1249 | if test "$with_valid" = "no" ; then
|
---|
1250 | echo Disabling DTD validation support
|
---|
1251 | WITH_VALID=0
|
---|
1252 | TEST_VALID=
|
---|
1253 | TEST_VTIME=
|
---|
1254 | else
|
---|
1255 | WITH_VALID=1
|
---|
1256 | TEST_VALID=Validtests
|
---|
1257 | TEST_VTIME=VTimingtests
|
---|
1258 | fi
|
---|
1259 | AC_SUBST(WITH_VALID)
|
---|
1260 | AC_SUBST(TEST_VALID)
|
---|
1261 | AC_SUBST(TEST_VTIME)
|
---|
1262 |
|
---|
1263 | if test "$with_catalog" = "no" ; then
|
---|
1264 | echo Disabling Catalog support
|
---|
1265 | WITH_CATALOG=0
|
---|
1266 | CATALOG_OBJ=
|
---|
1267 | TEST_CATALOG=
|
---|
1268 | else
|
---|
1269 | WITH_CATALOG=1
|
---|
1270 | CATALOG_OBJ="catalog.o"
|
---|
1271 | TEST_CATALOG=Catatests
|
---|
1272 | fi
|
---|
1273 | AC_SUBST(WITH_CATALOG)
|
---|
1274 | AC_SUBST(CATALOG_OBJ)
|
---|
1275 | AC_SUBST(TEST_CATALOG)
|
---|
1276 |
|
---|
1277 | if test "$with_docbook" = "no" ; then
|
---|
1278 | echo Disabling Docbook support
|
---|
1279 | WITH_DOCB=0
|
---|
1280 | DOCB_OBJ=
|
---|
1281 | else
|
---|
1282 | WITH_DOCB=1
|
---|
1283 | DOCB_OBJ="DOCBparser.o"
|
---|
1284 | fi
|
---|
1285 | AC_SUBST(WITH_DOCB)
|
---|
1286 | AC_SUBST(DOCB_OBJ)
|
---|
1287 |
|
---|
1288 |
|
---|
1289 | if test "$with_xptr" = "no" ; then
|
---|
1290 | echo Disabling XPointer support
|
---|
1291 | WITH_XPTR=0
|
---|
1292 | XPTR_OBJ=
|
---|
1293 | TEST_XPTR=
|
---|
1294 | else
|
---|
1295 | WITH_XPTR=1
|
---|
1296 | XPTR_OBJ=xpointer.o
|
---|
1297 | TEST_XPTR=XPtrtests
|
---|
1298 | if test "$with_xpath" = "no" ; then
|
---|
1299 | echo XPointer requires XPath support - enabling it
|
---|
1300 | with_xpath=yes
|
---|
1301 | fi
|
---|
1302 | fi
|
---|
1303 | AC_SUBST(WITH_XPTR)
|
---|
1304 | AC_SUBST(XPTR_OBJ)
|
---|
1305 | AC_SUBST(TEST_XPTR)
|
---|
1306 |
|
---|
1307 | if test "$with_c14n" = "no" ; then
|
---|
1308 | echo Disabling C14N support
|
---|
1309 | WITH_C14N=0
|
---|
1310 | C14N_OBJ=
|
---|
1311 | TEST_C14N=
|
---|
1312 | else
|
---|
1313 | WITH_C14N=1
|
---|
1314 | C14N_OBJ="c14n.c"
|
---|
1315 | TEST_C14N=C14Ntests
|
---|
1316 | if test "$with_xpath" = "no" ; then
|
---|
1317 | echo C14N requires XPath support - enabling it
|
---|
1318 | with_xpath=yes
|
---|
1319 | fi
|
---|
1320 | fi
|
---|
1321 | AC_SUBST(WITH_C14N)
|
---|
1322 | AC_SUBST(C14N_OBJ)
|
---|
1323 | AC_SUBST(TEST_C14N)
|
---|
1324 |
|
---|
1325 | if test "$with_xinclude" = "no" ; then
|
---|
1326 | echo Disabling XInclude support
|
---|
1327 | WITH_XINCLUDE=0
|
---|
1328 | XINCLUDE_OBJ=
|
---|
1329 | with_xinclude="no"
|
---|
1330 | TEST_XINCLUDE=
|
---|
1331 | else
|
---|
1332 | WITH_XINCLUDE=1
|
---|
1333 | XINCLUDE_OBJ=xinclude.o
|
---|
1334 | TEST_XINCLUDE=XIncludetests
|
---|
1335 | if test "$with_xpath" = "no" ; then
|
---|
1336 | echo XInclude requires XPath support - enabling it
|
---|
1337 | with_xpath=yes
|
---|
1338 | fi
|
---|
1339 | fi
|
---|
1340 | AC_SUBST(WITH_XINCLUDE)
|
---|
1341 | AC_SUBST(XINCLUDE_OBJ)
|
---|
1342 | AC_SUBST(TEST_XINCLUDE)
|
---|
1343 |
|
---|
1344 | if test "$with_xptr" = "" -a "$with_xpath" = "no" ; then
|
---|
1345 | with_xptr=no
|
---|
1346 | fi
|
---|
1347 |
|
---|
1348 | if test "$with_schematron" = "" -a "$with_xpath" = "no" ; then
|
---|
1349 | with_schematron=no
|
---|
1350 | fi
|
---|
1351 |
|
---|
1352 | if test "$with_schematron" = "no" ; then
|
---|
1353 | echo "Disabling Schematron support"
|
---|
1354 | WITH_SCHEMATRON=0
|
---|
1355 | TEST_SCHEMATRON=
|
---|
1356 | else
|
---|
1357 | echo "Enabled Schematron support"
|
---|
1358 | WITH_SCHEMATRON=1
|
---|
1359 | TEST_SCHEMATRON="Schematrontests"
|
---|
1360 | with_xpath=yes
|
---|
1361 | with_pattern=yes
|
---|
1362 | with_schematron=yes
|
---|
1363 | fi
|
---|
1364 | AC_SUBST(WITH_SCHEMATRON)
|
---|
1365 | AC_SUBST(TEST_SCHEMATRON)
|
---|
1366 |
|
---|
1367 | if test "$with_xpath" = "no" ; then
|
---|
1368 | echo Disabling XPATH support
|
---|
1369 | WITH_XPATH=0
|
---|
1370 | XPATH_OBJ=
|
---|
1371 | TEST_XPATH=
|
---|
1372 | else
|
---|
1373 | WITH_XPATH=1
|
---|
1374 | XPATH_OBJ=xpath.o
|
---|
1375 | TEST_XPATH=XPathtests
|
---|
1376 | fi
|
---|
1377 | AC_SUBST(WITH_XPATH)
|
---|
1378 | AC_SUBST(XPATH_OBJ)
|
---|
1379 | AC_SUBST(TEST_XPATH)
|
---|
1380 |
|
---|
1381 | dnl
|
---|
1382 | dnl output functions
|
---|
1383 | dnl
|
---|
1384 | if test "$with_output" = "no" ; then
|
---|
1385 | echo Disabling serialization/saving support
|
---|
1386 | WITH_OUTPUT=0
|
---|
1387 | else
|
---|
1388 | WITH_OUTPUT=1
|
---|
1389 | fi
|
---|
1390 | AC_SUBST(WITH_OUTPUT)
|
---|
1391 |
|
---|
1392 | WITH_ICONV=0
|
---|
1393 | if test "$with_iconv" = "no" ; then
|
---|
1394 | echo Disabling ICONV support
|
---|
1395 | else
|
---|
1396 | if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
|
---|
1397 | CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
|
---|
1398 | # Export this since our headers include iconv.h
|
---|
1399 | XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
|
---|
1400 | ICONV_LIBS="-L$with_iconv/lib"
|
---|
1401 | fi
|
---|
1402 |
|
---|
1403 | AC_CHECK_HEADER(iconv.h,
|
---|
1404 | AC_MSG_CHECKING(for iconv)
|
---|
1405 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
|
---|
1406 | #include <iconv.h>]],[[
|
---|
1407 | iconv_t cd = iconv_open ("","");
|
---|
1408 | iconv (cd, NULL, NULL, NULL, NULL);]])],[
|
---|
1409 | AC_MSG_RESULT(yes)
|
---|
1410 | WITH_ICONV=1],[
|
---|
1411 | AC_MSG_RESULT(no)
|
---|
1412 | AC_MSG_CHECKING(for iconv in -liconv)
|
---|
1413 |
|
---|
1414 | _ldflags="${LDFLAGS}"
|
---|
1415 | _libs="${LIBS}"
|
---|
1416 | LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
|
---|
1417 | LIBS="${LIBS} -liconv"
|
---|
1418 |
|
---|
1419 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
|
---|
1420 | #include <iconv.h>]],[[
|
---|
1421 | iconv_t cd = iconv_open ("","");
|
---|
1422 | iconv (cd, NULL, NULL, NULL, NULL);]])],[
|
---|
1423 | AC_MSG_RESULT(yes)
|
---|
1424 | WITH_ICONV=1
|
---|
1425 | ICONV_LIBS="${ICONV_LIBS} -liconv"
|
---|
1426 | LIBS="${_libs}"
|
---|
1427 | LDFLAGS="${_ldflags}"],[
|
---|
1428 | AC_MSG_RESULT(no)
|
---|
1429 | LIBS="${_libs}"
|
---|
1430 | LDFLAGS="${_ldflags}"])]))
|
---|
1431 |
|
---|
1432 | if test "$WITH_ICONV" = "1" ; then
|
---|
1433 | AC_MSG_CHECKING([for iconv declaration])
|
---|
1434 | AC_CACHE_VAL(xml_cv_iconv_arg2, [
|
---|
1435 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
|
---|
1436 | #include <iconv.h>
|
---|
1437 | extern
|
---|
1438 | #ifdef __cplusplus
|
---|
1439 | "C"
|
---|
1440 | #endif
|
---|
1441 | #if defined(__STDC__) || defined(__cplusplus)
|
---|
1442 | size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
|
---|
1443 | #else
|
---|
1444 | size_t iconv();
|
---|
1445 | #endif
|
---|
1446 | ]], [])], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
|
---|
1447 |
|
---|
1448 | xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
|
---|
1449 | AC_MSG_RESULT([${xml_xxx:-
|
---|
1450 | }$xml_cv_iconv_decl])
|
---|
1451 | AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
|
---|
1452 | [Define as const if the declaration of iconv() needs const.])
|
---|
1453 | fi
|
---|
1454 | fi
|
---|
1455 | case "$host" in
|
---|
1456 | *mingw*) M_LIBS=""
|
---|
1457 | ;;
|
---|
1458 | *beos*) M_LIBS=""
|
---|
1459 | ;;
|
---|
1460 | *haiku*) M_LIBS=""
|
---|
1461 | ;;
|
---|
1462 | *) M_LIBS="-lm"
|
---|
1463 | ;;
|
---|
1464 | esac
|
---|
1465 | AC_SUBST(WITH_ICONV)
|
---|
1466 |
|
---|
1467 | WITH_ICU=0
|
---|
1468 | ICU_LIBS=""
|
---|
1469 | if test "$with_icu" != "yes" ; then
|
---|
1470 | echo Disabling ICU support
|
---|
1471 | else
|
---|
1472 | # Try pkg-config first so that static linking works.
|
---|
1473 | # If this succeeeds, we ignore the WITH_ICU directory.
|
---|
1474 | PKG_CHECK_MODULES([ICU],[icu-i18n],
|
---|
1475 | [have_libicu=yes],
|
---|
1476 | [have_libicu=no])
|
---|
1477 |
|
---|
1478 | if test "x$have_libicu" = "xyes"; then
|
---|
1479 | PKG_CHECK_VAR([ICU_DEFS], [icu-i18n], [DEFS])
|
---|
1480 | if test "x$ICU_DEFS" != "x"; then
|
---|
1481 | CPPFLAGS="$CPPFLAGS $ICU_DEFS"
|
---|
1482 | fi
|
---|
1483 | fi
|
---|
1484 |
|
---|
1485 | # If pkg-config failed, fall back to AC_CHECK_LIB. This
|
---|
1486 | # will not pick up the necessary LIBS flags for liblzma's
|
---|
1487 | # private dependencies, though, so static linking may fail.
|
---|
1488 | if test "x$have_libicu" = "xno"; then
|
---|
1489 | ICU_CONFIG=icu-config
|
---|
1490 | if ${ICU_CONFIG} --cflags >/dev/null 2>&1
|
---|
1491 | then
|
---|
1492 | ICU_LIBS=`${ICU_CONFIG} --ldflags`
|
---|
1493 | have_libicu=yes
|
---|
1494 | echo Enabling ICU support
|
---|
1495 | else
|
---|
1496 | if test "$with_icu" != "yes" -a "$with_iconv" != "" ; then
|
---|
1497 | CPPFLAGS="${CPPFLAGS} -I$with_icu"
|
---|
1498 | # Export this since our headers include icu.h
|
---|
1499 | XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_icu"
|
---|
1500 | fi
|
---|
1501 |
|
---|
1502 | AC_CHECK_HEADER(unicode/ucnv.h,
|
---|
1503 | AC_MSG_CHECKING(for icu)
|
---|
1504 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unicode/ucnv.h>]], [[
|
---|
1505 | UConverter *utf = ucnv_open("UTF-8", NULL);]])],[
|
---|
1506 | AC_MSG_RESULT(yes)
|
---|
1507 | have_libicu=yes],[
|
---|
1508 | AC_MSG_RESULT(no)
|
---|
1509 | AC_MSG_CHECKING(for icu in -licucore)
|
---|
1510 |
|
---|
1511 | _ldflags="${LDFLAGS}"
|
---|
1512 | _libs="${LIBS}"
|
---|
1513 | LDFLAGS="${LDFLAGS} ${ICU_LIBS}"
|
---|
1514 | LIBS="${LIBS} -licucore"
|
---|
1515 |
|
---|
1516 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unicode/ucnv.h>]], [[
|
---|
1517 | UConverter *utf = ucnv_open("UTF-8", NULL);]])],[
|
---|
1518 | AC_MSG_RESULT(yes)
|
---|
1519 | have_libicu=yes
|
---|
1520 | ICU_LIBS="${ICU_LIBS} -licucore"
|
---|
1521 | LIBS="${_libs}"
|
---|
1522 | LDFLAGS="${_ldflags}"],[
|
---|
1523 | AC_MSG_RESULT(no)
|
---|
1524 | LIBS="${_libs}"
|
---|
1525 | LDFLAGS="${_ldflags}"])]))
|
---|
1526 | fi
|
---|
1527 | fi
|
---|
1528 |
|
---|
1529 | # Found the library via either method?
|
---|
1530 | if test "x$have_libicu" = "xyes"; then
|
---|
1531 | WITH_ICU=1
|
---|
1532 | fi
|
---|
1533 | fi
|
---|
1534 | XML_LIBS="-lxml2"
|
---|
1535 | XML_PRIVATE_LIBS="$Z_LIBS $LZMA_LIBS $THREAD_LIBS $ICONV_LIBS $ICU_LIBS $M_LIBS $LIBS"
|
---|
1536 | XML_LIBTOOLLIBS="libxml2.la"
|
---|
1537 | AC_SUBST(WITH_ICU)
|
---|
1538 |
|
---|
1539 | WITH_ISO8859X=1
|
---|
1540 | if test "$WITH_ICONV" != "1" ; then
|
---|
1541 | if test "$with_iso8859x" = "no" ; then
|
---|
1542 | echo Disabling ISO8859X support
|
---|
1543 | WITH_ISO8859X=0
|
---|
1544 | fi
|
---|
1545 | fi
|
---|
1546 | AC_SUBST(WITH_ISO8859X)
|
---|
1547 |
|
---|
1548 | if test "$with_schemas" = "no" ; then
|
---|
1549 | echo "Disabling Schemas/Relax-NG support"
|
---|
1550 | WITH_SCHEMAS=0
|
---|
1551 | TEST_SCHEMAS=
|
---|
1552 | else
|
---|
1553 | echo "Enabled Schemas/Relax-NG support"
|
---|
1554 | WITH_SCHEMAS=1
|
---|
1555 | TEST_SCHEMAS="Schemastests Relaxtests"
|
---|
1556 | if test "$PYTHON_INCLUDES" != "" ; then
|
---|
1557 | PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
|
---|
1558 | fi
|
---|
1559 | with_regexps=yes
|
---|
1560 | fi
|
---|
1561 | AC_SUBST(WITH_SCHEMAS)
|
---|
1562 | AC_SUBST(TEST_SCHEMAS)
|
---|
1563 |
|
---|
1564 | if test "$with_regexps" = "no" ; then
|
---|
1565 | echo Disabling Regexps support
|
---|
1566 | WITH_REGEXPS=0
|
---|
1567 | TEST_REGEXPS=
|
---|
1568 | else
|
---|
1569 | WITH_REGEXPS=1
|
---|
1570 | TEST_REGEXPS="Regexptests Automatatests"
|
---|
1571 | fi
|
---|
1572 | AC_SUBST(WITH_REGEXPS)
|
---|
1573 | AC_SUBST(TEST_REGEXPS)
|
---|
1574 |
|
---|
1575 | if test "$with_debug" = "no" ; then
|
---|
1576 | echo Disabling DEBUG support
|
---|
1577 | WITH_DEBUG=0
|
---|
1578 | DEBUG_OBJ=
|
---|
1579 | TEST_DEBUG=
|
---|
1580 | else
|
---|
1581 | WITH_DEBUG=1
|
---|
1582 | DEBUG_OBJ=debugXML.o
|
---|
1583 | TEST_DEBUG=Scripttests
|
---|
1584 | fi
|
---|
1585 | AC_SUBST(WITH_DEBUG)
|
---|
1586 | AC_SUBST(DEBUG_OBJ)
|
---|
1587 | AC_SUBST(TEST_DEBUG)
|
---|
1588 |
|
---|
1589 | if test "$with_mem_debug" = "yes" ; then
|
---|
1590 | if test "$with_thread_alloc" = "yes" ; then
|
---|
1591 | echo Disabling memory debug - cannot use mem-debug with thread-alloc!
|
---|
1592 | WITH_MEM_DEBUG=0
|
---|
1593 | else
|
---|
1594 | echo Enabling memory debug support
|
---|
1595 | WITH_MEM_DEBUG=1
|
---|
1596 | fi
|
---|
1597 | else
|
---|
1598 | WITH_MEM_DEBUG=0
|
---|
1599 | fi
|
---|
1600 | AC_SUBST(WITH_MEM_DEBUG)
|
---|
1601 |
|
---|
1602 | if test "$with_run_debug" = "yes" ; then
|
---|
1603 | echo Enabling runtime debug support
|
---|
1604 | WITH_RUN_DEBUG=1
|
---|
1605 | else
|
---|
1606 | WITH_RUN_DEBUG=0
|
---|
1607 | fi
|
---|
1608 | AC_SUBST(WITH_RUN_DEBUG)
|
---|
1609 |
|
---|
1610 | WIN32_EXTRA_LIBADD=
|
---|
1611 | WIN32_EXTRA_LDFLAGS=
|
---|
1612 | CYGWIN_EXTRA_LDFLAGS=
|
---|
1613 | CYGWIN_EXTRA_PYTHON_LIBADD=
|
---|
1614 | WIN32_EXTRA_PYTHON_LIBADD=
|
---|
1615 | case "$host" in
|
---|
1616 | *-*-mingw*)
|
---|
1617 | CPPFLAGS="$CPPFLAGS -DWIN32"
|
---|
1618 | WIN32_EXTRA_LIBADD="-lws2_32"
|
---|
1619 | WIN32_EXTRA_LDFLAGS="-no-undefined"
|
---|
1620 | if test "${PYTHON}" != ""
|
---|
1621 | then
|
---|
1622 | case "$host" in
|
---|
1623 | *-w64-mingw*)
|
---|
1624 | WIN32_EXTRA_PYTHON_LIBADD="-shrext .pyd -L${pythondir}/../../lib -lpython${PYTHON_VERSION}"
|
---|
1625 | ;;
|
---|
1626 | *)
|
---|
1627 | WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)"
|
---|
1628 | ;;
|
---|
1629 | esac
|
---|
1630 | fi
|
---|
1631 | ;;
|
---|
1632 | *-*-cygwin*)
|
---|
1633 | CYGWIN_EXTRA_LDFLAGS="-no-undefined"
|
---|
1634 | if test "${PYTHON}" != ""
|
---|
1635 | then
|
---|
1636 | CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
|
---|
1637 | fi
|
---|
1638 | ;;
|
---|
1639 | esac
|
---|
1640 | AC_SUBST(WIN32_EXTRA_LIBADD)
|
---|
1641 | AC_SUBST(WIN32_EXTRA_LDFLAGS)
|
---|
1642 | AC_SUBST(WIN32_EXTRA_PYTHON_LIBADD)
|
---|
1643 | AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
|
---|
1644 | AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
|
---|
1645 |
|
---|
1646 | dnl Checking the standard string functions availability
|
---|
1647 | dnl
|
---|
1648 | dnl Note mingw* has C99 implementation that produce expected xml numbers
|
---|
1649 | dnl if code use {v}snprintf functions.
|
---|
1650 | dnl If you like to activate at run-time C99 compatible number output
|
---|
1651 | dnl see release note for mingw runtime 3.15:
|
---|
1652 | dnl http://sourceforge.net/project/shownotes.php?release_id=24832
|
---|
1653 | dnl
|
---|
1654 | dnl Also *win32*config.h files redefine them for various MSC compilers.
|
---|
1655 | dnl
|
---|
1656 | dnl So do not redefine {v}snprintf to _{v}snprintf like following:
|
---|
1657 | dnl AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
|
---|
1658 | dnl AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
|
---|
1659 | dnl and do not redefine those functions is C-source files.
|
---|
1660 | dnl
|
---|
1661 | AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
|
---|
1662 | NEED_TRIO=1)
|
---|
1663 |
|
---|
1664 | if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
|
---|
1665 | then
|
---|
1666 | echo Enabling code coverage for GCC
|
---|
1667 | EXTRA_CFLAGS="$EXTRA_CFLAGS -fprofile-arcs -ftest-coverage"
|
---|
1668 | LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
|
---|
1669 | else
|
---|
1670 | echo Disabling code coverage for GCC
|
---|
1671 | fi
|
---|
1672 |
|
---|
1673 | AC_SUBST(CPPFLAGS)
|
---|
1674 | AC_SUBST(EXTRA_CFLAGS)
|
---|
1675 | AC_SUBST(LDFLAGS)
|
---|
1676 | AC_SUBST(XML_CFLAGS)
|
---|
1677 |
|
---|
1678 | AC_SUBST(XML_LIBDIR)
|
---|
1679 | AC_SUBST(XML_LIBS)
|
---|
1680 | AC_SUBST(XML_PRIVATE_LIBS)
|
---|
1681 | AC_SUBST(XML_LIBTOOLLIBS)
|
---|
1682 | AC_SUBST(ICONV_LIBS)
|
---|
1683 | AC_SUBST(ICU_LIBS)
|
---|
1684 | AC_SUBST(XML_INCLUDEDIR)
|
---|
1685 | AC_SUBST(HTML_DIR)
|
---|
1686 | AC_SUBST(PYTHON)
|
---|
1687 | AC_SUBST(PYTHON_VERSION)
|
---|
1688 | AC_SUBST(PYTHON_INCLUDES)
|
---|
1689 | AC_SUBST(PYTHON_SITE_PACKAGES)
|
---|
1690 |
|
---|
1691 | AC_SUBST(M_LIBS)
|
---|
1692 | AC_SUBST(RDL_LIBS)
|
---|
1693 |
|
---|
1694 | dnl for the spec file
|
---|
1695 | RELDATE=`date +'%a %b %e %Y'`
|
---|
1696 | AC_SUBST(RELDATE)
|
---|
1697 | AC_SUBST(PYTHON_TESTS)
|
---|
1698 |
|
---|
1699 | rm -f COPYING.LIB COPYING
|
---|
1700 | ln -s $srcdir/Copyright COPYING
|
---|
1701 |
|
---|
1702 | # keep on one line for cygwin c.f. #130896
|
---|
1703 | AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile fuzz/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake])
|
---|
1704 | AC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py])
|
---|
1705 | AC_CONFIG_FILES([xml2-config], [chmod +x xml2-config])
|
---|
1706 | AC_OUTPUT
|
---|
1707 |
|
---|
1708 | echo Done configuring
|
---|