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 | |
| 6 | LIBXML_MAJOR_VERSION=1 |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 7 | LIBXML_MINOR_VERSION=8 |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 8 | LIBXML_MICRO_VERSION=4 |
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 | |
| 12 | AC_SUBST(LIBXML_MAJOR_VERSION) |
| 13 | AC_SUBST(LIBXML_MINOR_VERSION) |
| 14 | AC_SUBST(LIBXML_MICRO_VERSION) |
| 15 | AC_SUBST(LIBXML_VERSION) |
| 16 | AC_SUBST(LIBXML_VERSION_INFO) |
| 17 | |
| 18 | VERSION=$LIBXML_VERSION |
| 19 | |
| 20 | AM_INIT_AUTOMAKE(libxml, $VERSION) |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 21 | |
| 22 | 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] | 23 | |
| 24 | dnl Checks for programs. |
| 25 | AC_PROG_CC |
| 26 | AC_PROG_INSTALL |
Sebastian Wilhelmi | a44c8a4 | 1998-08-07 08:38:58 +0000 | [diff] [blame] | 27 | AC_PROG_CPP |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 28 | AC_PATH_PROG(RM, rm, /bin/rm) |
| 29 | AC_PATH_PROG(MV, mv, /bin/mv) |
| 30 | AC_PATH_PROG(TAR, tar, /bin/tar) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 31 | |
| 32 | AM_PROG_LIBTOOL |
| 33 | |
| 34 | AM_MAINTAINER_MODE |
| 35 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 36 | dnl Checks for zlib library. |
| 37 | _cppflags="${CPPFLAGS}" |
| 38 | _ldflags="${LDFLAGS}" |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 39 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 40 | AC_ARG_WITH(zlib, |
| 41 | [ --with-zlib[=DIR] use libz in DIR],[ |
| 42 | if test "$withval" != "no"; then |
| 43 | Z_DIR=$withval |
| 44 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 45 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 46 | fi |
| 47 | ]) |
| 48 | |
| 49 | AC_CHECK_HEADER(zlib.h, |
| 50 | AC_CHECK_LIB(z, gzread,[ |
| 51 | AC_DEFINE(HAVE_LIBZ) |
| 52 | if test "x${Z_DIR}" != "x"; then |
| 53 | Z_CFLAGS="-I${Z_DIR}/include" |
| 54 | Z_LIBS="-L${Z_DIR}/lib -lz" |
| 55 | else |
| 56 | Z_LIBS="-lz" |
| 57 | fi])) |
| 58 | AC_SUBST(Z_CFLAGS) |
| 59 | AC_SUBST(Z_LIBS) |
| 60 | |
| 61 | CPPFLAGS=${_cppflags} |
| 62 | LDFLAGS=${_ldflags} |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 63 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 64 | dnl Checks for header files. |
| 65 | AC_HEADER_DIRENT |
| 66 | AC_HEADER_STDC |
| 67 | 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] | 68 | 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] | 69 | 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] | 70 | AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h) |
| 71 | AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 72 | |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 73 | dnl Specific dir for HTML output ? |
| 74 | if test "x$with_html_dir" = "x" ; then |
| 75 | HTML_DIR='${datadir}/gtk-doc/html' |
| 76 | else |
| 77 | HTML_DIR=$with_html_dir |
| 78 | fi |
| 79 | |
| 80 | AC_SUBST(HTML_DIR) |
| 81 | |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 82 | AC_ARG_ENABLE(corba, [ --enable-corba Add Corba support (default)]) |
| 83 | |
| 84 | dnl |
| 85 | dnl Corba is enabled by default |
| 86 | dnl |
Daniel Veillard | da4d3c4 | 1998-11-04 20:07:05 +0000 | [diff] [blame] | 87 | if test "$enable_corba" = "no" ; then |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 88 | CORBA_CFLAGS="-DWITHOUT_CORBA" |
| 89 | fi |
| 90 | AC_SUBST(CORBA_CFLAGS) |
| 91 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 92 | dnl Checks for library functions. |
| 93 | AC_FUNC_STRFTIME |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 94 | AC_CHECK_FUNCS(strdup strndup strerror snprintf) |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 95 | AC_CHECK_FUNCS(finite isnand fp_class class fpclass) |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 96 | AC_CHECK_FUNCS(strftime localtime) |
| 97 | |
| 98 | dnl Checks for inet libraries: |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 99 | AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) |
| 100 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
| 101 | AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect)) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 102 | |
| 103 | dnl Checks for isnan in libm if not in libc |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 104 | AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan, |
| 105 | [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 106 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 107 | AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf, |
| 108 | [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 109 | |
| 110 | XML_LIBDIR='-L${libdir}' |
| 111 | XML_INCLUDEDIR='-I${includedir}/gnome-xml' |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 112 | XML_LIBS="-lxml $Z_LIBS $M_LIBS $LIBS" |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 113 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 114 | dnl |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 115 | dnl Extra flags |
| 116 | dnl |
| 117 | XML_CFLAGS="" |
| 118 | |
| 119 | dnl |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 120 | dnl Workaround wor HP native compiler |
| 121 | dnl http://bugs.gnome.org/db/31/3163.html |
| 122 | dnl |
| 123 | if test "${CC}" != "gcc" ; then |
| 124 | case "${host}" in |
| 125 | *-*-hpux* ) |
| 126 | CFLAGS="${CFLAGS} -Wp,-H16800 -Ae" |
| 127 | ;; |
| 128 | esac |
| 129 | fi |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 130 | |
| 131 | dnl |
| 132 | dnl Use buffers for content |
| 133 | dnl |
| 134 | |
| 135 | AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content]) |
| 136 | if test "$with_buffers" = "yes" ; then |
| 137 | CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 138 | XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 139 | fi |
| 140 | |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 141 | dnl |
| 142 | dnl Tester makes use of readline if present |
| 143 | dnl |
| 144 | RDL_LIBS="" |
| 145 | AC_CHECK_LIB(history, append_history, |
| 146 | RDL_LIBS="-lhistory"; AC_DEFINE(HAVE_LIBHISTORY)) |
| 147 | AC_CHECK_LIB(readline, readline, |
| 148 | RDL_LIBS="-lreadline ${RDL_LIBS}"; AC_DEFINE(HAVE_LIBREADLINE)) |
| 149 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 150 | AC_SUBST(CFLAGS) |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 151 | AC_SUBST(XML_CFLAGS) |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 152 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 153 | AC_SUBST(XML_LIBDIR) |
| 154 | AC_SUBST(XML_LIBS) |
| 155 | AC_SUBST(XML_INCLUDEDIR) |
| 156 | AC_SUBST(HTML_DIR) |
| 157 | AC_SUBST(HAVE_ISNAN) |
| 158 | AC_SUBST(HAVE_ISINF) |
| 159 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 160 | AC_SUBST(M_LIBS) |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 161 | AC_SUBST(RDL_LIBS) |
Daniel Veillard | 3c558c3 | 1999-12-22 11:30:41 +0000 | [diff] [blame] | 162 | AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xml-config win32config.h) |
Arturo Espinosa | 15fe6e7 | 1998-09-07 17:27:57 +0000 | [diff] [blame] | 163 | |