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], 12)
|
---|
6 | m4_define([MICRO_VERSION], 6)
|
---|
7 |
|
---|
8 | AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
|
---|
9 | AC_CONFIG_SRCDIR([entities.c])
|
---|
10 | AC_CONFIG_HEADERS([config.h])
|
---|
11 | AC_CONFIG_MACRO_DIR([m4])
|
---|
12 | AC_CANONICAL_HOST
|
---|
13 |
|
---|
14 | LIBXML_MAJOR_VERSION=MAJOR_VERSION
|
---|
15 | LIBXML_MINOR_VERSION=MINOR_VERSION
|
---|
16 | LIBXML_MICRO_VERSION=MICRO_VERSION
|
---|
17 | LIBXML_MICRO_VERSION_SUFFIX=
|
---|
18 | LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
|
---|
19 | LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
|
---|
20 |
|
---|
21 | LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
|
---|
22 |
|
---|
23 | if test -d .git ; then
|
---|
24 | extra=`git describe 2>/dev/null | sed 's+LIBXML[[0-9.]]*-++'`
|
---|
25 | echo extra=$extra
|
---|
26 | if test "$extra" != ""
|
---|
27 | then
|
---|
28 | LIBXML_VERSION_EXTRA="-GIT$extra"
|
---|
29 | fi
|
---|
30 | fi
|
---|
31 |
|
---|
32 | AC_SUBST(LIBXML_MAJOR_VERSION)
|
---|
33 | AC_SUBST(LIBXML_MINOR_VERSION)
|
---|
34 | AC_SUBST(LIBXML_MICRO_VERSION)
|
---|
35 | AC_SUBST(LIBXML_VERSION)
|
---|
36 | AC_SUBST(LIBXML_VERSION_INFO)
|
---|
37 | AC_SUBST(LIBXML_VERSION_NUMBER)
|
---|
38 | AC_SUBST(LIBXML_VERSION_EXTRA)
|
---|
39 |
|
---|
40 | VERSION=${LIBXML_VERSION}
|
---|
41 |
|
---|
42 | AM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz])
|
---|
43 | AM_MAINTAINER_MODE([enable])
|
---|
44 | AM_SILENT_RULES([yes])
|
---|
45 |
|
---|
46 | dnl Checks for programs.
|
---|
47 | AC_PROG_CC
|
---|
48 | AC_PROG_INSTALL
|
---|
49 | AC_PROG_LN_S
|
---|
50 | AC_PROG_MKDIR_P
|
---|
51 | AC_PATH_PROG(TAR, tar, /bin/tar)
|
---|
52 | AC_PATH_PROG(PERL, perl, /usr/bin/perl)
|
---|
53 | AC_PATH_PROG(WGET, wget, /usr/bin/wget)
|
---|
54 | AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
|
---|
55 | PKG_PROG_PKG_CONFIG
|
---|
56 |
|
---|
57 | LT_INIT([disable-static])
|
---|
58 | LT_LIB_M
|
---|
59 |
|
---|
60 | dnl
|
---|
61 | dnl We process the AC_ARG_WITH first so that later we can modify
|
---|
62 | dnl some of them to try to prevent impossible combinations. This
|
---|
63 | dnl also allows up so alphabetize the choices
|
---|
64 | dnl
|
---|
65 |
|
---|
66 | AC_ARG_WITH(c14n,
|
---|
67 | [ --with-c14n Canonical XML 1.0 support (on)])
|
---|
68 | AC_ARG_WITH(catalog,
|
---|
69 | [ --with-catalog XML Catalogs support (on)])
|
---|
70 | AC_ARG_WITH(debug,
|
---|
71 | [ --with-debug debugging module and shell (on)])
|
---|
72 | AC_ARG_WITH(ftp,
|
---|
73 | [ --with-ftp FTP support (off)])
|
---|
74 | AC_ARG_WITH(history,
|
---|
75 | [ --with-history history support for shell (off)])
|
---|
76 | AC_ARG_WITH(readline,
|
---|
77 | [ --with-readline[[=DIR]] use readline in DIR (for shell history)])
|
---|
78 | AC_ARG_WITH(html,
|
---|
79 | [ --with-html HTML parser (on)])
|
---|
80 | AC_ARG_WITH(http,
|
---|
81 | [ --with-http HTTP support (on)])
|
---|
82 | AC_ARG_WITH(iconv,
|
---|
83 | [ --with-iconv[[=DIR]] iconv support (on)])
|
---|
84 | AC_ARG_WITH(icu,
|
---|
85 | [ --with-icu ICU support (off)])
|
---|
86 | AC_ARG_WITH(iso8859x,
|
---|
87 | [ --with-iso8859x ISO-8859-X support if no iconv (on)])
|
---|
88 | AC_ARG_WITH(lzma,
|
---|
89 | [ --with-lzma[[=DIR]] use liblzma in DIR (on)])
|
---|
90 | AC_ARG_WITH(mem_debug,
|
---|
91 | [ --with-mem-debug memory debugging module (off)])
|
---|
92 | AC_ARG_WITH(modules,
|
---|
93 | [ --with-modules dynamic modules support (on)])
|
---|
94 | AC_ARG_WITH(output,
|
---|
95 | [ --with-output serialization support (on)])
|
---|
96 | AC_ARG_WITH(pattern,
|
---|
97 | [ --with-pattern xmlPattern selection interface (on)])
|
---|
98 | AC_ARG_WITH(push,
|
---|
99 | [ --with-push push parser interfaces (on)])
|
---|
100 | AC_ARG_WITH(python,
|
---|
101 | [ --with-python Python bindings (on)])
|
---|
102 | AC_ARG_WITH(reader,
|
---|
103 | [ --with-reader xmlReader parsing interface (on)])
|
---|
104 | AC_ARG_WITH(regexps,
|
---|
105 | [ --with-regexps regular expressions support (on)])
|
---|
106 | AC_ARG_WITH(run_debug,
|
---|
107 | [ --with-run-debug runtime debugging module (off)])
|
---|
108 | AC_ARG_WITH(sax1,
|
---|
109 | [ --with-sax1 older SAX1 interface (on)])
|
---|
110 | AC_ARG_WITH(schemas,
|
---|
111 | [ --with-schemas XML Schemas 1.0 and RELAX NG support (on)])
|
---|
112 | AC_ARG_WITH(schematron,
|
---|
113 | [ --with-schematron Schematron support (on)])
|
---|
114 | AC_ARG_WITH(threads,
|
---|
115 | [ --with-threads multithreading support (on)])
|
---|
116 | AC_ARG_WITH(thread-alloc,
|
---|
117 | [ --with-thread-alloc per-thread malloc hooks (off)])
|
---|
118 | AC_ARG_WITH(tree,
|
---|
119 | [ --with-tree DOM like tree manipulation APIs (on)])
|
---|
120 | AC_ARG_WITH(valid,
|
---|
121 | [ --with-valid DTD validation support (on)])
|
---|
122 | AC_ARG_WITH(writer,
|
---|
123 | [ --with-writer xmlWriter serialization interface (on)])
|
---|
124 | AC_ARG_WITH(xinclude,
|
---|
125 | [ --with-xinclude XInclude 1.0 support (on)])
|
---|
126 | AC_ARG_WITH(xpath,
|
---|
127 | [ --with-xpath XPath 1.0 support (on)])
|
---|
128 | AC_ARG_WITH(xptr,
|
---|
129 | [ --with-xptr XPointer support (on)])
|
---|
130 | AC_ARG_WITH(xptr-locs,
|
---|
131 | [ --with-xptr-locs XPointer ranges and points (off)])
|
---|
132 | AC_ARG_WITH(zlib,
|
---|
133 | [ --with-zlib[[=DIR]] use libz in DIR (on)])
|
---|
134 |
|
---|
135 | AC_ARG_WITH(minimum,
|
---|
136 | [ --with-minimum build a minimally sized library (off)])
|
---|
137 | AC_ARG_WITH(legacy,
|
---|
138 | [ --with-legacy maximum ABI compatibility (off)])
|
---|
139 |
|
---|
140 | AC_ARG_WITH(tls,
|
---|
141 | [ --with-tls thread-local storage (on)])
|
---|
142 | AC_ARG_WITH(fexceptions,
|
---|
143 | [ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
|
---|
144 | AC_ARG_WITH(coverage,
|
---|
145 | [ --with-coverage build for code coverage with GCC (off)])
|
---|
146 |
|
---|
147 | dnl
|
---|
148 | dnl hard dependencies on options
|
---|
149 | dnl
|
---|
150 | if test "$with_c14n" = "yes"; then
|
---|
151 | if test "$with_output" = "no"; then
|
---|
152 | echo WARNING: --with-c14n overrides --without-output
|
---|
153 | fi
|
---|
154 | with_output=yes
|
---|
155 | if test "$with_xpath" = "no"; then
|
---|
156 | echo WARNING: --with-c14n overrides --without-xpath
|
---|
157 | fi
|
---|
158 | with_xpath=yes
|
---|
159 | fi
|
---|
160 | if test "$with_schemas" = "yes"; then
|
---|
161 | if test "$with_pattern" = "no"; then
|
---|
162 | echo WARNING: --with-schemas overrides --without-pattern
|
---|
163 | fi
|
---|
164 | with_pattern=yes
|
---|
165 | if test "$with_regexps" = "no"; then
|
---|
166 | echo WARNING: --with-schemas overrides --without-regexps
|
---|
167 | fi
|
---|
168 | with_regexps=yes
|
---|
169 | fi
|
---|
170 | if test "$with_schematron" = "yes"; then
|
---|
171 | if test "$with_pattern" = "no"; then
|
---|
172 | echo WARNING: --with-schematron overrides --without-pattern
|
---|
173 | fi
|
---|
174 | with_pattern=yes
|
---|
175 | if test "$with_tree" = "no"; then
|
---|
176 | echo WARNING: --with-schematron overrides --without-tree
|
---|
177 | fi
|
---|
178 | with_tree=yes
|
---|
179 | if test "$with_xpath" = "no"; then
|
---|
180 | echo WARNING: --with-schematron overrides --without-xpath
|
---|
181 | fi
|
---|
182 | with_xpath=yes
|
---|
183 | fi
|
---|
184 | if test "$with_reader" = "yes"; then
|
---|
185 | if test "$with_push" = "no"; then
|
---|
186 | echo WARNING: --with-reader overrides --without-push
|
---|
187 | fi
|
---|
188 | with_push=yes
|
---|
189 | if test "$with_tree" = "no"; then
|
---|
190 | echo WARNING: --with-reader overrides --without-tree
|
---|
191 | fi
|
---|
192 | with_tree=yes
|
---|
193 | fi
|
---|
194 | if test "$with_writer" = "yes"; then
|
---|
195 | if test "$with_output" = "no"; then
|
---|
196 | echo WARNING: --with-writer overrides --without-output
|
---|
197 | fi
|
---|
198 | with_output=yes
|
---|
199 | if test "$with_push" = "no"; then
|
---|
200 | echo WARNING: --with-writer overrides --without-push
|
---|
201 | fi
|
---|
202 | with_push=yes
|
---|
203 | fi
|
---|
204 | if test "$with_xinclude" = "yes"; then
|
---|
205 | if test "$with_xpath" = "no"; then
|
---|
206 | echo WARNING: --with-xinclude overrides --without-xpath
|
---|
207 | fi
|
---|
208 | with_xpath=yes
|
---|
209 | fi
|
---|
210 | if test "$with_xptr_locs" = "yes"; then
|
---|
211 | if test "$with_xptr" = "no"; then
|
---|
212 | echo WARNING: --with-xptr-locs overrides --without-xptr
|
---|
213 | fi
|
---|
214 | with_xptr=yes
|
---|
215 | fi
|
---|
216 | if test "$with_xptr" = "yes"; then
|
---|
217 | if test "$with_xpath" = "no"; then
|
---|
218 | echo WARNING: --with-xptr overrides --without-xpath
|
---|
219 | fi
|
---|
220 | with_xpath=yes
|
---|
221 | fi
|
---|
222 |
|
---|
223 | if test "$with_minimum" = "yes"; then
|
---|
224 | dnl
|
---|
225 | dnl option to build a minimal libxml2 library
|
---|
226 | dnl
|
---|
227 | echo "Configuring for a minimal library"
|
---|
228 | test "$with_c14n" = "" && with_c14n=no
|
---|
229 | test "$with_catalog" = "" && with_catalog=no
|
---|
230 | test "$with_debug" = "" && with_debug=no
|
---|
231 | test "$with_fexceptions" = "" && with_fexceptions=no
|
---|
232 | test "$with_history" = "" && with_history=no
|
---|
233 | test "$with_html" = "" && with_html=no
|
---|
234 | test "$with_http" = "" && with_http=no
|
---|
235 | test "$with_iconv" = "" && with_iconv=no
|
---|
236 | test "$with_iso8859x" = "" && with_iso8859x=no
|
---|
237 | test "$with_lzma" = "" && with_lzma=no
|
---|
238 | test "$with_mem_debug" = "" && with_mem_debug=no
|
---|
239 | test "$with_output" = "" && with_output=no
|
---|
240 | test "$with_pattern" = "" && with_pattern=no
|
---|
241 | test "$with_push" = "" && with_push=no
|
---|
242 | test "$with_python" = "" && with_python=no
|
---|
243 | test "$with_reader" = "" && with_reader=no
|
---|
244 | test "$with_readline" = "" && with_readline=no
|
---|
245 | test "$with_regexps" = "" && with_regexps=no
|
---|
246 | test "$with_run_debug" = "" && with_run_debug=no
|
---|
247 | test "$with_sax1" = "" && with_sax1=no
|
---|
248 | test "$with_schemas" = "" && with_schemas=no
|
---|
249 | test "$with_schematron" = "" && with_schematron=no
|
---|
250 | test "$with_threads" = "" && with_threads=no
|
---|
251 | test "$with_thread_alloc" = "" && with_thread_alloc=no
|
---|
252 | test "$with_tree" = "" && with_tree=no
|
---|
253 | test "$with_valid" = "" && with_valid=no
|
---|
254 | test "$with_writer" = "" && with_writer=no
|
---|
255 | test "$with_xinclude" = "" && with_xinclude=no
|
---|
256 | test "$with_xpath" = "" && with_xpath=no
|
---|
257 | test "$with_xptr" = "" && with_xptr=no
|
---|
258 | test "$with_zlib" = "" && with_zlib=no
|
---|
259 | test "$with_modules" = "" && with_modules=no
|
---|
260 | else
|
---|
261 | dnl
|
---|
262 | dnl Disable dependent modules
|
---|
263 | dnl
|
---|
264 | if test "$with_output" = "no"; then
|
---|
265 | with_c14n=no
|
---|
266 | with_writer=no
|
---|
267 | fi
|
---|
268 | if test "$with_pattern" = "no"; then
|
---|
269 | with_schemas=no
|
---|
270 | with_schematron=no
|
---|
271 | fi
|
---|
272 | if test "$with_push" = "no"; then
|
---|
273 | with_reader=no
|
---|
274 | with_writer=no
|
---|
275 | fi
|
---|
276 | if test "$with_regexps" = "no"; then
|
---|
277 | with_schemas=no
|
---|
278 | fi
|
---|
279 | if test "$with_tree" = "no"; then
|
---|
280 | with_reader=no
|
---|
281 | with_schematron=no
|
---|
282 | fi
|
---|
283 | if test "$with_xpath" = "no"; then
|
---|
284 | with_c14n=no
|
---|
285 | with_schematron=no
|
---|
286 | with_xinclude=no
|
---|
287 | with_xptr=no
|
---|
288 | fi
|
---|
289 | fi
|
---|
290 |
|
---|
291 | XML_PRIVATE_LIBS=
|
---|
292 | XML_PRIVATE_CFLAGS=
|
---|
293 | XML_PC_LIBS=
|
---|
294 | XML_PC_REQUIRES=
|
---|
295 |
|
---|
296 | dnl
|
---|
297 | dnl Checks for header files.
|
---|
298 | dnl
|
---|
299 | AC_CHECK_HEADERS([stdint.h inttypes.h])
|
---|
300 | AC_CHECK_HEADERS([fcntl.h unistd.h sys/stat.h])
|
---|
301 | AC_CHECK_HEADERS([sys/mman.h])
|
---|
302 | AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h netdb.h])
|
---|
303 | AC_CHECK_HEADERS([sys/select.h poll.h])
|
---|
304 | AC_CHECK_HEADERS([sys/time.h sys/timeb.h])
|
---|
305 | AC_CHECK_HEADERS([dl.h dlfcn.h])
|
---|
306 | AC_CHECK_HEADERS([glob.h])
|
---|
307 | AM_CONDITIONAL(WITH_GLOB, test "$ac_cv_header_glob_h" = "yes")
|
---|
308 |
|
---|
309 | dnl
|
---|
310 | dnl Checking types
|
---|
311 | dnl
|
---|
312 | AC_TYPE_UINT32_T
|
---|
313 |
|
---|
314 | dnl Checks for library functions.
|
---|
315 | AC_CHECK_FUNCS([gettimeofday ftime stat isascii mmap munmap])
|
---|
316 |
|
---|
317 | AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */
|
---|
318 | #if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
|
---|
319 | # undef /**/ HAVE_MMAP
|
---|
320 | #endif])
|
---|
321 |
|
---|
322 | dnl Checking for va_copy availability
|
---|
323 | AC_MSG_CHECKING([for va_copy])
|
---|
324 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
|
---|
325 | va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])],
|
---|
326 | have_va_copy=yes,
|
---|
327 | have_va_copy=no)
|
---|
328 | AC_MSG_RESULT($have_va_copy)
|
---|
329 | if test x"$have_va_copy" = x"yes"; then
|
---|
330 | AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
|
---|
331 | else
|
---|
332 | AC_MSG_CHECKING([for __va_copy])
|
---|
333 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
|
---|
334 | va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],
|
---|
335 | have___va_copy=yes,
|
---|
336 | have___va_copy=no)
|
---|
337 | AC_MSG_RESULT($have___va_copy)
|
---|
338 | if test x"$have___va_copy" = x"yes"; then
|
---|
339 | AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
|
---|
340 | fi
|
---|
341 | fi
|
---|
342 |
|
---|
343 | dnl Checking whether va_list is an array type
|
---|
344 | AC_MSG_CHECKING([whether va_list is an array type])
|
---|
345 | AC_TRY_COMPILE2([
|
---|
346 | #include <stdarg.h>
|
---|
347 | void a(va_list * ap) {}],[
|
---|
348 | va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1],[
|
---|
349 | AC_MSG_RESULT(no)],[
|
---|
350 | AC_MSG_RESULT(yes)
|
---|
351 | AC_DEFINE([VA_LIST_IS_ARRAY], [1],[Define if va_list is an array type])])
|
---|
352 |
|
---|
353 | dnl
|
---|
354 | dnl Checks for inet libraries
|
---|
355 | dnl
|
---|
356 | if test "$with_http" != "no" || test "with_ftp" = "yes"; then
|
---|
357 | case "$host" in
|
---|
358 | *-*-mingw*)
|
---|
359 | dnl AC_SEARCH_LIBS doesn't work because of non-standard calling
|
---|
360 | dnl conventions on 32-bit Windows.
|
---|
361 | NET_LIBS="$NET_LIBS -lws2_32"
|
---|
362 | ;;
|
---|
363 | *)
|
---|
364 | _libs=$LIBS
|
---|
365 | AC_SEARCH_LIBS(gethostbyname, [nsl], [
|
---|
366 | if test "$ac_cv_search_gethostbyname" != "none required"; then
|
---|
367 | NET_LIBS="$NET_LIBS $ac_cv_search_gethostbyname"
|
---|
368 | fi], [:], [$NET_LIBS])
|
---|
369 | AC_SEARCH_LIBS(connect, [bsd socket inet], [
|
---|
370 | if test "$ac_cv_search_connect" != "none required"; then
|
---|
371 | NET_LIBS="$NET_LIBS $ac_cv_search_connect"
|
---|
372 | fi], [:], [$NET_LIBS])
|
---|
373 | LIBS=$_libs
|
---|
374 | ;;
|
---|
375 | esac
|
---|
376 |
|
---|
377 | dnl Determine what socket length (socklen_t) data type is
|
---|
378 | AC_MSG_CHECKING([for type of socket length (socklen_t)])
|
---|
379 | AC_TRY_COMPILE2([
|
---|
380 | #include <stddef.h>
|
---|
381 | #ifdef _WIN32
|
---|
382 | #include <ws2tcpip.h>
|
---|
383 | #else
|
---|
384 | #include <sys/socket.h>
|
---|
385 | #endif],[
|
---|
386 | (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
|
---|
387 | AC_MSG_RESULT(socklen_t *)
|
---|
388 | XML_SOCKLEN_T=socklen_t],[
|
---|
389 | AC_TRY_COMPILE2([
|
---|
390 | #include <stddef.h>
|
---|
391 | #include <sys/socket.h>],[
|
---|
392 | (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
|
---|
393 | AC_MSG_RESULT(size_t *)
|
---|
394 | XML_SOCKLEN_T=size_t],[
|
---|
395 | AC_TRY_COMPILE2([
|
---|
396 | #include <stddef.h>
|
---|
397 | #include <sys/socket.h>],[
|
---|
398 | (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
|
---|
399 | AC_MSG_RESULT(int *)
|
---|
400 | XML_SOCKLEN_T=int],[
|
---|
401 | AC_MSG_WARN(could not determine)
|
---|
402 | XML_SOCKLEN_T="int"])])])
|
---|
403 | AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
|
---|
404 |
|
---|
405 | dnl
|
---|
406 | dnl Checking for availability of IPv6
|
---|
407 | dnl
|
---|
408 | AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
|
---|
409 | if test "$with_minimum" = "yes"
|
---|
410 | then
|
---|
411 | enable_ipv6=no
|
---|
412 | fi
|
---|
413 | if test $enable_ipv6 = yes; then
|
---|
414 | AC_MSG_CHECKING([whether to enable IPv6])
|
---|
415 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
416 | #ifdef _WIN32
|
---|
417 | #include <winsock2.h>
|
---|
418 | #else
|
---|
419 | #include <sys/socket.h>
|
---|
420 | #ifdef HAVE_NETDB_H
|
---|
421 | #include <netdb.h>
|
---|
422 | #endif
|
---|
423 | #endif
|
---|
424 | ]], [[
|
---|
425 | struct sockaddr_storage ss;
|
---|
426 | socket(AF_INET6, SOCK_STREAM, 0);
|
---|
427 | getaddrinfo(0, 0, 0, 0);
|
---|
428 | ]])], [
|
---|
429 | AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
|
---|
430 | AC_MSG_RESULT([yes])], [
|
---|
431 | AC_MSG_RESULT([no])]
|
---|
432 | )
|
---|
433 | fi
|
---|
434 | fi
|
---|
435 |
|
---|
436 | dnl
|
---|
437 | dnl Extra flags
|
---|
438 | dnl
|
---|
439 | XML_LIBDIR='-L${libdir}'
|
---|
440 | XML_INCLUDEDIR='-I${includedir}/libxml2'
|
---|
441 | XML_CFLAGS=""
|
---|
442 |
|
---|
443 | dnl Thread-local storage
|
---|
444 | if test "$with_tls" = "yes"; then
|
---|
445 | AC_COMPILE_IFELSE([
|
---|
446 | AC_LANG_SOURCE([_Thread_local int v;]) ], [
|
---|
447 | AC_DEFINE([XML_THREAD_LOCAL], [_Thread_local], [TLS specifier]) ], [
|
---|
448 | AC_COMPILE_IFELSE([
|
---|
449 | AC_LANG_SOURCE([__thread int v;]) ], [
|
---|
450 | AC_DEFINE([XML_THREAD_LOCAL], [__thread], [TLS specifier]) ], [
|
---|
451 | AC_COMPILE_IFELSE([
|
---|
452 | AC_LANG_SOURCE([__declspec(thread) int v;]) ], [
|
---|
453 | AC_DEFINE([XML_THREAD_LOCAL], [__declspec(thread)], [TLS specifier]) ], [
|
---|
454 | WARN_NO_TLS=1 ])])])
|
---|
455 | fi
|
---|
456 |
|
---|
457 | dnl Checking whether __attribute__((destructor)) is accepted by the compiler
|
---|
458 | AC_MSG_CHECKING([whether __attribute__((destructor)) is accepted])
|
---|
459 | AC_TRY_COMPILE2([
|
---|
460 | void __attribute__((destructor))
|
---|
461 | f(void) {}], [], [
|
---|
462 | AC_MSG_RESULT(yes)
|
---|
463 | AC_DEFINE([HAVE_ATTRIBUTE_DESTRUCTOR], [1],[Define if __attribute__((destructor)) is accepted])
|
---|
464 | AC_DEFINE([ATTRIBUTE_DESTRUCTOR], [__attribute__((destructor))],[A form that will not confuse apibuild.py])],[
|
---|
465 | AC_MSG_RESULT(no)])
|
---|
466 |
|
---|
467 | dnl
|
---|
468 | dnl Linker version scripts for symbol versioning
|
---|
469 | dnl
|
---|
470 | VERSION_SCRIPT_FLAGS=
|
---|
471 | # lt_cv_prog_gnu_ld is from libtool 2.+
|
---|
472 | if test "$lt_cv_prog_gnu_ld" = yes; then
|
---|
473 | case $host in
|
---|
474 | *-*-cygwin* | *-*-mingw* | *-*-msys* )
|
---|
475 | ;;
|
---|
476 | *)
|
---|
477 | dnl lld 16 defaults to --no-undefined-version but the version script
|
---|
478 | dnl can contain symbols disabled by configuration options.
|
---|
479 | AX_APPEND_LINK_FLAGS([-Wl,--undefined-version], [VERSION_SCRIPT_FLAGS])
|
---|
480 | AX_APPEND_FLAG([-Wl,--version-script=], [VERSION_SCRIPT_FLAGS])
|
---|
481 | ;;
|
---|
482 | esac
|
---|
483 | else
|
---|
484 | case $host in
|
---|
485 | *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
|
---|
486 | esac
|
---|
487 | fi
|
---|
488 | AC_SUBST(VERSION_SCRIPT_FLAGS)
|
---|
489 | AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
|
---|
490 |
|
---|
491 | dnl
|
---|
492 | dnl Workaround for native compilers
|
---|
493 | dnl HP : http://bugs.gnome.org/db/31/3163.html
|
---|
494 | dnl DEC : Enable NaN/Inf
|
---|
495 | dnl
|
---|
496 | if test "${GCC}" != "yes" ; then
|
---|
497 | case "${host}" in
|
---|
498 | hppa*-*-hpux* )
|
---|
499 | AM_CFLAGS="${AM_CFLAGS} -Wp,-H30000"
|
---|
500 | ;;
|
---|
501 | *-dec-osf* )
|
---|
502 | AM_CFLAGS="${AM_CFLAGS} -ieee"
|
---|
503 | ;;
|
---|
504 | alpha*-*-linux* )
|
---|
505 | AM_CFLAGS="${AM_CFLAGS} -ieee"
|
---|
506 | ;;
|
---|
507 | esac
|
---|
508 | else
|
---|
509 | if test "$with_fexceptions" = "yes"
|
---|
510 | then
|
---|
511 | #
|
---|
512 | # Not activated by default because this inflates the code size
|
---|
513 | # Used to allow propagation of C++ exceptions through the library
|
---|
514 | #
|
---|
515 | AM_CFLAGS="${AM_CFLAGS} -fexceptions"
|
---|
516 | fi
|
---|
517 |
|
---|
518 | # warnings we'd like to see
|
---|
519 | AM_CFLAGS="${AM_CFLAGS} -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes"
|
---|
520 | # warnings we'd like to suppress
|
---|
521 | AM_CFLAGS="${AM_CFLAGS} -Wno-long-long -Wno-format-extra-args"
|
---|
522 | case "${host}" in
|
---|
523 | alpha*-*-linux* )
|
---|
524 | AM_CFLAGS="${AM_CFLAGS} -mieee"
|
---|
525 | ;;
|
---|
526 | alpha*-*-osf* )
|
---|
527 | AM_CFLAGS="${AM_CFLAGS} -mieee"
|
---|
528 | ;;
|
---|
529 | esac
|
---|
530 | fi
|
---|
531 | case ${host} in
|
---|
532 | *-*-solaris*)
|
---|
533 | XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
|
---|
534 | ;;
|
---|
535 | hppa*-hp-mpeix)
|
---|
536 | NEED_TRIO=1
|
---|
537 | ;;
|
---|
538 | *-*-cygwin* | *-*-mingw* | *-*-msys* )
|
---|
539 | # If the host is Windows, and shared libraries are disabled, we
|
---|
540 | # need to add -DLIBXML_STATIC to AM_CFLAGS in order for linking to
|
---|
541 | # work properly (without it, xmlexports.h would force the use of
|
---|
542 | # DLL imports, which obviously aren't present in a static
|
---|
543 | # library).
|
---|
544 | if test "x$enable_shared" = "xno"; then
|
---|
545 | XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
|
---|
546 | AM_CFLAGS="$AM_CFLAGS -DLIBXML_STATIC"
|
---|
547 | fi
|
---|
548 | ;;
|
---|
549 | esac
|
---|
550 |
|
---|
551 |
|
---|
552 | dnl
|
---|
553 | dnl Simple API modules
|
---|
554 | dnl
|
---|
555 |
|
---|
556 | if test "$with_tree" = "no" ; then
|
---|
557 | echo Disabling DOM like tree manipulation APIs
|
---|
558 | WITH_TREE=0
|
---|
559 | else
|
---|
560 | WITH_TREE=1
|
---|
561 | fi
|
---|
562 | AC_SUBST(WITH_TREE)
|
---|
563 |
|
---|
564 | if test "$with_ftp" != "yes" ; then
|
---|
565 | WITH_FTP=0
|
---|
566 | else
|
---|
567 | echo Enabling FTP support
|
---|
568 | WITH_FTP=1
|
---|
569 | fi
|
---|
570 | AC_SUBST(WITH_FTP)
|
---|
571 | AM_CONDITIONAL(WITH_FTP_SOURCES, test "$WITH_FTP" = "1")
|
---|
572 |
|
---|
573 | if test "$with_http" = "no" ; then
|
---|
574 | echo Disabling HTTP support
|
---|
575 | WITH_HTTP=0
|
---|
576 | else
|
---|
577 | WITH_HTTP=1
|
---|
578 | fi
|
---|
579 | AC_SUBST(WITH_HTTP)
|
---|
580 | AM_CONDITIONAL(WITH_HTTP_SOURCES, test "$WITH_HTTP" = "1")
|
---|
581 |
|
---|
582 | if test "$with_legacy" != "yes" ; then
|
---|
583 | WITH_LEGACY=0
|
---|
584 | else
|
---|
585 | echo Enabling deprecated APIs
|
---|
586 | WITH_LEGACY=1
|
---|
587 | fi
|
---|
588 | AC_SUBST(WITH_LEGACY)
|
---|
589 | AM_CONDITIONAL(WITH_LEGACY_SOURCES, test "$WITH_LEGACY" = "1")
|
---|
590 |
|
---|
591 | if test "$with_reader" = "no" ; then
|
---|
592 | echo Disabling the xmlReader parsing interface
|
---|
593 | WITH_READER=0
|
---|
594 | else
|
---|
595 | WITH_READER=1
|
---|
596 | fi
|
---|
597 | AC_SUBST(WITH_READER)
|
---|
598 | AM_CONDITIONAL(WITH_READER_SOURCES, test "$WITH_READER" = "1")
|
---|
599 |
|
---|
600 | if test "$with_writer" = "no" ; then
|
---|
601 | echo Disabling the xmlWriter saving interface
|
---|
602 | WITH_WRITER=0
|
---|
603 | else
|
---|
604 | WITH_WRITER=1
|
---|
605 | fi
|
---|
606 | AC_SUBST(WITH_WRITER)
|
---|
607 | AM_CONDITIONAL(WITH_WRITER_SOURCES, test "$WITH_WRITER" = "1")
|
---|
608 |
|
---|
609 | if test "$with_pattern" = "no" ; then
|
---|
610 | echo Disabling the xmlPattern parsing interface
|
---|
611 | WITH_PATTERN=0
|
---|
612 | else
|
---|
613 | WITH_PATTERN=1
|
---|
614 | fi
|
---|
615 | AC_SUBST(WITH_PATTERN)
|
---|
616 | AM_CONDITIONAL(WITH_PATTERN_SOURCES, test "$WITH_PATTERN" = "1")
|
---|
617 |
|
---|
618 | if test "$with_sax1" = "no" ; then
|
---|
619 | echo Disabling the older SAX1 interface
|
---|
620 | WITH_SAX1=0
|
---|
621 | else
|
---|
622 | WITH_SAX1=1
|
---|
623 | fi
|
---|
624 | AC_SUBST(WITH_SAX1)
|
---|
625 | AM_CONDITIONAL(WITH_SAX1_SOURCES, test "$WITH_SAX1" = "1")
|
---|
626 |
|
---|
627 | if test "$with_push" = "no" ; then
|
---|
628 | echo Disabling the PUSH parser interfaces
|
---|
629 | WITH_PUSH=0
|
---|
630 | else
|
---|
631 | WITH_PUSH=1
|
---|
632 | fi
|
---|
633 | AC_SUBST(WITH_PUSH)
|
---|
634 |
|
---|
635 | if test "$with_html" = "no" ; then
|
---|
636 | echo Disabling HTML support
|
---|
637 | WITH_HTML=0
|
---|
638 | else
|
---|
639 | WITH_HTML=1
|
---|
640 | fi
|
---|
641 | AC_SUBST(WITH_HTML)
|
---|
642 | AM_CONDITIONAL(WITH_HTML_SOURCES, test "$WITH_HTML" = "1")
|
---|
643 |
|
---|
644 | if test "$with_valid" = "no" ; then
|
---|
645 | echo Disabling DTD validation support
|
---|
646 | WITH_VALID=0
|
---|
647 | else
|
---|
648 | WITH_VALID=1
|
---|
649 | fi
|
---|
650 | AC_SUBST(WITH_VALID)
|
---|
651 | AM_CONDITIONAL(WITH_VALID_SOURCES, test "$WITH_VALID" = "1")
|
---|
652 |
|
---|
653 | if test "$with_catalog" = "no" ; then
|
---|
654 | echo Disabling Catalog support
|
---|
655 | WITH_CATALOG=0
|
---|
656 | else
|
---|
657 | WITH_CATALOG=1
|
---|
658 | fi
|
---|
659 | AC_SUBST(WITH_CATALOG)
|
---|
660 | AM_CONDITIONAL(WITH_CATALOG_SOURCES, test "$WITH_CATALOG" = "1")
|
---|
661 |
|
---|
662 | if test "$with_xptr" = "no" ; then
|
---|
663 | echo Disabling XPointer support
|
---|
664 | WITH_XPTR=0
|
---|
665 | WITH_XPTR_LOCS=0
|
---|
666 | else
|
---|
667 | WITH_XPTR=1
|
---|
668 | fi
|
---|
669 | AC_SUBST(WITH_XPTR)
|
---|
670 | AM_CONDITIONAL(WITH_XPTR_SOURCES, test "$WITH_XPTR" = "1")
|
---|
671 |
|
---|
672 | if test "$with_xptr_locs" != "yes" ; then
|
---|
673 | WITH_XPTR_LOCS=0
|
---|
674 | else
|
---|
675 | echo Enabling Xpointer locations support
|
---|
676 | WITH_XPTR_LOCS=1
|
---|
677 | fi
|
---|
678 | AC_SUBST(WITH_XPTR_LOCS)
|
---|
679 |
|
---|
680 | if test "$with_c14n" = "no" ; then
|
---|
681 | echo Disabling C14N support
|
---|
682 | WITH_C14N=0
|
---|
683 | else
|
---|
684 | WITH_C14N=1
|
---|
685 | fi
|
---|
686 | AC_SUBST(WITH_C14N)
|
---|
687 | AM_CONDITIONAL(WITH_C14N_SOURCES, test "$WITH_C14N" = "1")
|
---|
688 |
|
---|
689 | if test "$with_xinclude" = "no" ; then
|
---|
690 | echo Disabling XInclude support
|
---|
691 | WITH_XINCLUDE=0
|
---|
692 | else
|
---|
693 | WITH_XINCLUDE=1
|
---|
694 | fi
|
---|
695 | AC_SUBST(WITH_XINCLUDE)
|
---|
696 | AM_CONDITIONAL(WITH_XINCLUDE_SOURCES, test "$WITH_XINCLUDE" = "1")
|
---|
697 |
|
---|
698 | if test "$with_schematron" = "no" ; then
|
---|
699 | echo "Disabling Schematron support"
|
---|
700 | WITH_SCHEMATRON=0
|
---|
701 | else
|
---|
702 | WITH_SCHEMATRON=1
|
---|
703 | fi
|
---|
704 | AC_SUBST(WITH_SCHEMATRON)
|
---|
705 | AM_CONDITIONAL(WITH_SCHEMATRON_SOURCES, test "$WITH_SCHEMATRON" = "1")
|
---|
706 |
|
---|
707 | if test "$with_xpath" = "no" ; then
|
---|
708 | echo Disabling XPATH support
|
---|
709 | WITH_XPATH=0
|
---|
710 | else
|
---|
711 | WITH_XPATH=1
|
---|
712 | fi
|
---|
713 | AC_SUBST(WITH_XPATH)
|
---|
714 | AM_CONDITIONAL(WITH_XPATH_SOURCES, test "$WITH_XPATH" = "1")
|
---|
715 |
|
---|
716 | if test "$with_output" = "no" ; then
|
---|
717 | echo Disabling serialization/saving support
|
---|
718 | WITH_OUTPUT=0
|
---|
719 | else
|
---|
720 | WITH_OUTPUT=1
|
---|
721 | fi
|
---|
722 | AC_SUBST(WITH_OUTPUT)
|
---|
723 | AM_CONDITIONAL(WITH_OUTPUT_SOURCES, test "$WITH_OUTPUT" = "1")
|
---|
724 |
|
---|
725 | if test "$WITH_ICONV" != "1" && test "$with_iso8859x" = "no" ; then
|
---|
726 | echo Disabling ISO8859X support
|
---|
727 | WITH_ISO8859X=0
|
---|
728 | else
|
---|
729 | WITH_ISO8859X=1
|
---|
730 | fi
|
---|
731 | AC_SUBST(WITH_ISO8859X)
|
---|
732 |
|
---|
733 | if test "$with_schemas" = "no" ; then
|
---|
734 | echo "Disabling Schemas/Relax-NG support"
|
---|
735 | WITH_SCHEMAS=0
|
---|
736 | else
|
---|
737 | WITH_SCHEMAS=1
|
---|
738 | fi
|
---|
739 | AC_SUBST(WITH_SCHEMAS)
|
---|
740 | AM_CONDITIONAL(WITH_SCHEMAS_SOURCES, test "$WITH_SCHEMAS" = "1")
|
---|
741 |
|
---|
742 | if test "$with_regexps" = "no" ; then
|
---|
743 | echo Disabling Regexps support
|
---|
744 | WITH_REGEXPS=0
|
---|
745 | else
|
---|
746 | WITH_REGEXPS=1
|
---|
747 | fi
|
---|
748 | AC_SUBST(WITH_REGEXPS)
|
---|
749 | AM_CONDITIONAL(WITH_REGEXPS_SOURCES, test "$WITH_REGEXPS" = "1")
|
---|
750 |
|
---|
751 | if test "$with_debug" = "no" ; then
|
---|
752 | echo Disabling DEBUG support
|
---|
753 | WITH_DEBUG=0
|
---|
754 | else
|
---|
755 | WITH_DEBUG=1
|
---|
756 | fi
|
---|
757 | AC_SUBST(WITH_DEBUG)
|
---|
758 | AM_CONDITIONAL(WITH_DEBUG_SOURCES, test "$WITH_DEBUG" = "1")
|
---|
759 |
|
---|
760 | if test "$with_mem_debug" = "yes" ; then
|
---|
761 | if test "$with_thread_alloc" = "yes" ; then
|
---|
762 | echo Disabling memory debug - cannot use mem-debug with thread-alloc!
|
---|
763 | WITH_MEM_DEBUG=0
|
---|
764 | else
|
---|
765 | echo Enabling memory debug support
|
---|
766 | WITH_MEM_DEBUG=1
|
---|
767 | fi
|
---|
768 | else
|
---|
769 | WITH_MEM_DEBUG=0
|
---|
770 | fi
|
---|
771 | AC_SUBST(WITH_MEM_DEBUG)
|
---|
772 |
|
---|
773 | dnl
|
---|
774 | dnl Check for Python
|
---|
775 | dnl
|
---|
776 |
|
---|
777 | AS_IF([test "x$with_python" != "xno"], [
|
---|
778 | AM_PATH_PYTHON
|
---|
779 | PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
|
---|
780 | ])
|
---|
781 | AM_CONDITIONAL([WITH_PYTHON], [test "x$with_python" != "xno"])
|
---|
782 |
|
---|
783 | dnl
|
---|
784 | dnl Extra Python flags for Windows
|
---|
785 | dnl
|
---|
786 | PYTHON_LDFLAGS=
|
---|
787 | if test "${PYTHON}" != ""; then
|
---|
788 | case "$host" in
|
---|
789 | *-*-mingw* )
|
---|
790 | PYTHON_LDFLAGS="-no-undefined -shrext .pyd"
|
---|
791 | ;;
|
---|
792 | *-*-cygwin* |*-*-msys* )
|
---|
793 | PYTHON_LDFLAGS="-no-undefined"
|
---|
794 | ;;
|
---|
795 | esac
|
---|
796 | fi
|
---|
797 | AC_SUBST(PYTHON_LDFLAGS)
|
---|
798 |
|
---|
799 | dnl
|
---|
800 | dnl Check for DSO support
|
---|
801 | dnl
|
---|
802 | WITH_MODULES=0
|
---|
803 |
|
---|
804 | if test "$with_modules" != "no" ; then
|
---|
805 | case "$host" in
|
---|
806 | *-*-cygwin* | *-*-msys* )
|
---|
807 | MODULE_EXTENSION=".dll"
|
---|
808 | ;;
|
---|
809 | *-*-mingw*)
|
---|
810 | MODULE_EXTENSION=".dll"
|
---|
811 | WITH_MODULES=1
|
---|
812 | ;;
|
---|
813 | *-*-hpux*)
|
---|
814 | MODULE_EXTENSION=".sl"
|
---|
815 | ;;
|
---|
816 | *)
|
---|
817 | MODULE_EXTENSION=".so"
|
---|
818 | ;;
|
---|
819 | esac
|
---|
820 |
|
---|
821 | if test "$WITH_MODULES" = "0"; then
|
---|
822 | _libs=$LIBS
|
---|
823 | AC_SEARCH_LIBS([dlopen], [dl], [
|
---|
824 | WITH_MODULES=1
|
---|
825 | if test "$ac_cv_search_dlopen" != "none required"; then
|
---|
826 | MODULE_PLATFORM_LIBS=$ac_cv_search_dlopen
|
---|
827 | fi
|
---|
828 | AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])], [
|
---|
829 | AC_SEARCH_LIBS([shl_load], [dld], [
|
---|
830 | WITH_MODULES=1
|
---|
831 | if test "$ac_cv_search_shl_load" != "none required"; then
|
---|
832 | MODULE_PLATFORM_LIBS=$ac_cv_search_shl_load
|
---|
833 | fi
|
---|
834 | AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])])])
|
---|
835 | LIBS=$_libs
|
---|
836 | fi
|
---|
837 | fi
|
---|
838 |
|
---|
839 | AC_SUBST(WITH_MODULES)
|
---|
840 | AC_SUBST(MODULE_PLATFORM_LIBS)
|
---|
841 | AC_SUBST(MODULE_EXTENSION)
|
---|
842 | AM_CONDITIONAL(WITH_MODULES_SOURCES, test "$WITH_MODULES" = "1")
|
---|
843 |
|
---|
844 | dnl
|
---|
845 | dnl Check for trio string functions
|
---|
846 | dnl
|
---|
847 | if test "${NEED_TRIO}" = "1" ; then
|
---|
848 | echo Adding trio library for string functions
|
---|
849 | WITH_TRIO=1
|
---|
850 | else
|
---|
851 | WITH_TRIO=0
|
---|
852 | fi
|
---|
853 | AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
|
---|
854 | AC_SUBST(WITH_TRIO)
|
---|
855 |
|
---|
856 | dnl
|
---|
857 | dnl Thread-related stuff
|
---|
858 | dnl
|
---|
859 | THREAD_LIBS=""
|
---|
860 | BASE_THREAD_LIBS=""
|
---|
861 | WITH_THREADS=0
|
---|
862 | THREAD_CFLAGS=""
|
---|
863 | WITH_THREAD_ALLOC=0
|
---|
864 |
|
---|
865 | if test "$with_threads" = "no" ; then
|
---|
866 | echo Disabling multithreaded support
|
---|
867 | else
|
---|
868 | case $host_os in
|
---|
869 | *mingw*)
|
---|
870 | dnl Default to native threads on Windows
|
---|
871 | WITH_THREADS="1"
|
---|
872 | ;;
|
---|
873 | *)
|
---|
874 | dnl Use pthread by default in other cases
|
---|
875 | _libs=$LIBS
|
---|
876 | AC_CHECK_HEADERS(pthread.h,
|
---|
877 | AC_SEARCH_LIBS([pthread_join], [pthread], [
|
---|
878 | WITH_THREADS="1"
|
---|
879 | if test "$ac_cv_search_pthread_join" != "none required"; then
|
---|
880 | THREAD_LIBS=$ac_cv_search_pthread_join
|
---|
881 | fi
|
---|
882 | AC_DEFINE([HAVE_PTHREAD_H], [],
|
---|
883 | [Define if <pthread.h> is there])]))
|
---|
884 | LIBS=$_libs
|
---|
885 | ;;
|
---|
886 | esac
|
---|
887 |
|
---|
888 | case $host_os in
|
---|
889 | *linux*)
|
---|
890 | if test "${GCC}" = "yes" ; then
|
---|
891 | BASE_THREAD_LIBS="$THREAD_LIBS"
|
---|
892 | THREAD_LIBS=""
|
---|
893 | fi
|
---|
894 | ;;
|
---|
895 | esac
|
---|
896 |
|
---|
897 | if test "$WITH_THREADS" = "1" ; then
|
---|
898 | THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
|
---|
899 | fi
|
---|
900 | fi
|
---|
901 | if test "$with_thread_alloc" = "yes" && test "$WITH_THREADS" = "1" ; then
|
---|
902 | WITH_THREAD_ALLOC=1
|
---|
903 | fi
|
---|
904 |
|
---|
905 | AC_SUBST(THREAD_LIBS)
|
---|
906 | AC_SUBST(BASE_THREAD_LIBS)
|
---|
907 | AC_SUBST(WITH_THREADS)
|
---|
908 | AC_SUBST(THREAD_CFLAGS)
|
---|
909 | AC_SUBST(WITH_THREAD_ALLOC)
|
---|
910 |
|
---|
911 | dnl
|
---|
912 | dnl xmllint shell history
|
---|
913 | dnl
|
---|
914 | if test "$with_history" = "yes" && test "$with_readline" != "no"; then
|
---|
915 | echo Enabling xmllint shell history
|
---|
916 | dnl check for terminal library. this is a very cool solution
|
---|
917 | dnl from octave's configure.in
|
---|
918 | unset tcap
|
---|
919 | for termlib in ncurses curses termcap terminfo termlib; do
|
---|
920 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
|
---|
921 | test -n "$tcap" && break
|
---|
922 | done
|
---|
923 |
|
---|
924 | _cppflags=$CPPFLAGS
|
---|
925 | _libs=$LIBS
|
---|
926 | if test "$with_readline" != "" && test "$with_readline" != "yes"; then
|
---|
927 | RDL_DIR=$with_readline
|
---|
928 | CPPFLAGS="${CPPFLAGS} -I$RDL_DIR/include"
|
---|
929 | LIBS="${LIBS} -L$RDL_DIR/lib"
|
---|
930 | fi
|
---|
931 | AC_CHECK_HEADER(readline/history.h,
|
---|
932 | AC_CHECK_LIB(history, append_history,[
|
---|
933 | RDL_LIBS="-lhistory"
|
---|
934 | if test "x${RDL_DIR}" != "x"; then
|
---|
935 | RDL_CFLAGS="-I$RDL_DIR/include"
|
---|
936 | RDL_LIBS="-L$RDL_DIR/lib $RDL_LIBS"
|
---|
937 | fi
|
---|
938 | AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
|
---|
939 | AC_CHECK_HEADER(readline/readline.h,
|
---|
940 | AC_CHECK_LIB(readline, readline,[
|
---|
941 | RDL_LIBS="-lreadline $RDL_LIBS $tcap"
|
---|
942 | if test "x$RDL_DIR" != "x"; then
|
---|
943 | RDL_CFLAGS="-I$RDL_DIR/include"
|
---|
944 | RDL_LIBS="-L$RDL_DIR/lib $RDL_LIBS"
|
---|
945 | fi
|
---|
946 | AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
|
---|
947 | CPPFLAGS=$_cppflags
|
---|
948 | LIBS=$_libs
|
---|
949 | fi
|
---|
950 | AC_SUBST(RDL_CFLAGS)
|
---|
951 | AC_SUBST(RDL_LIBS)
|
---|
952 |
|
---|
953 | dnl
|
---|
954 | dnl Checks for zlib library.
|
---|
955 | dnl
|
---|
956 | WITH_ZLIB=0
|
---|
957 |
|
---|
958 | if test "$with_zlib" = "no"; then
|
---|
959 | echo "Disabling zlib compression support"
|
---|
960 | else
|
---|
961 | if test "$with_zlib" != "yes"; then
|
---|
962 | Z_DIR=$with_zlib
|
---|
963 | fi
|
---|
964 |
|
---|
965 | # Don't run pkg-config if with_zlib contains a path.
|
---|
966 | if test "x$Z_DIR" = "x"; then
|
---|
967 | # Try pkg-config first so that static linking works.
|
---|
968 | PKG_CHECK_MODULES([Z],[zlib],
|
---|
969 | [WITH_ZLIB=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} zlib"],
|
---|
970 | [:])
|
---|
971 | fi
|
---|
972 |
|
---|
973 | if test "$WITH_ZLIB" = "0"; then
|
---|
974 | _cppflags=$CPPFLAGS
|
---|
975 | _libs=$LIBS
|
---|
976 | if test "x$Z_DIR" != "x"; then
|
---|
977 | CPPFLAGS="${CPPFLAGS} -I$Z_DIR/include"
|
---|
978 | LIBS="${LIBS} -L$Z_DIR/lib"
|
---|
979 | fi
|
---|
980 | AC_CHECK_HEADERS(zlib.h,
|
---|
981 | AC_CHECK_LIB(z, gzread,[
|
---|
982 | WITH_ZLIB=1
|
---|
983 | if test "x${Z_DIR}" != "x"; then
|
---|
984 | Z_CFLAGS="-I${Z_DIR}/include"
|
---|
985 | Z_LIBS="-L${Z_DIR}/lib -lz"
|
---|
986 | [case ${host} in
|
---|
987 | *-*-solaris*)
|
---|
988 | Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
|
---|
989 | ;;
|
---|
990 | esac]
|
---|
991 | else
|
---|
992 | Z_LIBS="-lz"
|
---|
993 | fi])
|
---|
994 | XML_PC_LIBS="${XML_PC_LIBS} ${Z_LIBS}"
|
---|
995 | )
|
---|
996 | CPPFLAGS=$_cppflags
|
---|
997 | LIBS=$_libs
|
---|
998 | fi
|
---|
999 |
|
---|
1000 | XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${Z_CFLAGS}"
|
---|
1001 | XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${Z_LIBS}"
|
---|
1002 | fi
|
---|
1003 | AC_SUBST(WITH_ZLIB)
|
---|
1004 |
|
---|
1005 | dnl
|
---|
1006 | dnl Checks for lzma library.
|
---|
1007 | dnl
|
---|
1008 | WITH_LZMA=0
|
---|
1009 |
|
---|
1010 | if test "$with_lzma" = "no"; then
|
---|
1011 | echo "Disabling lzma compression support"
|
---|
1012 | else
|
---|
1013 | if test "$with_lzma" != "yes"; then
|
---|
1014 | LZMA_DIR=$with_lzma
|
---|
1015 | fi
|
---|
1016 |
|
---|
1017 | # Don't run pkg-config if with_lzma contains a path.
|
---|
1018 | if test "x$LZMA_DIR" = "x"; then
|
---|
1019 | # Try pkg-config first so that static linking works.
|
---|
1020 | PKG_CHECK_MODULES([LZMA],[liblzma],
|
---|
1021 | [WITH_LZMA=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} liblzma"],
|
---|
1022 | [:])
|
---|
1023 | fi
|
---|
1024 |
|
---|
1025 | # If pkg-config failed, fall back to AC_CHECK_LIB. This
|
---|
1026 | # will not pick up the necessary LIBS flags for liblzma's
|
---|
1027 | # private dependencies, though, so static linking may fail.
|
---|
1028 | if test "$WITH_LZMA" = "0"; then
|
---|
1029 | _cppflags=$CPPFLAGS
|
---|
1030 | _libs=$LIBS
|
---|
1031 | if test "x$LZMA_DIR" != "x"; then
|
---|
1032 | CPPFLAGS="${CPPFLAGS} -I$LZMA_DIR/include"
|
---|
1033 | LIBS="${LIBS} -L$LZMA_DIR/lib"
|
---|
1034 | fi
|
---|
1035 | AC_CHECK_HEADERS(lzma.h,
|
---|
1036 | AC_CHECK_LIB(lzma, lzma_code,[
|
---|
1037 | WITH_LZMA=1
|
---|
1038 | if test "x${LZMA_DIR}" != "x"; then
|
---|
1039 | LZMA_CFLAGS="-I${LZMA_DIR}/include"
|
---|
1040 | LZMA_LIBS="-L${LZMA_DIR}/lib -llzma"
|
---|
1041 | else
|
---|
1042 | LZMA_LIBS="-llzma"
|
---|
1043 | fi])
|
---|
1044 | XML_PC_LIBS="${XML_PC_LIBS} ${LZMA_LIBS}"
|
---|
1045 | )
|
---|
1046 | CPPFLAGS=$_cppflags
|
---|
1047 | LIBS=$_libs
|
---|
1048 | fi
|
---|
1049 |
|
---|
1050 | XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${LZMA_CFLAGS}"
|
---|
1051 | XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${LZMA_LIBS}"
|
---|
1052 | fi
|
---|
1053 | AC_SUBST(WITH_LZMA)
|
---|
1054 | AM_CONDITIONAL(WITH_LZMA_SOURCES, test "$WITH_LZMA" = "1")
|
---|
1055 |
|
---|
1056 | dnl
|
---|
1057 | dnl Checks for iconv library.
|
---|
1058 | dnl
|
---|
1059 | WITH_ICONV=0
|
---|
1060 |
|
---|
1061 | if test "$with_iconv" = "no" ; then
|
---|
1062 | echo Disabling ICONV support
|
---|
1063 | else
|
---|
1064 | _cppflags=$CPPFLAGS
|
---|
1065 | _libs=$LIBS
|
---|
1066 | if test "$with_iconv" != "yes" && test "$with_iconv" != "" ; then
|
---|
1067 | ICONV_DIR=$with_iconv
|
---|
1068 | CPPFLAGS="$CPPFLAGS -I$ICONV_DIR/include"
|
---|
1069 | LIBS="$LIBS -L$ICONV_DIR/lib"
|
---|
1070 | fi
|
---|
1071 | AC_MSG_CHECKING([for libiconv])
|
---|
1072 | AC_LINK_IFELSE([
|
---|
1073 | AC_LANG_PROGRAM([#include <iconv.h>], [iconv_open(0,0);])
|
---|
1074 | ], [
|
---|
1075 | WITH_ICONV=1
|
---|
1076 | AC_MSG_RESULT([none required])
|
---|
1077 | ], [
|
---|
1078 | LIBS="$LIBS -liconv"
|
---|
1079 | AC_LINK_IFELSE([
|
---|
1080 | AC_LANG_PROGRAM([#include <iconv.h>], [iconv_open(0,0);])
|
---|
1081 | ], [
|
---|
1082 | WITH_ICONV=1
|
---|
1083 | ICONV_LIBS="-liconv"
|
---|
1084 | AC_MSG_RESULT([yes])
|
---|
1085 | ], [
|
---|
1086 | AC_MSG_RESULT([no])
|
---|
1087 | ])
|
---|
1088 | ])
|
---|
1089 | if test "$WITH_ICONV" = "1" && test "$ICONV_DIR" != ""; then
|
---|
1090 | ICONV_CFLAGS="-I$ICONV_DIR/include"
|
---|
1091 | ICONV_LIBS="-L$ICONV_DIR/lib $ICONV_LIBS"
|
---|
1092 | # Export this since our headers include iconv.h
|
---|
1093 | XML_INCLUDEDIR="$XML_INCLUDEDIR -I$ICONV_DIR/include"
|
---|
1094 | fi
|
---|
1095 | CPPFLAGS=$_cppflags
|
---|
1096 | LIBS=$_libs
|
---|
1097 | fi
|
---|
1098 | AC_SUBST(WITH_ICONV)
|
---|
1099 | AC_SUBST(ICONV_CFLAGS)
|
---|
1100 |
|
---|
1101 | dnl
|
---|
1102 | dnl Checks for ICU library.
|
---|
1103 | dnl
|
---|
1104 | WITH_ICU=0
|
---|
1105 |
|
---|
1106 | if test "$with_icu" = "no" || test "$with_icu" = "" ; then
|
---|
1107 | echo Disabling ICU support
|
---|
1108 | else
|
---|
1109 | # Try pkg-config first so that static linking works.
|
---|
1110 | # If this succeeeds, we ignore the WITH_ICU directory.
|
---|
1111 | PKG_CHECK_MODULES([ICU], [icu-i18n], [
|
---|
1112 | WITH_ICU=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} icu-i18n"
|
---|
1113 | m4_ifdef([PKG_CHECK_VAR],
|
---|
1114 | [PKG_CHECK_VAR([ICU_DEFS], [icu-i18n], [DEFS])])
|
---|
1115 | if test "x$ICU_DEFS" != "x"; then
|
---|
1116 | ICU_CFLAGS="$ICU_CFLAGS $ICU_DEFS"
|
---|
1117 | fi],[:])
|
---|
1118 |
|
---|
1119 | if test "$WITH_ICU" = "0"; then
|
---|
1120 | ICU_CONFIG=icu-config
|
---|
1121 | if ${ICU_CONFIG} --cflags >/dev/null 2>&1
|
---|
1122 | then
|
---|
1123 | WITH_ICU=1
|
---|
1124 | ICU_CFLAGS=`${ICU_CONFIG} --cflags`
|
---|
1125 | ICU_LIBS=`${ICU_CONFIG} --ldflags`
|
---|
1126 | XML_PC_LIBS="${XML_PC_LIBS} ${ICU_LIBS}"
|
---|
1127 | else
|
---|
1128 | _cppflags="${CPPFLAGS}"
|
---|
1129 | _libs="${LIBS}"
|
---|
1130 | if test "$with_icu" != "yes" ; then
|
---|
1131 | ICU_DIR=$with_icu
|
---|
1132 | CPPFLAGS="${CPPFLAGS} -I$ICU_DIR/include"
|
---|
1133 | LIBS="${LIBS} -L$ICU_DIR/lib"
|
---|
1134 | fi
|
---|
1135 |
|
---|
1136 | AC_CHECK_HEADER(unicode/ucnv.h, [
|
---|
1137 | AC_CHECK_LIB([icucore], [ucnv_open], [
|
---|
1138 | WITH_ICU=1
|
---|
1139 | ICU_LIBS=-licucore
|
---|
1140 | if test "$ICU_DIR" != ""; then
|
---|
1141 | ICU_CFLAGS="-I$ICU_DIR/include"
|
---|
1142 | ICU_LIBS="-L$ICU_DIR/lib $ICU_LIBS"
|
---|
1143 | fi])])
|
---|
1144 | XML_PC_LIBS="${XML_PC_LIBS} ${ICU_LIBS}"
|
---|
1145 | CPPFLAGS=$_cppflags
|
---|
1146 | LIBS=$_libs
|
---|
1147 | fi
|
---|
1148 | fi
|
---|
1149 |
|
---|
1150 | XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${ICU_CFLAGS}"
|
---|
1151 | XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${ICU_LIBS}"
|
---|
1152 | fi
|
---|
1153 | AC_SUBST(WITH_ICU)
|
---|
1154 |
|
---|
1155 | if test "$with_coverage" = "yes" && test "${GCC}" = "yes"
|
---|
1156 | then
|
---|
1157 | echo Enabling code coverage for GCC
|
---|
1158 | AM_CFLAGS="$AM_CFLAGS -fprofile-arcs -ftest-coverage"
|
---|
1159 | AM_LDFLAGS="$AM_LDFLAGS -fprofile-arcs -ftest-coverage"
|
---|
1160 | else
|
---|
1161 | echo Disabling code coverage for GCC
|
---|
1162 | fi
|
---|
1163 |
|
---|
1164 | XML_LIBS="-lxml2"
|
---|
1165 | XML_LIBTOOLLIBS="libxml2.la"
|
---|
1166 | NON_PC_LIBS="${THREAD_LIBS} ${ICONV_LIBS} ${LIBM} ${NET_LIBS}"
|
---|
1167 | XML_PC_LIBS="${XML_PC_LIBS} ${NON_PC_LIBS}"
|
---|
1168 | XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${NON_PC_LIBS}"
|
---|
1169 | XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${THREAD_CFLAGS} ${ICONV_CFLAGS}"
|
---|
1170 |
|
---|
1171 | dnl When static-only:
|
---|
1172 | dnl * Duplicate xml-config static --libs into --dynamic.
|
---|
1173 | dnl * Fold pkg-config private fields into main fields.
|
---|
1174 | if test "x$enable_shared" = "xno"; then
|
---|
1175 | XML_PRIVATE_LIBS_NO_SHARED="${XML_PRIVATE_LIBS}"
|
---|
1176 | XML_PC_PRIVATE=
|
---|
1177 | XML_PC_LIBS_PRIVATE=
|
---|
1178 | else
|
---|
1179 | XML_PRIVATE_LIBS_NO_SHARED=
|
---|
1180 | XML_PC_PRIVATE=".private"
|
---|
1181 | XML_PC_LIBS_PRIVATE="
|
---|
1182 | Libs.private:"
|
---|
1183 | fi
|
---|
1184 | AC_SUBST(XML_PRIVATE_LIBS_NO_SHARED)
|
---|
1185 | AC_SUBST(XML_PC_PRIVATE)
|
---|
1186 | AC_SUBST(XML_PC_LIBS_PRIVATE)
|
---|
1187 | AM_SUBST_NOTMAKE(XML_PRIVATE_LIBS_NO_SHARED)
|
---|
1188 | AM_SUBST_NOTMAKE(XML_PC_PRIVATE)
|
---|
1189 | AM_SUBST_NOTMAKE(XML_PC_LIBS_PRIVATE)
|
---|
1190 |
|
---|
1191 | AC_SUBST(XML_PC_LIBS)
|
---|
1192 | AC_SUBST(XML_PC_REQUIRES)
|
---|
1193 | AM_SUBST_NOTMAKE(XML_PC_LIBS)
|
---|
1194 | AM_SUBST_NOTMAKE(XML_PC_REQUIRES)
|
---|
1195 |
|
---|
1196 | AC_SUBST(AM_CFLAGS)
|
---|
1197 | AC_SUBST(AM_LDFLAGS)
|
---|
1198 | AC_SUBST(XML_CFLAGS)
|
---|
1199 |
|
---|
1200 | AC_SUBST(XML_LIBDIR)
|
---|
1201 | AC_SUBST(XML_LIBS)
|
---|
1202 | AC_SUBST(XML_PRIVATE_LIBS)
|
---|
1203 | AC_SUBST(XML_PRIVATE_CFLAGS)
|
---|
1204 | AC_SUBST(XML_LIBTOOLLIBS)
|
---|
1205 | AC_SUBST(XML_INCLUDEDIR)
|
---|
1206 |
|
---|
1207 | dnl for the spec file
|
---|
1208 | RELDATE=`date +'%a %b %e %Y'`
|
---|
1209 | AC_SUBST(RELDATE)
|
---|
1210 |
|
---|
1211 | # keep on one line for cygwin c.f. #130896
|
---|
1212 | AC_CONFIG_FILES([Makefile include/Makefile include/libxml/Makefile include/private/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])
|
---|
1213 | AC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py])
|
---|
1214 | AC_CONFIG_FILES([xml2-config], [chmod +x xml2-config])
|
---|
1215 | AC_OUTPUT
|
---|
1216 |
|
---|
1217 | if test "$WARN_NO_TLS" != ""; then
|
---|
1218 | echo "================================================================"
|
---|
1219 | echo "WARNING: Your C compiler appears to not support thread-local"
|
---|
1220 | echo "storage. Future versions of libxml2 will require this feature"
|
---|
1221 | echo "for multi-threading."
|
---|
1222 | echo "================================================================"
|
---|
1223 | fi
|
---|