VirtualBox

source: vbox/trunk/src/libs/libxml2-2.13.2/configure.ac@ 106165

最後變更 在這個檔案從106165是 105420,由 vboxsync 提交於 4 月 前

libxml2-2.12.6: Applied and adjusted our libxml2 changes to 2.12.6. bugref:10730

  • 屬性 svn:eol-style 設為 native
檔案大小: 32.7 KB
 
1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ([2.63])
3
4m4_define([MAJOR_VERSION], 2)
5m4_define([MINOR_VERSION], 13)
6m4_define([MICRO_VERSION], 2)
7
8AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
9AC_CONFIG_SRCDIR([entities.c])
10AC_CONFIG_HEADERS([config.h])
11AC_CONFIG_MACRO_DIR([m4])
12AC_CANONICAL_HOST
13
14LIBXML_MAJOR_VERSION=MAJOR_VERSION
15LIBXML_MINOR_VERSION=MINOR_VERSION
16LIBXML_MICRO_VERSION=MICRO_VERSION
17LIBXML_MICRO_VERSION_SUFFIX=
18LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
19LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
20
21LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
22
23if 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
30fi
31
32AC_SUBST(LIBXML_MAJOR_VERSION)
33AC_SUBST(LIBXML_MINOR_VERSION)
34AC_SUBST(LIBXML_MICRO_VERSION)
35AC_SUBST(LIBXML_VERSION)
36AC_SUBST(LIBXML_VERSION_INFO)
37AC_SUBST(LIBXML_VERSION_NUMBER)
38AC_SUBST(LIBXML_VERSION_EXTRA)
39
40VERSION=${LIBXML_VERSION}
41
42AM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz])
43AM_MAINTAINER_MODE([enable])
44AM_SILENT_RULES([yes])
45
46dnl Checks for programs.
47AC_PROG_CC
48AC_PROG_INSTALL
49AC_PROG_LN_S
50AC_PROG_MKDIR_P
51AC_PATH_PROG(TAR, tar, /bin/tar)
52AC_PATH_PROG(PERL, perl, /usr/bin/perl)
53AC_PATH_PROG(WGET, wget, /usr/bin/wget)
54AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
55PKG_PROG_PKG_CONFIG
56
57LT_INIT([disable-static])
58LT_LIB_M
59
60dnl
61dnl We process the AC_ARG_WITH first so that later we can modify
62dnl some of them to try to prevent impossible combinations. This
63dnl also allows up so alphabetize the choices
64dnl
65
66AC_ARG_WITH(c14n,
67[ --with-c14n Canonical XML 1.0 support (on)])
68AC_ARG_WITH(catalog,
69[ --with-catalog XML Catalogs support (on)])
70AC_ARG_WITH(debug,
71[ --with-debug debugging module and shell (on)])
72AC_ARG_WITH(ftp,
73[ --with-ftp FTP support (off)])
74AC_ARG_WITH(history,
75[ --with-history history support for shell (off)])
76AC_ARG_WITH(readline,
77[ --with-readline[[=DIR]] use readline in DIR (for shell history)])
78AC_ARG_WITH(html,
79[ --with-html HTML parser (on)])
80AC_ARG_WITH(http,
81[ --with-http HTTP support (off)])
82AC_ARG_WITH(iconv,
83[ --with-iconv[[=DIR]] iconv support (on)])
84AC_ARG_WITH(icu,
85[ --with-icu ICU support (off)])
86AC_ARG_WITH(iso8859x,
87[ --with-iso8859x ISO-8859-X support if no iconv (on)])
88AC_ARG_WITH(lzma,
89[ --with-lzma[[=DIR]] use liblzma in DIR (off)])
90AC_ARG_WITH(modules,
91[ --with-modules dynamic modules support (on)])
92AC_ARG_WITH(output,
93[ --with-output serialization support (on)])
94AC_ARG_WITH(pattern,
95[ --with-pattern xmlPattern selection interface (on)])
96AC_ARG_WITH(push,
97[ --with-push push parser interfaces (on)])
98AC_ARG_WITH(python,
99[ --with-python Python bindings (on)])
100AC_ARG_WITH(reader,
101[ --with-reader xmlReader parsing interface (on)])
102AC_ARG_WITH(regexps,
103[ --with-regexps regular expressions support (on)])
104AC_ARG_WITH(sax1,
105[ --with-sax1 older SAX1 interface (on)])
106AC_ARG_WITH(schemas,
107[ --with-schemas XML Schemas 1.0 and RELAX NG support (on)])
108AC_ARG_WITH(schematron,
109[ --with-schematron Schematron support (on)])
110AC_ARG_WITH(threads,
111[ --with-threads multithreading support (on)])
112AC_ARG_WITH(thread-alloc,
113[ --with-thread-alloc per-thread malloc hooks (off)])
114AC_ARG_WITH(tree,
115[ --with-tree DOM like tree manipulation APIs (on)])
116AC_ARG_WITH(valid,
117[ --with-valid DTD validation support (on)])
118AC_ARG_WITH(writer,
119[ --with-writer xmlWriter serialization interface (on)])
120AC_ARG_WITH(xinclude,
121[ --with-xinclude XInclude 1.0 support (on)])
122AC_ARG_WITH(xpath,
123[ --with-xpath XPath 1.0 support (on)])
124AC_ARG_WITH(xptr,
125[ --with-xptr XPointer support (on)])
126AC_ARG_WITH(xptr-locs,
127[ --with-xptr-locs XPointer ranges and points (off)])
128AC_ARG_WITH(zlib,
129[ --with-zlib[[=DIR]] use libz in DIR (off)])
130
131AC_ARG_WITH(minimum,
132[ --with-minimum build a minimally sized library (off)])
133AC_ARG_WITH(legacy,
134[ --with-legacy maximum ABI compatibility (off)])
135
136AC_ARG_WITH(tls,
137[ --with-tls thread-local storage (off)])
138
139dnl
140dnl Legacy defaults
141dnl
142if 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
152fi
153
154dnl
155dnl hard dependencies on options
156dnl
157if 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
166fi
167if 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
176fi
177if 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
190fi
191if 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
200fi
201if 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
210fi
211if 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
216fi
217if 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
222fi
223if 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
228fi
229
230if 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
264else
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
293fi
294
295XML_PRIVATE_LIBS=
296XML_PRIVATE_CFLAGS=
297XML_PC_LIBS=
298XML_PC_REQUIRES=
299
300dnl
301dnl Checks for header files.
302dnl
303AC_CHECK_HEADERS([stdint.h])
304AC_CHECK_HEADERS([fcntl.h unistd.h sys/stat.h])
305AC_CHECK_HEADERS([sys/mman.h])
306AC_CHECK_HEADERS([sys/time.h sys/timeb.h])
307AC_CHECK_HEADERS([sys/random.h])
308AC_CHECK_HEADERS([dl.h dlfcn.h])
309AC_CHECK_HEADERS([glob.h])
310AM_CONDITIONAL(WITH_GLOB, test "$ac_cv_header_glob_h" = "yes")
311
312dnl Checks for library functions.
313AC_CHECK_FUNCS([getentropy gettimeofday ftime stat mmap munmap])
314
315AH_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
320dnl
321dnl Checks for inet libraries
322dnl
323if 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
404fi
405
406dnl
407dnl Extra flags
408dnl
409XML_LIBDIR='-L${libdir}'
410XML_INCLUDEDIR='-I${includedir}/libxml2'
411XML_CFLAGS=""
412
413dnl Thread-local storage
414if 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 ])])])
425fi
426
427dnl Checking whether __attribute__((destructor)) is accepted by the compiler
428AC_MSG_CHECKING([whether __attribute__((destructor)) is accepted])
429AC_TRY_COMPILE2([
430void __attribute__((destructor))
431f(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
437dnl
438dnl Linker version scripts for symbol versioning
439dnl
440VERSION_SCRIPT_FLAGS=
441# lt_cv_prog_gnu_ld is from libtool 2.+
442if 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
453else
454 case $host in
455 *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
456 esac
457fi
458AC_SUBST(VERSION_SCRIPT_FLAGS)
459AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
460
461dnl
462dnl Workaround for native compilers
463dnl HP : http://bugs.gnome.org/db/31/3163.html
464dnl DEC : Enable NaN/Inf
465dnl
466if 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
478else
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
491fi
492case ${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 ;;
507esac
508
509
510dnl
511dnl Simple API modules
512dnl
513
514if test "$with_tree" = "no" ; then
515 echo Disabling DOM like tree manipulation APIs
516 WITH_TREE=0
517else
518 WITH_TREE=1
519fi
520AC_SUBST(WITH_TREE)
521
522if test "$with_ftp" != "yes" ; then
523 WITH_FTP=0
524else
525 echo Enabling FTP support
526 WITH_FTP=1
527fi
528AC_SUBST(WITH_FTP)
529AM_CONDITIONAL(WITH_FTP_SOURCES, test "$WITH_FTP" = "1")
530
531if test "$with_http" != "yes" ; then
532 WITH_HTTP=0
533else
534 echo Enabling HTTP support
535 WITH_HTTP=1
536fi
537AC_SUBST(WITH_HTTP)
538AM_CONDITIONAL(WITH_HTTP_SOURCES, test "$WITH_HTTP" = "1")
539
540if test "$with_legacy" != "yes" ; then
541 WITH_LEGACY=0
542else
543 echo Enabling deprecated APIs
544 WITH_LEGACY=1
545fi
546AC_SUBST(WITH_LEGACY)
547AM_CONDITIONAL(WITH_LEGACY_SOURCES, test "$WITH_LEGACY" = "1")
548
549if test "$with_reader" = "no" ; then
550 echo Disabling the xmlReader parsing interface
551 WITH_READER=0
552else
553 WITH_READER=1
554fi
555AC_SUBST(WITH_READER)
556AM_CONDITIONAL(WITH_READER_SOURCES, test "$WITH_READER" = "1")
557
558if test "$with_writer" = "no" ; then
559 echo Disabling the xmlWriter saving interface
560 WITH_WRITER=0
561else
562 WITH_WRITER=1
563fi
564AC_SUBST(WITH_WRITER)
565AM_CONDITIONAL(WITH_WRITER_SOURCES, test "$WITH_WRITER" = "1")
566
567if test "$with_pattern" = "no" ; then
568 echo Disabling the xmlPattern parsing interface
569 WITH_PATTERN=0
570else
571 WITH_PATTERN=1
572fi
573AC_SUBST(WITH_PATTERN)
574AM_CONDITIONAL(WITH_PATTERN_SOURCES, test "$WITH_PATTERN" = "1")
575
576if test "$with_sax1" = "no" ; then
577 echo Disabling the older SAX1 interface
578 WITH_SAX1=0
579else
580 WITH_SAX1=1
581fi
582AC_SUBST(WITH_SAX1)
583AM_CONDITIONAL(WITH_SAX1_SOURCES, test "$WITH_SAX1" = "1")
584
585if test "$with_push" = "no" ; then
586 echo Disabling the PUSH parser interfaces
587 WITH_PUSH=0
588else
589 WITH_PUSH=1
590fi
591AC_SUBST(WITH_PUSH)
592
593if test "$with_html" = "no" ; then
594 echo Disabling HTML support
595 WITH_HTML=0
596else
597 WITH_HTML=1
598fi
599AC_SUBST(WITH_HTML)
600AM_CONDITIONAL(WITH_HTML_SOURCES, test "$WITH_HTML" = "1")
601
602if test "$with_valid" = "no" ; then
603 echo Disabling DTD validation support
604 WITH_VALID=0
605else
606 WITH_VALID=1
607fi
608AC_SUBST(WITH_VALID)
609AM_CONDITIONAL(WITH_VALID_SOURCES, test "$WITH_VALID" = "1")
610
611if test "$with_catalog" = "no" ; then
612 echo Disabling Catalog support
613 WITH_CATALOG=0
614else
615 WITH_CATALOG=1
616fi
617AC_SUBST(WITH_CATALOG)
618AM_CONDITIONAL(WITH_CATALOG_SOURCES, test "$WITH_CATALOG" = "1")
619
620if test "$with_xptr" = "no" ; then
621 echo Disabling XPointer support
622 WITH_XPTR=0
623 WITH_XPTR_LOCS=0
624else
625 WITH_XPTR=1
626fi
627AC_SUBST(WITH_XPTR)
628AM_CONDITIONAL(WITH_XPTR_SOURCES, test "$WITH_XPTR" = "1")
629
630if test "$with_xptr_locs" != "yes" ; then
631 WITH_XPTR_LOCS=0
632else
633 echo Enabling Xpointer locations support
634 WITH_XPTR_LOCS=1
635fi
636AC_SUBST(WITH_XPTR_LOCS)
637
638if test "$with_c14n" = "no" ; then
639 echo Disabling C14N support
640 WITH_C14N=0
641else
642 WITH_C14N=1
643fi
644AC_SUBST(WITH_C14N)
645AM_CONDITIONAL(WITH_C14N_SOURCES, test "$WITH_C14N" = "1")
646
647if test "$with_xinclude" = "no" ; then
648 echo Disabling XInclude support
649 WITH_XINCLUDE=0
650else
651 WITH_XINCLUDE=1
652fi
653AC_SUBST(WITH_XINCLUDE)
654AM_CONDITIONAL(WITH_XINCLUDE_SOURCES, test "$WITH_XINCLUDE" = "1")
655
656if test "$with_schematron" = "no" ; then
657 echo "Disabling Schematron support"
658 WITH_SCHEMATRON=0
659else
660 WITH_SCHEMATRON=1
661fi
662AC_SUBST(WITH_SCHEMATRON)
663AM_CONDITIONAL(WITH_SCHEMATRON_SOURCES, test "$WITH_SCHEMATRON" = "1")
664
665if test "$with_xpath" = "no" ; then
666 echo Disabling XPATH support
667 WITH_XPATH=0
668else
669 WITH_XPATH=1
670fi
671AC_SUBST(WITH_XPATH)
672AM_CONDITIONAL(WITH_XPATH_SOURCES, test "$WITH_XPATH" = "1")
673
674if test "$with_output" = "no" ; then
675 echo Disabling serialization/saving support
676 WITH_OUTPUT=0
677else
678 WITH_OUTPUT=1
679fi
680AC_SUBST(WITH_OUTPUT)
681AM_CONDITIONAL(WITH_OUTPUT_SOURCES, test "$WITH_OUTPUT" = "1")
682
683if test "$WITH_ICONV" != "1" && test "$with_iso8859x" = "no" ; then
684 echo Disabling ISO8859X support
685 WITH_ISO8859X=0
686else
687 WITH_ISO8859X=1
688fi
689AC_SUBST(WITH_ISO8859X)
690
691if test "$with_schemas" = "no" ; then
692 echo "Disabling Schemas/Relax-NG support"
693 WITH_SCHEMAS=0
694else
695 WITH_SCHEMAS=1
696fi
697AC_SUBST(WITH_SCHEMAS)
698AM_CONDITIONAL(WITH_SCHEMAS_SOURCES, test "$WITH_SCHEMAS" = "1")
699
700if test "$with_regexps" = "no" ; then
701 echo Disabling Regexps support
702 WITH_REGEXPS=0
703else
704 WITH_REGEXPS=1
705fi
706AC_SUBST(WITH_REGEXPS)
707AM_CONDITIONAL(WITH_REGEXPS_SOURCES, test "$WITH_REGEXPS" = "1")
708
709if test "$with_debug" = "no" ; then
710 echo Disabling DEBUG support
711 WITH_DEBUG=0
712else
713 WITH_DEBUG=1
714fi
715AC_SUBST(WITH_DEBUG)
716AM_CONDITIONAL(WITH_DEBUG_SOURCES, test "$WITH_DEBUG" = "1")
717
718dnl
719dnl Check for Python
720dnl
721
722AS_IF([test "x$with_python" != "xno"], [
723 AM_PATH_PYTHON
724 PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
725])
726AM_CONDITIONAL([WITH_PYTHON], [test "x$with_python" != "xno"])
727
728dnl
729dnl Extra Python flags for Windows
730dnl
731PYTHON_LDFLAGS=
732if 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
741fi
742AC_SUBST(PYTHON_LDFLAGS)
743
744dnl
745dnl Check for DSO support
746dnl
747WITH_MODULES=0
748
749if 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
782fi
783
784AC_SUBST(WITH_MODULES)
785AC_SUBST(MODULE_PLATFORM_LIBS)
786AC_SUBST(MODULE_EXTENSION)
787AM_CONDITIONAL(WITH_MODULES_SOURCES, test "$WITH_MODULES" = "1")
788
789dnl
790dnl Thread-related stuff
791dnl
792THREAD_LIBS=""
793BASE_THREAD_LIBS=""
794WITH_THREADS=0
795WITH_THREAD_ALLOC=0
796
797if test "$with_threads" = "no" ; then
798 echo Disabling multithreaded support
799else
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
828fi
829if test "$with_thread_alloc" = "yes" && test "$WITH_THREADS" = "1" ; then
830 WITH_THREAD_ALLOC=1
831fi
832
833AC_SUBST(THREAD_LIBS)
834AC_SUBST(BASE_THREAD_LIBS)
835AC_SUBST(WITH_THREADS)
836AC_SUBST(WITH_THREAD_ALLOC)
837
838dnl
839dnl xmllint shell history
840dnl
841if 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
876fi
877AC_SUBST(RDL_CFLAGS)
878AC_SUBST(RDL_LIBS)
879
880dnl
881dnl Checks for zlib library.
882dnl
883WITH_ZLIB=0
884
885if 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}"
929fi
930AC_SUBST(WITH_ZLIB)
931
932dnl
933dnl Checks for lzma library.
934dnl
935WITH_LZMA=0
936
937if 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}"
979fi
980AC_SUBST(WITH_LZMA)
981AM_CONDITIONAL(WITH_LZMA_SOURCES, test "$WITH_LZMA" = "1")
982
983dnl
984dnl Checks for iconv library.
985dnl
986WITH_ICONV=0
987
988if test "$with_iconv" = "no" ; then
989 echo Disabling ICONV support
990else
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
1024fi
1025AC_SUBST(WITH_ICONV)
1026AC_SUBST(ICONV_CFLAGS)
1027
1028dnl
1029dnl Checks for ICU library.
1030dnl
1031WITH_ICU=0
1032
1033if 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}"
1079fi
1080AC_SUBST(WITH_ICU)
1081
1082dnl
1083dnl Crypto libraries
1084dnl
1085case "$host" in
1086 *-*-mingw*)
1087 CRYPTO_LIBS="-lbcrypt"
1088 ;;
1089esac
1090
1091XML_LIBS="-lxml2"
1092XML_LIBTOOLLIBS="libxml2.la"
1093NON_PC_LIBS="${THREAD_LIBS} ${ICONV_LIBS} ${LIBM} ${NET_LIBS} ${CRYPTO_LIBS}"
1094XML_PC_LIBS="${XML_PC_LIBS} ${NON_PC_LIBS}"
1095XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${NON_PC_LIBS}"
1096XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${ICONV_CFLAGS}"
1097
1098dnl When static-only:
1099dnl * Duplicate xml-config static --libs into --dynamic.
1100dnl * Fold pkg-config private fields into main fields.
1101if test "x$enable_shared" = "xno"; then
1102 XML_PRIVATE_LIBS_NO_SHARED="${XML_PRIVATE_LIBS}"
1103 XML_PC_PRIVATE=
1104 XML_PC_LIBS_PRIVATE=
1105else
1106 XML_PRIVATE_LIBS_NO_SHARED=
1107 XML_PC_PRIVATE=".private"
1108 XML_PC_LIBS_PRIVATE="
1109Libs.private:"
1110fi
1111AC_SUBST(XML_PRIVATE_LIBS_NO_SHARED)
1112AC_SUBST(XML_PC_PRIVATE)
1113AC_SUBST(XML_PC_LIBS_PRIVATE)
1114AM_SUBST_NOTMAKE(XML_PRIVATE_LIBS_NO_SHARED)
1115AM_SUBST_NOTMAKE(XML_PC_PRIVATE)
1116AM_SUBST_NOTMAKE(XML_PC_LIBS_PRIVATE)
1117
1118AC_SUBST(XML_PC_LIBS)
1119AC_SUBST(XML_PC_REQUIRES)
1120AM_SUBST_NOTMAKE(XML_PC_LIBS)
1121AM_SUBST_NOTMAKE(XML_PC_REQUIRES)
1122
1123AC_SUBST(AM_CFLAGS)
1124AC_SUBST(AM_LDFLAGS)
1125AC_SUBST(XML_CFLAGS)
1126
1127AC_SUBST(XML_LIBDIR)
1128AC_SUBST(XML_LIBS)
1129AC_SUBST(XML_PRIVATE_LIBS)
1130AC_SUBST(XML_PRIVATE_CFLAGS)
1131AC_SUBST(XML_LIBTOOLLIBS)
1132AC_SUBST(XML_INCLUDEDIR)
1133
1134dnl for the spec file
1135RELDATE=`date +'%a %b %e %Y'`
1136AC_SUBST(RELDATE)
1137
1138# keep on one line for cygwin c.f. #130896
1139AC_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])
1140AC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py])
1141AC_CONFIG_FILES([xml2-config], [chmod +x xml2-config])
1142AC_OUTPUT
1143
1144if 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 "================================================================"
1150fi
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette