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