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 | ef90ba7 | 2001-12-07 14:24:22 +0000 | [diff] [blame] | 9 | LIBXML_MICRO_VERSION=12 |
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 | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 188 | |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 189 | dnl |
| 190 | dnl Use buffers for content |
| 191 | dnl |
| 192 | |
| 193 | AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content]) |
| 194 | if test "$with_buffers" = "yes" ; then |
| 195 | CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 196 | XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT" |
| 197 | fi |
| 198 | |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 199 | dnl |
| 200 | dnl Tester makes use of readline if present |
| 201 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 202 | _cppflags="${CPPFLAGS}" |
| 203 | _ldflags="${LDFLAGS}" |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 204 | |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 205 | AC_ARG_WITH(readline, |
| 206 | [ --with-readline=DIR use readline in DIR],[ |
| 207 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 208 | RDL_DIR=$withval |
| 209 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 210 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 211 | fi |
| 212 | ]) |
| 213 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 214 | dnl |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 215 | dnl specific tests to setup DV's devel environment with debug etc ... |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 216 | dnl (-Wunreachable-code) |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 217 | dnl |
| 218 | if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then |
| 219 | if test "${with_mem_debug}" = "" ; then |
| 220 | with_mem_debug="yes" |
| 221 | fi |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 222 | if test "${with_docbook}" = "" ; then |
| 223 | with_docbook="yes" |
| 224 | fi |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 225 | if test "${with_xptr}" = "" ; then |
| 226 | with_xptr="yes" |
| 227 | fi |
Daniel Veillard | 017b108 | 2001-06-21 11:20:21 +0000 | [diff] [blame] | 228 | 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] | 229 | dnl -Wcast-qual -ansi |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 230 | fi |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 231 | |
| 232 | dnl |
| 233 | dnl Check for trio string functions |
| 234 | dnl |
| 235 | |
| 236 | if test "${NEED_TRIO}" = "1" ; then |
| 237 | echo Adding trio library for string functions |
| 238 | WITH_TRIO=1 |
| 239 | else |
| 240 | WITH_TRIO=0 |
| 241 | fi |
Daniel Veillard | 01ef738 | 2001-05-08 07:31:43 +0000 | [diff] [blame] | 242 | AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1") |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 243 | AC_SUBST(WITH_TRIO) |
| 244 | |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 245 | dnl |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 246 | dnl Aloow to enable/disable various pieces |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 247 | dnl |
| 248 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 249 | THREAD_LIBS="" |
| 250 | WITH_THREADS=0 |
| 251 | THREAD_CFLAGS="" |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 252 | TEST_THREADS="" |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 253 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 254 | AC_ARG_WITH(threads, [ --with-threads Add multithread support(off)]) |
| 255 | if test "$with_threads" = "yes" ; then |
| 256 | echo Enabling multithreaded support |
| 257 | |
| 258 | AC_CHECK_HEADER(pthread.h, |
| 259 | AC_CHECK_LIB(pthread, pthread_mutex_lock,[ |
| 260 | THREAD_LIBS="-lpthread" |
| 261 | AC_DEFINE(HAVE_LIBPTHREAD) |
| 262 | AC_DEFINE(HAVE_PTHREAD_H) |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 263 | WITH_THREADS="1"])) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 264 | |
| 265 | if test "$WITH_THREADS" = "1" ; then |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 266 | THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" |
| 267 | TEST_THREADS="Threadtests" |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 268 | fi |
| 269 | fi |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 270 | 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] | 271 | if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then |
| 272 | THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED" |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 273 | fi |
| 274 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 275 | AC_SUBST(THREAD_LIBS) |
| 276 | AC_SUBST(WITH_THREADS) |
| 277 | AC_SUBST(THREAD_CFLAGS) |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 278 | AC_SUBST(TEST_THREADS) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 279 | |
| 280 | 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] | 281 | if test "$with_history" = "yes" ; then |
Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 282 | echo Enabling xmllint shell history |
| 283 | dnl check for terminal library. this is a very cool solution |
| 284 | dnl from octave's configure.in |
| 285 | unset tcap |
| 286 | for termlib in ncurses curses termcap terminfo termlib; do |
| 287 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) |
| 288 | test -n "$tcap" && break |
| 289 | done |
| 290 | |
| 291 | AC_CHECK_HEADER(readline/history.h, |
| 292 | AC_CHECK_LIB(history, append_history,[ |
| 293 | RDL_LIBS="-lhistory" |
| 294 | AC_DEFINE(HAVE_LIBHISTORY)])) |
| 295 | AC_CHECK_HEADER(readline/readline.h, |
| 296 | AC_CHECK_LIB(readline, readline,[ |
| 297 | RDL_LIBS="-lreadline $RDL_LIBS $tcap" |
| 298 | AC_DEFINE(HAVE_LIBREADLINE)], , $tcap)) |
| 299 | if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then |
| 300 | CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" |
| 301 | RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" |
| 302 | else |
| 303 | CPPFLAGS=${_cppflags} |
| 304 | fi |
| 305 | LDFLAGS=${_ldflags} |
| 306 | fi |
| 307 | |
| 308 | AC_SUBST(WITH_FTP) |
| 309 | AC_SUBST(FTP_OBJ) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 310 | AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)]) |
| 311 | if test "$with_ftp" = "no" ; then |
| 312 | echo Disabling FTP support |
| 313 | WITH_FTP=0 |
| 314 | FTP_OBJ= |
| 315 | else |
| 316 | WITH_FTP=1 |
| 317 | FTP_OBJ=nanoftp.o |
| 318 | fi |
| 319 | AC_SUBST(WITH_FTP) |
| 320 | AC_SUBST(FTP_OBJ) |
| 321 | |
| 322 | AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)]) |
| 323 | if test "$with_http" = "no" ; then |
| 324 | echo Disabling HTTP support |
| 325 | WITH_HTTP=0 |
| 326 | HTTP_OBJ= |
| 327 | else |
| 328 | WITH_HTTP=1 |
| 329 | HTTP_OBJ=nanohttp.o |
| 330 | fi |
| 331 | AC_SUBST(WITH_HTTP) |
| 332 | AC_SUBST(HTTP_OBJ) |
| 333 | |
| 334 | AC_ARG_WITH(html, [ --with-html Add the HTML support (on)]) |
| 335 | if test "$with_html" = "no" ; then |
| 336 | echo Disabling HTML support |
| 337 | WITH_HTML=0 |
| 338 | HTML_OBJ= |
| 339 | else |
| 340 | WITH_HTML=1 |
| 341 | HTML_OBJ="HTMLparser.o HTMLtree.o" |
| 342 | fi |
| 343 | AC_SUBST(WITH_HTML) |
| 344 | AC_SUBST(HTML_OBJ) |
| 345 | |
Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 346 | AC_ARG_WITH(catalog, [ --with-catalog Add the Catalog support (on)]) |
| 347 | if test "$with_catalog" = "no" ; then |
| 348 | echo Disabling Catalog support |
| 349 | WITH_CATALOG=0 |
| 350 | CATALOG_OBJ= |
| 351 | else |
| 352 | WITH_CATALOG=1 |
| 353 | CATALOG_OBJ="catalog.o" |
| 354 | fi |
| 355 | AC_SUBST(WITH_CATALOG) |
| 356 | AC_SUBST(CATALOG_OBJ) |
| 357 | |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 358 | AC_ARG_WITH(docbook, [ --with-docbook Add Docbook SGML support (on)]) |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 359 | if test "$with_docbook" = "no" ; then |
| 360 | echo Disabling Docbook support |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 361 | WITH_DOCB=0 |
| 362 | DOCB_OBJ= |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 363 | else |
| 364 | WITH_DOCB=1 |
| 365 | DOCB_OBJ="DOCBparser.o" |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 366 | fi |
| 367 | AC_SUBST(WITH_DOCB) |
| 368 | AC_SUBST(DOCB_OBJ) |
| 369 | |
| 370 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 371 | AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)]) |
| 372 | if test "$with_xpath" = "no" ; then |
| 373 | echo Disabling XPATH support |
Daniel Veillard | 52afe80 | 2000-10-22 16:56:02 +0000 | [diff] [blame] | 374 | with_xptr="no" |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 375 | WITH_XPATH=0 |
| 376 | XPATH_OBJ= |
| 377 | else |
| 378 | WITH_XPATH=1 |
| 379 | XPATH_OBJ=xpath.o |
| 380 | fi |
| 381 | AC_SUBST(WITH_XPATH) |
| 382 | AC_SUBST(XPATH_OBJ) |
| 383 | |
Daniel Veillard | c8df0aa | 2000-10-10 23:50:30 +0000 | [diff] [blame] | 384 | AC_ARG_WITH(xptr, [ --with-xptr Add the XPointer support (on)]) |
| 385 | if test "$with_xptr" = "no" ; then |
| 386 | echo Disabling XPointer support |
| 387 | WITH_XPTR=0 |
| 388 | XPTR_OBJ= |
| 389 | else |
| 390 | WITH_XPTR=1 |
| 391 | XPTR_OBJ=xpointer.o |
| 392 | fi |
| 393 | AC_SUBST(WITH_XPTR) |
| 394 | AC_SUBST(XPTR_OBJ) |
| 395 | |
Daniel Veillard | 9e8bfae | 2000-11-06 16:43:11 +0000 | [diff] [blame] | 396 | AC_ARG_WITH(xinclude, [ --with-xinclude Add the XInclude support (on)]) |
| 397 | if test "$with_xinclude" = "no" ; then |
| 398 | echo Disabling XInclude support |
| 399 | WITH_XINCLUDE=0 |
| 400 | XINCLUDE_OBJ= |
| 401 | with_xinclude="no" |
| 402 | else |
| 403 | WITH_XINCLUDE=1 |
| 404 | XINCLUDE_OBJ=xinclude.o |
| 405 | fi |
| 406 | AC_SUBST(WITH_XINCLUDE) |
| 407 | AC_SUBST(XINCLUDE_OBJ) |
| 408 | |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 409 | WITH_ICONV=0 |
| 410 | AC_ARG_WITH(iconv, [ --with-iconv[=DIR] Add ICONV support (on)]) |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 411 | if test "$with_iconv" = "no" ; then |
| 412 | echo Disabling ICONV support |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 413 | else |
Daniel Veillard | 220346d | 2001-12-07 11:33:54 +0000 | [diff] [blame] | 414 | if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 415 | CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" |
Daniel Veillard | f5b44e4 | 2001-09-17 17:19:54 +0000 | [diff] [blame] | 416 | # Export this since our headers include iconv.h |
| 417 | XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 418 | ICONV_LIBS="-L$with_iconv/lib" |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 419 | fi |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 420 | |
| 421 | AC_CHECK_HEADER(iconv.h, |
| 422 | AC_MSG_CHECKING(for iconv) |
| 423 | AC_TRY_LINK([#include <stdlib.h> |
| 424 | #include <iconv.h>],[ |
| 425 | iconv_t cd = iconv_open ("",""); |
| 426 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
| 427 | AC_MSG_RESULT(yes) |
| 428 | WITH_ICONV=1],[ |
| 429 | AC_MSG_RESULT(no) |
| 430 | AC_MSG_CHECKING(for iconv in -liconv) |
| 431 | |
| 432 | _ldflags="${LDFLAGS}" |
| 433 | _libs="${LIBS}" |
| 434 | LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" |
| 435 | LIBS="${LIBS} -liconv" |
| 436 | |
| 437 | AC_TRY_LINK([#include <stdlib.h> |
| 438 | #include <iconv.h>],[ |
| 439 | iconv_t cd = iconv_open ("",""); |
| 440 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
| 441 | AC_MSG_RESULT(yes) |
| 442 | WITH_ICONV=1 |
| 443 | ICONV_LIBS="${ICONV_LIBS} -liconv" |
| 444 | LIBS="${_libs}" |
| 445 | LDFLAGS="${_ldflags}"],[ |
| 446 | AC_MSG_RESULT(no) |
| 447 | LIBS="${_libs}" |
| 448 | LDFLAGS="${_ldflags}"])])) |
| 449 | fi |
Daniel Veillard | b82c166 | 2001-12-09 14:00:54 +0000 | [diff] [blame] | 450 | M_LIBS="-lm" |
| 451 | XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 452 | AC_SUBST(WITH_ICONV) |
| 453 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 454 | AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)]) |
| 455 | if test "$with_debug" = "no" ; then |
| 456 | echo Disabling DEBUG support |
| 457 | WITH_DEBUG=0 |
| 458 | DEBUG_OBJ= |
| 459 | else |
| 460 | WITH_DEBUG=1 |
| 461 | DEBUG_OBJ=debugXML.o |
| 462 | fi |
| 463 | AC_SUBST(WITH_DEBUG) |
| 464 | AC_SUBST(DEBUG_OBJ) |
| 465 | |
| 466 | AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)]) |
| 467 | if test "$with_mem_debug" = "yes" ; then |
| 468 | echo Enabling memory debug support |
| 469 | WITH_MEM_DEBUG=1 |
| 470 | else |
| 471 | WITH_MEM_DEBUG=0 |
| 472 | fi |
| 473 | AC_SUBST(WITH_MEM_DEBUG) |
| 474 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 475 | AC_SUBST(CFLAGS) |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 476 | AC_SUBST(XML_CFLAGS) |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 477 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 478 | AC_SUBST(XML_LIBDIR) |
| 479 | AC_SUBST(XML_LIBS) |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 480 | AC_SUBST(ICONV_LIBS) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 481 | AC_SUBST(XML_INCLUDEDIR) |
| 482 | AC_SUBST(HTML_DIR) |
| 483 | AC_SUBST(HAVE_ISNAN) |
| 484 | AC_SUBST(HAVE_ISINF) |
| 485 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 486 | AC_SUBST(M_LIBS) |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 487 | AC_SUBST(RDL_LIBS) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 488 | |
Daniel Veillard | c5d6434 | 2001-06-24 12:13:24 +0000 | [diff] [blame] | 489 | 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] | 490 | |