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