Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | AC_PREREQ(2.2) |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 3 | AC_INIT(entities.h) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 4 | AM_CONFIG_HEADER(config.h) |
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 | 32bc74e | 2000-07-14 14:49:25 +0000 | [diff] [blame] | 7 | LIBXML_MINOR_VERSION=2 |
Daniel Veillard | 87b9539 | 2000-08-12 21:12:04 +0000 | [diff] [blame] | 8 | LIBXML_MICRO_VERSION=2 |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 9 | LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION |
| 10 | LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION |
| 11 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 12 | LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` |
| 13 | |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 14 | AC_SUBST(LIBXML_MAJOR_VERSION) |
| 15 | AC_SUBST(LIBXML_MINOR_VERSION) |
| 16 | AC_SUBST(LIBXML_MICRO_VERSION) |
| 17 | AC_SUBST(LIBXML_VERSION) |
| 18 | AC_SUBST(LIBXML_VERSION_INFO) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 19 | AC_SUBST(LIBXML_VERSION_NUMBER) |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 20 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 21 | VERSION=${LIBXML_VERSION} |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 22 | |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 23 | AM_INIT_AUTOMAKE(libxml2, $VERSION) |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 24 | |
| 25 | AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 26 | |
| 27 | dnl Checks for programs. |
| 28 | AC_PROG_CC |
| 29 | AC_PROG_INSTALL |
Sebastian Wilhelmi | a44c8a4 | 1998-08-07 08:38:58 +0000 | [diff] [blame] | 30 | AC_PROG_CPP |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 31 | AC_PATH_PROG(RM, rm, /bin/rm) |
| 32 | AC_PATH_PROG(MV, mv, /bin/mv) |
| 33 | AC_PATH_PROG(TAR, tar, /bin/tar) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 34 | |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame^] | 35 | dnl Make sure we have an ANSI compiler |
| 36 | AM_C_PROTOTYPES |
| 37 | test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) |
| 38 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 39 | AM_PROG_LIBTOOL |
| 40 | |
| 41 | AM_MAINTAINER_MODE |
| 42 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 43 | dnl Checks for zlib library. |
| 44 | _cppflags="${CPPFLAGS}" |
| 45 | _ldflags="${LDFLAGS}" |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 46 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 47 | AC_ARG_WITH(zlib, |
| 48 | [ --with-zlib[=DIR] use libz in DIR],[ |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame^] | 49 | if test "$withval" != "no" -a "$withval" != "yes"; then |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 50 | Z_DIR=$withval |
| 51 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 52 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 53 | fi |
| 54 | ]) |
| 55 | |
Daniel Veillard | 461a66c | 2000-01-18 18:01:01 +0000 | [diff] [blame] | 56 | AC_CHECK_HEADERS(zlib.h, |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 57 | AC_CHECK_LIB(z, gzread,[ |
| 58 | AC_DEFINE(HAVE_LIBZ) |
| 59 | if test "x${Z_DIR}" != "x"; then |
| 60 | Z_CFLAGS="-I${Z_DIR}/include" |
| 61 | Z_LIBS="-L${Z_DIR}/lib -lz" |
| 62 | else |
| 63 | Z_LIBS="-lz" |
| 64 | fi])) |
| 65 | AC_SUBST(Z_CFLAGS) |
| 66 | AC_SUBST(Z_LIBS) |
| 67 | |
| 68 | CPPFLAGS=${_cppflags} |
| 69 | LDFLAGS=${_ldflags} |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 70 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 71 | dnl Checks for header files. |
| 72 | AC_HEADER_DIRENT |
| 73 | AC_HEADER_STDC |
| 74 | AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h) |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 75 | AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 76 | AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h) |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 77 | AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h) |
Daniel Veillard | 46e370e | 2000-07-21 20:32:03 +0000 | [diff] [blame] | 78 | AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h sys/mman.h) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 79 | |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 80 | dnl Specific dir for HTML output ? |
| 81 | if test "x$with_html_dir" = "x" ; then |
| 82 | HTML_DIR='${datadir}/gtk-doc/html' |
| 83 | else |
| 84 | HTML_DIR=$with_html_dir |
| 85 | fi |
| 86 | |
| 87 | AC_SUBST(HTML_DIR) |
| 88 | |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 89 | AC_ARG_ENABLE(corba, [ --enable-corba Add Corba support (default)]) |
| 90 | |
| 91 | dnl |
| 92 | dnl Corba is enabled by default |
| 93 | dnl |
Daniel Veillard | da4d3c4 | 1998-11-04 20:07:05 +0000 | [diff] [blame] | 94 | if test "$enable_corba" = "no" ; then |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 95 | CORBA_CFLAGS="-DWITHOUT_CORBA" |
| 96 | fi |
| 97 | AC_SUBST(CORBA_CFLAGS) |
| 98 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 99 | dnl Checks for library functions. |
| 100 | AC_FUNC_STRFTIME |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 101 | AC_CHECK_FUNCS(strdup strndup strerror snprintf) |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 102 | AC_CHECK_FUNCS(finite isnand fp_class class fpclass) |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 103 | AC_CHECK_FUNCS(strftime localtime) |
| 104 | |
| 105 | dnl Checks for inet libraries: |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 106 | AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) |
| 107 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
| 108 | AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect)) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 109 | |
| 110 | dnl Checks for isnan in libm if not in libc |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 111 | AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan, |
| 112 | [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 113 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 114 | AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf, |
| 115 | [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 116 | |
| 117 | XML_LIBDIR='-L${libdir}' |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 118 | XML_INCLUDEDIR='-I${includedir}/libxml -I${includedir}' |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 119 | XML_LIBS="-lxml $Z_LIBS $M_LIBS $LIBS" |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 120 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 121 | dnl |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 122 | dnl Extra flags |
| 123 | dnl |
| 124 | XML_CFLAGS="" |
| 125 | |
| 126 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame^] | 127 | dnl Workaround for HP native compiler |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 128 | dnl http://bugs.gnome.org/db/31/3163.html |
| 129 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame^] | 130 | if test "${GCC}" != "yes" ; then |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 131 | case "${host}" in |
| 132 | *-*-hpux* ) |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame^] | 133 | CFLAGS="${CFLAGS} -Wp,-H30000" |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 134 | ;; |
| 135 | esac |
| 136 | fi |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 137 | |
| 138 | dnl |
| 139 | dnl Use buffers for content |
| 140 | dnl |
| 141 | |
| 142 | AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content]) |
| 143 | if test "$with_buffers" = "yes" ; then |
| 144 | CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 145 | XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 146 | fi |
| 147 | |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 148 | dnl |
| 149 | dnl Tester makes use of readline if present |
| 150 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame^] | 151 | _cppflags="${CPPFLAGS}" |
| 152 | _ldflags="${LDFLAGS}" |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 153 | |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame^] | 154 | AC_ARG_WITH(readline, |
| 155 | [ --with-readline=DIR use readline in DIR],[ |
| 156 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 157 | RDL_DIR=$withval |
| 158 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 159 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 160 | fi |
| 161 | ]) |
| 162 | |
| 163 | dnl check for terminal library. this is a very cool solution |
| 164 | dnl from octave's configure.in |
| 165 | unset tcap |
| 166 | for termlib in ncurses curses termcap terminfo termlib; do |
| 167 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) |
| 168 | test -n "$tcap" && break |
| 169 | done |
| 170 | |
| 171 | AC_CHECK_HEADER(readline/history.h, |
| 172 | AC_CHECK_LIB(history, append_history,[ |
| 173 | RDL_LIBS="-lhistory" |
| 174 | AC_DEFINE(HAVE_LIBHISTORY)])) |
| 175 | AC_CHECK_HEADER(readline/readline.h, |
| 176 | AC_CHECK_LIB(readline, readline,[ |
| 177 | RDL_LIBS="-lreadline $RDL_LIBS $tcap" |
| 178 | AC_DEFINE(HAVE_LIBREADLINE)], , $tcap)) |
| 179 | if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then |
| 180 | CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" |
| 181 | RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" |
| 182 | else |
| 183 | CPPFLAGS=${_cppflags} |
| 184 | fi |
| 185 | LDFLAGS=${_ldflags} |
| 186 | |
| 187 | AC_SUBST(RDL_LIBS) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 188 | |
| 189 | dnl |
| 190 | dnl Aloow to disable various pieces |
| 191 | dnl |
| 192 | |
| 193 | AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)]) |
| 194 | if test "$with_ftp" = "no" ; then |
| 195 | echo Disabling FTP support |
| 196 | WITH_FTP=0 |
| 197 | FTP_OBJ= |
| 198 | else |
| 199 | WITH_FTP=1 |
| 200 | FTP_OBJ=nanoftp.o |
| 201 | fi |
| 202 | AC_SUBST(WITH_FTP) |
| 203 | AC_SUBST(FTP_OBJ) |
| 204 | |
| 205 | AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)]) |
| 206 | if test "$with_http" = "no" ; then |
| 207 | echo Disabling HTTP support |
| 208 | WITH_HTTP=0 |
| 209 | HTTP_OBJ= |
| 210 | else |
| 211 | WITH_HTTP=1 |
| 212 | HTTP_OBJ=nanohttp.o |
| 213 | fi |
| 214 | AC_SUBST(WITH_HTTP) |
| 215 | AC_SUBST(HTTP_OBJ) |
| 216 | |
| 217 | AC_ARG_WITH(html, [ --with-html Add the HTML support (on)]) |
| 218 | if test "$with_html" = "no" ; then |
| 219 | echo Disabling HTML support |
| 220 | WITH_HTML=0 |
| 221 | HTML_OBJ= |
| 222 | else |
| 223 | WITH_HTML=1 |
| 224 | HTML_OBJ="HTMLparser.o HTMLtree.o" |
| 225 | fi |
| 226 | AC_SUBST(WITH_HTML) |
| 227 | AC_SUBST(HTML_OBJ) |
| 228 | |
| 229 | AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)]) |
| 230 | if test "$with_xpath" = "no" ; then |
| 231 | echo Disabling XPATH support |
| 232 | WITH_XPATH=0 |
| 233 | XPATH_OBJ= |
| 234 | else |
| 235 | WITH_XPATH=1 |
| 236 | XPATH_OBJ=xpath.o |
| 237 | fi |
| 238 | AC_SUBST(WITH_XPATH) |
| 239 | AC_SUBST(XPATH_OBJ) |
| 240 | |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 241 | AC_ARG_WITH(iconv, [ --with-iconv Add the ICONV support (on)]) |
| 242 | if test "$with_iconv" = "no" ; then |
| 243 | echo Disabling ICONV support |
| 244 | WITH_ICONV=0 |
| 245 | else |
| 246 | if test "$have_iconv" != "" ; then |
| 247 | echo Iconv support not found |
| 248 | WITH_ICONV=0 |
| 249 | else |
| 250 | WITH_ICONV=1 |
| 251 | fi |
| 252 | fi |
| 253 | AC_SUBST(WITH_ICONV) |
| 254 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 255 | AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)]) |
| 256 | if test "$with_debug" = "no" ; then |
| 257 | echo Disabling DEBUG support |
| 258 | WITH_DEBUG=0 |
| 259 | DEBUG_OBJ= |
| 260 | else |
| 261 | WITH_DEBUG=1 |
| 262 | DEBUG_OBJ=debugXML.o |
| 263 | fi |
| 264 | AC_SUBST(WITH_DEBUG) |
| 265 | AC_SUBST(DEBUG_OBJ) |
| 266 | |
| 267 | AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)]) |
| 268 | if test "$with_mem_debug" = "yes" ; then |
| 269 | echo Enabling memory debug support |
| 270 | WITH_MEM_DEBUG=1 |
| 271 | else |
| 272 | WITH_MEM_DEBUG=0 |
| 273 | fi |
| 274 | AC_SUBST(WITH_MEM_DEBUG) |
| 275 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 276 | AC_SUBST(CFLAGS) |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 277 | AC_SUBST(XML_CFLAGS) |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 278 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 279 | AC_SUBST(XML_LIBDIR) |
| 280 | AC_SUBST(XML_LIBS) |
| 281 | AC_SUBST(XML_INCLUDEDIR) |
| 282 | AC_SUBST(HTML_DIR) |
| 283 | AC_SUBST(HAVE_ISNAN) |
| 284 | AC_SUBST(HAVE_ISINF) |
| 285 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 286 | AC_SUBST(M_LIBS) |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 287 | AC_SUBST(RDL_LIBS) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 288 | |
| 289 | dnl |
| 290 | dnl create the libxml link needed to get dependencies right |
| 291 | dnl |
| 292 | if test -f $srcdir/libxml |
| 293 | then |
| 294 | rm -f $srcdir/libxml libxml |
| 295 | (cd $srcdir ; ln -s . libxml) |
| 296 | (ln -s . libxml) |
| 297 | else |
| 298 | (cd $srcdir ; rm -f libxml ; ln -s . libxml) |
| 299 | (rm -f libxml ; ln -s . libxml) |
| 300 | fi |
| 301 | AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xmlversion.h xml-config win32config.h) |
Arturo Espinosa | 15fe6e7 | 1998-09-07 17:27:57 +0000 | [diff] [blame] | 302 | |