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) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 3 | AC_INIT(entities.c) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 4 | AM_CONFIG_HEADER(config.h) |
Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 5 | AC_CANONICAL_HOST |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 6 | |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 7 | LIBXML_MAJOR_VERSION=2 |
Daniel Veillard | 6a2e406 | 2001-02-08 10:31:33 +0000 | [diff] [blame] | 8 | LIBXML_MINOR_VERSION=3 |
Daniel Veillard | 4ec885a | 2001-06-17 10:31:07 +0000 | [diff] [blame] | 9 | LIBXML_MICRO_VERSION=11 |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 10 | LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION |
| 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 | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 15 | AC_SUBST(LIBXML_MAJOR_VERSION) |
| 16 | AC_SUBST(LIBXML_MINOR_VERSION) |
| 17 | AC_SUBST(LIBXML_MICRO_VERSION) |
| 18 | AC_SUBST(LIBXML_VERSION) |
| 19 | AC_SUBST(LIBXML_VERSION_INFO) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 20 | AC_SUBST(LIBXML_VERSION_NUMBER) |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 21 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 22 | VERSION=${LIBXML_VERSION} |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 23 | |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 24 | AM_INIT_AUTOMAKE(libxml2, $VERSION) |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 25 | |
| 26 | 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] | 27 | |
| 28 | dnl Checks for programs. |
| 29 | AC_PROG_CC |
| 30 | AC_PROG_INSTALL |
Sebastian Wilhelmi | a44c8a4 | 1998-08-07 08:38:58 +0000 | [diff] [blame] | 31 | AC_PROG_CPP |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 32 | AC_PATH_PROG(RM, rm, /bin/rm) |
| 33 | AC_PATH_PROG(MV, mv, /bin/mv) |
| 34 | AC_PATH_PROG(TAR, tar, /bin/tar) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 35 | |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 36 | dnl Make sure we have an ANSI compiler |
| 37 | AM_C_PROTOTYPES |
| 38 | test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) |
| 39 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 40 | AM_PROG_LIBTOOL |
| 41 | |
| 42 | AM_MAINTAINER_MODE |
| 43 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 44 | dnl Checks for zlib library. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 45 | _cppflags="${CPPFLAGS}" |
| 46 | _ldflags="${LDFLAGS}" |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 47 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 48 | AC_ARG_WITH(zlib, |
| 49 | [ --with-zlib[=DIR] use libz in DIR],[ |
| 50 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 51 | Z_DIR=$withval |
| 52 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 53 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 54 | fi |
| 55 | ]) |
| 56 | |
| 57 | AC_CHECK_HEADERS(zlib.h, |
| 58 | AC_CHECK_LIB(z, gzread,[ |
| 59 | AC_DEFINE(HAVE_LIBZ) |
| 60 | if test "x${Z_DIR}" != "x"; then |
| 61 | Z_CFLAGS="-I${Z_DIR}/include" |
| 62 | Z_LIBS="-L${Z_DIR}/lib -lz" |
Daniel Veillard | c3739e7 | 2001-05-15 15:23:27 +0000 | [diff] [blame] | 63 | [case ${host} in |
Daniel Veillard | a4f27e0 | 2001-05-15 12:41:29 +0000 | [diff] [blame] | 64 | *-*-solaris*) |
Daniel Veillard | c3739e7 | 2001-05-15 15:23:27 +0000 | [diff] [blame] | 65 | Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" |
Daniel Veillard | a4f27e0 | 2001-05-15 12:41:29 +0000 | [diff] [blame] | 66 | ;; |
Daniel Veillard | c3739e7 | 2001-05-15 15:23:27 +0000 | [diff] [blame] | 67 | esac] |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 68 | else |
| 69 | Z_LIBS="-lz" |
| 70 | fi])) |
| 71 | AC_SUBST(Z_CFLAGS) |
| 72 | AC_SUBST(Z_LIBS) |
| 73 | |
| 74 | CPPFLAGS=${_cppflags} |
| 75 | LDFLAGS=${_ldflags} |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 76 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 77 | dnl Checks for header files. |
| 78 | AC_HEADER_DIRENT |
| 79 | AC_HEADER_STDC |
| 80 | AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h) |
Daniel Veillard | 27b5528 | 2001-04-11 12:22:25 +0000 | [diff] [blame] | 81 | AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h ansidecl.h) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 82 | 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] | 83 | 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] | 84 | AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h sys/mman.h) |
Daniel Veillard | 068a965 | 2001-06-07 15:30:26 +0000 | [diff] [blame] | 85 | AC_CHECK_HEADERS(signal.h) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 86 | |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 87 | dnl Specific dir for HTML output ? |
| 88 | if test "x$with_html_dir" = "x" ; then |
Daniel Veillard | 0a6c358 | 2001-03-14 19:15:37 +0000 | [diff] [blame] | 89 | HTML_DIR='$(prefix)/doc' |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 90 | else |
| 91 | HTML_DIR=$with_html_dir |
| 92 | fi |
| 93 | |
| 94 | AC_SUBST(HTML_DIR) |
| 95 | |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 96 | AC_ARG_ENABLE(corba, |
| 97 | [ --enable-corba Add Corba support (default)]) |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 98 | |
| 99 | dnl |
| 100 | dnl Corba is enabled by default |
| 101 | dnl |
Daniel Veillard | da4d3c4 | 1998-11-04 20:07:05 +0000 | [diff] [blame] | 102 | if test "$enable_corba" = "no" ; then |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 103 | CORBA_CFLAGS="-DWITHOUT_CORBA" |
| 104 | fi |
| 105 | AC_SUBST(CORBA_CFLAGS) |
| 106 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 107 | dnl Checks for library functions. |
| 108 | AC_FUNC_STRFTIME |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 109 | AC_CHECK_FUNCS(strdup strndup strerror) |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 110 | AC_CHECK_FUNCS(finite isnand fp_class class fpclass) |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 111 | AC_CHECK_FUNCS(strftime localtime) |
Daniel Veillard | 068a965 | 2001-06-07 15:30:26 +0000 | [diff] [blame] | 112 | AC_CHECK_FUNCS(stat _stat signal) |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 113 | |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 114 | dnl Checking the standard string functions availability |
| 115 | AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, |
| 116 | NEED_TRIO=1) |
| 117 | |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 118 | dnl Checks for inet libraries: |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 119 | AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) |
| 120 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
| 121 | AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect)) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 122 | |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 123 | dnl Determine what socket length (socklen_t) data type is |
| 124 | AC_MSG_CHECKING([for type of socket length (socklen_t)]) |
| 125 | AC_TRY_COMPILE2([ |
| 126 | #include <stddef.h> |
| 127 | #include <sys/types.h> |
| 128 | #include <sys/socket.h>],[ |
| 129 | (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[ |
| 130 | AC_MSG_RESULT(socklen_t *) |
| 131 | SOCKLEN_T=socklen_t],[ |
| 132 | AC_TRY_COMPILE2([ |
| 133 | #include <stddef.h> |
| 134 | #include <sys/types.h> |
| 135 | #include <sys/socket.h>],[ |
| 136 | (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[ |
| 137 | AC_MSG_RESULT(size_t *) |
| 138 | SOCKLEN_T=size_t],[ |
| 139 | AC_TRY_COMPILE2([ |
| 140 | #include <stddef.h> |
| 141 | #include <sys/types.h> |
| 142 | #include <sys/socket.h>],[ |
| 143 | (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[ |
| 144 | AC_MSG_RESULT(int *) |
| 145 | SOCKLEN_T=int],[ |
| 146 | AC_MSG_WARN(could not determine)])])]) |
| 147 | AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T) |
| 148 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 149 | dnl Checks for isnan in libm if not in libc |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 150 | AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan, |
Bjorn Reese | e1dc011 | 2001-03-03 12:09:03 +0000 | [diff] [blame] | 151 | [AC_DEFINE(HAVE_ISNAN)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 152 | |
Daniel Veillard | 760f442 | 2001-02-15 14:59:48 +0000 | [diff] [blame] | 153 | AC_CHECK_FUNC(isinf, AC_DEFINE(HAVE_ISINF) , AC_CHECK_LIB(m, isinf, |
Bjorn Reese | e1dc011 | 2001-03-03 12:09:03 +0000 | [diff] [blame] | 154 | [AC_DEFINE(HAVE_ISINF)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 155 | |
| 156 | XML_LIBDIR='-L${libdir}' |
Daniel Veillard | e8282ed | 2000-10-10 23:01:31 +0000 | [diff] [blame] | 157 | XML_INCLUDEDIR='-I${includedir}/libxml -I${includedir}' |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 158 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 159 | dnl |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 160 | dnl Extra flags |
| 161 | dnl |
| 162 | XML_CFLAGS="" |
Daniel Veillard | 357c960 | 2001-05-03 10:49:20 +0000 | [diff] [blame] | 163 | RDL_LIBS="" |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 164 | |
| 165 | dnl |
Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 166 | dnl Workaround for native compilers |
| 167 | dnl HP : http://bugs.gnome.org/db/31/3163.html |
| 168 | dnl DEC : Enable NaN/Inf |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 169 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 170 | if test "${GCC}" != "yes" ; then |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 171 | case "${host}" in |
| 172 | *-*-hpux* ) |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 173 | CFLAGS="${CFLAGS} -Wp,-H30000" |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 174 | ;; |
Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 175 | *-dec-osf* ) |
| 176 | CFLAGS="${CFLAGS} -ieee" |
| 177 | ;; |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 178 | esac |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 179 | else |
| 180 | CFLAGS="${CFLAGS} -Wall" |
Daniel Veillard | 14839d5 | 2001-06-06 16:11:56 +0000 | [diff] [blame] | 181 | case "${host}" in |
| 182 | alpha*-*-linux* ) |
| 183 | CFLAGS="${CFLAGS} -mieee" |
| 184 | ;; |
| 185 | esac |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 186 | fi |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 187 | case ${host} in |
| 188 | *-*-solaris*) |
Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 189 | XML_LIBDIR="${XML_LIBDIR} -R${libdir}" |
| 190 | ;; |
| 191 | esac |
| 192 | |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 193 | |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 194 | |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 195 | dnl |
| 196 | dnl Use buffers for content |
| 197 | dnl |
| 198 | |
| 199 | AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content]) |
| 200 | if test "$with_buffers" = "yes" ; then |
| 201 | CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 202 | XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 203 | fi |
| 204 | |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 205 | dnl |
| 206 | dnl Tester makes use of readline if present |
| 207 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 208 | _cppflags="${CPPFLAGS}" |
| 209 | _ldflags="${LDFLAGS}" |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 210 | |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 211 | AC_ARG_WITH(readline, |
| 212 | [ --with-readline=DIR use readline in DIR],[ |
| 213 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 214 | RDL_DIR=$withval |
| 215 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 216 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 217 | fi |
| 218 | ]) |
| 219 | |
| 220 | dnl check for terminal library. this is a very cool solution |
| 221 | dnl from octave's configure.in |
| 222 | unset tcap |
| 223 | for termlib in ncurses curses termcap terminfo termlib; do |
| 224 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) |
| 225 | test -n "$tcap" && break |
| 226 | done |
| 227 | |
| 228 | AC_CHECK_HEADER(readline/history.h, |
| 229 | AC_CHECK_LIB(history, append_history,[ |
| 230 | RDL_LIBS="-lhistory" |
| 231 | AC_DEFINE(HAVE_LIBHISTORY)])) |
| 232 | AC_CHECK_HEADER(readline/readline.h, |
| 233 | AC_CHECK_LIB(readline, readline,[ |
| 234 | RDL_LIBS="-lreadline $RDL_LIBS $tcap" |
| 235 | AC_DEFINE(HAVE_LIBREADLINE)], , $tcap)) |
| 236 | if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then |
| 237 | CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" |
| 238 | RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" |
| 239 | else |
| 240 | CPPFLAGS=${_cppflags} |
| 241 | fi |
| 242 | LDFLAGS=${_ldflags} |
| 243 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 244 | dnl |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 245 | dnl specific tests to setup DV's devel environment with debug etc ... |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 246 | dnl (-Wunreachable-code) |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 247 | dnl |
| 248 | if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then |
| 249 | if test "${with_mem_debug}" = "" ; then |
| 250 | with_mem_debug="yes" |
| 251 | fi |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 252 | if test "${with_docbook}" = "" ; then |
| 253 | with_docbook="yes" |
| 254 | fi |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 255 | if test "${with_xptr}" = "" ; then |
| 256 | with_xptr="yes" |
| 257 | fi |
Daniel Veillard | 14839d5 | 2001-06-06 16:11:56 +0000 | [diff] [blame] | 258 | CFLAGS="${CFLAGS} -g -O -pedantic -W -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 " |
Daniel Veillard | c86a4fa | 2001-03-26 16:28:29 +0000 | [diff] [blame] | 259 | dnl -Wcast-qual -ansi |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 260 | fi |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 261 | |
| 262 | dnl |
| 263 | dnl Check for trio string functions |
| 264 | dnl |
| 265 | |
| 266 | if test "${NEED_TRIO}" = "1" ; then |
| 267 | echo Adding trio library for string functions |
| 268 | WITH_TRIO=1 |
| 269 | else |
| 270 | WITH_TRIO=0 |
| 271 | fi |
Daniel Veillard | 01ef738 | 2001-05-08 07:31:43 +0000 | [diff] [blame] | 272 | AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1") |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 273 | AC_SUBST(WITH_TRIO) |
| 274 | |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 275 | dnl |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 276 | dnl Aloow to disable various pieces |
| 277 | dnl |
| 278 | |
| 279 | AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)]) |
| 280 | if test "$with_ftp" = "no" ; then |
| 281 | echo Disabling FTP support |
| 282 | WITH_FTP=0 |
| 283 | FTP_OBJ= |
| 284 | else |
| 285 | WITH_FTP=1 |
| 286 | FTP_OBJ=nanoftp.o |
| 287 | fi |
| 288 | AC_SUBST(WITH_FTP) |
| 289 | AC_SUBST(FTP_OBJ) |
| 290 | |
| 291 | AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)]) |
| 292 | if test "$with_http" = "no" ; then |
| 293 | echo Disabling HTTP support |
| 294 | WITH_HTTP=0 |
| 295 | HTTP_OBJ= |
| 296 | else |
| 297 | WITH_HTTP=1 |
| 298 | HTTP_OBJ=nanohttp.o |
| 299 | fi |
| 300 | AC_SUBST(WITH_HTTP) |
| 301 | AC_SUBST(HTTP_OBJ) |
| 302 | |
| 303 | AC_ARG_WITH(html, [ --with-html Add the HTML support (on)]) |
| 304 | if test "$with_html" = "no" ; then |
| 305 | echo Disabling HTML support |
| 306 | WITH_HTML=0 |
| 307 | HTML_OBJ= |
| 308 | else |
| 309 | WITH_HTML=1 |
| 310 | HTML_OBJ="HTMLparser.o HTMLtree.o" |
| 311 | fi |
| 312 | AC_SUBST(WITH_HTML) |
| 313 | AC_SUBST(HTML_OBJ) |
| 314 | |
Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 315 | AC_ARG_WITH(catalog, [ --with-catalog Add the Catalog support (on)]) |
| 316 | if test "$with_catalog" = "no" ; then |
| 317 | echo Disabling Catalog support |
| 318 | WITH_CATALOG=0 |
| 319 | CATALOG_OBJ= |
| 320 | else |
| 321 | WITH_CATALOG=1 |
| 322 | CATALOG_OBJ="catalog.o" |
| 323 | fi |
| 324 | AC_SUBST(WITH_CATALOG) |
| 325 | AC_SUBST(CATALOG_OBJ) |
| 326 | |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 327 | AC_ARG_WITH(docbook, [ --with-docbook Add Docbook SGML support (on)]) |
| 328 | if test "$with_docbook" = "no" ; then |
| 329 | echo Disabling Docbook support |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 330 | WITH_DOCB=0 |
| 331 | DOCB_OBJ= |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 332 | else |
| 333 | WITH_DOCB=1 |
| 334 | DOCB_OBJ="DOCBparser.o" |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 335 | fi |
| 336 | AC_SUBST(WITH_DOCB) |
| 337 | AC_SUBST(DOCB_OBJ) |
| 338 | |
| 339 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 340 | AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)]) |
| 341 | if test "$with_xpath" = "no" ; then |
| 342 | echo Disabling XPATH support |
Daniel Veillard | 52afe80 | 2000-10-22 16:56:02 +0000 | [diff] [blame] | 343 | with_xptr="no" |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 344 | WITH_XPATH=0 |
| 345 | XPATH_OBJ= |
| 346 | else |
| 347 | WITH_XPATH=1 |
| 348 | XPATH_OBJ=xpath.o |
| 349 | fi |
| 350 | AC_SUBST(WITH_XPATH) |
| 351 | AC_SUBST(XPATH_OBJ) |
| 352 | |
Daniel Veillard | c8df0aa | 2000-10-10 23:50:30 +0000 | [diff] [blame] | 353 | AC_ARG_WITH(xptr, [ --with-xptr Add the XPointer support (on)]) |
| 354 | if test "$with_xptr" = "no" ; then |
| 355 | echo Disabling XPointer support |
| 356 | WITH_XPTR=0 |
| 357 | XPTR_OBJ= |
| 358 | else |
| 359 | WITH_XPTR=1 |
| 360 | XPTR_OBJ=xpointer.o |
| 361 | fi |
| 362 | AC_SUBST(WITH_XPTR) |
| 363 | AC_SUBST(XPTR_OBJ) |
| 364 | |
Daniel Veillard | 9e8bfae | 2000-11-06 16:43:11 +0000 | [diff] [blame] | 365 | AC_ARG_WITH(xinclude, [ --with-xinclude Add the XInclude support (on)]) |
| 366 | if test "$with_xinclude" = "no" ; then |
| 367 | echo Disabling XInclude support |
| 368 | WITH_XINCLUDE=0 |
| 369 | XINCLUDE_OBJ= |
| 370 | with_xinclude="no" |
| 371 | else |
| 372 | WITH_XINCLUDE=1 |
| 373 | XINCLUDE_OBJ=xinclude.o |
| 374 | fi |
| 375 | AC_SUBST(WITH_XINCLUDE) |
| 376 | AC_SUBST(XINCLUDE_OBJ) |
| 377 | |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 378 | AC_ARG_WITH(iconv, [ --with-iconv Add the ICONV support (on)]) |
| 379 | if test "$with_iconv" = "no" ; then |
| 380 | echo Disabling ICONV support |
| 381 | WITH_ICONV=0 |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 382 | else |
| 383 | AC_CHECK_HEADER(iconv.h, |
Daniel Veillard | a2bc368 | 2001-05-03 08:27:20 +0000 | [diff] [blame] | 384 | AC_CHECK_FUNC(iconv, , |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 385 | AC_CHECK_LIB(iconv, iconv, ICONV_LIBS="-liconv"))) |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 386 | if test "$have_iconv" != "" ; then |
| 387 | echo Iconv support not found |
| 388 | WITH_ICONV=0 |
| 389 | else |
| 390 | WITH_ICONV=1 |
| 391 | fi |
| 392 | fi |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 393 | XML_LIBS="-lxml2 $Z_LIBS $ICONV_LIBS -lm $LIBS" |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 394 | AC_SUBST(WITH_ICONV) |
| 395 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 396 | AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)]) |
| 397 | if test "$with_debug" = "no" ; then |
| 398 | echo Disabling DEBUG support |
| 399 | WITH_DEBUG=0 |
| 400 | DEBUG_OBJ= |
| 401 | else |
| 402 | WITH_DEBUG=1 |
| 403 | DEBUG_OBJ=debugXML.o |
| 404 | fi |
| 405 | AC_SUBST(WITH_DEBUG) |
| 406 | AC_SUBST(DEBUG_OBJ) |
| 407 | |
| 408 | AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)]) |
| 409 | if test "$with_mem_debug" = "yes" ; then |
| 410 | echo Enabling memory debug support |
| 411 | WITH_MEM_DEBUG=1 |
| 412 | else |
| 413 | WITH_MEM_DEBUG=0 |
| 414 | fi |
| 415 | AC_SUBST(WITH_MEM_DEBUG) |
| 416 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 417 | AC_SUBST(CFLAGS) |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 418 | AC_SUBST(XML_CFLAGS) |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 419 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 420 | AC_SUBST(XML_LIBDIR) |
| 421 | AC_SUBST(XML_LIBS) |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 422 | AC_SUBST(ICONV_LIBS) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 423 | AC_SUBST(XML_INCLUDEDIR) |
| 424 | AC_SUBST(HTML_DIR) |
| 425 | AC_SUBST(HAVE_ISNAN) |
| 426 | AC_SUBST(HAVE_ISINF) |
| 427 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 428 | AC_SUBST(M_LIBS) |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 429 | AC_SUBST(RDL_LIBS) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 430 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 431 | dnl |
| 432 | dnl create the libxml and include links needed to get dependencies right |
| 433 | dnl |
| 434 | if test ! -d $srcdir/include/libxml |
| 435 | then |
| 436 | if test ! -d $srcdir/include |
| 437 | then |
| 438 | rm -f $srcdir/include |
| 439 | mkdir $srcdir/include |
| 440 | fi |
| 441 | rm -f $srcdir/libxml |
| 442 | (cd $srcdir/include ; ln -s .. libxml) |
| 443 | fi |
| 444 | if test ! -r $srcdir/libxml |
| 445 | then |
| 446 | (cd $srcdir ; ln -s include/libxml libxml) |
| 447 | fi |
| 448 | if test ! -r include/libxml |
| 449 | then |
| 450 | if test ! -d include |
| 451 | then |
| 452 | rm -f include |
| 453 | mkdir include |
| 454 | fi |
| 455 | (cd include ; ln -s ../libxml libxml) |
| 456 | fi |
| 457 | if test ! -r libxml |
| 458 | then |
| 459 | rm -rf libxml |
| 460 | ln -s $srcdir/include/libxml libxml |
| 461 | fi |
| 462 | |
| 463 | AC_OUTPUT(libxml.spec Makefile include/Makefile doc/Makefile example/Makefile libxml/xmlversion.h xml2-config libxml-2.0.pc xml2Conf.sh) |
Arturo Espinosa | 15fe6e7 | 1998-09-07 17:27:57 +0000 | [diff] [blame] | 464 | |