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 | 09ab7e1 | 2001-07-10 15:49:44 +0000 | [diff] [blame] | 8 | LIBXML_MINOR_VERSION=4 |
Daniel Veillard | 744683d | 2002-01-14 17:30:20 +0000 | [diff] [blame] | 9 | LIBXML_MICRO_VERSION=13 |
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 | |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 48 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 49 | AC_ARG_WITH(zlib, |
| 50 | [ --with-zlib[=DIR] use libz in DIR],[ |
| 51 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 52 | Z_DIR=$withval |
| 53 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 54 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 55 | fi |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 56 | ]) |
| 57 | if test "$with_zlib" = "no"; then |
| 58 | echo "Disabling compression support" |
| 59 | else |
Daniel Veillard | 3fbe8e3 | 2001-10-06 13:30:33 +0000 | [diff] [blame] | 60 | AC_CHECK_HEADERS(zlib.h, |
| 61 | AC_CHECK_LIB(z, gzread,[ |
| 62 | AC_DEFINE(HAVE_LIBZ) |
| 63 | if test "x${Z_DIR}" != "x"; then |
| 64 | Z_CFLAGS="-I${Z_DIR}/include" |
| 65 | Z_LIBS="-L${Z_DIR}/lib -lz" |
| 66 | [case ${host} in |
| 67 | *-*-solaris*) |
| 68 | Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" |
| 69 | ;; |
| 70 | esac] |
| 71 | else |
| 72 | Z_LIBS="-lz" |
| 73 | fi])) |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 74 | fi |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 75 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 76 | AC_SUBST(Z_CFLAGS) |
| 77 | AC_SUBST(Z_LIBS) |
| 78 | |
| 79 | CPPFLAGS=${_cppflags} |
| 80 | LDFLAGS=${_ldflags} |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 81 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 82 | dnl Checks for header files. |
| 83 | AC_HEADER_DIRENT |
| 84 | AC_HEADER_STDC |
| 85 | 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] | 86 | 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] | 87 | 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] | 88 | 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] | 89 | 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] | 90 | AC_CHECK_HEADERS(signal.h) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 91 | |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 92 | dnl Specific dir for HTML output ? |
| 93 | if test "x$with_html_dir" = "x" ; then |
Daniel Veillard | 0a6c358 | 2001-03-14 19:15:37 +0000 | [diff] [blame] | 94 | HTML_DIR='$(prefix)/doc' |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 95 | else |
| 96 | HTML_DIR=$with_html_dir |
| 97 | fi |
| 98 | |
| 99 | AC_SUBST(HTML_DIR) |
| 100 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 101 | dnl Checks for library functions. |
| 102 | AC_FUNC_STRFTIME |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 103 | AC_CHECK_FUNCS(strdup strndup strerror) |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 104 | AC_CHECK_FUNCS(finite isnand fp_class class fpclass) |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 105 | AC_CHECK_FUNCS(strftime localtime) |
Daniel Veillard | 068a965 | 2001-06-07 15:30:26 +0000 | [diff] [blame] | 106 | AC_CHECK_FUNCS(stat _stat signal) |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 107 | |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 108 | dnl Checking the standard string functions availability |
| 109 | AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, |
| 110 | NEED_TRIO=1) |
| 111 | |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 112 | dnl Checks for inet libraries: |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 113 | AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) |
| 114 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
| 115 | AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect)) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 116 | |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 117 | dnl Determine what socket length (socklen_t) data type is |
| 118 | AC_MSG_CHECKING([for type of socket length (socklen_t)]) |
| 119 | AC_TRY_COMPILE2([ |
| 120 | #include <stddef.h> |
| 121 | #include <sys/types.h> |
| 122 | #include <sys/socket.h>],[ |
| 123 | (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[ |
| 124 | AC_MSG_RESULT(socklen_t *) |
| 125 | SOCKLEN_T=socklen_t],[ |
| 126 | AC_TRY_COMPILE2([ |
| 127 | #include <stddef.h> |
| 128 | #include <sys/types.h> |
| 129 | #include <sys/socket.h>],[ |
| 130 | (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[ |
| 131 | AC_MSG_RESULT(size_t *) |
| 132 | SOCKLEN_T=size_t],[ |
| 133 | AC_TRY_COMPILE2([ |
| 134 | #include <stddef.h> |
| 135 | #include <sys/types.h> |
| 136 | #include <sys/socket.h>],[ |
| 137 | (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[ |
| 138 | AC_MSG_RESULT(int *) |
| 139 | SOCKLEN_T=int],[ |
| 140 | AC_MSG_WARN(could not determine)])])]) |
| 141 | AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T) |
| 142 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 143 | dnl Checks for isnan in libm if not in libc |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 144 | AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan, |
Bjorn Reese | e1dc011 | 2001-03-03 12:09:03 +0000 | [diff] [blame] | 145 | [AC_DEFINE(HAVE_ISNAN)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 146 | |
Daniel Veillard | 760f442 | 2001-02-15 14:59:48 +0000 | [diff] [blame] | 147 | 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] | 148 | [AC_DEFINE(HAVE_ISINF)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 149 | |
| 150 | XML_LIBDIR='-L${libdir}' |
Daniel Veillard | 07cdb2a | 2001-09-12 20:19:58 +0000 | [diff] [blame] | 151 | XML_INCLUDEDIR='-I${includedir}/libxml2/libxml -I${includedir}/libxml2' |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 152 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 153 | dnl |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 154 | dnl Extra flags |
| 155 | dnl |
| 156 | XML_CFLAGS="" |
Daniel Veillard | 357c960 | 2001-05-03 10:49:20 +0000 | [diff] [blame] | 157 | RDL_LIBS="" |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 158 | |
| 159 | dnl |
Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 160 | dnl Workaround for native compilers |
| 161 | dnl HP : http://bugs.gnome.org/db/31/3163.html |
| 162 | dnl DEC : Enable NaN/Inf |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 163 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 164 | if test "${GCC}" != "yes" ; then |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 165 | case "${host}" in |
| 166 | *-*-hpux* ) |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 167 | CFLAGS="${CFLAGS} -Wp,-H30000" |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 168 | ;; |
Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 169 | *-dec-osf* ) |
| 170 | CFLAGS="${CFLAGS} -ieee" |
| 171 | ;; |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 172 | esac |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 173 | else |
| 174 | CFLAGS="${CFLAGS} -Wall" |
Daniel Veillard | 14839d5 | 2001-06-06 16:11:56 +0000 | [diff] [blame] | 175 | case "${host}" in |
| 176 | alpha*-*-linux* ) |
| 177 | CFLAGS="${CFLAGS} -mieee" |
| 178 | ;; |
| 179 | esac |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 180 | fi |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 181 | case ${host} in |
| 182 | *-*-solaris*) |
Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 183 | XML_LIBDIR="${XML_LIBDIR} -R${libdir}" |
| 184 | ;; |
| 185 | esac |
| 186 | |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 187 | |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 188 | dnl |
| 189 | dnl check for python |
| 190 | dnl |
| 191 | |
| 192 | PYTHON= |
| 193 | PYTHON_VERSION= |
| 194 | PYTHON_INCLUDES= |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 195 | PYTHON_SITE_PACKAGES= |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 196 | AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found]) |
| 197 | if test "$with_python" != "no" ; then |
| 198 | if test -x "$with_python/bin/python" |
| 199 | then |
| 200 | echo Found python in $with_python/bin/python |
| 201 | PYTHON="$with_python/bin/python" |
| 202 | else |
| 203 | AC_PATH_PROG(PYTHON, python python2.2 python2.1 python2.0 python1.6 python1.5) |
| 204 | fi |
| 205 | if test "$PYTHON" != "" |
| 206 | then |
| 207 | PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` |
| 208 | echo Found Python version $PYTHON_VERSION |
| 209 | fi |
| 210 | if test "$PYTHON_VERSION" != "" |
| 211 | then |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 212 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ |
| 213 | -d $with_python/lib/python$PYTHON_VERSION/site-packages |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 214 | then |
| 215 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 216 | PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 217 | else |
| 218 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h |
| 219 | then |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 220 | PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' |
| 221 | PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages' |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 222 | else |
| 223 | if test -r /usr/include/python$PYTHON_VERSION/Python.h |
| 224 | then |
| 225 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 226 | PYTHON_SITE_PACKAGES=/usr/lib/python$PYTHON_VERSION/site-packages |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 227 | else |
| 228 | echo could not find python$PYTHON_VERSION/Python.h |
| 229 | fi |
| 230 | fi |
| 231 | fi |
| 232 | fi |
| 233 | fi |
| 234 | AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") |
| 235 | |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 236 | |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 237 | dnl |
| 238 | dnl Use buffers for content |
| 239 | dnl |
| 240 | |
| 241 | AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content]) |
| 242 | if test "$with_buffers" = "yes" ; then |
| 243 | CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 244 | XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 245 | fi |
| 246 | |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 247 | dnl |
| 248 | dnl Tester makes use of readline if present |
| 249 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 250 | _cppflags="${CPPFLAGS}" |
| 251 | _ldflags="${LDFLAGS}" |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 252 | |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 253 | AC_ARG_WITH(readline, |
| 254 | [ --with-readline=DIR use readline in DIR],[ |
| 255 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 256 | RDL_DIR=$withval |
| 257 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 258 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 259 | fi |
| 260 | ]) |
| 261 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 262 | dnl |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 263 | dnl specific tests to setup DV's devel environment with debug etc ... |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 264 | dnl (-Wunreachable-code) |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 265 | dnl |
| 266 | if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then |
| 267 | if test "${with_mem_debug}" = "" ; then |
| 268 | with_mem_debug="yes" |
| 269 | fi |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 270 | if test "${with_docbook}" = "" ; then |
| 271 | with_docbook="yes" |
| 272 | fi |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 273 | if test "${with_xptr}" = "" ; then |
| 274 | with_xptr="yes" |
| 275 | fi |
Daniel Veillard | 017b108 | 2001-06-21 11:20:21 +0000 | [diff] [blame] | 276 | 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] | 277 | dnl -Wcast-qual -ansi |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 278 | fi |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 279 | |
| 280 | dnl |
| 281 | dnl Check for trio string functions |
| 282 | dnl |
| 283 | |
| 284 | if test "${NEED_TRIO}" = "1" ; then |
| 285 | echo Adding trio library for string functions |
| 286 | WITH_TRIO=1 |
| 287 | else |
| 288 | WITH_TRIO=0 |
| 289 | fi |
Daniel Veillard | 01ef738 | 2001-05-08 07:31:43 +0000 | [diff] [blame] | 290 | AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1") |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 291 | AC_SUBST(WITH_TRIO) |
| 292 | |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 293 | dnl |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 294 | dnl Aloow to enable/disable various pieces |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 295 | dnl |
| 296 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 297 | THREAD_LIBS="" |
| 298 | WITH_THREADS=0 |
| 299 | THREAD_CFLAGS="" |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 300 | TEST_THREADS="" |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 301 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 302 | AC_ARG_WITH(threads, [ --with-threads Add multithread support(off)]) |
| 303 | if test "$with_threads" = "yes" ; then |
| 304 | echo Enabling multithreaded support |
| 305 | |
| 306 | AC_CHECK_HEADER(pthread.h, |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 307 | AC_CHECK_LIB(pthread, pthread_join,[ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 308 | THREAD_LIBS="-lpthread" |
| 309 | AC_DEFINE(HAVE_LIBPTHREAD) |
| 310 | AC_DEFINE(HAVE_PTHREAD_H) |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 311 | WITH_THREADS="1"])) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 312 | |
| 313 | if test "$WITH_THREADS" = "1" ; then |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 314 | THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" |
| 315 | TEST_THREADS="Threadtests" |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 316 | fi |
| 317 | fi |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 318 | AC_ARG_WITH(thread-alloc, [ --with-thread-alloc Add per-thread memory(off)]) |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 319 | if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then |
| 320 | THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED" |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 321 | fi |
| 322 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 323 | AC_SUBST(THREAD_LIBS) |
| 324 | AC_SUBST(WITH_THREADS) |
| 325 | AC_SUBST(THREAD_CFLAGS) |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 326 | AC_SUBST(TEST_THREADS) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 327 | |
| 328 | AC_ARG_WITH(history, [ --with-history Add history support to xmllint shell(off)]) |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 329 | if test "$with_history" = "yes" ; then |
Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 330 | echo Enabling xmllint shell history |
| 331 | dnl check for terminal library. this is a very cool solution |
| 332 | dnl from octave's configure.in |
| 333 | unset tcap |
| 334 | for termlib in ncurses curses termcap terminfo termlib; do |
| 335 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) |
| 336 | test -n "$tcap" && break |
| 337 | done |
| 338 | |
| 339 | AC_CHECK_HEADER(readline/history.h, |
| 340 | AC_CHECK_LIB(history, append_history,[ |
| 341 | RDL_LIBS="-lhistory" |
| 342 | AC_DEFINE(HAVE_LIBHISTORY)])) |
| 343 | AC_CHECK_HEADER(readline/readline.h, |
| 344 | AC_CHECK_LIB(readline, readline,[ |
| 345 | RDL_LIBS="-lreadline $RDL_LIBS $tcap" |
| 346 | AC_DEFINE(HAVE_LIBREADLINE)], , $tcap)) |
| 347 | if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then |
| 348 | CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" |
| 349 | RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" |
| 350 | else |
| 351 | CPPFLAGS=${_cppflags} |
| 352 | fi |
| 353 | LDFLAGS=${_ldflags} |
| 354 | fi |
| 355 | |
| 356 | AC_SUBST(WITH_FTP) |
| 357 | AC_SUBST(FTP_OBJ) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 358 | AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)]) |
| 359 | if test "$with_ftp" = "no" ; then |
| 360 | echo Disabling FTP support |
| 361 | WITH_FTP=0 |
| 362 | FTP_OBJ= |
| 363 | else |
| 364 | WITH_FTP=1 |
| 365 | FTP_OBJ=nanoftp.o |
| 366 | fi |
| 367 | AC_SUBST(WITH_FTP) |
| 368 | AC_SUBST(FTP_OBJ) |
| 369 | |
| 370 | AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)]) |
| 371 | if test "$with_http" = "no" ; then |
| 372 | echo Disabling HTTP support |
| 373 | WITH_HTTP=0 |
| 374 | HTTP_OBJ= |
| 375 | else |
| 376 | WITH_HTTP=1 |
| 377 | HTTP_OBJ=nanohttp.o |
| 378 | fi |
| 379 | AC_SUBST(WITH_HTTP) |
| 380 | AC_SUBST(HTTP_OBJ) |
| 381 | |
| 382 | AC_ARG_WITH(html, [ --with-html Add the HTML support (on)]) |
| 383 | if test "$with_html" = "no" ; then |
| 384 | echo Disabling HTML support |
| 385 | WITH_HTML=0 |
| 386 | HTML_OBJ= |
| 387 | else |
| 388 | WITH_HTML=1 |
| 389 | HTML_OBJ="HTMLparser.o HTMLtree.o" |
| 390 | fi |
| 391 | AC_SUBST(WITH_HTML) |
| 392 | AC_SUBST(HTML_OBJ) |
| 393 | |
Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 394 | AC_ARG_WITH(catalog, [ --with-catalog Add the Catalog support (on)]) |
| 395 | if test "$with_catalog" = "no" ; then |
| 396 | echo Disabling Catalog support |
| 397 | WITH_CATALOG=0 |
| 398 | CATALOG_OBJ= |
| 399 | else |
| 400 | WITH_CATALOG=1 |
| 401 | CATALOG_OBJ="catalog.o" |
| 402 | fi |
| 403 | AC_SUBST(WITH_CATALOG) |
| 404 | AC_SUBST(CATALOG_OBJ) |
| 405 | |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 406 | AC_ARG_WITH(docbook, [ --with-docbook Add Docbook SGML support (on)]) |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 407 | if test "$with_docbook" = "no" ; then |
| 408 | echo Disabling Docbook support |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 409 | WITH_DOCB=0 |
| 410 | DOCB_OBJ= |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 411 | else |
| 412 | WITH_DOCB=1 |
| 413 | DOCB_OBJ="DOCBparser.o" |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 414 | fi |
| 415 | AC_SUBST(WITH_DOCB) |
| 416 | AC_SUBST(DOCB_OBJ) |
| 417 | |
| 418 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 419 | AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)]) |
| 420 | if test "$with_xpath" = "no" ; then |
| 421 | echo Disabling XPATH support |
Daniel Veillard | 52afe80 | 2000-10-22 16:56:02 +0000 | [diff] [blame] | 422 | with_xptr="no" |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 423 | WITH_XPATH=0 |
| 424 | XPATH_OBJ= |
| 425 | else |
| 426 | WITH_XPATH=1 |
| 427 | XPATH_OBJ=xpath.o |
| 428 | fi |
| 429 | AC_SUBST(WITH_XPATH) |
| 430 | AC_SUBST(XPATH_OBJ) |
| 431 | |
Daniel Veillard | c8df0aa | 2000-10-10 23:50:30 +0000 | [diff] [blame] | 432 | AC_ARG_WITH(xptr, [ --with-xptr Add the XPointer support (on)]) |
| 433 | if test "$with_xptr" = "no" ; then |
| 434 | echo Disabling XPointer support |
| 435 | WITH_XPTR=0 |
| 436 | XPTR_OBJ= |
| 437 | else |
| 438 | WITH_XPTR=1 |
| 439 | XPTR_OBJ=xpointer.o |
| 440 | fi |
| 441 | AC_SUBST(WITH_XPTR) |
| 442 | AC_SUBST(XPTR_OBJ) |
| 443 | |
Daniel Veillard | 9e8bfae | 2000-11-06 16:43:11 +0000 | [diff] [blame] | 444 | AC_ARG_WITH(xinclude, [ --with-xinclude Add the XInclude support (on)]) |
| 445 | if test "$with_xinclude" = "no" ; then |
| 446 | echo Disabling XInclude support |
| 447 | WITH_XINCLUDE=0 |
| 448 | XINCLUDE_OBJ= |
| 449 | with_xinclude="no" |
| 450 | else |
| 451 | WITH_XINCLUDE=1 |
| 452 | XINCLUDE_OBJ=xinclude.o |
| 453 | fi |
| 454 | AC_SUBST(WITH_XINCLUDE) |
| 455 | AC_SUBST(XINCLUDE_OBJ) |
| 456 | |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 457 | WITH_ICONV=0 |
| 458 | AC_ARG_WITH(iconv, [ --with-iconv[=DIR] Add ICONV support (on)]) |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 459 | if test "$with_iconv" = "no" ; then |
| 460 | echo Disabling ICONV support |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 461 | else |
Daniel Veillard | 220346d | 2001-12-07 11:33:54 +0000 | [diff] [blame] | 462 | if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 463 | CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" |
Daniel Veillard | f5b44e4 | 2001-09-17 17:19:54 +0000 | [diff] [blame] | 464 | # Export this since our headers include iconv.h |
| 465 | XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 466 | ICONV_LIBS="-L$with_iconv/lib" |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 467 | fi |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 468 | |
| 469 | AC_CHECK_HEADER(iconv.h, |
| 470 | AC_MSG_CHECKING(for iconv) |
| 471 | AC_TRY_LINK([#include <stdlib.h> |
| 472 | #include <iconv.h>],[ |
| 473 | iconv_t cd = iconv_open ("",""); |
| 474 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
| 475 | AC_MSG_RESULT(yes) |
| 476 | WITH_ICONV=1],[ |
| 477 | AC_MSG_RESULT(no) |
| 478 | AC_MSG_CHECKING(for iconv in -liconv) |
| 479 | |
| 480 | _ldflags="${LDFLAGS}" |
| 481 | _libs="${LIBS}" |
| 482 | LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" |
| 483 | LIBS="${LIBS} -liconv" |
| 484 | |
| 485 | AC_TRY_LINK([#include <stdlib.h> |
| 486 | #include <iconv.h>],[ |
| 487 | iconv_t cd = iconv_open ("",""); |
| 488 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
| 489 | AC_MSG_RESULT(yes) |
| 490 | WITH_ICONV=1 |
| 491 | ICONV_LIBS="${ICONV_LIBS} -liconv" |
| 492 | LIBS="${_libs}" |
| 493 | LDFLAGS="${_ldflags}"],[ |
| 494 | AC_MSG_RESULT(no) |
| 495 | LIBS="${_libs}" |
| 496 | LDFLAGS="${_ldflags}"])])) |
| 497 | fi |
Daniel Veillard | b82c166 | 2001-12-09 14:00:54 +0000 | [diff] [blame] | 498 | M_LIBS="-lm" |
| 499 | XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 500 | AC_SUBST(WITH_ICONV) |
| 501 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 502 | AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)]) |
| 503 | if test "$with_debug" = "no" ; then |
| 504 | echo Disabling DEBUG support |
| 505 | WITH_DEBUG=0 |
| 506 | DEBUG_OBJ= |
| 507 | else |
| 508 | WITH_DEBUG=1 |
| 509 | DEBUG_OBJ=debugXML.o |
| 510 | fi |
| 511 | AC_SUBST(WITH_DEBUG) |
| 512 | AC_SUBST(DEBUG_OBJ) |
| 513 | |
| 514 | AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)]) |
| 515 | if test "$with_mem_debug" = "yes" ; then |
| 516 | echo Enabling memory debug support |
| 517 | WITH_MEM_DEBUG=1 |
| 518 | else |
| 519 | WITH_MEM_DEBUG=0 |
| 520 | fi |
| 521 | AC_SUBST(WITH_MEM_DEBUG) |
| 522 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 523 | AC_SUBST(CFLAGS) |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 524 | AC_SUBST(XML_CFLAGS) |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 525 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 526 | AC_SUBST(XML_LIBDIR) |
| 527 | AC_SUBST(XML_LIBS) |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 528 | AC_SUBST(ICONV_LIBS) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 529 | AC_SUBST(XML_INCLUDEDIR) |
| 530 | AC_SUBST(HTML_DIR) |
| 531 | AC_SUBST(HAVE_ISNAN) |
| 532 | AC_SUBST(HAVE_ISINF) |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 533 | AC_SUBST(PYTHON) |
| 534 | AC_SUBST(PYTHON_VERSION) |
| 535 | AC_SUBST(PYTHON_INCLUDES) |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 536 | AC_SUBST(PYTHON_SITE_PACKAGES) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 537 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 538 | AC_SUBST(M_LIBS) |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 539 | AC_SUBST(RDL_LIBS) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 540 | |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 541 | AC_OUTPUT(libxml.spec Makefile include/Makefile include/libxml/Makefile doc/Makefile example/Makefile python/Makefile python/tests/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] | 542 | |