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