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