Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
Daniel Veillard | 5d04ad1 | 2012-09-11 17:17:15 +0800 | [diff] [blame] | 2 | AC_PREREQ([2.63]) |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 3 | AC_INIT |
| 4 | AC_CONFIG_SRCDIR([entities.c]) |
| 5 | AC_CONFIG_HEADERS([config.h]) |
Daniel Veillard | 3157e51 | 2010-03-09 11:32:46 +0100 | [diff] [blame] | 6 | AC_CONFIG_MACRO_DIR([m4]) |
Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 7 | AC_CANONICAL_HOST |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 8 | |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 9 | LIBXML_MAJOR_VERSION=2 |
Daniel Veillard | aa017c5 | 2012-08-10 10:42:56 +0800 | [diff] [blame] | 10 | LIBXML_MINOR_VERSION=9 |
Daniel Veillard | f4e5a69 | 2013-04-19 15:36:36 +0800 | [diff] [blame] | 11 | LIBXML_MICRO_VERSION=1 |
Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 12 | LIBXML_MICRO_VERSION_SUFFIX= |
Daniel Veillard | 4fc5281 | 2003-09-01 20:33:13 +0000 | [diff] [blame] | 13 | LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 14 | LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION |
| 15 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 16 | LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` |
| 17 | |
Daniel Veillard | 9cb1b64 | 2007-01-03 15:07:44 +0000 | [diff] [blame] | 18 | if test -f CVS/Entries ; then |
Daniel Veillard | dab93ea | 2004-08-20 16:47:10 +0000 | [diff] [blame] | 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 |
Daniel Veillard | 9cb1b64 | 2007-01-03 15:07:44 +0000 | [diff] [blame] | 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 |
veillard | 97c7be6 | 2009-05-12 08:43:54 +0200 | [diff] [blame] | 32 | else if test -d .git ; then |
Christian Dywan | 040dcb5 | 2012-05-10 22:55:07 +0800 | [diff] [blame] | 33 | extra=`git describe 2>/dev/null | sed 's+LIBXML[[0-9.]]*-++'` |
veillard | 97c7be6 | 2009-05-12 08:43:54 +0200 | [diff] [blame] | 34 | echo extra=$extra |
| 35 | if test "$extra" != "" |
| 36 | then |
| 37 | LIBXML_VERSION_EXTRA="-GIT$extra" |
| 38 | fi |
| 39 | fi |
Daniel Veillard | 9cb1b64 | 2007-01-03 15:07:44 +0000 | [diff] [blame] | 40 | fi |
William M. Brack | f402549 | 2004-08-18 21:08:46 +0000 | [diff] [blame] | 41 | fi |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 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) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 47 | AC_SUBST(LIBXML_VERSION_NUMBER) |
William M. Brack | f402549 | 2004-08-18 21:08:46 +0000 | [diff] [blame] | 48 | AC_SUBST(LIBXML_VERSION_EXTRA) |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 49 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 50 | VERSION=${LIBXML_VERSION} |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 51 | |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 52 | AM_INIT_AUTOMAKE(libxml2, $VERSION) |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 53 | |
Stefan Kost | c9c939d | 2011-05-10 10:34:41 +0300 | [diff] [blame] | 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 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 59 | dnl Checks for programs. |
| 60 | AC_PROG_CC |
| 61 | AC_PROG_INSTALL |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 62 | AC_PROG_LN_S |
Adrian Bunk | 64b0d60 | 2010-11-04 09:43:31 +0100 | [diff] [blame] | 63 | AC_PROG_MKDIR_P |
Sebastian Wilhelmi | a44c8a4 | 1998-08-07 08:38:58 +0000 | [diff] [blame] | 64 | AC_PROG_CPP |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 65 | AC_PATH_PROG(MV, mv, /bin/mv) |
| 66 | AC_PATH_PROG(TAR, tar, /bin/tar) |
William M. Brack | 1826d0a | 2004-07-21 09:03:57 +0000 | [diff] [blame] | 67 | AC_PATH_PROG(PERL, perl, /usr/bin/perl) |
Daniel Veillard | 33a2de9 | 2006-10-11 08:33:22 +0000 | [diff] [blame] | 68 | AC_PATH_PROG(WGET, wget, /usr/bin/wget) |
Daniel Veillard | 8b817da | 2004-09-30 09:19:33 +0000 | [diff] [blame] | 69 | AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint) |
Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 70 | AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) |
Philip Withnall | f3f86ff | 2013-10-28 17:24:02 +0000 | [diff] [blame] | 71 | PKG_PROG_PKG_CONFIG |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 72 | |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 73 | LT_INIT |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 74 | |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 75 | dnl |
Daniel Veillard | 8ed1072 | 2009-08-20 19:17:36 +0200 | [diff] [blame] | 76 | dnl if the system support linker version scripts for symbol versioning |
| 77 | dnl then add it |
| 78 | dnl |
| 79 | VERSION_SCRIPT_FLAGS= |
Roumen Petrov | f39adc2 | 2010-03-11 14:49:13 +0100 | [diff] [blame] | 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 |
Daniel Veillard | 8ed1072 | 2009-08-20 19:17:36 +0200 | [diff] [blame] | 88 | AC_SUBST(VERSION_SCRIPT_FLAGS) |
Daniel Veillard | 0081987 | 2010-11-04 21:53:14 +0100 | [diff] [blame] | 89 | AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"]) |
Daniel Veillard | 8ed1072 | 2009-08-20 19:17:36 +0200 | [diff] [blame] | 90 | |
| 91 | dnl |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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 |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 95 | dnl |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 96 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 97 | dnl |
| 98 | dnl zlib option might change flags, so we save them initially |
| 99 | dnl |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 100 | _cppflags="${CPPFLAGS}" |
Arfrever Frehtes Taifersar Arahesis | 1f01f49 | 2012-08-28 22:16:50 +0800 | [diff] [blame] | 101 | _libs="${LIBS}" |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 102 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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 ? |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 120 | AC_ARG_WITH(html-dir, AS_HELP_STRING([--with-html-dir=path], |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 121 | [path to base html directory, default $datadir/doc/html]), |
| 122 | [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc']) |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 123 | |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 124 | AC_ARG_WITH(html-subdir, AS_HELP_STRING([--with-html-subdir=path], |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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)]) |
Giuseppe Iuculano | 48f7dcb | 2010-11-04 17:42:42 +0100 | [diff] [blame] | 133 | AC_ARG_WITH(icu, |
| 134 | [ --with-icu add ICU support (off)]) |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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]) |
Jonas Eriksson | fcb1bb5 | 2014-03-06 09:13:17 +0100 | [diff] [blame] | 151 | AC_ARG_WITH(python_install_dir, |
| 152 | [ --with-python-install-dir=DIR |
| 153 | install Python bindings in DIR]) |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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" |
Arfrever Frehtes Taifersar Arahesis | 1f01f49 | 2012-08-28 22:16:50 +0800 | [diff] [blame] | 161 | LIBS="${LIBS} -L$withval/lib" |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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, |
Daniel Veillard | 39e5c89 | 2005-07-03 22:48:50 +0000 | [diff] [blame] | 171 | [ --with-schemas add Relax-NG and Schemas support (on)]) |
Daniel Veillard | ed6c549 | 2005-07-23 15:00:22 +0000 | [diff] [blame] | 172 | AC_ARG_WITH(schematron, |
| 173 | [ --with-schematron add Schematron support (on)]) |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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)]) |
Daniel Veillard | f6b71bd | 2005-01-04 17:50:14 +0000 | [diff] [blame] | 190 | AC_ARG_WITH(modules, |
| 191 | [ --with-modules add the dynamic modules support (on)]) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 192 | AC_ARG_WITH(zlib, |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 193 | [ --with-zlib[[=DIR]] use libz in DIR],[ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 194 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 195 | Z_DIR=$withval |
| 196 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
Arfrever Frehtes Taifersar Arahesis | 1f01f49 | 2012-08-28 22:16:50 +0800 | [diff] [blame] | 197 | LIBS="${LIBS} -L$withval/lib" |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 198 | fi |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 199 | ]) |
Anders F Bjorklund | eae5261 | 2011-09-18 16:59:13 +0200 | [diff] [blame] | 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" |
Arfrever Frehtes Taifersar Arahesis | 1f01f49 | 2012-08-28 22:16:50 +0800 | [diff] [blame] | 205 | LIBS="${LIBS} -L$withval/lib" |
Anders F Bjorklund | eae5261 | 2011-09-18 16:59:13 +0200 | [diff] [blame] | 206 | fi |
| 207 | ]) |
Daniel Veillard | bfa5cf1 | 2008-08-27 15:33:28 +0000 | [diff] [blame] | 208 | AC_ARG_WITH(coverage, |
| 209 | [ --with-coverage build for code coverage with GCC (off)]) |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 210 | |
Daniel Veillard | b40744e | 2008-10-17 13:26:44 +0000 | [diff] [blame] | 211 | AC_ARG_ENABLE(rebuild-docs, |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 212 | [ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=no]]]) |
Daniel Richard | 878ec9d | 2012-09-07 14:52:17 +0800 | [diff] [blame] | 213 | if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then |
| 214 | AC_MSG_ERROR([cannot rebuild docs when builddir != srcdir]) |
| 215 | fi |
Daniel Veillard | 28cc42d | 2012-08-10 10:00:18 +0800 | [diff] [blame] | 216 | AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"]) |
Daniel Veillard | b40744e | 2008-10-17 13:26:44 +0000 | [diff] [blame] | 217 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 218 | dnl |
Daniel Veillard | 39e5c89 | 2005-07-03 22:48:50 +0000 | [diff] [blame] | 219 | dnl hard dependancies on options |
| 220 | dnl |
| 221 | if test "$with_schemas" = "yes" |
| 222 | then |
| 223 | with_pattern=yes |
Daniel Veillard | c51f51c | 2007-05-02 16:25:45 +0000 | [diff] [blame] | 224 | with_regexps=yes |
Daniel Veillard | 39e5c89 | 2005-07-03 22:48:50 +0000 | [diff] [blame] | 225 | fi |
Daniel Veillard | ed6c549 | 2005-07-23 15:00:22 +0000 | [diff] [blame] | 226 | if test "$with_schematron" = "yes" |
| 227 | then |
| 228 | with_pattern=yes |
Nicolas Le Cam | 1af8b7b | 2013-06-14 22:20:37 +0200 | [diff] [blame] | 229 | with_tree=yes |
Daniel Veillard | ed6c549 | 2005-07-23 15:00:22 +0000 | [diff] [blame] | 230 | with_xpath=yes |
| 231 | fi |
Daniel Veillard | 39e5c89 | 2005-07-03 22:48:50 +0000 | [diff] [blame] | 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 |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 241 | dnl option to build a minimal libxml2 library |
| 242 | dnl |
| 243 | if test "$with_minimum" = "yes" |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 244 | then |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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 |
Daniel Veillard | c51f51c | 2007-05-02 16:25:45 +0000 | [diff] [blame] | 323 | if test "$with_regexps" = "" |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 324 | then |
Daniel Veillard | c51f51c | 2007-05-02 16:25:45 +0000 | [diff] [blame] | 325 | with_regexps=no |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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 |
Daniel Veillard | ed6c549 | 2005-07-23 15:00:22 +0000 | [diff] [blame] | 339 | if test "$with_schematron" = "" |
| 340 | then |
| 341 | with_schematron=no |
| 342 | fi |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 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 |
Daniel Veillard | f6b71bd | 2005-01-04 17:50:14 +0000 | [diff] [blame] | 379 | if test "$with_modules" = "" |
| 380 | then |
| 381 | with_modules=no |
| 382 | fi |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 383 | fi |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 384 | |
| 385 | echo Checking zlib |
| 386 | |
| 387 | dnl Checks for zlib library. |
| 388 | |
Daniel Veillard | 75acfee | 2006-07-13 06:29:56 +0000 | [diff] [blame] | 389 | WITH_ZLIB=0 |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 390 | if test "$with_zlib" = "no"; then |
| 391 | echo "Disabling compression support" |
| 392 | else |
Daniel Veillard | 3fbe8e3 | 2001-10-06 13:30:33 +0000 | [diff] [blame] | 393 | AC_CHECK_HEADERS(zlib.h, |
| 394 | AC_CHECK_LIB(z, gzread,[ |
Daniel Veillard | 75acfee | 2006-07-13 06:29:56 +0000 | [diff] [blame] | 395 | AC_DEFINE([HAVE_LIBZ], [1], [Have compression library]) |
| 396 | WITH_ZLIB=1 |
Daniel Veillard | 3fbe8e3 | 2001-10-06 13:30:33 +0000 | [diff] [blame] | 397 | if test "x${Z_DIR}" != "x"; then |
| 398 | Z_CFLAGS="-I${Z_DIR}/include" |
| 399 | Z_LIBS="-L${Z_DIR}/lib -lz" |
| 400 | [case ${host} in |
| 401 | *-*-solaris*) |
| 402 | Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" |
| 403 | ;; |
| 404 | esac] |
| 405 | else |
| 406 | Z_LIBS="-lz" |
| 407 | fi])) |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 408 | fi |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 409 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 410 | AC_SUBST(Z_CFLAGS) |
| 411 | AC_SUBST(Z_LIBS) |
Daniel Veillard | 75acfee | 2006-07-13 06:29:56 +0000 | [diff] [blame] | 412 | AC_SUBST(WITH_ZLIB) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 413 | |
Anders F Bjorklund | eae5261 | 2011-09-18 16:59:13 +0200 | [diff] [blame] | 414 | echo Checking lzma |
| 415 | |
| 416 | dnl Checks for lzma library. |
| 417 | |
| 418 | WITH_LZMA=0 |
| 419 | if test "$with_lzma" = "no"; then |
| 420 | echo "Disabling compression support" |
| 421 | else |
Philip Withnall | f3f86ff | 2013-10-28 17:24:02 +0000 | [diff] [blame] | 422 | # Try pkg-config first so that static linking works. |
| 423 | # If this succeeeds, we ignore the WITH_LZMA directory. |
| 424 | PKG_CHECK_MODULES([LZMA],[liblzma], |
| 425 | [have_liblzma=yes], |
| 426 | [have_liblzma=no]) |
| 427 | |
| 428 | # If pkg-config failed, fall back to AC_CHECK_LIB. This |
| 429 | # will not pick up the necessary LIBS flags for liblzma's |
| 430 | # private dependencies, though, so static linking may fail. |
| 431 | if test "x$have_liblzma" = "xno"; then |
| 432 | AC_CHECK_HEADERS(lzma.h, |
| 433 | AC_CHECK_LIB(lzma, lzma_code,[ |
| 434 | have_liblzma=yes |
| 435 | if test "x${LZMA_DIR}" != "x"; then |
| 436 | LZMA_CFLAGS="-I${LZMA_DIR}/include" |
| 437 | LZMA_LIBS="-L${LZMA_DIR}/lib -llzma" |
| 438 | else |
| 439 | LZMA_LIBS="-llzma" |
| 440 | fi], |
| 441 | [have_liblzma=no])) |
| 442 | fi |
| 443 | |
| 444 | # Found the library via either method? |
| 445 | if test "x$have_liblzma" = "xyes"; then |
| 446 | AC_DEFINE([HAVE_LIBLZMA], [1], [Have compression library]) |
| 447 | WITH_LZMA=1 |
| 448 | fi |
Anders F Bjorklund | eae5261 | 2011-09-18 16:59:13 +0200 | [diff] [blame] | 449 | fi |
| 450 | |
| 451 | AC_SUBST(LZMA_CFLAGS) |
| 452 | AC_SUBST(LZMA_LIBS) |
| 453 | AC_SUBST(WITH_LZMA) |
| 454 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 455 | CPPFLAGS=${_cppflags} |
Arfrever Frehtes Taifersar Arahesis | 1f01f49 | 2012-08-28 22:16:50 +0800 | [diff] [blame] | 456 | LIBS=${_libs} |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 457 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 458 | echo Checking headers |
| 459 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 460 | dnl Checks for header files. |
| 461 | AC_HEADER_DIRENT |
| 462 | AC_HEADER_STDC |
Daniel Veillard | 817e70b | 2002-11-19 22:28:48 +0000 | [diff] [blame] | 463 | AC_CHECK_HEADERS([fcntl.h]) |
| 464 | AC_CHECK_HEADERS([unistd.h]) |
| 465 | AC_CHECK_HEADERS([ctype.h]) |
| 466 | AC_CHECK_HEADERS([dirent.h]) |
| 467 | AC_CHECK_HEADERS([errno.h]) |
| 468 | AC_CHECK_HEADERS([malloc.h]) |
| 469 | AC_CHECK_HEADERS([stdarg.h]) |
| 470 | AC_CHECK_HEADERS([sys/stat.h]) |
| 471 | AC_CHECK_HEADERS([sys/types.h]) |
Daniel Veillard | 7f4547c | 2008-10-03 07:58:23 +0000 | [diff] [blame] | 472 | AC_CHECK_HEADERS([stdint.h]) |
Daniel Mustieles | bde9c35 | 2012-03-19 21:39:58 +0100 | [diff] [blame] | 473 | AC_CHECK_HEADERS([inttypes.h]) |
Daniel Veillard | 817e70b | 2002-11-19 22:28:48 +0000 | [diff] [blame] | 474 | AC_CHECK_HEADERS([time.h]) |
| 475 | AC_CHECK_HEADERS([ansidecl.h]) |
| 476 | AC_CHECK_HEADERS([ieeefp.h]) |
| 477 | AC_CHECK_HEADERS([nan.h]) |
| 478 | AC_CHECK_HEADERS([math.h]) |
Daniel Veillard | ebe48c6 | 2003-12-03 12:12:27 +0000 | [diff] [blame] | 479 | AC_CHECK_HEADERS([limits.h]) |
Daniel Veillard | 817e70b | 2002-11-19 22:28:48 +0000 | [diff] [blame] | 480 | AC_CHECK_HEADERS([fp_class.h]) |
| 481 | AC_CHECK_HEADERS([float.h]) |
| 482 | AC_CHECK_HEADERS([stdlib.h]) |
| 483 | AC_CHECK_HEADERS([sys/socket.h], [], [], |
| 484 | [#if HAVE_SYS_TYPES_H |
| 485 | # include <sys/types.h> |
| 486 | # endif |
| 487 | ]) |
| 488 | AC_CHECK_HEADERS([netinet/in.h], [], [], |
| 489 | [#if HAVE_SYS_TYPES_H |
| 490 | # include <sys/types.h> |
| 491 | # endif |
| 492 | ]) |
| 493 | AC_CHECK_HEADERS([arpa/inet.h], [], [], |
| 494 | [#if HAVE_SYS_TYPES_H |
| 495 | # include <sys/types.h> |
| 496 | # endif |
| 497 | #if HAVE_ARPA_INET_H |
| 498 | # include <arpa/inet.h> |
| 499 | # endif |
| 500 | ]) |
| 501 | AC_CHECK_HEADERS([netdb.h]) |
| 502 | AC_CHECK_HEADERS([sys/time.h]) |
| 503 | AC_CHECK_HEADERS([sys/select.h]) |
Raphael Prevost | 48b60c3 | 2009-08-23 13:11:01 +0200 | [diff] [blame] | 504 | AC_CHECK_HEADERS([poll.h]) |
Daniel Veillard | 817e70b | 2002-11-19 22:28:48 +0000 | [diff] [blame] | 505 | AC_CHECK_HEADERS([sys/mman.h]) |
| 506 | AC_CHECK_HEADERS([sys/timeb.h]) |
| 507 | AC_CHECK_HEADERS([signal.h]) |
| 508 | AC_CHECK_HEADERS([arpa/nameser.h], [], [], |
| 509 | [#if HAVE_SYS_TYPES_H |
| 510 | # include <sys/types.h> |
| 511 | # endif |
| 512 | ]) |
| 513 | AC_CHECK_HEADERS([resolv.h], [], [], |
| 514 | [#if HAVE_SYS_TYPES_H |
| 515 | # include <sys/types.h> |
| 516 | # endif |
| 517 | #if HAVE_NETINET_IN_H |
| 518 | # include <netinet/in.h> |
| 519 | # endif |
| 520 | #if HAVE_ARPA_NAMESER_H |
| 521 | # include <arpa/nameser.h> |
| 522 | # endif |
| 523 | ]) |
Daniel Veillard | dcd9390 | 2005-01-13 11:25:15 +0000 | [diff] [blame] | 524 | AC_CHECK_HEADERS([dl.h]) |
| 525 | AC_CHECK_HEADERS([dlfcn.h]) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 526 | |
Daniel Veillard | fc97906 | 2004-03-04 22:07:16 +0000 | [diff] [blame] | 527 | |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 528 | echo Checking types |
| 529 | |
| 530 | AC_TYPE_UINT32_T |
| 531 | |
| 532 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 533 | echo Checking libraries |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 534 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 535 | dnl Checks for library functions. |
| 536 | AC_FUNC_STRFTIME |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 537 | AC_CHECK_FUNCS(strdup strndup strerror) |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 538 | AC_CHECK_FUNCS(finite isnand fp_class class fpclass) |
Daniel Veillard | 90bc371 | 2002-03-07 15:12:58 +0000 | [diff] [blame] | 539 | AC_CHECK_FUNCS(strftime localtime gettimeofday ftime) |
Daniel Veillard | 068a965 | 2001-06-07 15:30:26 +0000 | [diff] [blame] | 540 | AC_CHECK_FUNCS(stat _stat signal) |
Daniel Veillard | d495e6a | 2012-05-20 20:48:34 +0800 | [diff] [blame] | 541 | AC_CHECK_FUNCS(rand rand_r srand time) |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 542 | AC_CHECK_FUNCS(isascii mmap munmap putenv) |
| 543 | |
| 544 | AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */ |
| 545 | #if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) |
| 546 | # undef /**/ HAVE_MMAP |
| 547 | #endif]) |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 548 | |
William M. Brack | f4caa5e | 2005-10-20 09:04:05 +0000 | [diff] [blame] | 549 | dnl Checking for va_copy availability |
| 550 | AC_MSG_CHECKING([for va_copy]) |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 551 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> |
| 552 | va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])], |
William M. Brack | f4caa5e | 2005-10-20 09:04:05 +0000 | [diff] [blame] | 553 | have_va_copy=yes, |
| 554 | have_va_copy=no) |
| 555 | AC_MSG_RESULT($have_va_copy) |
| 556 | if test x"$have_va_copy" = x"yes"; then |
| 557 | AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) |
| 558 | else |
| 559 | AC_MSG_CHECKING([for __va_copy]) |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 560 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> |
| 561 | va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])], |
William M. Brack | f4caa5e | 2005-10-20 09:04:05 +0000 | [diff] [blame] | 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 | fi |
| 568 | fi |
| 569 | |
Patrick Monnerat | d1c0cc9 | 2013-12-12 15:14:47 +0800 | [diff] [blame] | 570 | dnl Checking whether va_list is an array type |
| 571 | AC_MSG_CHECKING([whether va_list is an array type]) |
| 572 | AC_TRY_COMPILE2([ |
| 573 | #include <stdarg.h> |
| 574 | void a(va_list * ap) {}],[ |
| 575 | va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1],[ |
| 576 | AC_MSG_RESULT(no)],[ |
| 577 | AC_MSG_RESULT(yes) |
| 578 | AC_DEFINE([VA_LIST_IS_ARRAY], [1],[Define if va_list is an array type])]) |
| 579 | |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 580 | dnl Checks for inet libraries: |
Daniel Veillard | d4e39ae | 2005-10-28 15:59:14 +0000 | [diff] [blame] | 581 | AC_SEARCH_LIBS(gethostent, [nsl]) |
Scott McCreary | 59f5308 | 2009-08-26 09:55:24 +0200 | [diff] [blame] | 582 | AC_SEARCH_LIBS(setsockopt, [socket net network]) |
Daniel Veillard | d4e39ae | 2005-10-28 15:59:14 +0000 | [diff] [blame] | 583 | AC_SEARCH_LIBS(connect, [inet]) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 584 | |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 585 | dnl Determine what socket length (socklen_t) data type is |
| 586 | AC_MSG_CHECKING([for type of socket length (socklen_t)]) |
| 587 | AC_TRY_COMPILE2([ |
| 588 | #include <stddef.h> |
| 589 | #include <sys/types.h> |
| 590 | #include <sys/socket.h>],[ |
| 591 | (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[ |
| 592 | AC_MSG_RESULT(socklen_t *) |
Daniel Veillard | c284c64 | 2005-03-31 10:24:24 +0000 | [diff] [blame] | 593 | XML_SOCKLEN_T=socklen_t],[ |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 594 | AC_TRY_COMPILE2([ |
| 595 | #include <stddef.h> |
| 596 | #include <sys/types.h> |
| 597 | #include <sys/socket.h>],[ |
| 598 | (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[ |
| 599 | AC_MSG_RESULT(size_t *) |
Daniel Veillard | c284c64 | 2005-03-31 10:24:24 +0000 | [diff] [blame] | 600 | XML_SOCKLEN_T=size_t],[ |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 601 | AC_TRY_COMPILE2([ |
| 602 | #include <stddef.h> |
| 603 | #include <sys/types.h> |
| 604 | #include <sys/socket.h>],[ |
| 605 | (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[ |
| 606 | AC_MSG_RESULT(int *) |
Daniel Veillard | c284c64 | 2005-03-31 10:24:24 +0000 | [diff] [blame] | 607 | XML_SOCKLEN_T=int],[ |
William M. Brack | 2e6b143 | 2004-02-09 15:10:28 +0000 | [diff] [blame] | 608 | AC_MSG_WARN(could not determine) |
Daniel Veillard | c284c64 | 2005-03-31 10:24:24 +0000 | [diff] [blame] | 609 | XML_SOCKLEN_T="int"])])]) |
| 610 | AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is]) |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 611 | |
Patrick Monnerat | d1c0cc9 | 2013-12-12 15:14:47 +0800 | [diff] [blame] | 612 | dnl Checking if gethostbyname() argument is const. |
| 613 | AC_MSG_CHECKING([for const gethostbyname() argument]) |
| 614 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], |
| 615 | [[(void)gethostbyname((const char *)"");]])], |
| 616 | have_gethostbyname_const_arg=yes, |
| 617 | have_gethostbyname_const_arg=no) |
| 618 | AC_MSG_RESULT($have_gethostbyname_const_arg) |
| 619 | if test x"$have_gethostbyname_const_arg" = x"yes"; then |
| 620 | AC_DEFINE([GETHOSTBYNAME_ARG_CAST], [], |
| 621 | [Type cast for the gethostbyname() argument]) |
| 622 | else |
| 623 | AC_DEFINE([GETHOSTBYNAME_ARG_CAST], [(char *)], |
| 624 | [Type cast for the gethostbyname() argument]) |
| 625 | fi |
| 626 | |
| 627 | dnl Checking if send() second argument is const. |
| 628 | AC_MSG_CHECKING([for const send() second argument]) |
| 629 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 630 | #include <sys/socket.h>]], |
| 631 | [[(void)send(1,(const char *)"",1,1);]])], |
| 632 | have_send_const_arg2=yes, |
| 633 | have_send_const_arg2=no) |
| 634 | AC_MSG_RESULT($have_send_const_arg2) |
| 635 | if test x"$have_send_const_arg2" = x"yes"; then |
| 636 | AC_DEFINE([SEND_ARG2_CAST], [], |
| 637 | [Type cast for the send() function 2nd arg]) |
| 638 | else |
| 639 | AC_DEFINE([SEND_ARG2_CAST], [(char *)], |
| 640 | [Type cast for the send() function 2nd arg]) |
| 641 | fi |
| 642 | |
Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 643 | dnl ***********************Checking for availability of IPv6******************* |
| 644 | |
| 645 | AC_MSG_CHECKING([whether to enable IPv6]) |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 646 | AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes) |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 647 | if test "$with_minimum" = "yes" |
| 648 | then |
| 649 | enable_ipv6=no |
| 650 | fi |
Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 651 | if test $enable_ipv6 = yes; then |
| 652 | have_ipv6=no |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 653 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 654 | # include <sys/types.h> |
| 655 | # include <sys/socket.h> |
| 656 | ]], [[ |
Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 657 | struct sockaddr_storage ss; |
| 658 | socket(AF_INET6, SOCK_STREAM, 0) |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 659 | ]])], |
Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 660 | have_ipv6=yes, |
| 661 | have_ipv6=no |
| 662 | ) |
| 663 | AC_MSG_RESULT($have_ipv6) |
| 664 | |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 665 | if test $have_ipv6 = yes; then |
Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 666 | AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6]) |
Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 667 | have_broken_ss_family=no |
| 668 | |
| 669 | dnl ********************************************************************* |
| 670 | dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have |
| 671 | dnl a ss_family member, but rather __ss_family. Let's detect that |
William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 672 | dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these |
| 673 | dnl platforms. However, we should only do this if ss_family is not |
| 674 | dnl present. |
Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 675 | dnl ******************************************************************** |
William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 676 | AC_MSG_CHECKING([struct sockaddr::ss_family]) |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 677 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 678 | # include <sys/types.h> |
| 679 | # include <sys/socket.h> |
| 680 | ]], [[ |
Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 681 | struct sockaddr_storage ss ; |
William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 682 | ss.ss_family = 0 ; |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 683 | ]])], |
William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 684 | have_ss_family=yes, |
| 685 | have_ss_family=no |
Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 686 | ) |
William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 687 | AC_MSG_RESULT($have_ss_family) |
| 688 | if test x$have_ss_family = xno ; then |
| 689 | AC_MSG_CHECKING([broken struct sockaddr::ss_family]) |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 690 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 691 | # include <sys/types.h> |
| 692 | # include <sys/socket.h> |
| 693 | ]], [[ |
William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 694 | struct sockaddr_storage ss ; |
| 695 | ss.__ss_family = 0 ; |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 696 | ]])], |
William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 697 | have_broken_ss_family=yes, |
| 698 | have_broken_ss_family=no |
| 699 | ) |
| 700 | AC_MSG_RESULT($have_broken_ss_family) |
| 701 | if test x$have_broken_ss_family = xyes ; then |
| 702 | AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [], |
| 703 | [Whether struct sockaddr::__ss_family exists]) |
| 704 | AC_DEFINE(ss_family, __ss_family, |
| 705 | [ss_family is not defined here, use __ss_family instead]) |
| 706 | else |
| 707 | AC_MSG_WARN(ss_family and __ss_family not found) |
| 708 | fi |
Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 709 | fi |
Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 710 | |
| 711 | have_getaddrinfo=no |
| 712 | AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes) |
| 713 | if test $have_getaddrinfo != yes; then |
| 714 | for lib in bsd socket inet; do |
| 715 | AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break]) |
| 716 | done |
| 717 | fi |
| 718 | |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 719 | if test $have_getaddrinfo = yes; then |
Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 720 | AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there]) |
Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 721 | fi |
| 722 | fi |
| 723 | fi |
| 724 | |
| 725 | dnl ******************************End IPv6 checks****************************** |
| 726 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 727 | dnl Checks for isnan in libm if not in libc |
Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 728 | AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan, |
Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 729 | [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 730 | |
Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 731 | AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf, |
| 732 | [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 733 | |
| 734 | XML_LIBDIR='-L${libdir}' |
Daniel Veillard | e7dd2b8 | 2002-03-15 18:44:02 +0000 | [diff] [blame] | 735 | XML_INCLUDEDIR='-I${includedir}/libxml2' |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 736 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 737 | dnl |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 738 | dnl Extra flags |
| 739 | dnl |
| 740 | XML_CFLAGS="" |
Daniel Veillard | 357c960 | 2001-05-03 10:49:20 +0000 | [diff] [blame] | 741 | RDL_LIBS="" |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 742 | |
| 743 | dnl |
Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 744 | dnl Workaround for native compilers |
| 745 | dnl HP : http://bugs.gnome.org/db/31/3163.html |
| 746 | dnl DEC : Enable NaN/Inf |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 747 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 748 | if test "${GCC}" != "yes" ; then |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 749 | case "${host}" in |
Daniel Veillard | 6a0baa0 | 2005-12-10 11:11:12 +0000 | [diff] [blame] | 750 | hppa*-*-hpux* ) |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 751 | CFLAGS="${CFLAGS} -Wp,-H30000" |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 752 | ;; |
Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 753 | *-dec-osf* ) |
| 754 | CFLAGS="${CFLAGS} -ieee" |
| 755 | ;; |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 756 | alpha*-*-linux* ) |
| 757 | CFLAGS="${CFLAGS} -ieee" |
| 758 | ;; |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 759 | esac |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 760 | else |
Daniel Veillard | d94849b | 2003-07-28 13:02:24 +0000 | [diff] [blame] | 761 | if test "$with_fexceptions" = "yes" |
| 762 | then |
| 763 | # |
| 764 | # Not activated by default because this inflates the code size |
| 765 | # Used to allow propagation of C++ exceptions through the library |
| 766 | # |
| 767 | CFLAGS="${CFLAGS} -fexceptions" |
| 768 | fi |
Stefan Kost | 85deb48 | 2011-05-10 10:55:07 +0300 | [diff] [blame] | 769 | |
| 770 | # warnings we'd like to see |
| 771 | 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" |
| 772 | # warnings we'd like to supress |
| 773 | CFLAGS="${CFLAGS} -Wno-long-long" |
Daniel Veillard | 14839d5 | 2001-06-06 16:11:56 +0000 | [diff] [blame] | 774 | case "${host}" in |
| 775 | alpha*-*-linux* ) |
| 776 | CFLAGS="${CFLAGS} -mieee" |
| 777 | ;; |
Daniel Veillard | cb5b4d6 | 2002-04-11 08:24:26 +0000 | [diff] [blame] | 778 | alpha*-*-osf* ) |
| 779 | CFLAGS="${CFLAGS} -mieee" |
| 780 | ;; |
Daniel Veillard | 14839d5 | 2001-06-06 16:11:56 +0000 | [diff] [blame] | 781 | esac |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 782 | fi |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 783 | case ${host} in |
| 784 | *-*-solaris*) |
Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 785 | XML_LIBDIR="${XML_LIBDIR} -R${libdir}" |
| 786 | ;; |
Daniel Veillard | d30be4a | 2002-03-28 18:25:31 +0000 | [diff] [blame] | 787 | hppa*-hp-mpeix) |
| 788 | NEED_TRIO=1 |
| 789 | ;; |
Daniel Veillard | 4188ddf | 2006-01-19 08:58:42 +0000 | [diff] [blame] | 790 | *-*-mingw* | *-*-cygwin* | *-*-msvc* ) |
| 791 | # If the host is Windows, and shared libraries are disabled, we |
| 792 | # need to add -DLIBXML_STATIC to CFLAGS in order for linking to |
| 793 | # work properly (without it, xmlexports.h would force the use of |
| 794 | # DLL imports, which obviously aren't present in a static |
| 795 | # library). |
| 796 | if test "x$enable_shared" = "xno"; then |
| 797 | XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC" |
| 798 | CFLAGS="$CFLAGS -DLIBXML_STATIC" |
| 799 | fi |
| 800 | ;; |
Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 801 | esac |
| 802 | |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 803 | |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 804 | dnl |
| 805 | dnl check for python |
| 806 | dnl |
| 807 | |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 808 | PYTHON_VERSION= |
| 809 | PYTHON_INCLUDES= |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 810 | PYTHON_SITE_PACKAGES= |
Daniel Veillard | 6dc9196 | 2004-03-22 19:10:02 +0000 | [diff] [blame] | 811 | PYTHON_TESTS= |
Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 812 | pythondir= |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 813 | if test "$with_python" != "no" ; then |
| 814 | if test -x "$with_python/bin/python" |
| 815 | then |
| 816 | echo Found python in $with_python/bin/python |
| 817 | PYTHON="$with_python/bin/python" |
Daniel Veillard | 9b731d7 | 2002-04-14 12:56:08 +0000 | [diff] [blame] | 818 | else |
LRN | fbd4ddf | 2010-11-04 15:45:46 +0100 | [diff] [blame] | 819 | if test -x "$with_python/python.exe" |
| 820 | then |
| 821 | echo Found python in $with_python/python.exe |
| 822 | PYTHON="$with_python/python.exe" |
| 823 | else |
| 824 | if test -x "$with_python" |
| 825 | then |
| 826 | echo Found python in $with_python |
| 827 | PYTHON="$with_python" |
| 828 | else |
| 829 | if test -x "$PYTHON" |
| 830 | then |
| 831 | echo Found python in environment PYTHON=$PYTHON |
Daniel Veillard | b8e3f80 | 2013-03-28 09:46:20 +0800 | [diff] [blame] | 832 | with_python=`$PYTHON -c "import sys; print(sys.exec_prefix)"` |
LRN | fbd4ddf | 2010-11-04 15:45:46 +0100 | [diff] [blame] | 833 | else |
| 834 | AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) |
| 835 | fi |
Daniel Veillard | 4f69eb6 | 2005-08-24 22:19:10 +0000 | [diff] [blame] | 836 | fi |
Daniel Veillard | a8a89fe | 2002-04-12 21:03:34 +0000 | [diff] [blame] | 837 | fi |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 838 | fi |
| 839 | if test "$PYTHON" != "" |
| 840 | then |
Daniel Veillard | b8e3f80 | 2013-03-28 09:46:20 +0800 | [diff] [blame] | 841 | PYTHON_VERSION=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_version())"` |
| 842 | PYTHON_INCLUDES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"` |
| 843 | # does not work as it produce a /usr/lib/python path instead of/usr/lib64/python |
| 844 | # |
| 845 | # PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"` |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 846 | echo Found Python version $PYTHON_VERSION |
| 847 | fi |
Daniel Veillard | b8e3f80 | 2013-03-28 09:46:20 +0800 | [diff] [blame] | 848 | if test "$PYTHON_VERSION" != "" -a "$PYTHON_INCLUDES" = "" |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 849 | then |
Daniel Veillard | b8e3f80 | 2013-03-28 09:46:20 +0800 | [diff] [blame] | 850 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 851 | then |
| 852 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
| 853 | else |
| 854 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h |
| 855 | then |
Daniel Veillard | 8492ba1 | 2006-04-25 12:52:12 +0000 | [diff] [blame] | 856 | PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 857 | else |
| 858 | if test -r /usr/include/python$PYTHON_VERSION/Python.h |
| 859 | then |
| 860 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
| 861 | else |
Daniel Veillard | b8e3f80 | 2013-03-28 09:46:20 +0800 | [diff] [blame] | 862 | if test -r $with_python/include/Python.h |
LRN | fbd4ddf | 2010-11-04 15:45:46 +0100 | [diff] [blame] | 863 | then |
| 864 | PYTHON_INCLUDES=$with_python/include |
LRN | fbd4ddf | 2010-11-04 15:45:46 +0100 | [diff] [blame] | 865 | else |
| 866 | echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h |
| 867 | fi |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 868 | fi |
| 869 | fi |
Daniel Veillard | b8e3f80 | 2013-03-28 09:46:20 +0800 | [diff] [blame] | 870 | fi |
| 871 | fi |
Jonas Eriksson | fcb1bb5 | 2014-03-06 09:13:17 +0100 | [diff] [blame] | 872 | if test "$with_python_install_dir" != "" |
| 873 | then |
| 874 | PYTHON_SITE_PACKAGES="$with_python_install_dir" |
| 875 | fi |
Daniel Veillard | b8e3f80 | 2013-03-28 09:46:20 +0800 | [diff] [blame] | 876 | if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = "" |
| 877 | then |
| 878 | if test -d $libdir/python$PYTHON_VERSION/site-packages |
| 879 | then |
| 880 | PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages |
| 881 | else |
| 882 | if test -d $with_python/lib/site-packages |
Daniel Veillard | b6984ef | 2002-08-14 16:55:31 +0000 | [diff] [blame] | 883 | then |
Daniel Veillard | b8e3f80 | 2013-03-28 09:46:20 +0800 | [diff] [blame] | 884 | PYTHON_SITE_PACKAGES=$with_python/lib/site-packages |
| 885 | else |
| 886 | PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"` |
Daniel Veillard | b6984ef | 2002-08-14 16:55:31 +0000 | [diff] [blame] | 887 | fi |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 888 | fi |
| 889 | fi |
Daniel Veillard | b8e3f80 | 2013-03-28 09:46:20 +0800 | [diff] [blame] | 890 | pythondir='$(PYTHON_SITE_PACKAGES)' |
| 891 | PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags` |
Daniel Veillard | 4f69eb6 | 2005-08-24 22:19:10 +0000 | [diff] [blame] | 892 | else |
| 893 | PYTHON= |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 894 | fi |
| 895 | AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") |
Daniel Veillard | 40b1134 | 2002-09-20 12:01:39 +0000 | [diff] [blame] | 896 | if test "$PYTHON_INCLUDES" != "" |
| 897 | then |
| 898 | PYTHON_SUBDIR=python |
| 899 | else |
| 900 | PYTHON_SUBDIR= |
| 901 | fi |
Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 902 | AC_SUBST(pythondir) |
Daniel Veillard | 40b1134 | 2002-09-20 12:01:39 +0000 | [diff] [blame] | 903 | AC_SUBST(PYTHON_SUBDIR) |
Frederic Crozat | e21731d | 2009-09-12 18:02:40 +0200 | [diff] [blame] | 904 | AC_SUBST(PYTHON_LIBS) |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 905 | |
Daniel Veillard | ce1648b | 2005-01-04 15:10:22 +0000 | [diff] [blame] | 906 | dnl check for dso support |
| 907 | WITH_MODULES=0 |
Daniel Veillard | ce1648b | 2005-01-04 15:10:22 +0000 | [diff] [blame] | 908 | TEST_MODULES= |
| 909 | |
Daniel Veillard | f6b71bd | 2005-01-04 17:50:14 +0000 | [diff] [blame] | 910 | if test "$with_modules" != "no" ; then |
Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 911 | case "$host" in |
| 912 | *-*-cygwin*) |
| 913 | MODULE_EXTENSION=".dll" |
| 914 | AC_CHECK_LIB(cygwin, dlopen, [ |
| 915 | WITH_MODULES=1 |
| 916 | MODULE_PLATFORM_LIBS= |
| 917 | AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) |
| 918 | ]) |
| 919 | ;; |
Roumen Petrov | 120a269 | 2010-03-10 10:07:49 +0100 | [diff] [blame] | 920 | *-*-mingw*) |
| 921 | MODULE_EXTENSION=".dll" |
| 922 | WITH_MODULES=1 |
| 923 | ;; |
Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 924 | *) |
Daniel Veillard | 1d96f5a | 2005-10-28 08:44:48 +0000 | [diff] [blame] | 925 | AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [ |
| 926 | AC_CHECK_LIB(dld, shl_load, [ |
| 927 | MODULE_PLATFORM_LIBS="-ldld" |
| 928 | libxml_have_shl_load=yes], [ |
| 929 | AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [ |
| 930 | AC_CHECK_LIB(dl, dlopen, [ |
| 931 | MODULE_PLATFORM_LIBS="-ldl" |
| 932 | libxml_have_dlopen=yes])])])]) |
| 933 | |
| 934 | if test "${libxml_have_shl_load}" = "yes"; then |
| 935 | MODULE_EXTENSION=".sl" |
Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 936 | WITH_MODULES=1 |
Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 937 | AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso]) |
Daniel Veillard | 1d96f5a | 2005-10-28 08:44:48 +0000 | [diff] [blame] | 938 | fi |
Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 939 | |
Daniel Veillard | 1d96f5a | 2005-10-28 08:44:48 +0000 | [diff] [blame] | 940 | if test "${libxml_have_dlopen}" = "yes"; then |
| 941 | case "${host}" in |
| 942 | *-*-hpux* ) |
| 943 | MODULE_EXTENSION=".sl" |
| 944 | ;; |
| 945 | * ) |
| 946 | MODULE_EXTENSION=".so" |
| 947 | ;; |
| 948 | esac |
| 949 | |
Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 950 | WITH_MODULES=1 |
Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 951 | AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) |
Daniel Veillard | 1d96f5a | 2005-10-28 08:44:48 +0000 | [diff] [blame] | 952 | fi |
Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 953 | ;; |
| 954 | esac |
Daniel Veillard | f6b71bd | 2005-01-04 17:50:14 +0000 | [diff] [blame] | 955 | fi |
Daniel Veillard | ce1648b | 2005-01-04 15:10:22 +0000 | [diff] [blame] | 956 | |
| 957 | if test "${WITH_MODULES}" = "1"; then |
| 958 | TEST_MODULES="ModuleTests" |
| 959 | fi |
| 960 | |
| 961 | AC_SUBST(WITH_MODULES) |
| 962 | AC_SUBST(MODULE_PLATFORM_LIBS) |
| 963 | AC_SUBST(MODULE_EXTENSION) |
| 964 | AC_SUBST(TEST_MODULES) |
| 965 | |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 966 | dnl |
| 967 | dnl Tester makes use of readline if present |
| 968 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 969 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 970 | dnl |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 971 | dnl specific tests to setup DV and Bill's devel environments with debug etc ... |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 972 | dnl (-Wunreachable-code) |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 973 | dnl |
William M. Brack | 871611b | 2003-10-18 04:53:14 +0000 | [diff] [blame] | 974 | if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \ |
Daniel Veillard | b7c6ac4 | 2004-06-29 22:01:27 +0000 | [diff] [blame] | 975 | [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \ |
William M. Brack | 7f28a01 | 2007-01-11 23:42:10 +0000 | [diff] [blame] | 976 | [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]] |
William M. Brack | 871611b | 2003-10-18 04:53:14 +0000 | [diff] [blame] | 977 | then |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 978 | if test "$with_minimum" != "yes" |
| 979 | then |
| 980 | if test "${with_mem_debug}" = "" ; then |
Daniel Veillard | 379a3b7 | 2005-08-12 10:18:14 +0000 | [diff] [blame] | 981 | echo Activating memory debugging |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 982 | with_mem_debug="yes" |
Daniel Veillard | 22cdb84 | 2004-10-04 14:09:17 +0000 | [diff] [blame] | 983 | with_run_debug="yes" |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 984 | fi |
| 985 | if test "${with_docbook}" = "" ; then |
| 986 | with_docbook="yes" |
| 987 | fi |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 988 | fi |
Daniel Veillard | 3854c57 | 2005-08-25 10:17:45 +0000 | [diff] [blame] | 989 | if test "${GCC}" = "yes" ; then |
Daniel Veillard | 05f9735 | 2004-10-31 15:35:32 +0000 | [diff] [blame] | 990 | 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" |
Daniel Veillard | eff45a9 | 2004-10-29 12:10:55 +0000 | [diff] [blame] | 991 | fi |
Daniel Veillard | 2e9b165 | 2003-02-19 13:29:45 +0000 | [diff] [blame] | 992 | STATIC_BINARIES="-static" |
Daniel Veillard | c86a4fa | 2001-03-26 16:28:29 +0000 | [diff] [blame] | 993 | dnl -Wcast-qual -ansi |
Daniel Veillard | 2e9b165 | 2003-02-19 13:29:45 +0000 | [diff] [blame] | 994 | else |
| 995 | STATIC_BINARIES= |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 996 | fi |
Daniel Veillard | 2e9b165 | 2003-02-19 13:29:45 +0000 | [diff] [blame] | 997 | AC_SUBST(STATIC_BINARIES) |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 998 | |
| 999 | dnl |
| 1000 | dnl Check for trio string functions |
| 1001 | dnl |
| 1002 | |
| 1003 | if test "${NEED_TRIO}" = "1" ; then |
| 1004 | echo Adding trio library for string functions |
| 1005 | WITH_TRIO=1 |
| 1006 | else |
| 1007 | WITH_TRIO=0 |
| 1008 | fi |
Daniel Veillard | 01ef738 | 2001-05-08 07:31:43 +0000 | [diff] [blame] | 1009 | AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1") |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 1010 | AC_SUBST(WITH_TRIO) |
| 1011 | |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 1012 | dnl |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 1013 | dnl Allow to enable/disable various pieces |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1014 | dnl |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1015 | echo Checking configuration requirements |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1016 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1017 | dnl |
| 1018 | dnl Thread-related stuff |
| 1019 | dnl |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 1020 | THREAD_LIBS="" |
Daniel Veillard | dbfe05a | 2005-05-04 09:18:00 +0000 | [diff] [blame] | 1021 | BASE_THREAD_LIBS="" |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 1022 | WITH_THREADS=0 |
| 1023 | THREAD_CFLAGS="" |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 1024 | TEST_THREADS="" |
Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1025 | THREADS_W32="" |
Tim Starling | 0ad948e | 2012-10-29 13:41:55 +1100 | [diff] [blame] | 1026 | WITH_THREAD_ALLOC=0 |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 1027 | |
Daniel Veillard | 8494271 | 2003-04-18 14:40:05 +0000 | [diff] [blame] | 1028 | if test "$with_threads" = "no" ; then |
| 1029 | echo Disabling multithreaded support |
| 1030 | else |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 1031 | echo Enabling multithreaded support |
Sam Thursfield | 115581a | 2012-05-09 18:46:56 +0800 | [diff] [blame] | 1032 | |
| 1033 | dnl Default to native threads on Win32 |
Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1034 | case $host_os in |
Sam Thursfield | 115581a | 2012-05-09 18:46:56 +0800 | [diff] [blame] | 1035 | *mingw32*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then |
LRN | 203fd2e | 2009-08-07 21:47:25 +0200 | [diff] [blame] | 1036 | WITH_THREADS="1" |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 1037 | THREADS_W32="1" |
Sam Thursfield | 115581a | 2012-05-09 18:46:56 +0800 | [diff] [blame] | 1038 | THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" |
LRN | 203fd2e | 2009-08-07 21:47:25 +0200 | [diff] [blame] | 1039 | fi |
Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1040 | ;; |
Sam Thursfield | 115581a | 2012-05-09 18:46:56 +0800 | [diff] [blame] | 1041 | esac |
| 1042 | |
| 1043 | dnl Use pthread by default in other cases |
| 1044 | if test -z "$THREADS_W32"; then |
| 1045 | if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then |
| 1046 | AC_CHECK_HEADER(pthread.h, |
| 1047 | AC_CHECK_LIB(pthread, pthread_join,[ |
| 1048 | THREAD_LIBS="-lpthread" |
| 1049 | AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)]) |
| 1050 | AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there]) |
| 1051 | WITH_THREADS="1"])) |
| 1052 | fi |
| 1053 | fi |
| 1054 | |
| 1055 | case $host_os in |
William M. Brack | a73f45b | 2005-01-11 02:21:33 +0000 | [diff] [blame] | 1056 | *cygwin*) THREAD_LIBS="" |
| 1057 | ;; |
Daniel Veillard | 7a3447a | 2005-01-04 14:31:14 +0000 | [diff] [blame] | 1058 | *beos*) WITH_THREADS="1" |
| 1059 | THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" |
| 1060 | ;; |
Daniel Veillard | dbfe05a | 2005-05-04 09:18:00 +0000 | [diff] [blame] | 1061 | *linux*) |
Daniel Veillard | 32a461f | 2005-08-25 21:48:54 +0000 | [diff] [blame] | 1062 | if test "${GCC}" = "yes" ; then |
| 1063 | GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'` |
| 1064 | GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'` |
| 1065 | GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'` |
| 1066 | if test "${THREAD_LIBS}" = "-lpthread" ; then |
| 1067 | if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null |
| 1068 | then |
| 1069 | THREAD_LIBS="" |
| 1070 | BASE_THREAD_LIBS="-lpthread" |
| 1071 | else |
LRN | 203fd2e | 2009-08-07 21:47:25 +0200 | [diff] [blame] | 1072 | if expr ${GCC_MAJOR} \> 3 > /dev/null |
Daniel Veillard | 32a461f | 2005-08-25 21:48:54 +0000 | [diff] [blame] | 1073 | then |
| 1074 | THREAD_LIBS="" |
| 1075 | BASE_THREAD_LIBS="-lpthread" |
| 1076 | else |
| 1077 | echo old GCC disabling weak symbols for pthread |
| 1078 | fi |
| 1079 | fi |
| 1080 | fi |
Daniel Veillard | dbfe05a | 2005-05-04 09:18:00 +0000 | [diff] [blame] | 1081 | fi |
| 1082 | ;; |
Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1083 | esac |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 1084 | if test "$WITH_THREADS" = "1" ; then |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 1085 | THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" |
| 1086 | TEST_THREADS="Threadtests" |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 1087 | fi |
| 1088 | fi |
William M. Brack | 306e33c | 2004-06-12 01:01:22 +0000 | [diff] [blame] | 1089 | if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then |
Tim Starling | 0ad948e | 2012-10-29 13:41:55 +1100 | [diff] [blame] | 1090 | WITH_THREAD_ALLOC=1 |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 1091 | fi |
| 1092 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 1093 | AC_SUBST(THREAD_LIBS) |
Daniel Veillard | dbfe05a | 2005-05-04 09:18:00 +0000 | [diff] [blame] | 1094 | AC_SUBST(BASE_THREAD_LIBS) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 1095 | AC_SUBST(WITH_THREADS) |
| 1096 | AC_SUBST(THREAD_CFLAGS) |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 1097 | AC_SUBST(TEST_THREADS) |
Tim Starling | 0ad948e | 2012-10-29 13:41:55 +1100 | [diff] [blame] | 1098 | AC_SUBST(WITH_THREAD_ALLOC) |
Roumen Petrov | 8886f33 | 2012-08-13 16:38:09 +0800 | [diff] [blame] | 1099 | AM_CONDITIONAL([THREADS_W32],[test -n "$THREADS_W32"]) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 1100 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1101 | dnl |
| 1102 | dnl xmllint shell history |
| 1103 | dnl |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 1104 | if test "$with_history" = "yes" ; then |
Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 1105 | echo Enabling xmllint shell history |
| 1106 | dnl check for terminal library. this is a very cool solution |
| 1107 | dnl from octave's configure.in |
| 1108 | unset tcap |
| 1109 | for termlib in ncurses curses termcap terminfo termlib; do |
| 1110 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) |
| 1111 | test -n "$tcap" && break |
| 1112 | done |
| 1113 | |
| 1114 | AC_CHECK_HEADER(readline/history.h, |
| 1115 | AC_CHECK_LIB(history, append_history,[ |
| 1116 | RDL_LIBS="-lhistory" |
Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 1117 | AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])])) |
Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 1118 | AC_CHECK_HEADER(readline/readline.h, |
| 1119 | AC_CHECK_LIB(readline, readline,[ |
| 1120 | RDL_LIBS="-lreadline $RDL_LIBS $tcap" |
Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 1121 | AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap)) |
Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 1122 | if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then |
| 1123 | CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" |
| 1124 | RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" |
Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 1125 | fi |
Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 1126 | fi |
| 1127 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1128 | dnl |
| 1129 | dnl Tree functions |
| 1130 | dnl |
Daniel Veillard | 652327a | 2003-09-29 18:02:38 +0000 | [diff] [blame] | 1131 | if test "$with_tree" = "no" ; then |
| 1132 | echo Disabling DOM like tree manipulation APIs |
| 1133 | WITH_TREE=0 |
| 1134 | else |
| 1135 | WITH_TREE=1 |
| 1136 | fi |
| 1137 | AC_SUBST(WITH_TREE) |
| 1138 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1139 | if test "$with_ftp" = "no" ; then |
| 1140 | echo Disabling FTP support |
| 1141 | WITH_FTP=0 |
| 1142 | FTP_OBJ= |
| 1143 | else |
| 1144 | WITH_FTP=1 |
| 1145 | FTP_OBJ=nanoftp.o |
| 1146 | fi |
| 1147 | AC_SUBST(WITH_FTP) |
| 1148 | AC_SUBST(FTP_OBJ) |
| 1149 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1150 | if test "$with_http" = "no" ; then |
| 1151 | echo Disabling HTTP support |
| 1152 | WITH_HTTP=0 |
| 1153 | HTTP_OBJ= |
| 1154 | else |
| 1155 | WITH_HTTP=1 |
| 1156 | HTTP_OBJ=nanohttp.o |
| 1157 | fi |
| 1158 | AC_SUBST(WITH_HTTP) |
| 1159 | AC_SUBST(HTTP_OBJ) |
| 1160 | |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1161 | if test "$with_legacy" = "no" ; then |
| 1162 | echo Disabling deprecated APIs |
| 1163 | WITH_LEGACY=0 |
| 1164 | else |
| 1165 | WITH_LEGACY=1 |
| 1166 | fi |
| 1167 | AC_SUBST(WITH_LEGACY) |
| 1168 | |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 1169 | if test "$with_reader" = "no" ; then |
| 1170 | echo Disabling the xmlReader parsing interface |
| 1171 | WITH_READER=0 |
Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1172 | READER_TEST= |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 1173 | else |
| 1174 | WITH_READER=1 |
Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1175 | READER_TEST=Readertests |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1176 | if test "$with_push" = "no" ; then |
| 1177 | echo xmlReader requires Push interface - enabling it |
| 1178 | with_push=yes |
| 1179 | fi |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 1180 | fi |
| 1181 | AC_SUBST(WITH_READER) |
Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1182 | AC_SUBST(READER_TEST) |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 1183 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1184 | if test "$with_writer" = "no" ; then |
| 1185 | echo Disabling the xmlWriter saving interface |
| 1186 | WITH_WRITER=0 |
| 1187 | # WRITER_TEST= |
| 1188 | else |
| 1189 | WITH_WRITER=1 |
| 1190 | # WRITER_TEST=Writertests |
| 1191 | if test "$with_push" = "no" ; then |
| 1192 | echo xmlWriter requires Push interface - enabling it |
| 1193 | with_push=yes |
| 1194 | fi |
| 1195 | if test "$with_output" = "no" ; then |
| 1196 | echo xmlWriter requires Output interface - enabling it |
| 1197 | with_output=yes |
| 1198 | fi |
Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1199 | fi |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1200 | AC_SUBST(WITH_WRITER) |
| 1201 | #AC_SUBST(WRITER_TEST) |
| 1202 | |
Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1203 | if test "$with_pattern" = "no" ; then |
| 1204 | echo Disabling the xmlPattern parsing interface |
| 1205 | WITH_PATTERN=0 |
Daniel Veillard | f9d1691 | 2005-01-30 22:36:30 +0000 | [diff] [blame] | 1206 | TEST_PATTERN= |
Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1207 | else |
| 1208 | WITH_PATTERN=1 |
Daniel Veillard | f9d1691 | 2005-01-30 22:36:30 +0000 | [diff] [blame] | 1209 | TEST_PATTERN=Patterntests |
Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1210 | fi |
| 1211 | AC_SUBST(WITH_PATTERN) |
Daniel Veillard | f9d1691 | 2005-01-30 22:36:30 +0000 | [diff] [blame] | 1212 | AC_SUBST(TEST_PATTERN) |
Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1213 | |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 1214 | if test "$with_sax1" = "no" ; then |
| 1215 | echo Disabling the older SAX1 interface |
| 1216 | WITH_SAX1=0 |
| 1217 | TEST_SAX= |
| 1218 | else |
| 1219 | WITH_SAX1=1 |
| 1220 | TEST_SAX=SAXtests |
| 1221 | fi |
| 1222 | AC_SUBST(WITH_SAX1) |
Akira TAGOH | 961b535 | 2012-07-03 14:13:59 +0900 | [diff] [blame] | 1223 | AM_CONDITIONAL(WITH_SAX1_SOURCES, test "${WITH_TRIO}" = "1") |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 1224 | AC_SUBST(TEST_SAX) |
| 1225 | |
Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1226 | if test "$with_push" = "no" ; then |
| 1227 | echo Disabling the PUSH parser interfaces |
| 1228 | WITH_PUSH=0 |
| 1229 | TEST_PUSH= |
| 1230 | else |
| 1231 | WITH_PUSH=1 |
| 1232 | TEST_PUSH="XMLPushtests" |
| 1233 | fi |
| 1234 | AC_SUBST(WITH_PUSH) |
| 1235 | AC_SUBST(TEST_PUSH) |
| 1236 | |
Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1237 | if test "$with_html" = "no" ; then |
| 1238 | echo Disabling HTML support |
| 1239 | WITH_HTML=0 |
| 1240 | HTML_OBJ= |
| 1241 | TEST_HTML= |
| 1242 | else |
| 1243 | WITH_HTML=1 |
| 1244 | HTML_OBJ="HTMLparser.o HTMLtree.o" |
| 1245 | TEST_HTML=HTMLtests |
William M. Brack | 871611b | 2003-10-18 04:53:14 +0000 | [diff] [blame] | 1246 | if test "$with_push" != "no" ; then |
Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1247 | TEST_PHTML=HTMLPushtests |
| 1248 | else |
| 1249 | TEST_PHTML= |
| 1250 | fi |
| 1251 | fi |
| 1252 | AC_SUBST(WITH_HTML) |
| 1253 | AC_SUBST(HTML_OBJ) |
| 1254 | AC_SUBST(TEST_HTML) |
| 1255 | AC_SUBST(TEST_PHTML) |
| 1256 | |
Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1257 | if test "$with_valid" = "no" ; then |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1258 | echo Disabling DTD validation support |
| 1259 | WITH_VALID=0 |
| 1260 | TEST_VALID= |
| 1261 | TEST_VTIME= |
| 1262 | else |
| 1263 | WITH_VALID=1 |
| 1264 | TEST_VALID=Validtests |
| 1265 | TEST_VTIME=VTimingtests |
| 1266 | fi |
| 1267 | AC_SUBST(WITH_VALID) |
| 1268 | AC_SUBST(TEST_VALID) |
| 1269 | AC_SUBST(TEST_VTIME) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1270 | |
Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 1271 | if test "$with_catalog" = "no" ; then |
| 1272 | echo Disabling Catalog support |
| 1273 | WITH_CATALOG=0 |
| 1274 | CATALOG_OBJ= |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1275 | TEST_CATALOG= |
Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 1276 | else |
| 1277 | WITH_CATALOG=1 |
| 1278 | CATALOG_OBJ="catalog.o" |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1279 | TEST_CATALOG=Catatests |
Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 1280 | fi |
| 1281 | AC_SUBST(WITH_CATALOG) |
| 1282 | AC_SUBST(CATALOG_OBJ) |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1283 | AC_SUBST(TEST_CATALOG) |
Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 1284 | |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 1285 | if test "$with_docbook" = "no" ; then |
| 1286 | echo Disabling Docbook support |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 1287 | WITH_DOCB=0 |
| 1288 | DOCB_OBJ= |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 1289 | else |
| 1290 | WITH_DOCB=1 |
| 1291 | DOCB_OBJ="DOCBparser.o" |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 1292 | fi |
| 1293 | AC_SUBST(WITH_DOCB) |
| 1294 | AC_SUBST(DOCB_OBJ) |
| 1295 | |
| 1296 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1297 | if test "$with_xptr" = "no" ; then |
| 1298 | echo Disabling XPointer support |
| 1299 | WITH_XPTR=0 |
| 1300 | XPTR_OBJ= |
| 1301 | TEST_XPTR= |
| 1302 | else |
| 1303 | WITH_XPTR=1 |
| 1304 | XPTR_OBJ=xpointer.o |
| 1305 | TEST_XPTR=XPtrtests |
| 1306 | if test "$with_xpath" = "no" ; then |
| 1307 | echo XPointer requires XPath support - enabling it |
| 1308 | with_xpath=yes |
| 1309 | fi |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1310 | fi |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1311 | AC_SUBST(WITH_XPTR) |
| 1312 | AC_SUBST(XPTR_OBJ) |
| 1313 | AC_SUBST(TEST_XPTR) |
| 1314 | |
| 1315 | if test "$with_c14n" = "no" ; then |
| 1316 | echo Disabling C14N support |
| 1317 | WITH_C14N=0 |
| 1318 | C14N_OBJ= |
| 1319 | TEST_C14N= |
| 1320 | else |
| 1321 | WITH_C14N=1 |
| 1322 | C14N_OBJ="c14n.c" |
| 1323 | TEST_C14N=C14Ntests |
| 1324 | if test "$with_xpath" = "no" ; then |
| 1325 | echo C14N requires XPath support - enabling it |
| 1326 | with_xpath=yes |
| 1327 | fi |
| 1328 | fi |
| 1329 | AC_SUBST(WITH_C14N) |
| 1330 | AC_SUBST(C14N_OBJ) |
| 1331 | AC_SUBST(TEST_C14N) |
| 1332 | |
| 1333 | if test "$with_xinclude" = "no" ; then |
| 1334 | echo Disabling XInclude support |
| 1335 | WITH_XINCLUDE=0 |
| 1336 | XINCLUDE_OBJ= |
| 1337 | with_xinclude="no" |
| 1338 | TEST_XINCLUDE= |
| 1339 | else |
| 1340 | WITH_XINCLUDE=1 |
| 1341 | XINCLUDE_OBJ=xinclude.o |
| 1342 | TEST_XINCLUDE=XIncludetests |
| 1343 | if test "$with_xpath" = "no" ; then |
| 1344 | echo XInclude requires XPath support - enabling it |
| 1345 | with_xpath=yes |
| 1346 | fi |
| 1347 | fi |
| 1348 | AC_SUBST(WITH_XINCLUDE) |
| 1349 | AC_SUBST(XINCLUDE_OBJ) |
| 1350 | AC_SUBST(TEST_XINCLUDE) |
| 1351 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1352 | if test "$with_xpath" = "no" ; then |
| 1353 | echo Disabling XPATH support |
| 1354 | WITH_XPATH=0 |
| 1355 | XPATH_OBJ= |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1356 | TEST_XPATH= |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1357 | else |
| 1358 | WITH_XPATH=1 |
| 1359 | XPATH_OBJ=xpath.o |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1360 | TEST_XPATH=XPathtests |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1361 | fi |
| 1362 | AC_SUBST(WITH_XPATH) |
| 1363 | AC_SUBST(XPATH_OBJ) |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1364 | AC_SUBST(TEST_XPATH) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1365 | |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1366 | dnl |
| 1367 | dnl output functions |
| 1368 | dnl |
| 1369 | if test "$with_output" = "no" ; then |
| 1370 | echo Disabling serialization/saving support |
| 1371 | WITH_OUTPUT=0 |
Daniel Veillard | c8df0aa | 2000-10-10 23:50:30 +0000 | [diff] [blame] | 1372 | else |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1373 | WITH_OUTPUT=1 |
Daniel Veillard | c8df0aa | 2000-10-10 23:50:30 +0000 | [diff] [blame] | 1374 | fi |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1375 | AC_SUBST(WITH_OUTPUT) |
Daniel Veillard | 9e8bfae | 2000-11-06 16:43:11 +0000 | [diff] [blame] | 1376 | |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1377 | WITH_ICONV=0 |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 1378 | if test "$with_iconv" = "no" ; then |
| 1379 | echo Disabling ICONV support |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 1380 | else |
Daniel Veillard | 220346d | 2001-12-07 11:33:54 +0000 | [diff] [blame] | 1381 | if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1382 | CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" |
Daniel Veillard | f5b44e4 | 2001-09-17 17:19:54 +0000 | [diff] [blame] | 1383 | # Export this since our headers include iconv.h |
| 1384 | XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1385 | ICONV_LIBS="-L$with_iconv/lib" |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 1386 | fi |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1387 | |
| 1388 | AC_CHECK_HEADER(iconv.h, |
| 1389 | AC_MSG_CHECKING(for iconv) |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 1390 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> |
| 1391 | #include <iconv.h>]],[[ |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1392 | iconv_t cd = iconv_open ("",""); |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 1393 | iconv (cd, NULL, NULL, NULL, NULL);]])],[ |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1394 | AC_MSG_RESULT(yes) |
| 1395 | WITH_ICONV=1],[ |
| 1396 | AC_MSG_RESULT(no) |
| 1397 | AC_MSG_CHECKING(for iconv in -liconv) |
| 1398 | |
| 1399 | _ldflags="${LDFLAGS}" |
| 1400 | _libs="${LIBS}" |
| 1401 | LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" |
| 1402 | LIBS="${LIBS} -liconv" |
| 1403 | |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 1404 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> |
| 1405 | #include <iconv.h>]],[[ |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1406 | iconv_t cd = iconv_open ("",""); |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 1407 | iconv (cd, NULL, NULL, NULL, NULL);]])],[ |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1408 | AC_MSG_RESULT(yes) |
| 1409 | WITH_ICONV=1 |
| 1410 | ICONV_LIBS="${ICONV_LIBS} -liconv" |
| 1411 | LIBS="${_libs}" |
| 1412 | LDFLAGS="${_ldflags}"],[ |
| 1413 | AC_MSG_RESULT(no) |
| 1414 | LIBS="${_libs}" |
| 1415 | LDFLAGS="${_ldflags}"])])) |
Daniel Veillard | 8e1a46d | 2008-02-15 07:47:26 +0000 | [diff] [blame] | 1416 | |
| 1417 | if test "$WITH_ICONV" = "1" ; then |
| 1418 | AC_MSG_CHECKING([for iconv declaration]) |
| 1419 | AC_CACHE_VAL(xml_cv_iconv_arg2, [ |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 1420 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> |
Daniel Veillard | 8e1a46d | 2008-02-15 07:47:26 +0000 | [diff] [blame] | 1421 | #include <iconv.h> |
| 1422 | extern |
| 1423 | #ifdef __cplusplus |
| 1424 | "C" |
| 1425 | #endif |
| 1426 | #if defined(__STDC__) || defined(__cplusplus) |
| 1427 | size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); |
| 1428 | #else |
| 1429 | size_t iconv(); |
| 1430 | #endif |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 1431 | ]], [])], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")]) |
Daniel Veillard | 8e1a46d | 2008-02-15 07:47:26 +0000 | [diff] [blame] | 1432 | |
| 1433 | 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);" |
| 1434 | AC_MSG_RESULT([${xml_xxx:- |
| 1435 | }$xml_cv_iconv_decl]) |
| 1436 | AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2, |
| 1437 | [Define as const if the declaration of iconv() needs const.]) |
| 1438 | fi |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1439 | fi |
Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1440 | case "$host" in |
| 1441 | *mingw*) M_LIBS="" |
| 1442 | ;; |
Daniel Veillard | 7a3447a | 2005-01-04 14:31:14 +0000 | [diff] [blame] | 1443 | *beos*) M_LIBS="" |
| 1444 | ;; |
Scott McCreary | 508a8d6 | 2009-08-24 16:35:35 +0200 | [diff] [blame] | 1445 | *haiku*) M_LIBS="" |
| 1446 | ;; |
Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1447 | *) M_LIBS="-lm" |
| 1448 | ;; |
| 1449 | esac |
Daniel Veillard | b82c166 | 2001-12-09 14:00:54 +0000 | [diff] [blame] | 1450 | XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" |
Daniel Veillard | 90d165b | 2003-09-01 20:33:13 +0000 | [diff] [blame] | 1451 | XML_LIBTOOLLIBS="libxml2.la" |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 1452 | AC_SUBST(WITH_ICONV) |
| 1453 | |
Giuseppe Iuculano | 48f7dcb | 2010-11-04 17:42:42 +0100 | [diff] [blame] | 1454 | WITH_ICU=0 |
Arfrever Frehtes Taifersar Arahesis | 1f01f49 | 2012-08-28 22:16:50 +0800 | [diff] [blame] | 1455 | ICU_LIBS="" |
Giuseppe Iuculano | 48f7dcb | 2010-11-04 17:42:42 +0100 | [diff] [blame] | 1456 | if test "$with_icu" != "yes" ; then |
| 1457 | echo Disabling ICU support |
| 1458 | else |
| 1459 | ICU_CONFIG=icu-config |
| 1460 | if ${ICU_CONFIG} --cflags >/dev/null 2>&1 |
| 1461 | then |
Arfrever Frehtes Taifersar Arahesis | 1f01f49 | 2012-08-28 22:16:50 +0800 | [diff] [blame] | 1462 | ICU_LIBS=`${ICU_CONFIG} --ldflags` |
Giuseppe Iuculano | 48f7dcb | 2010-11-04 17:42:42 +0100 | [diff] [blame] | 1463 | WITH_ICU=1 |
| 1464 | echo Enabling ICU support |
| 1465 | else |
| 1466 | AC_MSG_ERROR([libicu config program icu-config not found]) |
| 1467 | fi |
| 1468 | fi |
| 1469 | AC_SUBST(WITH_ICU) |
Arfrever Frehtes Taifersar Arahesis | 1f01f49 | 2012-08-28 22:16:50 +0800 | [diff] [blame] | 1470 | AC_SUBST(ICU_LIBS) |
Giuseppe Iuculano | 48f7dcb | 2010-11-04 17:42:42 +0100 | [diff] [blame] | 1471 | |
Daniel Veillard | 01fc1a9 | 2003-07-30 15:12:01 +0000 | [diff] [blame] | 1472 | WITH_ISO8859X=1 |
Daniel Veillard | 01fc1a9 | 2003-07-30 15:12:01 +0000 | [diff] [blame] | 1473 | if test "$WITH_ICONV" != "1" ; then |
| 1474 | if test "$with_iso8859x" = "no" ; then |
| 1475 | echo Disabling ISO8859X support |
| 1476 | WITH_ISO8859X=0 |
| 1477 | fi |
| 1478 | fi |
| 1479 | AC_SUBST(WITH_ISO8859X) |
| 1480 | |
Daniel Veillard | ed6c549 | 2005-07-23 15:00:22 +0000 | [diff] [blame] | 1481 | if test "$with_schematron" = "no" ; then |
| 1482 | echo "Disabling Schematron support" |
| 1483 | WITH_SCHEMATRON=0 |
| 1484 | TEST_SCHEMATRON= |
| 1485 | else |
| 1486 | echo "Enabled Schematron support" |
| 1487 | WITH_SCHEMATRON=1 |
| 1488 | TEST_SCHEMATRON="Schematrontests" |
| 1489 | with_xpath=yes |
| 1490 | with_pattern=yes |
| 1491 | fi |
| 1492 | AC_SUBST(WITH_SCHEMATRON) |
| 1493 | AC_SUBST(TEST_SCHEMATRON) |
| 1494 | |
Daniel Veillard | ef4d3bc | 2003-02-07 12:38:22 +0000 | [diff] [blame] | 1495 | if test "$with_schemas" = "no" ; then |
William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1496 | echo "Disabling Schemas/Relax-NG support" |
Daniel Veillard | ef4d3bc | 2003-02-07 12:38:22 +0000 | [diff] [blame] | 1497 | WITH_SCHEMAS=0 |
| 1498 | TEST_SCHEMAS= |
| 1499 | else |
Daniel Veillard | 71531f3 | 2003-02-05 13:19:53 +0000 | [diff] [blame] | 1500 | echo "Enabled Schemas/Relax-NG support" |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 1501 | WITH_SCHEMAS=1 |
Daniel Veillard | 6eadf63 | 2003-01-23 18:29:16 +0000 | [diff] [blame] | 1502 | TEST_SCHEMAS="Schemastests Relaxtests" |
Daniel Veillard | 6dc9196 | 2004-03-22 19:10:02 +0000 | [diff] [blame] | 1503 | if test "$PYTHON_INCLUDES" != "" ; then |
| 1504 | PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests" |
| 1505 | fi |
Daniel Veillard | 23e7357 | 2002-09-19 19:56:43 +0000 | [diff] [blame] | 1506 | with_regexps=yes |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 1507 | fi |
| 1508 | AC_SUBST(WITH_SCHEMAS) |
| 1509 | AC_SUBST(TEST_SCHEMAS) |
| 1510 | |
Daniel Veillard | 23e7357 | 2002-09-19 19:56:43 +0000 | [diff] [blame] | 1511 | if test "$with_regexps" = "no" ; then |
| 1512 | echo Disabling Regexps support |
| 1513 | WITH_REGEXPS=0 |
| 1514 | TEST_REGEXPS= |
| 1515 | else |
| 1516 | WITH_REGEXPS=1 |
| 1517 | TEST_REGEXPS="Regexptests Automatatests" |
| 1518 | fi |
| 1519 | AC_SUBST(WITH_REGEXPS) |
| 1520 | AC_SUBST(TEST_REGEXPS) |
| 1521 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1522 | if test "$with_debug" = "no" ; then |
| 1523 | echo Disabling DEBUG support |
| 1524 | WITH_DEBUG=0 |
| 1525 | DEBUG_OBJ= |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1526 | TEST_DEBUG= |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1527 | else |
| 1528 | WITH_DEBUG=1 |
| 1529 | DEBUG_OBJ=debugXML.o |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1530 | TEST_DEBUG=Scripttests |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1531 | fi |
| 1532 | AC_SUBST(WITH_DEBUG) |
| 1533 | AC_SUBST(DEBUG_OBJ) |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1534 | AC_SUBST(TEST_DEBUG) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1535 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1536 | if test "$with_mem_debug" = "yes" ; then |
William M. Brack | 306e33c | 2004-06-12 01:01:22 +0000 | [diff] [blame] | 1537 | if test "$with_thread_alloc" = "yes" ; then |
| 1538 | echo Disabling memory debug - cannot use mem-debug with thread-alloc! |
| 1539 | WITH_MEM_DEBUG=0 |
| 1540 | else |
| 1541 | echo Enabling memory debug support |
| 1542 | WITH_MEM_DEBUG=1 |
| 1543 | fi |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1544 | else |
| 1545 | WITH_MEM_DEBUG=0 |
| 1546 | fi |
| 1547 | AC_SUBST(WITH_MEM_DEBUG) |
| 1548 | |
Daniel Veillard | 22cdb84 | 2004-10-04 14:09:17 +0000 | [diff] [blame] | 1549 | if test "$with_run_debug" = "yes" ; then |
| 1550 | echo Enabling runtime debug support |
| 1551 | WITH_RUN_DEBUG=1 |
| 1552 | else |
| 1553 | WITH_RUN_DEBUG=0 |
| 1554 | fi |
| 1555 | AC_SUBST(WITH_RUN_DEBUG) |
Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1556 | |
| 1557 | WIN32_EXTRA_LIBADD= |
| 1558 | WIN32_EXTRA_LDFLAGS= |
William M. Brack | a73f45b | 2005-01-11 02:21:33 +0000 | [diff] [blame] | 1559 | CYGWIN_EXTRA_LDFLAGS= |
| 1560 | CYGWIN_EXTRA_PYTHON_LIBADD= |
LRN | fbd4ddf | 2010-11-04 15:45:46 +0100 | [diff] [blame] | 1561 | WIN32_EXTRA_PYTHON_LIBADD= |
Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1562 | case "$host" in |
| 1563 | *-*-mingw*) |
Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1564 | CPPFLAGS="$CPPFLAGS -DWIN32" |
| 1565 | WIN32_EXTRA_LIBADD="-lws2_32" |
Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1566 | WIN32_EXTRA_LDFLAGS="-no-undefined" |
| 1567 | AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation]) |
LRN | fbd4ddf | 2010-11-04 15:45:46 +0100 | [diff] [blame] | 1568 | if test "${PYTHON}" != "" |
| 1569 | then |
John Hein | a4fe9b2 | 2012-05-10 22:12:46 +0800 | [diff] [blame] | 1570 | WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" |
LRN | fbd4ddf | 2010-11-04 15:45:46 +0100 | [diff] [blame] | 1571 | fi |
Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1572 | ;; |
Daniel Veillard | d392ba7 | 2004-08-04 14:56:45 +0000 | [diff] [blame] | 1573 | *-*-cygwin*) |
| 1574 | CYGWIN_EXTRA_LDFLAGS="-no-undefined" |
William M. Brack | a73f45b | 2005-01-11 02:21:33 +0000 | [diff] [blame] | 1575 | if test "${PYTHON}" != "" |
| 1576 | then |
| 1577 | CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}" |
| 1578 | fi |
Daniel Veillard | d392ba7 | 2004-08-04 14:56:45 +0000 | [diff] [blame] | 1579 | ;; |
Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1580 | esac |
| 1581 | AC_SUBST(WIN32_EXTRA_LIBADD) |
| 1582 | AC_SUBST(WIN32_EXTRA_LDFLAGS) |
LRN | fbd4ddf | 2010-11-04 15:45:46 +0100 | [diff] [blame] | 1583 | AC_SUBST(WIN32_EXTRA_PYTHON_LIBADD) |
Daniel Veillard | d392ba7 | 2004-08-04 14:56:45 +0000 | [diff] [blame] | 1584 | AC_SUBST(CYGWIN_EXTRA_LDFLAGS) |
| 1585 | AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD) |
Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1586 | |
Andoni Morales | fda5717 | 2012-05-08 10:46:09 +0800 | [diff] [blame] | 1587 | dnl Checking the standard string functions availability |
Roumen Petrov | 978ff22 | 2012-05-20 16:07:54 +0300 | [diff] [blame] | 1588 | dnl |
| 1589 | dnl Note mingw* has C99 implementation that produce expected xml numbers |
| 1590 | dnl if code use {v}snprintf functions. |
| 1591 | dnl If you like to activate at run-time C99 compatible number output |
| 1592 | dnl see release note for mingw runtime 3.15: |
| 1593 | dnl http://sourceforge.net/project/shownotes.php?release_id=24832 |
| 1594 | dnl |
| 1595 | dnl Also *win32*config.h files redefine them for various MSC compilers. |
| 1596 | dnl |
| 1597 | dnl So do not redefine {v}snprintf to _{v}snprintf like follwing: |
| 1598 | dnl AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around]) |
| 1599 | dnl AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around]) |
| 1600 | dnl and do not redefine those functions is C-source files. |
| 1601 | dnl |
| 1602 | AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, |
| 1603 | NEED_TRIO=1) |
Andoni Morales | fda5717 | 2012-05-08 10:46:09 +0800 | [diff] [blame] | 1604 | |
Daniel Veillard | bfa5cf1 | 2008-08-27 15:33:28 +0000 | [diff] [blame] | 1605 | if test "$with_coverage" = "yes" -a "${GCC}" = "yes" |
| 1606 | then |
| 1607 | echo Enabling code coverage for GCC |
| 1608 | CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" |
| 1609 | LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage" |
| 1610 | else |
| 1611 | echo Disabling code coverage for GCC |
| 1612 | fi |
| 1613 | |
Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1614 | AC_SUBST(CPPFLAGS) |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 1615 | AC_SUBST(CFLAGS) |
Daniel Veillard | bfa5cf1 | 2008-08-27 15:33:28 +0000 | [diff] [blame] | 1616 | AC_SUBST(LDFLAGS) |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 1617 | AC_SUBST(XML_CFLAGS) |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 1618 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 1619 | AC_SUBST(XML_LIBDIR) |
| 1620 | AC_SUBST(XML_LIBS) |
Daniel Veillard | 90d165b | 2003-09-01 20:33:13 +0000 | [diff] [blame] | 1621 | AC_SUBST(XML_LIBTOOLLIBS) |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 1622 | AC_SUBST(ICONV_LIBS) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 1623 | AC_SUBST(XML_INCLUDEDIR) |
| 1624 | AC_SUBST(HTML_DIR) |
| 1625 | AC_SUBST(HAVE_ISNAN) |
| 1626 | AC_SUBST(HAVE_ISINF) |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 1627 | AC_SUBST(PYTHON) |
| 1628 | AC_SUBST(PYTHON_VERSION) |
| 1629 | AC_SUBST(PYTHON_INCLUDES) |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 1630 | AC_SUBST(PYTHON_SITE_PACKAGES) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 1631 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 1632 | AC_SUBST(M_LIBS) |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 1633 | AC_SUBST(RDL_LIBS) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1634 | |
Daniel Veillard | 9715c17 | 2002-11-25 16:33:40 +0000 | [diff] [blame] | 1635 | dnl for the spec file |
| 1636 | RELDATE=`date +'%a %b %e %Y'` |
| 1637 | AC_SUBST(RELDATE) |
Daniel Veillard | 6dc9196 | 2004-03-22 19:10:02 +0000 | [diff] [blame] | 1638 | AC_SUBST(PYTHON_TESTS) |
Daniel Veillard | 9715c17 | 2002-11-25 16:33:40 +0000 | [diff] [blame] | 1639 | |
Daniel Veillard | c6e997c | 2003-01-27 12:35:42 +0000 | [diff] [blame] | 1640 | rm -f COPYING.LIB COPYING |
Daniel Richard G | 5706b6d | 2012-08-06 11:32:54 +0800 | [diff] [blame] | 1641 | ln -s $srcdir/Copyright COPYING |
Daniel Veillard | c575b99 | 2002-02-08 13:28:40 +0000 | [diff] [blame] | 1642 | |
Daniel Veillard | e4177a5 | 2004-01-08 16:43:57 +0000 | [diff] [blame] | 1643 | # keep on one line for cygwin c.f. #130896 |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 1644 | 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 xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py]) |
| 1645 | AC_OUTPUT |
Arturo Espinosa | 15fe6e7 | 1998-09-07 17:27:57 +0000 | [diff] [blame] | 1646 | |
Daniel Veillard | 06d2524 | 2004-02-25 13:01:42 +0000 | [diff] [blame] | 1647 | chmod +x xml2-config python/setup.py |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 1648 | echo Done configuring |