| Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
| Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 2 | AC_INIT(entities.c) |
| Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 3 | AM_CONFIG_HEADER(config.h) |
| Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 4 | AC_CANONICAL_HOST |
| Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 5 | |
| Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 6 | LIBXML_MAJOR_VERSION=2 |
| Daniel Veillard | 1572425 | 2008-08-30 15:01:04 +0000 | [diff] [blame] | 7 | LIBXML_MINOR_VERSION=7 |
| Daniel Veillard | 97ff9b3 | 2009-01-18 21:43:30 +0000 | [diff] [blame^] | 8 | LIBXML_MICRO_VERSION=3 |
| Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 9 | LIBXML_MICRO_VERSION_SUFFIX= |
| Daniel Veillard | 4fc5281 | 2003-09-01 20:33:13 +0000 | [diff] [blame] | 10 | 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] | 11 | LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION |
| 12 | |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 13 | LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` |
| 14 | |
| Daniel Veillard | 9cb1b64 | 2007-01-03 15:07:44 +0000 | [diff] [blame] | 15 | if test -f CVS/Entries ; then |
| Daniel Veillard | dab93ea | 2004-08-20 16:47:10 +0000 | [diff] [blame] | 16 | extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%` |
| 17 | echo extra=$extra |
| 18 | if test "$extra" != "" |
| 19 | then |
| 20 | LIBXML_VERSION_EXTRA="-CVS$extra" |
| 21 | fi |
| Daniel Veillard | 9cb1b64 | 2007-01-03 15:07:44 +0000 | [diff] [blame] | 22 | else if test -d .svn ; then |
| 23 | extra=`svn info | grep Revision | sed 's+Revision: ++'` |
| 24 | echo extra=$extra |
| 25 | if test "$extra" != "" |
| 26 | then |
| 27 | LIBXML_VERSION_EXTRA="-SVN$extra" |
| 28 | fi |
| 29 | fi |
| William M. Brack | f402549 | 2004-08-18 21:08:46 +0000 | [diff] [blame] | 30 | fi |
| Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 31 | AC_SUBST(LIBXML_MAJOR_VERSION) |
| 32 | AC_SUBST(LIBXML_MINOR_VERSION) |
| 33 | AC_SUBST(LIBXML_MICRO_VERSION) |
| 34 | AC_SUBST(LIBXML_VERSION) |
| 35 | AC_SUBST(LIBXML_VERSION_INFO) |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 36 | AC_SUBST(LIBXML_VERSION_NUMBER) |
| William M. Brack | f402549 | 2004-08-18 21:08:46 +0000 | [diff] [blame] | 37 | AC_SUBST(LIBXML_VERSION_EXTRA) |
| Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 38 | |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 39 | VERSION=${LIBXML_VERSION} |
| Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 40 | |
| Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 41 | AM_INIT_AUTOMAKE(libxml2, $VERSION) |
| Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 42 | |
| Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 43 | dnl Checks for programs. |
| 44 | AC_PROG_CC |
| 45 | AC_PROG_INSTALL |
| Sebastian Wilhelmi | a44c8a4 | 1998-08-07 08:38:58 +0000 | [diff] [blame] | 46 | AC_PROG_CPP |
| Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 47 | AC_PATH_PROG(RM, rm, /bin/rm) |
| 48 | AC_PATH_PROG(MV, mv, /bin/mv) |
| 49 | AC_PATH_PROG(TAR, tar, /bin/tar) |
| William M. Brack | 1826d0a | 2004-07-21 09:03:57 +0000 | [diff] [blame] | 50 | AC_PATH_PROG(PERL, perl, /usr/bin/perl) |
| Daniel Veillard | 33a2de9 | 2006-10-11 08:33:22 +0000 | [diff] [blame] | 51 | AC_PATH_PROG(WGET, wget, /usr/bin/wget) |
| Daniel Veillard | 8b817da | 2004-09-30 09:19:33 +0000 | [diff] [blame] | 52 | AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint) |
| Daniel Veillard | 06500c8 | 2004-09-07 09:12:44 +0000 | [diff] [blame] | 53 | AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) |
| Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 54 | |
| Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 55 | dnl Make sure we have an ANSI compiler |
| 56 | AM_C_PROTOTYPES |
| 57 | test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) |
| 58 | |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 59 | AC_LIBTOOL_WIN32_DLL |
| Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 60 | AM_PROG_LIBTOOL |
| 61 | |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 62 | dnl |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 63 | dnl We process the AC_ARG_WITH first so that later we can modify |
| 64 | dnl some of them to try to prevent impossible combinations. This |
| 65 | dnl also allows up so alphabetize the choices |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 66 | dnl |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 67 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 68 | dnl |
| 69 | dnl zlib option might change flags, so we save them initially |
| 70 | dnl |
| Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 71 | _cppflags="${CPPFLAGS}" |
| 72 | _ldflags="${LDFLAGS}" |
| Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 73 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 74 | AC_ARG_WITH(c14n, |
| 75 | [ --with-c14n add the Canonicalization support (on)]) |
| 76 | AC_ARG_WITH(catalog, |
| 77 | [ --with-catalog add the Catalog support (on)]) |
| 78 | AC_ARG_WITH(debug, |
| 79 | [ --with-debug add the debugging module (on)]) |
| 80 | AC_ARG_WITH(docbook, |
| 81 | [ --with-docbook add Docbook SGML support (on)]) |
| 82 | AC_ARG_WITH(fexceptions, |
| 83 | [ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)]) |
| 84 | AC_ARG_WITH(ftp, |
| 85 | [ --with-ftp add the FTP support (on)]) |
| 86 | AC_ARG_WITH(history, |
| 87 | [ --with-history add history support to xmllint shell(off)]) |
| 88 | AC_ARG_WITH(html, |
| 89 | [ --with-html add the HTML support (on)]) |
| 90 | dnl Specific dir for HTML output ? |
| 91 | AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path], |
| 92 | [path to base html directory, default $datadir/doc/html]), |
| 93 | [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc']) |
| Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 94 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 95 | AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path], |
| 96 | [directory used under html-dir, default $PACKAGE-$VERSION/html]), |
| 97 | [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"], |
| 98 | [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"]) |
| 99 | AC_SUBST(HTML_DIR) |
| 100 | AC_ARG_WITH(http, |
| 101 | [ --with-http add the HTTP support (on)]) |
| 102 | AC_ARG_WITH(iconv, |
| 103 | [ --with-iconv[[=DIR]] add ICONV support (on)]) |
| 104 | AC_ARG_WITH(iso8859x, |
| 105 | [ --with-iso8859x add ISO8859X support if no iconv (on)]) |
| 106 | AC_ARG_WITH(legacy, |
| 107 | [ --with-legacy add deprecated APIs for compatibility (on)]) |
| 108 | AC_ARG_WITH(mem_debug, |
| 109 | [ --with-mem-debug add the memory debugging module (off)]) |
| 110 | AC_ARG_WITH(minimum, |
| 111 | [ --with-minimum build a minimally sized library (off)]) |
| 112 | AC_ARG_WITH(output, |
| 113 | [ --with-output add the serialization support (on)]) |
| 114 | AC_ARG_WITH(pattern, |
| 115 | [ --with-pattern add the xmlPattern selection interface (on)]) |
| 116 | AC_ARG_WITH(push, |
| 117 | [ --with-push add the PUSH parser interfaces (on)]) |
| 118 | AC_ARG_WITH(python, |
| 119 | [ --with-python[[=DIR]] build Python bindings if found]) |
| 120 | AC_ARG_WITH(reader, |
| 121 | [ --with-reader add the xmlReader parsing interface (on)]) |
| 122 | AC_ARG_WITH(readline, |
| 123 | [ --with-readline=DIR use readline in DIR],[ |
| 124 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 125 | RDL_DIR=$withval |
| 126 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 127 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 128 | fi |
| 129 | ]) |
| 130 | AC_ARG_WITH(regexps, |
| 131 | [ --with-regexps add Regular Expressions support (on)]) |
| 132 | AC_ARG_WITH(run_debug, |
| 133 | [ --with-run-debug add the runtime debugging module (off)]) |
| 134 | AC_ARG_WITH(sax1, |
| 135 | [ --with-sax1 add the older SAX1 interface (on)]) |
| 136 | AC_ARG_WITH(schemas, |
| Daniel Veillard | 39e5c89 | 2005-07-03 22:48:50 +0000 | [diff] [blame] | 137 | [ --with-schemas add Relax-NG and Schemas support (on)]) |
| Daniel Veillard | ed6c549 | 2005-07-23 15:00:22 +0000 | [diff] [blame] | 138 | AC_ARG_WITH(schematron, |
| 139 | [ --with-schematron add Schematron support (on)]) |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 140 | AC_ARG_WITH(threads, |
| 141 | [ --with-threads add multithread support(on)]) |
| 142 | AC_ARG_WITH(thread-alloc, |
| 143 | [ --with-thread-alloc add per-thread memory(off)]) |
| 144 | AC_ARG_WITH(tree, |
| 145 | [ --with-tree add the DOM like tree manipulation APIs (on)]) |
| 146 | AC_ARG_WITH(valid, |
| 147 | [ --with-valid add the DTD validation support (on)]) |
| 148 | AC_ARG_WITH(writer, |
| 149 | [ --with-writer add the xmlWriter saving interface (on)]) |
| 150 | AC_ARG_WITH(xinclude, |
| 151 | [ --with-xinclude add the XInclude support (on)]) |
| 152 | AC_ARG_WITH(xpath, |
| 153 | [ --with-xpath add the XPATH support (on)]) |
| 154 | AC_ARG_WITH(xptr, |
| 155 | [ --with-xptr add the XPointer support (on)]) |
| Daniel Veillard | f6b71bd | 2005-01-04 17:50:14 +0000 | [diff] [blame] | 156 | AC_ARG_WITH(modules, |
| 157 | [ --with-modules add the dynamic modules support (on)]) |
| Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 158 | AC_ARG_WITH(zlib, |
| William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 159 | [ --with-zlib[[=DIR]] use libz in DIR],[ |
| Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 160 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 161 | Z_DIR=$withval |
| 162 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 163 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 164 | fi |
| Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 165 | ]) |
| Daniel Veillard | bfa5cf1 | 2008-08-27 15:33:28 +0000 | [diff] [blame] | 166 | AC_ARG_WITH(coverage, |
| 167 | [ --with-coverage build for code coverage with GCC (off)]) |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 168 | |
| Daniel Veillard | b40744e | 2008-10-17 13:26:44 +0000 | [diff] [blame] | 169 | AC_ARG_ENABLE(rebuild-docs, |
| 170 | [ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=yes]]]) |
| 171 | AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"]) |
| 172 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 173 | dnl |
| Daniel Veillard | 39e5c89 | 2005-07-03 22:48:50 +0000 | [diff] [blame] | 174 | dnl hard dependancies on options |
| 175 | dnl |
| 176 | if test "$with_schemas" = "yes" |
| 177 | then |
| 178 | with_pattern=yes |
| Daniel Veillard | c51f51c | 2007-05-02 16:25:45 +0000 | [diff] [blame] | 179 | with_regexps=yes |
| Daniel Veillard | 39e5c89 | 2005-07-03 22:48:50 +0000 | [diff] [blame] | 180 | fi |
| Daniel Veillard | ed6c549 | 2005-07-23 15:00:22 +0000 | [diff] [blame] | 181 | if test "$with_schematron" = "yes" |
| 182 | then |
| 183 | with_pattern=yes |
| 184 | with_xpath=yes |
| 185 | fi |
| Daniel Veillard | 39e5c89 | 2005-07-03 22:48:50 +0000 | [diff] [blame] | 186 | if test "$with_reader" = "yes" |
| 187 | then |
| 188 | with_push=yes |
| 189 | fi |
| 190 | if test "$with_xptr" = "yes" |
| 191 | then |
| 192 | with_xpath=yes |
| 193 | fi |
| 194 | dnl |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 195 | dnl option to build a minimal libxml2 library |
| 196 | dnl |
| 197 | if test "$with_minimum" = "yes" |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 198 | then |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 199 | echo "Configuring for a minimal library" |
| 200 | if test "$with_c14n" = "" |
| 201 | then |
| 202 | with_c14n=no |
| 203 | fi |
| 204 | if test "$with_catalog" = "" |
| 205 | then |
| 206 | with_catalog=no |
| 207 | fi |
| 208 | echo So far so good! |
| 209 | if test "$with_debug" = "" |
| 210 | then |
| 211 | with_debug=no |
| 212 | fi |
| 213 | if test "$with_docbook" = "" |
| 214 | then |
| 215 | with_docbook=no |
| 216 | fi |
| 217 | if test "$with_fexceptions" = "" |
| 218 | then |
| 219 | with_fexceptions=no |
| 220 | fi |
| 221 | if test "$with_ftp" = "" |
| 222 | then |
| 223 | with_ftp=no |
| 224 | fi |
| 225 | if test "$with_history" = "" |
| 226 | then |
| 227 | with_history=no |
| 228 | fi |
| 229 | if test "$with_html" = "" |
| 230 | then |
| 231 | with_html=no |
| 232 | fi |
| 233 | if test "$with_http" = "" |
| 234 | then |
| 235 | with_http=no |
| 236 | fi |
| 237 | if test "$with_iconv" = "" |
| 238 | then |
| 239 | with_iconv=no |
| 240 | fi |
| 241 | if test "$with_iso8859x" = "" |
| 242 | then |
| 243 | with_iso8859x=no |
| 244 | fi |
| 245 | if test "$with_legacy" = "" |
| 246 | then |
| 247 | with_legacy=no |
| 248 | fi |
| 249 | if test "$with_mem_debug" = "" |
| 250 | then |
| 251 | with_mem_debug=no |
| 252 | fi |
| 253 | if test "$with_output" = "" |
| 254 | then |
| 255 | with_output=no |
| 256 | fi |
| 257 | if test "$with_pattern" = "" |
| 258 | then |
| 259 | with_pattern=no |
| 260 | fi |
| 261 | if test "$with_push" = "" |
| 262 | then |
| 263 | with_push=no |
| 264 | fi |
| 265 | if test "$with_python" = "" |
| 266 | then |
| 267 | with_python=no |
| 268 | fi |
| 269 | if test "$with_reader" = "" |
| 270 | then |
| 271 | with_reader=no |
| 272 | fi |
| 273 | if test "$with_readline" = "" |
| 274 | then |
| 275 | with_readline=no |
| 276 | fi |
| Daniel Veillard | c51f51c | 2007-05-02 16:25:45 +0000 | [diff] [blame] | 277 | if test "$with_regexps" = "" |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 278 | then |
| Daniel Veillard | c51f51c | 2007-05-02 16:25:45 +0000 | [diff] [blame] | 279 | with_regexps=no |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 280 | fi |
| 281 | if test "$with_run_debug" = "" |
| 282 | then |
| 283 | with_run_debug=no |
| 284 | fi |
| 285 | if test "$with_sax1" = "" |
| 286 | then |
| 287 | with_sax1=no |
| 288 | fi |
| 289 | if test "$with_schemas" = "" |
| 290 | then |
| 291 | with_schemas=no |
| 292 | fi |
| Daniel Veillard | ed6c549 | 2005-07-23 15:00:22 +0000 | [diff] [blame] | 293 | if test "$with_schematron" = "" |
| 294 | then |
| 295 | with_schematron=no |
| 296 | fi |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 297 | if test "$with_threads" = "" |
| 298 | then |
| 299 | with_threads=no |
| 300 | fi |
| 301 | if test "$with_thread_alloc" = "" |
| 302 | then |
| 303 | with_thread_alloc=no |
| 304 | fi |
| 305 | if test "$with_tree" = "" |
| 306 | then |
| 307 | with_tree=no |
| 308 | fi |
| 309 | if test "$with_valid" = "" |
| 310 | then |
| 311 | with_valid=no |
| 312 | fi |
| 313 | if test "$with_writer" = "" |
| 314 | then |
| 315 | with_writer=no |
| 316 | fi |
| 317 | if test "$with_xinclude" = "" |
| 318 | then |
| 319 | with_xinclude=no |
| 320 | fi |
| 321 | if test "$with_xpath" = "" |
| 322 | then |
| 323 | with_xpath=no |
| 324 | fi |
| 325 | if test "$with_xptr" = "" |
| 326 | then |
| 327 | with_xptr=no |
| 328 | fi |
| 329 | if test "$with_zlib" = "" |
| 330 | then |
| 331 | with_zlib=no |
| 332 | fi |
| Daniel Veillard | f6b71bd | 2005-01-04 17:50:14 +0000 | [diff] [blame] | 333 | if test "$with_modules" = "" |
| 334 | then |
| 335 | with_modules=no |
| 336 | fi |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 337 | fi |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 338 | |
| 339 | echo Checking zlib |
| 340 | |
| 341 | dnl Checks for zlib library. |
| 342 | |
| Daniel Veillard | 75acfee | 2006-07-13 06:29:56 +0000 | [diff] [blame] | 343 | WITH_ZLIB=0 |
| Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 344 | if test "$with_zlib" = "no"; then |
| 345 | echo "Disabling compression support" |
| 346 | else |
| Daniel Veillard | 3fbe8e3 | 2001-10-06 13:30:33 +0000 | [diff] [blame] | 347 | AC_CHECK_HEADERS(zlib.h, |
| 348 | AC_CHECK_LIB(z, gzread,[ |
| Daniel Veillard | 75acfee | 2006-07-13 06:29:56 +0000 | [diff] [blame] | 349 | AC_DEFINE([HAVE_LIBZ], [1], [Have compression library]) |
| 350 | WITH_ZLIB=1 |
| Daniel Veillard | 3fbe8e3 | 2001-10-06 13:30:33 +0000 | [diff] [blame] | 351 | if test "x${Z_DIR}" != "x"; then |
| 352 | Z_CFLAGS="-I${Z_DIR}/include" |
| 353 | Z_LIBS="-L${Z_DIR}/lib -lz" |
| 354 | [case ${host} in |
| 355 | *-*-solaris*) |
| 356 | Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" |
| 357 | ;; |
| 358 | esac] |
| 359 | else |
| 360 | Z_LIBS="-lz" |
| 361 | fi])) |
| Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 362 | fi |
| Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 363 | |
| Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 364 | AC_SUBST(Z_CFLAGS) |
| 365 | AC_SUBST(Z_LIBS) |
| Daniel Veillard | 75acfee | 2006-07-13 06:29:56 +0000 | [diff] [blame] | 366 | AC_SUBST(WITH_ZLIB) |
| Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 367 | |
| 368 | CPPFLAGS=${_cppflags} |
| 369 | LDFLAGS=${_ldflags} |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 370 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 371 | echo Checking headers |
| 372 | |
| Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 373 | dnl Checks for header files. |
| 374 | AC_HEADER_DIRENT |
| 375 | AC_HEADER_STDC |
| Daniel Veillard | 817e70b | 2002-11-19 22:28:48 +0000 | [diff] [blame] | 376 | AC_CHECK_HEADERS([fcntl.h]) |
| 377 | AC_CHECK_HEADERS([unistd.h]) |
| 378 | AC_CHECK_HEADERS([ctype.h]) |
| 379 | AC_CHECK_HEADERS([dirent.h]) |
| 380 | AC_CHECK_HEADERS([errno.h]) |
| 381 | AC_CHECK_HEADERS([malloc.h]) |
| 382 | AC_CHECK_HEADERS([stdarg.h]) |
| 383 | AC_CHECK_HEADERS([sys/stat.h]) |
| 384 | AC_CHECK_HEADERS([sys/types.h]) |
| Daniel Veillard | 7f4547c | 2008-10-03 07:58:23 +0000 | [diff] [blame] | 385 | AC_CHECK_HEADERS([stdint.h]) |
| 386 | AC_CHECK_HEADERS([inttypes.h.h]) |
| Daniel Veillard | 817e70b | 2002-11-19 22:28:48 +0000 | [diff] [blame] | 387 | AC_CHECK_HEADERS([time.h]) |
| 388 | AC_CHECK_HEADERS([ansidecl.h]) |
| 389 | AC_CHECK_HEADERS([ieeefp.h]) |
| 390 | AC_CHECK_HEADERS([nan.h]) |
| 391 | AC_CHECK_HEADERS([math.h]) |
| Daniel Veillard | ebe48c6 | 2003-12-03 12:12:27 +0000 | [diff] [blame] | 392 | AC_CHECK_HEADERS([limits.h]) |
| Daniel Veillard | 817e70b | 2002-11-19 22:28:48 +0000 | [diff] [blame] | 393 | AC_CHECK_HEADERS([fp_class.h]) |
| 394 | AC_CHECK_HEADERS([float.h]) |
| 395 | AC_CHECK_HEADERS([stdlib.h]) |
| 396 | AC_CHECK_HEADERS([sys/socket.h], [], [], |
| 397 | [#if HAVE_SYS_TYPES_H |
| 398 | # include <sys/types.h> |
| 399 | # endif |
| 400 | ]) |
| 401 | AC_CHECK_HEADERS([netinet/in.h], [], [], |
| 402 | [#if HAVE_SYS_TYPES_H |
| 403 | # include <sys/types.h> |
| 404 | # endif |
| 405 | ]) |
| 406 | AC_CHECK_HEADERS([arpa/inet.h], [], [], |
| 407 | [#if HAVE_SYS_TYPES_H |
| 408 | # include <sys/types.h> |
| 409 | # endif |
| 410 | #if HAVE_ARPA_INET_H |
| 411 | # include <arpa/inet.h> |
| 412 | # endif |
| 413 | ]) |
| 414 | AC_CHECK_HEADERS([netdb.h]) |
| 415 | AC_CHECK_HEADERS([sys/time.h]) |
| 416 | AC_CHECK_HEADERS([sys/select.h]) |
| 417 | AC_CHECK_HEADERS([sys/mman.h]) |
| 418 | AC_CHECK_HEADERS([sys/timeb.h]) |
| 419 | AC_CHECK_HEADERS([signal.h]) |
| 420 | AC_CHECK_HEADERS([arpa/nameser.h], [], [], |
| 421 | [#if HAVE_SYS_TYPES_H |
| 422 | # include <sys/types.h> |
| 423 | # endif |
| 424 | ]) |
| 425 | AC_CHECK_HEADERS([resolv.h], [], [], |
| 426 | [#if HAVE_SYS_TYPES_H |
| 427 | # include <sys/types.h> |
| 428 | # endif |
| 429 | #if HAVE_NETINET_IN_H |
| 430 | # include <netinet/in.h> |
| 431 | # endif |
| 432 | #if HAVE_ARPA_NAMESER_H |
| 433 | # include <arpa/nameser.h> |
| 434 | # endif |
| 435 | ]) |
| Daniel Veillard | dcd9390 | 2005-01-13 11:25:15 +0000 | [diff] [blame] | 436 | AC_CHECK_HEADERS([dl.h]) |
| 437 | AC_CHECK_HEADERS([dlfcn.h]) |
| Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 438 | |
| Daniel Veillard | fc97906 | 2004-03-04 22:07:16 +0000 | [diff] [blame] | 439 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 440 | echo Checking libraries |
| Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 441 | |
| Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 442 | dnl Checks for library functions. |
| 443 | AC_FUNC_STRFTIME |
| Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 444 | AC_CHECK_FUNCS(strdup strndup strerror) |
| Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 445 | AC_CHECK_FUNCS(finite isnand fp_class class fpclass) |
| Daniel Veillard | 90bc371 | 2002-03-07 15:12:58 +0000 | [diff] [blame] | 446 | AC_CHECK_FUNCS(strftime localtime gettimeofday ftime) |
| Daniel Veillard | 068a965 | 2001-06-07 15:30:26 +0000 | [diff] [blame] | 447 | AC_CHECK_FUNCS(stat _stat signal) |
| Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 448 | |
| Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 449 | dnl Checking the standard string functions availability |
| 450 | AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, |
| 451 | NEED_TRIO=1) |
| 452 | |
| William M. Brack | f4caa5e | 2005-10-20 09:04:05 +0000 | [diff] [blame] | 453 | dnl Checking for va_copy availability |
| 454 | AC_MSG_CHECKING([for va_copy]) |
| 455 | AC_TRY_LINK([#include <stdarg.h> |
| 456 | va_list ap1,ap2;], [va_copy(ap1,ap2);], |
| 457 | have_va_copy=yes, |
| 458 | have_va_copy=no) |
| 459 | AC_MSG_RESULT($have_va_copy) |
| 460 | if test x"$have_va_copy" = x"yes"; then |
| 461 | AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) |
| 462 | else |
| 463 | AC_MSG_CHECKING([for __va_copy]) |
| 464 | AC_TRY_LINK([#include <stdarg.h> |
| 465 | va_list ap1,ap2;], [__va_copy(ap1,ap2);], |
| 466 | have___va_copy=yes, |
| 467 | have___va_copy=no) |
| 468 | AC_MSG_RESULT($have___va_copy) |
| 469 | if test x"$have___va_copy" = x"yes"; then |
| 470 | AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) |
| 471 | fi |
| 472 | fi |
| 473 | |
| Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 474 | dnl Checks for inet libraries: |
| Daniel Veillard | d4e39ae | 2005-10-28 15:59:14 +0000 | [diff] [blame] | 475 | AC_SEARCH_LIBS(gethostent, [nsl]) |
| 476 | AC_SEARCH_LIBS(setsockopt, [socket net]) |
| 477 | AC_SEARCH_LIBS(connect, [inet]) |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 478 | |
| Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 479 | dnl Determine what socket length (socklen_t) data type is |
| 480 | AC_MSG_CHECKING([for type of socket length (socklen_t)]) |
| 481 | AC_TRY_COMPILE2([ |
| 482 | #include <stddef.h> |
| 483 | #include <sys/types.h> |
| 484 | #include <sys/socket.h>],[ |
| 485 | (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[ |
| 486 | AC_MSG_RESULT(socklen_t *) |
| Daniel Veillard | c284c64 | 2005-03-31 10:24:24 +0000 | [diff] [blame] | 487 | XML_SOCKLEN_T=socklen_t],[ |
| Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 488 | AC_TRY_COMPILE2([ |
| 489 | #include <stddef.h> |
| 490 | #include <sys/types.h> |
| 491 | #include <sys/socket.h>],[ |
| 492 | (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[ |
| 493 | AC_MSG_RESULT(size_t *) |
| Daniel Veillard | c284c64 | 2005-03-31 10:24:24 +0000 | [diff] [blame] | 494 | XML_SOCKLEN_T=size_t],[ |
| Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 495 | AC_TRY_COMPILE2([ |
| 496 | #include <stddef.h> |
| 497 | #include <sys/types.h> |
| 498 | #include <sys/socket.h>],[ |
| 499 | (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[ |
| 500 | AC_MSG_RESULT(int *) |
| Daniel Veillard | c284c64 | 2005-03-31 10:24:24 +0000 | [diff] [blame] | 501 | XML_SOCKLEN_T=int],[ |
| William M. Brack | 2e6b143 | 2004-02-09 15:10:28 +0000 | [diff] [blame] | 502 | AC_MSG_WARN(could not determine) |
| Daniel Veillard | c284c64 | 2005-03-31 10:24:24 +0000 | [diff] [blame] | 503 | XML_SOCKLEN_T="int"])])]) |
| 504 | 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] | 505 | |
| Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 506 | dnl ***********************Checking for availability of IPv6******************* |
| 507 | |
| 508 | AC_MSG_CHECKING([whether to enable IPv6]) |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 509 | 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] | 510 | if test "$with_minimum" = "yes" |
| 511 | then |
| 512 | enable_ipv6=no |
| 513 | fi |
| Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 514 | if test $enable_ipv6 = yes; then |
| 515 | have_ipv6=no |
| 516 | AC_TRY_COMPILE([ |
| William M. Brack | 0c1e301 | 2007-03-14 12:40:21 +0000 | [diff] [blame] | 517 | #include <sys/types.h> |
| William M. Brack | 06559b3 | 2007-03-14 09:34:15 +0000 | [diff] [blame] | 518 | #include <sys/socket.h> |
| William M. Brack | 0c1e301 | 2007-03-14 12:40:21 +0000 | [diff] [blame] | 519 | ], [ |
| Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 520 | struct sockaddr_storage ss; |
| 521 | socket(AF_INET6, SOCK_STREAM, 0) |
| 522 | ], |
| 523 | have_ipv6=yes, |
| 524 | have_ipv6=no |
| 525 | ) |
| 526 | AC_MSG_RESULT($have_ipv6) |
| 527 | |
| William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 528 | if test $have_ipv6 = yes; then |
| Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 529 | AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6]) |
| Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 530 | have_broken_ss_family=no |
| 531 | |
| 532 | dnl ********************************************************************* |
| 533 | dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have |
| 534 | 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] | 535 | dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these |
| 536 | dnl platforms. However, we should only do this if ss_family is not |
| 537 | dnl present. |
| Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 538 | dnl ******************************************************************** |
| William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 539 | AC_MSG_CHECKING([struct sockaddr::ss_family]) |
| Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 540 | AC_TRY_COMPILE([ |
| William M. Brack | 0c1e301 | 2007-03-14 12:40:21 +0000 | [diff] [blame] | 541 | #include <sys/types.h> |
| William M. Brack | 06559b3 | 2007-03-14 09:34:15 +0000 | [diff] [blame] | 542 | #include <sys/socket.h> |
| William M. Brack | 0c1e301 | 2007-03-14 12:40:21 +0000 | [diff] [blame] | 543 | ], [ |
| Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 544 | struct sockaddr_storage ss ; |
| William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 545 | ss.ss_family = 0 ; |
| Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 546 | ], |
| William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 547 | have_ss_family=yes, |
| 548 | have_ss_family=no |
| Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 549 | ) |
| William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 550 | AC_MSG_RESULT($have_ss_family) |
| 551 | if test x$have_ss_family = xno ; then |
| 552 | AC_MSG_CHECKING([broken struct sockaddr::ss_family]) |
| 553 | AC_TRY_COMPILE([ |
| William M. Brack | 0c1e301 | 2007-03-14 12:40:21 +0000 | [diff] [blame] | 554 | #include <sys/types.h> |
| William M. Brack | 06559b3 | 2007-03-14 09:34:15 +0000 | [diff] [blame] | 555 | #include <sys/socket.h> |
| William M. Brack | 0c1e301 | 2007-03-14 12:40:21 +0000 | [diff] [blame] | 556 | ], [ |
| William M. Brack | 7d8b36b | 2005-06-25 07:30:50 +0000 | [diff] [blame] | 557 | struct sockaddr_storage ss ; |
| 558 | ss.__ss_family = 0 ; |
| 559 | ], |
| 560 | have_broken_ss_family=yes, |
| 561 | have_broken_ss_family=no |
| 562 | ) |
| 563 | AC_MSG_RESULT($have_broken_ss_family) |
| 564 | if test x$have_broken_ss_family = xyes ; then |
| 565 | AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [], |
| 566 | [Whether struct sockaddr::__ss_family exists]) |
| 567 | AC_DEFINE(ss_family, __ss_family, |
| 568 | [ss_family is not defined here, use __ss_family instead]) |
| 569 | else |
| 570 | AC_MSG_WARN(ss_family and __ss_family not found) |
| 571 | fi |
| Dodji Seketeli | 8eba3f3 | 2004-11-09 18:30:30 +0000 | [diff] [blame] | 572 | fi |
| Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 573 | |
| 574 | have_getaddrinfo=no |
| 575 | AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes) |
| 576 | if test $have_getaddrinfo != yes; then |
| 577 | for lib in bsd socket inet; do |
| 578 | AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break]) |
| 579 | done |
| 580 | fi |
| 581 | |
| William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 582 | if test $have_getaddrinfo = yes; then |
| Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 583 | AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there]) |
| Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 584 | fi |
| 585 | fi |
| 586 | fi |
| 587 | |
| 588 | dnl ******************************End IPv6 checks****************************** |
| 589 | |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 590 | dnl Checks for isnan in libm if not in libc |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 591 | 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] | 592 | [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])])) |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 593 | |
| Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 594 | AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf, |
| 595 | [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])])) |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 596 | |
| 597 | XML_LIBDIR='-L${libdir}' |
| Daniel Veillard | e7dd2b8 | 2002-03-15 18:44:02 +0000 | [diff] [blame] | 598 | XML_INCLUDEDIR='-I${includedir}/libxml2' |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 599 | |
| Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 600 | dnl |
| Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 601 | dnl Extra flags |
| 602 | dnl |
| 603 | XML_CFLAGS="" |
| Daniel Veillard | 357c960 | 2001-05-03 10:49:20 +0000 | [diff] [blame] | 604 | RDL_LIBS="" |
| Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 605 | |
| 606 | dnl |
| Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 607 | dnl Workaround for native compilers |
| 608 | dnl HP : http://bugs.gnome.org/db/31/3163.html |
| 609 | dnl DEC : Enable NaN/Inf |
| Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 610 | dnl |
| Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 611 | if test "${GCC}" != "yes" ; then |
| Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 612 | case "${host}" in |
| Daniel Veillard | 6a0baa0 | 2005-12-10 11:11:12 +0000 | [diff] [blame] | 613 | hppa*-*-hpux* ) |
| Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 614 | CFLAGS="${CFLAGS} -Wp,-H30000" |
| Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 615 | ;; |
| Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 616 | *-dec-osf* ) |
| 617 | CFLAGS="${CFLAGS} -ieee" |
| 618 | ;; |
| William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 619 | alpha*-*-linux* ) |
| 620 | CFLAGS="${CFLAGS} -ieee" |
| 621 | ;; |
| Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 622 | esac |
| Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 623 | else |
| Daniel Veillard | d94849b | 2003-07-28 13:02:24 +0000 | [diff] [blame] | 624 | if test "$with_fexceptions" = "yes" |
| 625 | then |
| 626 | # |
| 627 | # Not activated by default because this inflates the code size |
| 628 | # Used to allow propagation of C++ exceptions through the library |
| 629 | # |
| 630 | CFLAGS="${CFLAGS} -fexceptions" |
| 631 | fi |
| 632 | |
| Daniel Veillard | 05f9735 | 2004-10-31 15:35:32 +0000 | [diff] [blame] | 633 | 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" |
| Daniel Veillard | 14839d5 | 2001-06-06 16:11:56 +0000 | [diff] [blame] | 634 | case "${host}" in |
| 635 | alpha*-*-linux* ) |
| 636 | CFLAGS="${CFLAGS} -mieee" |
| 637 | ;; |
| Daniel Veillard | cb5b4d6 | 2002-04-11 08:24:26 +0000 | [diff] [blame] | 638 | alpha*-*-osf* ) |
| 639 | CFLAGS="${CFLAGS} -mieee" |
| 640 | ;; |
| Daniel Veillard | 14839d5 | 2001-06-06 16:11:56 +0000 | [diff] [blame] | 641 | esac |
| Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 642 | fi |
| Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 643 | case ${host} in |
| 644 | *-*-solaris*) |
| Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 645 | XML_LIBDIR="${XML_LIBDIR} -R${libdir}" |
| 646 | ;; |
| Daniel Veillard | d30be4a | 2002-03-28 18:25:31 +0000 | [diff] [blame] | 647 | hppa*-hp-mpeix) |
| 648 | NEED_TRIO=1 |
| 649 | ;; |
| Daniel Veillard | 4188ddf | 2006-01-19 08:58:42 +0000 | [diff] [blame] | 650 | *-*-mingw* | *-*-cygwin* | *-*-msvc* ) |
| 651 | # If the host is Windows, and shared libraries are disabled, we |
| 652 | # need to add -DLIBXML_STATIC to CFLAGS in order for linking to |
| 653 | # work properly (without it, xmlexports.h would force the use of |
| 654 | # DLL imports, which obviously aren't present in a static |
| 655 | # library). |
| 656 | if test "x$enable_shared" = "xno"; then |
| 657 | XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC" |
| 658 | CFLAGS="$CFLAGS -DLIBXML_STATIC" |
| 659 | fi |
| 660 | ;; |
| Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 661 | esac |
| 662 | |
| Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 663 | |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 664 | dnl |
| 665 | dnl check for python |
| 666 | dnl |
| 667 | |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 668 | PYTHON_VERSION= |
| 669 | PYTHON_INCLUDES= |
| Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 670 | PYTHON_SITE_PACKAGES= |
| Daniel Veillard | 6dc9196 | 2004-03-22 19:10:02 +0000 | [diff] [blame] | 671 | PYTHON_TESTS= |
| Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 672 | pythondir= |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 673 | if test "$with_python" != "no" ; then |
| 674 | if test -x "$with_python/bin/python" |
| 675 | then |
| 676 | echo Found python in $with_python/bin/python |
| 677 | PYTHON="$with_python/bin/python" |
| Daniel Veillard | 9b731d7 | 2002-04-14 12:56:08 +0000 | [diff] [blame] | 678 | else |
| Daniel Veillard | a8a89fe | 2002-04-12 21:03:34 +0000 | [diff] [blame] | 679 | if test -x "$with_python" |
| 680 | then |
| Daniel Veillard | 4efd3be | 2002-11-18 09:11:13 +0000 | [diff] [blame] | 681 | echo Found python in $with_python |
| 682 | PYTHON="$with_python" |
| Daniel Veillard | a8a89fe | 2002-04-12 21:03:34 +0000 | [diff] [blame] | 683 | else |
| Daniel Veillard | 4f69eb6 | 2005-08-24 22:19:10 +0000 | [diff] [blame] | 684 | if test -x "$PYTHON" |
| 685 | then |
| 686 | echo Found python in environment PYTHON=$PYTHON |
| Daniel Veillard | 8492ba1 | 2006-04-25 12:52:12 +0000 | [diff] [blame] | 687 | with_python=`$PYTHON -c "import sys; print sys.exec_prefix"` |
| Daniel Veillard | 4f69eb6 | 2005-08-24 22:19:10 +0000 | [diff] [blame] | 688 | else |
| Daniel Veillard | c2f7056 | 2005-09-01 12:45:26 +0000 | [diff] [blame] | 689 | AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) |
| Daniel Veillard | 4f69eb6 | 2005-08-24 22:19:10 +0000 | [diff] [blame] | 690 | fi |
| Daniel Veillard | a8a89fe | 2002-04-12 21:03:34 +0000 | [diff] [blame] | 691 | fi |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 692 | fi |
| 693 | if test "$PYTHON" != "" |
| 694 | then |
| 695 | PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` |
| 696 | echo Found Python version $PYTHON_VERSION |
| 697 | fi |
| 698 | if test "$PYTHON_VERSION" != "" |
| 699 | then |
| Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 700 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ |
| 701 | -d $with_python/lib/python$PYTHON_VERSION/site-packages |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 702 | then |
| 703 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
| Daniel Veillard | d7d0748 | 2006-05-03 13:15:44 +0000 | [diff] [blame] | 704 | PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 705 | else |
| 706 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h |
| 707 | then |
| Daniel Veillard | 8492ba1 | 2006-04-25 12:52:12 +0000 | [diff] [blame] | 708 | PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION |
| Daniel Veillard | d7d0748 | 2006-05-03 13:15:44 +0000 | [diff] [blame] | 709 | PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 710 | else |
| 711 | if test -r /usr/include/python$PYTHON_VERSION/Python.h |
| 712 | then |
| 713 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
| Daniel Veillard | d7d0748 | 2006-05-03 13:15:44 +0000 | [diff] [blame] | 714 | PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 715 | else |
| 716 | echo could not find python$PYTHON_VERSION/Python.h |
| 717 | fi |
| 718 | fi |
| William M. Brack | 5d4cba4 | 2004-01-06 15:19:12 +0000 | [diff] [blame] | 719 | if test ! -d "$PYTHON_SITE_PACKAGES" |
| Daniel Veillard | b6984ef | 2002-08-14 16:55:31 +0000 | [diff] [blame] | 720 | then |
| 721 | PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` |
| 722 | fi |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 723 | fi |
| 724 | fi |
| Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 725 | if test "$with_python" != "" |
| 726 | then |
| Daniel Veillard | d7d0748 | 2006-05-03 13:15:44 +0000 | [diff] [blame] | 727 | pythondir='$(PYTHON_SITE_PACKAGES)' |
| Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 728 | else |
| Daniel Veillard | b2f8f1d | 2006-04-28 16:30:48 +0000 | [diff] [blame] | 729 | pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
| Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 730 | fi |
| Daniel Veillard | 4f69eb6 | 2005-08-24 22:19:10 +0000 | [diff] [blame] | 731 | else |
| 732 | PYTHON= |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 733 | fi |
| 734 | AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") |
| Daniel Veillard | 40b1134 | 2002-09-20 12:01:39 +0000 | [diff] [blame] | 735 | if test "$PYTHON_INCLUDES" != "" |
| 736 | then |
| 737 | PYTHON_SUBDIR=python |
| 738 | else |
| 739 | PYTHON_SUBDIR= |
| 740 | fi |
| Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 741 | AC_SUBST(pythondir) |
| Daniel Veillard | 40b1134 | 2002-09-20 12:01:39 +0000 | [diff] [blame] | 742 | AC_SUBST(PYTHON_SUBDIR) |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 743 | |
| Daniel Veillard | ce1648b | 2005-01-04 15:10:22 +0000 | [diff] [blame] | 744 | dnl check for dso support |
| 745 | WITH_MODULES=0 |
| Daniel Veillard | ce1648b | 2005-01-04 15:10:22 +0000 | [diff] [blame] | 746 | TEST_MODULES= |
| 747 | |
| Daniel Veillard | f6b71bd | 2005-01-04 17:50:14 +0000 | [diff] [blame] | 748 | if test "$with_modules" != "no" ; then |
| Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 749 | case "$host" in |
| 750 | *-*-cygwin*) |
| 751 | MODULE_EXTENSION=".dll" |
| 752 | AC_CHECK_LIB(cygwin, dlopen, [ |
| 753 | WITH_MODULES=1 |
| 754 | MODULE_PLATFORM_LIBS= |
| 755 | AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) |
| 756 | ]) |
| 757 | ;; |
| 758 | *) |
| Daniel Veillard | 1d96f5a | 2005-10-28 08:44:48 +0000 | [diff] [blame] | 759 | AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [ |
| 760 | AC_CHECK_LIB(dld, shl_load, [ |
| 761 | MODULE_PLATFORM_LIBS="-ldld" |
| 762 | libxml_have_shl_load=yes], [ |
| 763 | AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [ |
| 764 | AC_CHECK_LIB(dl, dlopen, [ |
| 765 | MODULE_PLATFORM_LIBS="-ldl" |
| 766 | libxml_have_dlopen=yes])])])]) |
| 767 | |
| 768 | if test "${libxml_have_shl_load}" = "yes"; then |
| 769 | MODULE_EXTENSION=".sl" |
| Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 770 | WITH_MODULES=1 |
| Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 771 | AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso]) |
| Daniel Veillard | 1d96f5a | 2005-10-28 08:44:48 +0000 | [diff] [blame] | 772 | fi |
| Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 773 | |
| Daniel Veillard | 1d96f5a | 2005-10-28 08:44:48 +0000 | [diff] [blame] | 774 | if test "${libxml_have_dlopen}" = "yes"; then |
| 775 | case "${host}" in |
| 776 | *-*-hpux* ) |
| 777 | MODULE_EXTENSION=".sl" |
| 778 | ;; |
| 779 | * ) |
| 780 | MODULE_EXTENSION=".so" |
| 781 | ;; |
| 782 | esac |
| 783 | |
| Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 784 | WITH_MODULES=1 |
| Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 785 | AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) |
| Daniel Veillard | 1d96f5a | 2005-10-28 08:44:48 +0000 | [diff] [blame] | 786 | fi |
| Daniel Veillard | 9202b67 | 2005-07-14 09:31:14 +0000 | [diff] [blame] | 787 | ;; |
| 788 | esac |
| Daniel Veillard | f6b71bd | 2005-01-04 17:50:14 +0000 | [diff] [blame] | 789 | fi |
| Daniel Veillard | ce1648b | 2005-01-04 15:10:22 +0000 | [diff] [blame] | 790 | |
| 791 | if test "${WITH_MODULES}" = "1"; then |
| 792 | TEST_MODULES="ModuleTests" |
| 793 | fi |
| 794 | |
| 795 | AC_SUBST(WITH_MODULES) |
| 796 | AC_SUBST(MODULE_PLATFORM_LIBS) |
| 797 | AC_SUBST(MODULE_EXTENSION) |
| 798 | AC_SUBST(TEST_MODULES) |
| 799 | |
| Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 800 | dnl |
| 801 | dnl Tester makes use of readline if present |
| 802 | dnl |
| Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 803 | |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 804 | dnl |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 805 | 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] | 806 | dnl (-Wunreachable-code) |
| Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 807 | dnl |
| William M. Brack | 871611b | 2003-10-18 04:53:14 +0000 | [diff] [blame] | 808 | if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \ |
| Daniel Veillard | b7c6ac4 | 2004-06-29 22:01:27 +0000 | [diff] [blame] | 809 | [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \ |
| William M. Brack | 7f28a01 | 2007-01-11 23:42:10 +0000 | [diff] [blame] | 810 | [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]] |
| William M. Brack | 871611b | 2003-10-18 04:53:14 +0000 | [diff] [blame] | 811 | then |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 812 | if test "$with_minimum" != "yes" |
| 813 | then |
| 814 | if test "${with_mem_debug}" = "" ; then |
| Daniel Veillard | 379a3b7 | 2005-08-12 10:18:14 +0000 | [diff] [blame] | 815 | echo Activating memory debugging |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 816 | with_mem_debug="yes" |
| Daniel Veillard | 22cdb84 | 2004-10-04 14:09:17 +0000 | [diff] [blame] | 817 | with_run_debug="yes" |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 818 | fi |
| 819 | if test "${with_docbook}" = "" ; then |
| 820 | with_docbook="yes" |
| 821 | fi |
| Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 822 | fi |
| Daniel Veillard | 3854c57 | 2005-08-25 10:17:45 +0000 | [diff] [blame] | 823 | if test "${GCC}" = "yes" ; then |
| Daniel Veillard | 05f9735 | 2004-10-31 15:35:32 +0000 | [diff] [blame] | 824 | 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] | 825 | fi |
| Daniel Veillard | 2e9b165 | 2003-02-19 13:29:45 +0000 | [diff] [blame] | 826 | STATIC_BINARIES="-static" |
| Daniel Veillard | c86a4fa | 2001-03-26 16:28:29 +0000 | [diff] [blame] | 827 | dnl -Wcast-qual -ansi |
| Daniel Veillard | 2e9b165 | 2003-02-19 13:29:45 +0000 | [diff] [blame] | 828 | else |
| 829 | STATIC_BINARIES= |
| Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 830 | fi |
| Daniel Veillard | 2e9b165 | 2003-02-19 13:29:45 +0000 | [diff] [blame] | 831 | AC_SUBST(STATIC_BINARIES) |
| Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 832 | |
| 833 | dnl |
| 834 | dnl Check for trio string functions |
| 835 | dnl |
| 836 | |
| 837 | if test "${NEED_TRIO}" = "1" ; then |
| 838 | echo Adding trio library for string functions |
| 839 | WITH_TRIO=1 |
| 840 | else |
| 841 | WITH_TRIO=0 |
| 842 | fi |
| Daniel Veillard | 01ef738 | 2001-05-08 07:31:43 +0000 | [diff] [blame] | 843 | AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1") |
| Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 844 | AC_SUBST(WITH_TRIO) |
| 845 | |
| Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 846 | dnl |
| William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 847 | dnl Allow to enable/disable various pieces |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 848 | dnl |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 849 | echo Checking configuration requirements |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 850 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 851 | dnl |
| 852 | dnl Thread-related stuff |
| 853 | dnl |
| Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 854 | THREAD_LIBS="" |
| Daniel Veillard | dbfe05a | 2005-05-04 09:18:00 +0000 | [diff] [blame] | 855 | BASE_THREAD_LIBS="" |
| Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 856 | WITH_THREADS=0 |
| 857 | THREAD_CFLAGS="" |
| Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 858 | TEST_THREADS="" |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 859 | THREADS_W32="" |
| Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 860 | |
| Daniel Veillard | 8494271 | 2003-04-18 14:40:05 +0000 | [diff] [blame] | 861 | if test "$with_threads" = "no" ; then |
| 862 | echo Disabling multithreaded support |
| 863 | else |
| Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 864 | echo Enabling multithreaded support |
| 865 | |
| 866 | AC_CHECK_HEADER(pthread.h, |
| Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 867 | AC_CHECK_LIB(pthread, pthread_join,[ |
| Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 868 | THREAD_LIBS="-lpthread" |
| Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 869 | AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)]) |
| 870 | AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there]) |
| Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 871 | WITH_THREADS="1"])) |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 872 | case $host_os in |
| 873 | *mingw32*) WITH_THREADS="1" |
| 874 | THREADS_W32="Win32" |
| 875 | THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" |
| 876 | ;; |
| William M. Brack | a73f45b | 2005-01-11 02:21:33 +0000 | [diff] [blame] | 877 | *cygwin*) THREAD_LIBS="" |
| 878 | ;; |
| Daniel Veillard | 7a3447a | 2005-01-04 14:31:14 +0000 | [diff] [blame] | 879 | *beos*) WITH_THREADS="1" |
| 880 | THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" |
| 881 | ;; |
| Daniel Veillard | dbfe05a | 2005-05-04 09:18:00 +0000 | [diff] [blame] | 882 | *linux*) |
| Daniel Veillard | 32a461f | 2005-08-25 21:48:54 +0000 | [diff] [blame] | 883 | if test "${GCC}" = "yes" ; then |
| 884 | GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'` |
| 885 | GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'` |
| 886 | GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'` |
| 887 | if test "${THREAD_LIBS}" = "-lpthread" ; then |
| 888 | if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null |
| 889 | then |
| 890 | THREAD_LIBS="" |
| 891 | BASE_THREAD_LIBS="-lpthread" |
| 892 | else |
| 893 | if expr ${GCC_MAJOR} \> 3 > /dev/null |
| 894 | then |
| 895 | THREAD_LIBS="" |
| 896 | BASE_THREAD_LIBS="-lpthread" |
| 897 | else |
| 898 | echo old GCC disabling weak symbols for pthread |
| 899 | fi |
| 900 | fi |
| 901 | fi |
| Daniel Veillard | dbfe05a | 2005-05-04 09:18:00 +0000 | [diff] [blame] | 902 | fi |
| 903 | ;; |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 904 | esac |
| Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 905 | if test "$WITH_THREADS" = "1" ; then |
| Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 906 | THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" |
| 907 | TEST_THREADS="Threadtests" |
| Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 908 | fi |
| 909 | fi |
| William M. Brack | 306e33c | 2004-06-12 01:01:22 +0000 | [diff] [blame] | 910 | if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then |
| Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 911 | THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED" |
| Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 912 | fi |
| 913 | |
| Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 914 | AC_SUBST(THREAD_LIBS) |
| Daniel Veillard | dbfe05a | 2005-05-04 09:18:00 +0000 | [diff] [blame] | 915 | AC_SUBST(BASE_THREAD_LIBS) |
| Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 916 | AC_SUBST(WITH_THREADS) |
| 917 | AC_SUBST(THREAD_CFLAGS) |
| Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 918 | AC_SUBST(TEST_THREADS) |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 919 | AC_SUBST(THREADS_W32) |
| Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 920 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 921 | dnl |
| 922 | dnl xmllint shell history |
| 923 | dnl |
| Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 924 | if test "$with_history" = "yes" ; then |
| Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 925 | echo Enabling xmllint shell history |
| 926 | dnl check for terminal library. this is a very cool solution |
| 927 | dnl from octave's configure.in |
| 928 | unset tcap |
| 929 | for termlib in ncurses curses termcap terminfo termlib; do |
| 930 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) |
| 931 | test -n "$tcap" && break |
| 932 | done |
| 933 | |
| 934 | AC_CHECK_HEADER(readline/history.h, |
| 935 | AC_CHECK_LIB(history, append_history,[ |
| 936 | RDL_LIBS="-lhistory" |
| Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 937 | AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])])) |
| Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 938 | AC_CHECK_HEADER(readline/readline.h, |
| 939 | AC_CHECK_LIB(readline, readline,[ |
| 940 | RDL_LIBS="-lreadline $RDL_LIBS $tcap" |
| Daniel Veillard | c790bf4 | 2003-10-11 10:50:10 +0000 | [diff] [blame] | 941 | AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap)) |
| Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 942 | if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then |
| 943 | CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" |
| 944 | RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" |
| Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 945 | fi |
| Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 946 | fi |
| 947 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 948 | dnl |
| 949 | dnl Tree functions |
| 950 | dnl |
| Daniel Veillard | 652327a | 2003-09-29 18:02:38 +0000 | [diff] [blame] | 951 | if test "$with_tree" = "no" ; then |
| 952 | echo Disabling DOM like tree manipulation APIs |
| 953 | WITH_TREE=0 |
| 954 | else |
| 955 | WITH_TREE=1 |
| 956 | fi |
| 957 | AC_SUBST(WITH_TREE) |
| 958 | |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 959 | if test "$with_ftp" = "no" ; then |
| 960 | echo Disabling FTP support |
| 961 | WITH_FTP=0 |
| 962 | FTP_OBJ= |
| 963 | else |
| 964 | WITH_FTP=1 |
| 965 | FTP_OBJ=nanoftp.o |
| 966 | fi |
| 967 | AC_SUBST(WITH_FTP) |
| 968 | AC_SUBST(FTP_OBJ) |
| 969 | |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 970 | if test "$with_http" = "no" ; then |
| 971 | echo Disabling HTTP support |
| 972 | WITH_HTTP=0 |
| 973 | HTTP_OBJ= |
| 974 | else |
| 975 | WITH_HTTP=1 |
| 976 | HTTP_OBJ=nanohttp.o |
| 977 | fi |
| 978 | AC_SUBST(WITH_HTTP) |
| 979 | AC_SUBST(HTTP_OBJ) |
| 980 | |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 981 | if test "$with_legacy" = "no" ; then |
| 982 | echo Disabling deprecated APIs |
| 983 | WITH_LEGACY=0 |
| 984 | else |
| 985 | WITH_LEGACY=1 |
| 986 | fi |
| 987 | AC_SUBST(WITH_LEGACY) |
| 988 | |
| Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 989 | if test "$with_reader" = "no" ; then |
| 990 | echo Disabling the xmlReader parsing interface |
| 991 | WITH_READER=0 |
| Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 992 | READER_TEST= |
| Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 993 | else |
| 994 | WITH_READER=1 |
| Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 995 | READER_TEST=Readertests |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 996 | if test "$with_push" = "no" ; then |
| 997 | echo xmlReader requires Push interface - enabling it |
| 998 | with_push=yes |
| 999 | fi |
| Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 1000 | fi |
| 1001 | AC_SUBST(WITH_READER) |
| Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1002 | AC_SUBST(READER_TEST) |
| Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 1003 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1004 | if test "$with_writer" = "no" ; then |
| 1005 | echo Disabling the xmlWriter saving interface |
| 1006 | WITH_WRITER=0 |
| 1007 | # WRITER_TEST= |
| 1008 | else |
| 1009 | WITH_WRITER=1 |
| 1010 | # WRITER_TEST=Writertests |
| 1011 | if test "$with_push" = "no" ; then |
| 1012 | echo xmlWriter requires Push interface - enabling it |
| 1013 | with_push=yes |
| 1014 | fi |
| 1015 | if test "$with_output" = "no" ; then |
| 1016 | echo xmlWriter requires Output interface - enabling it |
| 1017 | with_output=yes |
| 1018 | fi |
| Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1019 | fi |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1020 | AC_SUBST(WITH_WRITER) |
| 1021 | #AC_SUBST(WRITER_TEST) |
| 1022 | |
| Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1023 | if test "$with_pattern" = "no" ; then |
| 1024 | echo Disabling the xmlPattern parsing interface |
| 1025 | WITH_PATTERN=0 |
| Daniel Veillard | f9d1691 | 2005-01-30 22:36:30 +0000 | [diff] [blame] | 1026 | TEST_PATTERN= |
| Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1027 | else |
| 1028 | WITH_PATTERN=1 |
| Daniel Veillard | f9d1691 | 2005-01-30 22:36:30 +0000 | [diff] [blame] | 1029 | TEST_PATTERN=Patterntests |
| Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1030 | fi |
| 1031 | AC_SUBST(WITH_PATTERN) |
| Daniel Veillard | f9d1691 | 2005-01-30 22:36:30 +0000 | [diff] [blame] | 1032 | AC_SUBST(TEST_PATTERN) |
| Daniel Veillard | b3de70c | 2003-12-02 22:32:15 +0000 | [diff] [blame] | 1033 | |
| Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 1034 | if test "$with_sax1" = "no" ; then |
| 1035 | echo Disabling the older SAX1 interface |
| 1036 | WITH_SAX1=0 |
| 1037 | TEST_SAX= |
| 1038 | else |
| 1039 | WITH_SAX1=1 |
| 1040 | TEST_SAX=SAXtests |
| 1041 | fi |
| 1042 | AC_SUBST(WITH_SAX1) |
| 1043 | AC_SUBST(TEST_SAX) |
| 1044 | |
| Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1045 | if test "$with_push" = "no" ; then |
| 1046 | echo Disabling the PUSH parser interfaces |
| 1047 | WITH_PUSH=0 |
| 1048 | TEST_PUSH= |
| 1049 | else |
| 1050 | WITH_PUSH=1 |
| 1051 | TEST_PUSH="XMLPushtests" |
| 1052 | fi |
| 1053 | AC_SUBST(WITH_PUSH) |
| 1054 | AC_SUBST(TEST_PUSH) |
| 1055 | |
| Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1056 | if test "$with_html" = "no" ; then |
| 1057 | echo Disabling HTML support |
| 1058 | WITH_HTML=0 |
| 1059 | HTML_OBJ= |
| 1060 | TEST_HTML= |
| 1061 | else |
| 1062 | WITH_HTML=1 |
| 1063 | HTML_OBJ="HTMLparser.o HTMLtree.o" |
| 1064 | TEST_HTML=HTMLtests |
| William M. Brack | 871611b | 2003-10-18 04:53:14 +0000 | [diff] [blame] | 1065 | if test "$with_push" != "no" ; then |
| Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1066 | TEST_PHTML=HTMLPushtests |
| 1067 | else |
| 1068 | TEST_PHTML= |
| 1069 | fi |
| 1070 | fi |
| 1071 | AC_SUBST(WITH_HTML) |
| 1072 | AC_SUBST(HTML_OBJ) |
| 1073 | AC_SUBST(TEST_HTML) |
| 1074 | AC_SUBST(TEST_PHTML) |
| 1075 | |
| Daniel Veillard | 73b013f | 2003-09-30 12:36:01 +0000 | [diff] [blame] | 1076 | if test "$with_valid" = "no" ; then |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1077 | echo Disabling DTD validation support |
| 1078 | WITH_VALID=0 |
| 1079 | TEST_VALID= |
| 1080 | TEST_VTIME= |
| 1081 | else |
| 1082 | WITH_VALID=1 |
| 1083 | TEST_VALID=Validtests |
| 1084 | TEST_VTIME=VTimingtests |
| 1085 | fi |
| 1086 | AC_SUBST(WITH_VALID) |
| 1087 | AC_SUBST(TEST_VALID) |
| 1088 | AC_SUBST(TEST_VTIME) |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1089 | |
| Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 1090 | if test "$with_catalog" = "no" ; then |
| 1091 | echo Disabling Catalog support |
| 1092 | WITH_CATALOG=0 |
| 1093 | CATALOG_OBJ= |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1094 | TEST_CATALOG= |
| Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 1095 | else |
| 1096 | WITH_CATALOG=1 |
| 1097 | CATALOG_OBJ="catalog.o" |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1098 | TEST_CATALOG=Catatests |
| Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 1099 | fi |
| 1100 | AC_SUBST(WITH_CATALOG) |
| 1101 | AC_SUBST(CATALOG_OBJ) |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1102 | AC_SUBST(TEST_CATALOG) |
| Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 1103 | |
| Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 1104 | if test "$with_docbook" = "no" ; then |
| 1105 | echo Disabling Docbook support |
| Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 1106 | WITH_DOCB=0 |
| 1107 | DOCB_OBJ= |
| Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 1108 | else |
| 1109 | WITH_DOCB=1 |
| 1110 | DOCB_OBJ="DOCBparser.o" |
| Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 1111 | fi |
| 1112 | AC_SUBST(WITH_DOCB) |
| 1113 | AC_SUBST(DOCB_OBJ) |
| 1114 | |
| 1115 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1116 | if test "$with_xptr" = "no" ; then |
| 1117 | echo Disabling XPointer support |
| 1118 | WITH_XPTR=0 |
| 1119 | XPTR_OBJ= |
| 1120 | TEST_XPTR= |
| 1121 | else |
| 1122 | WITH_XPTR=1 |
| 1123 | XPTR_OBJ=xpointer.o |
| 1124 | TEST_XPTR=XPtrtests |
| 1125 | if test "$with_xpath" = "no" ; then |
| 1126 | echo XPointer requires XPath support - enabling it |
| 1127 | with_xpath=yes |
| 1128 | fi |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1129 | fi |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1130 | AC_SUBST(WITH_XPTR) |
| 1131 | AC_SUBST(XPTR_OBJ) |
| 1132 | AC_SUBST(TEST_XPTR) |
| 1133 | |
| 1134 | if test "$with_c14n" = "no" ; then |
| 1135 | echo Disabling C14N support |
| 1136 | WITH_C14N=0 |
| 1137 | C14N_OBJ= |
| 1138 | TEST_C14N= |
| 1139 | else |
| 1140 | WITH_C14N=1 |
| 1141 | C14N_OBJ="c14n.c" |
| 1142 | TEST_C14N=C14Ntests |
| 1143 | if test "$with_xpath" = "no" ; then |
| 1144 | echo C14N requires XPath support - enabling it |
| 1145 | with_xpath=yes |
| 1146 | fi |
| 1147 | fi |
| 1148 | AC_SUBST(WITH_C14N) |
| 1149 | AC_SUBST(C14N_OBJ) |
| 1150 | AC_SUBST(TEST_C14N) |
| 1151 | |
| 1152 | if test "$with_xinclude" = "no" ; then |
| 1153 | echo Disabling XInclude support |
| 1154 | WITH_XINCLUDE=0 |
| 1155 | XINCLUDE_OBJ= |
| 1156 | with_xinclude="no" |
| 1157 | TEST_XINCLUDE= |
| 1158 | else |
| 1159 | WITH_XINCLUDE=1 |
| 1160 | XINCLUDE_OBJ=xinclude.o |
| 1161 | TEST_XINCLUDE=XIncludetests |
| 1162 | if test "$with_xpath" = "no" ; then |
| 1163 | echo XInclude requires XPath support - enabling it |
| 1164 | with_xpath=yes |
| 1165 | fi |
| 1166 | fi |
| 1167 | AC_SUBST(WITH_XINCLUDE) |
| 1168 | AC_SUBST(XINCLUDE_OBJ) |
| 1169 | AC_SUBST(TEST_XINCLUDE) |
| 1170 | |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1171 | if test "$with_xpath" = "no" ; then |
| 1172 | echo Disabling XPATH support |
| 1173 | WITH_XPATH=0 |
| 1174 | XPATH_OBJ= |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1175 | TEST_XPATH= |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1176 | else |
| 1177 | WITH_XPATH=1 |
| 1178 | XPATH_OBJ=xpath.o |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1179 | TEST_XPATH=XPathtests |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1180 | fi |
| 1181 | AC_SUBST(WITH_XPATH) |
| 1182 | AC_SUBST(XPATH_OBJ) |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1183 | AC_SUBST(TEST_XPATH) |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1184 | |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1185 | dnl |
| 1186 | dnl output functions |
| 1187 | dnl |
| 1188 | if test "$with_output" = "no" ; then |
| 1189 | echo Disabling serialization/saving support |
| 1190 | WITH_OUTPUT=0 |
| Daniel Veillard | c8df0aa | 2000-10-10 23:50:30 +0000 | [diff] [blame] | 1191 | else |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1192 | WITH_OUTPUT=1 |
| Daniel Veillard | c8df0aa | 2000-10-10 23:50:30 +0000 | [diff] [blame] | 1193 | fi |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1194 | AC_SUBST(WITH_OUTPUT) |
| Daniel Veillard | 9e8bfae | 2000-11-06 16:43:11 +0000 | [diff] [blame] | 1195 | |
| Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1196 | WITH_ICONV=0 |
| Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 1197 | if test "$with_iconv" = "no" ; then |
| 1198 | echo Disabling ICONV support |
| Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 1199 | else |
| Daniel Veillard | 220346d | 2001-12-07 11:33:54 +0000 | [diff] [blame] | 1200 | if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then |
| Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1201 | CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" |
| Daniel Veillard | f5b44e4 | 2001-09-17 17:19:54 +0000 | [diff] [blame] | 1202 | # Export this since our headers include iconv.h |
| 1203 | XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" |
| Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1204 | ICONV_LIBS="-L$with_iconv/lib" |
| Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 1205 | fi |
| Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1206 | |
| 1207 | AC_CHECK_HEADER(iconv.h, |
| 1208 | AC_MSG_CHECKING(for iconv) |
| 1209 | AC_TRY_LINK([#include <stdlib.h> |
| 1210 | #include <iconv.h>],[ |
| 1211 | iconv_t cd = iconv_open ("",""); |
| 1212 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
| 1213 | AC_MSG_RESULT(yes) |
| 1214 | WITH_ICONV=1],[ |
| 1215 | AC_MSG_RESULT(no) |
| 1216 | AC_MSG_CHECKING(for iconv in -liconv) |
| 1217 | |
| 1218 | _ldflags="${LDFLAGS}" |
| 1219 | _libs="${LIBS}" |
| 1220 | LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" |
| 1221 | LIBS="${LIBS} -liconv" |
| 1222 | |
| 1223 | AC_TRY_LINK([#include <stdlib.h> |
| 1224 | #include <iconv.h>],[ |
| 1225 | iconv_t cd = iconv_open ("",""); |
| 1226 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
| 1227 | AC_MSG_RESULT(yes) |
| 1228 | WITH_ICONV=1 |
| 1229 | ICONV_LIBS="${ICONV_LIBS} -liconv" |
| 1230 | LIBS="${_libs}" |
| 1231 | LDFLAGS="${_ldflags}"],[ |
| 1232 | AC_MSG_RESULT(no) |
| 1233 | LIBS="${_libs}" |
| 1234 | LDFLAGS="${_ldflags}"])])) |
| Daniel Veillard | 8e1a46d | 2008-02-15 07:47:26 +0000 | [diff] [blame] | 1235 | |
| 1236 | if test "$WITH_ICONV" = "1" ; then |
| 1237 | AC_MSG_CHECKING([for iconv declaration]) |
| 1238 | AC_CACHE_VAL(xml_cv_iconv_arg2, [ |
| 1239 | AC_TRY_COMPILE([#include <stdlib.h> |
| 1240 | #include <iconv.h> |
| 1241 | extern |
| 1242 | #ifdef __cplusplus |
| 1243 | "C" |
| 1244 | #endif |
| 1245 | #if defined(__STDC__) || defined(__cplusplus) |
| 1246 | size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); |
| 1247 | #else |
| 1248 | size_t iconv(); |
| 1249 | #endif |
| 1250 | ], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")]) |
| 1251 | |
| 1252 | 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);" |
| 1253 | AC_MSG_RESULT([${xml_xxx:- |
| 1254 | }$xml_cv_iconv_decl]) |
| 1255 | AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2, |
| 1256 | [Define as const if the declaration of iconv() needs const.]) |
| 1257 | fi |
| Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 1258 | fi |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1259 | case "$host" in |
| 1260 | *mingw*) M_LIBS="" |
| 1261 | ;; |
| Daniel Veillard | 7a3447a | 2005-01-04 14:31:14 +0000 | [diff] [blame] | 1262 | *beos*) M_LIBS="" |
| 1263 | ;; |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1264 | *) M_LIBS="-lm" |
| 1265 | ;; |
| 1266 | esac |
| Daniel Veillard | b82c166 | 2001-12-09 14:00:54 +0000 | [diff] [blame] | 1267 | XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" |
| Daniel Veillard | 90d165b | 2003-09-01 20:33:13 +0000 | [diff] [blame] | 1268 | XML_LIBTOOLLIBS="libxml2.la" |
| Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 1269 | AC_SUBST(WITH_ICONV) |
| 1270 | |
| Daniel Veillard | 01fc1a9 | 2003-07-30 15:12:01 +0000 | [diff] [blame] | 1271 | WITH_ISO8859X=1 |
| Daniel Veillard | 01fc1a9 | 2003-07-30 15:12:01 +0000 | [diff] [blame] | 1272 | if test "$WITH_ICONV" != "1" ; then |
| 1273 | if test "$with_iso8859x" = "no" ; then |
| 1274 | echo Disabling ISO8859X support |
| 1275 | WITH_ISO8859X=0 |
| 1276 | fi |
| 1277 | fi |
| 1278 | AC_SUBST(WITH_ISO8859X) |
| 1279 | |
| Daniel Veillard | ed6c549 | 2005-07-23 15:00:22 +0000 | [diff] [blame] | 1280 | if test "$with_schematron" = "no" ; then |
| 1281 | echo "Disabling Schematron support" |
| 1282 | WITH_SCHEMATRON=0 |
| 1283 | TEST_SCHEMATRON= |
| 1284 | else |
| 1285 | echo "Enabled Schematron support" |
| 1286 | WITH_SCHEMATRON=1 |
| 1287 | TEST_SCHEMATRON="Schematrontests" |
| 1288 | with_xpath=yes |
| 1289 | with_pattern=yes |
| 1290 | fi |
| 1291 | AC_SUBST(WITH_SCHEMATRON) |
| 1292 | AC_SUBST(TEST_SCHEMATRON) |
| 1293 | |
| Daniel Veillard | ef4d3bc | 2003-02-07 12:38:22 +0000 | [diff] [blame] | 1294 | if test "$with_schemas" = "no" ; then |
| William M. Brack | 21e4ef2 | 2005-01-02 09:53:13 +0000 | [diff] [blame] | 1295 | echo "Disabling Schemas/Relax-NG support" |
| Daniel Veillard | ef4d3bc | 2003-02-07 12:38:22 +0000 | [diff] [blame] | 1296 | WITH_SCHEMAS=0 |
| 1297 | TEST_SCHEMAS= |
| 1298 | else |
| Daniel Veillard | 71531f3 | 2003-02-05 13:19:53 +0000 | [diff] [blame] | 1299 | echo "Enabled Schemas/Relax-NG support" |
| Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 1300 | WITH_SCHEMAS=1 |
| Daniel Veillard | 6eadf63 | 2003-01-23 18:29:16 +0000 | [diff] [blame] | 1301 | TEST_SCHEMAS="Schemastests Relaxtests" |
| Daniel Veillard | 6dc9196 | 2004-03-22 19:10:02 +0000 | [diff] [blame] | 1302 | if test "$PYTHON_INCLUDES" != "" ; then |
| 1303 | PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests" |
| 1304 | fi |
| Daniel Veillard | 23e7357 | 2002-09-19 19:56:43 +0000 | [diff] [blame] | 1305 | with_regexps=yes |
| Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 1306 | fi |
| 1307 | AC_SUBST(WITH_SCHEMAS) |
| 1308 | AC_SUBST(TEST_SCHEMAS) |
| 1309 | |
| Daniel Veillard | 23e7357 | 2002-09-19 19:56:43 +0000 | [diff] [blame] | 1310 | if test "$with_regexps" = "no" ; then |
| 1311 | echo Disabling Regexps support |
| 1312 | WITH_REGEXPS=0 |
| 1313 | TEST_REGEXPS= |
| 1314 | else |
| 1315 | WITH_REGEXPS=1 |
| 1316 | TEST_REGEXPS="Regexptests Automatatests" |
| 1317 | fi |
| 1318 | AC_SUBST(WITH_REGEXPS) |
| 1319 | AC_SUBST(TEST_REGEXPS) |
| 1320 | |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1321 | if test "$with_debug" = "no" ; then |
| 1322 | echo Disabling DEBUG support |
| 1323 | WITH_DEBUG=0 |
| 1324 | DEBUG_OBJ= |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1325 | TEST_DEBUG= |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1326 | else |
| 1327 | WITH_DEBUG=1 |
| 1328 | DEBUG_OBJ=debugXML.o |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1329 | TEST_DEBUG=Scripttests |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1330 | fi |
| 1331 | AC_SUBST(WITH_DEBUG) |
| 1332 | AC_SUBST(DEBUG_OBJ) |
| Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 1333 | AC_SUBST(TEST_DEBUG) |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1334 | |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1335 | if test "$with_mem_debug" = "yes" ; then |
| William M. Brack | 306e33c | 2004-06-12 01:01:22 +0000 | [diff] [blame] | 1336 | if test "$with_thread_alloc" = "yes" ; then |
| 1337 | echo Disabling memory debug - cannot use mem-debug with thread-alloc! |
| 1338 | WITH_MEM_DEBUG=0 |
| 1339 | else |
| 1340 | echo Enabling memory debug support |
| 1341 | WITH_MEM_DEBUG=1 |
| 1342 | fi |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1343 | else |
| 1344 | WITH_MEM_DEBUG=0 |
| 1345 | fi |
| 1346 | AC_SUBST(WITH_MEM_DEBUG) |
| 1347 | |
| Daniel Veillard | 22cdb84 | 2004-10-04 14:09:17 +0000 | [diff] [blame] | 1348 | if test "$with_run_debug" = "yes" ; then |
| 1349 | echo Enabling runtime debug support |
| 1350 | WITH_RUN_DEBUG=1 |
| 1351 | else |
| 1352 | WITH_RUN_DEBUG=0 |
| 1353 | fi |
| 1354 | AC_SUBST(WITH_RUN_DEBUG) |
| Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1355 | |
| 1356 | WIN32_EXTRA_LIBADD= |
| 1357 | WIN32_EXTRA_LDFLAGS= |
| William M. Brack | a73f45b | 2005-01-11 02:21:33 +0000 | [diff] [blame] | 1358 | CYGWIN_EXTRA_LDFLAGS= |
| 1359 | CYGWIN_EXTRA_PYTHON_LIBADD= |
| Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1360 | case "$host" in |
| 1361 | *-*-mingw*) |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1362 | CPPFLAGS="$CPPFLAGS -DWIN32" |
| 1363 | WIN32_EXTRA_LIBADD="-lws2_32" |
| Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1364 | WIN32_EXTRA_LDFLAGS="-no-undefined" |
| 1365 | AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation]) |
| 1366 | AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around]) |
| 1367 | AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around]) |
| 1368 | ;; |
| Daniel Veillard | d392ba7 | 2004-08-04 14:56:45 +0000 | [diff] [blame] | 1369 | *-*-cygwin*) |
| 1370 | CYGWIN_EXTRA_LDFLAGS="-no-undefined" |
| William M. Brack | a73f45b | 2005-01-11 02:21:33 +0000 | [diff] [blame] | 1371 | if test "${PYTHON}" != "" |
| 1372 | then |
| 1373 | CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}" |
| 1374 | fi |
| Daniel Veillard | d392ba7 | 2004-08-04 14:56:45 +0000 | [diff] [blame] | 1375 | ;; |
| Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1376 | esac |
| 1377 | AC_SUBST(WIN32_EXTRA_LIBADD) |
| 1378 | AC_SUBST(WIN32_EXTRA_LDFLAGS) |
| Daniel Veillard | d392ba7 | 2004-08-04 14:56:45 +0000 | [diff] [blame] | 1379 | AC_SUBST(CYGWIN_EXTRA_LDFLAGS) |
| 1380 | AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD) |
| Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 1381 | |
| Daniel Veillard | bfa5cf1 | 2008-08-27 15:33:28 +0000 | [diff] [blame] | 1382 | if test "$with_coverage" = "yes" -a "${GCC}" = "yes" |
| 1383 | then |
| 1384 | echo Enabling code coverage for GCC |
| 1385 | CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" |
| 1386 | LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage" |
| 1387 | else |
| 1388 | echo Disabling code coverage for GCC |
| 1389 | fi |
| 1390 | |
| Daniel Veillard | 6984e6d | 2003-12-09 14:20:17 +0000 | [diff] [blame] | 1391 | AC_SUBST(CPPFLAGS) |
| Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 1392 | AC_SUBST(CFLAGS) |
| Daniel Veillard | bfa5cf1 | 2008-08-27 15:33:28 +0000 | [diff] [blame] | 1393 | AC_SUBST(LDFLAGS) |
| Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 1394 | AC_SUBST(XML_CFLAGS) |
| Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 1395 | |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 1396 | AC_SUBST(XML_LIBDIR) |
| 1397 | AC_SUBST(XML_LIBS) |
| Daniel Veillard | 90d165b | 2003-09-01 20:33:13 +0000 | [diff] [blame] | 1398 | AC_SUBST(XML_LIBTOOLLIBS) |
| Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 1399 | AC_SUBST(ICONV_LIBS) |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 1400 | AC_SUBST(XML_INCLUDEDIR) |
| 1401 | AC_SUBST(HTML_DIR) |
| 1402 | AC_SUBST(HAVE_ISNAN) |
| 1403 | AC_SUBST(HAVE_ISINF) |
| Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 1404 | AC_SUBST(PYTHON) |
| 1405 | AC_SUBST(PYTHON_VERSION) |
| 1406 | AC_SUBST(PYTHON_INCLUDES) |
| Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 1407 | AC_SUBST(PYTHON_SITE_PACKAGES) |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 1408 | |
| Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 1409 | AC_SUBST(M_LIBS) |
| Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 1410 | AC_SUBST(RDL_LIBS) |
| Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 1411 | |
| Daniel Veillard | 9715c17 | 2002-11-25 16:33:40 +0000 | [diff] [blame] | 1412 | dnl for the spec file |
| 1413 | RELDATE=`date +'%a %b %e %Y'` |
| 1414 | AC_SUBST(RELDATE) |
| Daniel Veillard | 6dc9196 | 2004-03-22 19:10:02 +0000 | [diff] [blame] | 1415 | AC_SUBST(PYTHON_TESTS) |
| Daniel Veillard | 9715c17 | 2002-11-25 16:33:40 +0000 | [diff] [blame] | 1416 | |
| Daniel Veillard | c6e997c | 2003-01-27 12:35:42 +0000 | [diff] [blame] | 1417 | rm -f COPYING.LIB COPYING |
| Daniel Veillard | c575b99 | 2002-02-08 13:28:40 +0000 | [diff] [blame] | 1418 | ln -s Copyright COPYING |
| 1419 | |
| Daniel Veillard | e4177a5 | 2004-01-08 16:43:57 +0000 | [diff] [blame] | 1420 | # keep on one line for cygwin c.f. #130896 |
| Daniel Veillard | 99b7850 | 2005-09-11 22:04:08 +0000 | [diff] [blame] | 1421 | AC_OUTPUT(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) |
| Arturo Espinosa | 15fe6e7 | 1998-09-07 17:27:57 +0000 | [diff] [blame] | 1422 | |
| Daniel Veillard | 06d2524 | 2004-02-25 13:01:42 +0000 | [diff] [blame] | 1423 | chmod +x xml2-config python/setup.py |
| Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 1424 | echo Done configuring |