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 | 4fc5281 | 2003-09-01 20:33:13 +0000 | [diff] [blame^] | 8 | LIBXML_MINOR_VERSION=6 |
| 9 | LIBXML_MICRO_VERSION=0 |
| 10 | LIBXML_MICRO_VERSION_SUFFIX=beta1 |
| 11 | LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 12 | LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION |
| 13 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 14 | LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` |
| 15 | |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 16 | AC_SUBST(LIBXML_MAJOR_VERSION) |
| 17 | AC_SUBST(LIBXML_MINOR_VERSION) |
| 18 | AC_SUBST(LIBXML_MICRO_VERSION) |
| 19 | AC_SUBST(LIBXML_VERSION) |
| 20 | AC_SUBST(LIBXML_VERSION_INFO) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 21 | AC_SUBST(LIBXML_VERSION_NUMBER) |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 22 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 23 | VERSION=${LIBXML_VERSION} |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 24 | |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 25 | AM_INIT_AUTOMAKE(libxml2, $VERSION) |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 26 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 27 | AC_ARG_WITH(html-dir, |
| 28 | [ --with-html-dir=PATH path to installed docs ]) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 29 | |
| 30 | dnl Checks for programs. |
| 31 | AC_PROG_CC |
| 32 | AC_PROG_INSTALL |
Sebastian Wilhelmi | a44c8a4 | 1998-08-07 08:38:58 +0000 | [diff] [blame] | 33 | AC_PROG_CPP |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 34 | AC_PATH_PROG(RM, rm, /bin/rm) |
| 35 | AC_PATH_PROG(MV, mv, /bin/mv) |
| 36 | AC_PATH_PROG(TAR, tar, /bin/tar) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 37 | |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 38 | dnl Make sure we have an ANSI compiler |
| 39 | AM_C_PROTOTYPES |
| 40 | test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) |
| 41 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 42 | AM_PROG_LIBTOOL |
| 43 | |
| 44 | AM_MAINTAINER_MODE |
| 45 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 46 | dnl Checks for zlib library. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 47 | _cppflags="${CPPFLAGS}" |
| 48 | _ldflags="${LDFLAGS}" |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 49 | |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 50 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 51 | AC_ARG_WITH(zlib, |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 52 | [ --with-zlib[[=DIR]] use libz in DIR],[ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 53 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 54 | Z_DIR=$withval |
| 55 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 56 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 57 | fi |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 58 | ]) |
| 59 | if test "$with_zlib" = "no"; then |
| 60 | echo "Disabling compression support" |
| 61 | else |
Daniel Veillard | 3fbe8e3 | 2001-10-06 13:30:33 +0000 | [diff] [blame] | 62 | AC_CHECK_HEADERS(zlib.h, |
| 63 | AC_CHECK_LIB(z, gzread,[ |
| 64 | AC_DEFINE(HAVE_LIBZ) |
| 65 | if test "x${Z_DIR}" != "x"; then |
| 66 | Z_CFLAGS="-I${Z_DIR}/include" |
| 67 | Z_LIBS="-L${Z_DIR}/lib -lz" |
| 68 | [case ${host} in |
| 69 | *-*-solaris*) |
| 70 | Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" |
| 71 | ;; |
| 72 | esac] |
| 73 | else |
| 74 | Z_LIBS="-lz" |
| 75 | fi])) |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 76 | fi |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 77 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 78 | AC_SUBST(Z_CFLAGS) |
| 79 | AC_SUBST(Z_LIBS) |
| 80 | |
| 81 | CPPFLAGS=${_cppflags} |
| 82 | LDFLAGS=${_ldflags} |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 83 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 84 | dnl Checks for header files. |
| 85 | AC_HEADER_DIRENT |
| 86 | AC_HEADER_STDC |
Daniel Veillard | 817e70b | 2002-11-19 22:28:48 +0000 | [diff] [blame] | 87 | AC_CHECK_HEADERS([fcntl.h]) |
| 88 | AC_CHECK_HEADERS([unistd.h]) |
| 89 | AC_CHECK_HEADERS([ctype.h]) |
| 90 | AC_CHECK_HEADERS([dirent.h]) |
| 91 | AC_CHECK_HEADERS([errno.h]) |
| 92 | AC_CHECK_HEADERS([malloc.h]) |
| 93 | AC_CHECK_HEADERS([stdarg.h]) |
| 94 | AC_CHECK_HEADERS([sys/stat.h]) |
| 95 | AC_CHECK_HEADERS([sys/types.h]) |
| 96 | AC_CHECK_HEADERS([time.h]) |
| 97 | AC_CHECK_HEADERS([ansidecl.h]) |
| 98 | AC_CHECK_HEADERS([ieeefp.h]) |
| 99 | AC_CHECK_HEADERS([nan.h]) |
| 100 | AC_CHECK_HEADERS([math.h]) |
| 101 | AC_CHECK_HEADERS([fp_class.h]) |
| 102 | AC_CHECK_HEADERS([float.h]) |
| 103 | AC_CHECK_HEADERS([stdlib.h]) |
| 104 | AC_CHECK_HEADERS([sys/socket.h], [], [], |
| 105 | [#if HAVE_SYS_TYPES_H |
| 106 | # include <sys/types.h> |
| 107 | # endif |
| 108 | ]) |
| 109 | AC_CHECK_HEADERS([netinet/in.h], [], [], |
| 110 | [#if HAVE_SYS_TYPES_H |
| 111 | # include <sys/types.h> |
| 112 | # endif |
| 113 | ]) |
| 114 | AC_CHECK_HEADERS([arpa/inet.h], [], [], |
| 115 | [#if HAVE_SYS_TYPES_H |
| 116 | # include <sys/types.h> |
| 117 | # endif |
| 118 | #if HAVE_ARPA_INET_H |
| 119 | # include <arpa/inet.h> |
| 120 | # endif |
| 121 | ]) |
| 122 | AC_CHECK_HEADERS([netdb.h]) |
| 123 | AC_CHECK_HEADERS([sys/time.h]) |
| 124 | AC_CHECK_HEADERS([sys/select.h]) |
| 125 | AC_CHECK_HEADERS([sys/mman.h]) |
| 126 | AC_CHECK_HEADERS([sys/timeb.h]) |
| 127 | AC_CHECK_HEADERS([signal.h]) |
| 128 | AC_CHECK_HEADERS([arpa/nameser.h], [], [], |
| 129 | [#if HAVE_SYS_TYPES_H |
| 130 | # include <sys/types.h> |
| 131 | # endif |
| 132 | ]) |
| 133 | AC_CHECK_HEADERS([resolv.h], [], [], |
| 134 | [#if HAVE_SYS_TYPES_H |
| 135 | # include <sys/types.h> |
| 136 | # endif |
| 137 | #if HAVE_NETINET_IN_H |
| 138 | # include <netinet/in.h> |
| 139 | # endif |
| 140 | #if HAVE_ARPA_NAMESER_H |
| 141 | # include <arpa/nameser.h> |
| 142 | # endif |
| 143 | ]) |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 144 | |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 145 | dnl Specific dir for HTML output ? |
| 146 | if test "x$with_html_dir" = "x" ; then |
Daniel Veillard | 0a6c358 | 2001-03-14 19:15:37 +0000 | [diff] [blame] | 147 | HTML_DIR='$(prefix)/doc' |
Daniel Veillard | 1164e75 | 1999-02-16 16:29:17 +0000 | [diff] [blame] | 148 | else |
| 149 | HTML_DIR=$with_html_dir |
| 150 | fi |
| 151 | |
| 152 | AC_SUBST(HTML_DIR) |
| 153 | |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 154 | dnl Checks for library functions. |
| 155 | AC_FUNC_STRFTIME |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 156 | AC_CHECK_FUNCS(strdup strndup strerror) |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 157 | AC_CHECK_FUNCS(finite isnand fp_class class fpclass) |
Daniel Veillard | 90bc371 | 2002-03-07 15:12:58 +0000 | [diff] [blame] | 158 | AC_CHECK_FUNCS(strftime localtime gettimeofday ftime) |
Daniel Veillard | 068a965 | 2001-06-07 15:30:26 +0000 | [diff] [blame] | 159 | AC_CHECK_FUNCS(stat _stat signal) |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 160 | |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 161 | dnl Checking the standard string functions availability |
| 162 | AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, |
| 163 | NEED_TRIO=1) |
| 164 | |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 165 | dnl Checks for inet libraries: |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 166 | AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) |
| 167 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
| 168 | AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect)) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 169 | |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 170 | dnl Determine what socket length (socklen_t) data type is |
| 171 | AC_MSG_CHECKING([for type of socket length (socklen_t)]) |
| 172 | AC_TRY_COMPILE2([ |
| 173 | #include <stddef.h> |
| 174 | #include <sys/types.h> |
| 175 | #include <sys/socket.h>],[ |
| 176 | (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[ |
| 177 | AC_MSG_RESULT(socklen_t *) |
| 178 | SOCKLEN_T=socklen_t],[ |
| 179 | AC_TRY_COMPILE2([ |
| 180 | #include <stddef.h> |
| 181 | #include <sys/types.h> |
| 182 | #include <sys/socket.h>],[ |
| 183 | (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[ |
| 184 | AC_MSG_RESULT(size_t *) |
| 185 | SOCKLEN_T=size_t],[ |
| 186 | AC_TRY_COMPILE2([ |
| 187 | #include <stddef.h> |
| 188 | #include <sys/types.h> |
| 189 | #include <sys/socket.h>],[ |
| 190 | (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[ |
| 191 | AC_MSG_RESULT(int *) |
| 192 | SOCKLEN_T=int],[ |
| 193 | AC_MSG_WARN(could not determine)])])]) |
| 194 | AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T) |
| 195 | |
Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 196 | dnl ***********************Checking for availability of IPv6******************* |
| 197 | |
| 198 | AC_MSG_CHECKING([whether to enable IPv6]) |
| 199 | AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes) |
| 200 | if test $enable_ipv6 = yes; then |
| 201 | have_ipv6=no |
| 202 | AC_TRY_COMPILE([ |
| 203 | #include <sys/socket.h> |
| 204 | #include <sys/types.h>], [ |
| 205 | struct sockaddr_storage ss; |
| 206 | socket(AF_INET6, SOCK_STREAM, 0) |
| 207 | ], |
| 208 | have_ipv6=yes, |
| 209 | have_ipv6=no |
| 210 | ) |
| 211 | AC_MSG_RESULT($have_ipv6) |
| 212 | |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 213 | if test $have_ipv6 = yes; then |
Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 214 | AC_DEFINE(SUPPORT_IP6) |
| 215 | |
| 216 | have_getaddrinfo=no |
| 217 | AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes) |
| 218 | if test $have_getaddrinfo != yes; then |
| 219 | for lib in bsd socket inet; do |
| 220 | AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break]) |
| 221 | done |
| 222 | fi |
| 223 | |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 224 | if test $have_getaddrinfo = yes; then |
Daniel Veillard | de2a67b | 2003-06-21 14:20:04 +0000 | [diff] [blame] | 225 | AC_DEFINE(HAVE_GETADDRINFO) |
| 226 | fi |
| 227 | fi |
| 228 | fi |
| 229 | |
| 230 | dnl ******************************End IPv6 checks****************************** |
| 231 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 232 | dnl Checks for isnan in libm if not in libc |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 233 | AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan, |
Bjorn Reese | e1dc011 | 2001-03-03 12:09:03 +0000 | [diff] [blame] | 234 | [AC_DEFINE(HAVE_ISNAN)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 235 | |
Daniel Veillard | 760f442 | 2001-02-15 14:59:48 +0000 | [diff] [blame] | 236 | 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] | 237 | [AC_DEFINE(HAVE_ISINF)])) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 238 | |
| 239 | XML_LIBDIR='-L${libdir}' |
Daniel Veillard | e7dd2b8 | 2002-03-15 18:44:02 +0000 | [diff] [blame] | 240 | XML_INCLUDEDIR='-I${includedir}/libxml2' |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 241 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 242 | dnl |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 243 | dnl Extra flags |
| 244 | dnl |
| 245 | XML_CFLAGS="" |
Daniel Veillard | 357c960 | 2001-05-03 10:49:20 +0000 | [diff] [blame] | 246 | RDL_LIBS="" |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 247 | |
Daniel Veillard | d94849b | 2003-07-28 13:02:24 +0000 | [diff] [blame] | 248 | AC_ARG_WITH(fexceptions, |
| 249 | [ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)]) |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 250 | dnl |
Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 251 | dnl Workaround for native compilers |
| 252 | dnl HP : http://bugs.gnome.org/db/31/3163.html |
| 253 | dnl DEC : Enable NaN/Inf |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 254 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 255 | if test "${GCC}" != "yes" ; then |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 256 | case "${host}" in |
| 257 | *-*-hpux* ) |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 258 | CFLAGS="${CFLAGS} -Wp,-H30000" |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 259 | ;; |
Daniel Veillard | b45c43b | 2001-04-28 17:02:11 +0000 | [diff] [blame] | 260 | *-dec-osf* ) |
| 261 | CFLAGS="${CFLAGS} -ieee" |
| 262 | ;; |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 263 | alpha*-*-linux* ) |
| 264 | CFLAGS="${CFLAGS} -ieee" |
| 265 | ;; |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 266 | esac |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 267 | else |
Daniel Veillard | d94849b | 2003-07-28 13:02:24 +0000 | [diff] [blame] | 268 | if test "$with_fexceptions" = "yes" |
| 269 | then |
| 270 | # |
| 271 | # Not activated by default because this inflates the code size |
| 272 | # Used to allow propagation of C++ exceptions through the library |
| 273 | # |
| 274 | CFLAGS="${CFLAGS} -fexceptions" |
| 275 | fi |
| 276 | |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 277 | CFLAGS="${CFLAGS} -Wall" |
Daniel Veillard | 14839d5 | 2001-06-06 16:11:56 +0000 | [diff] [blame] | 278 | case "${host}" in |
| 279 | alpha*-*-linux* ) |
| 280 | CFLAGS="${CFLAGS} -mieee" |
| 281 | ;; |
Daniel Veillard | cb5b4d6 | 2002-04-11 08:24:26 +0000 | [diff] [blame] | 282 | alpha*-*-osf* ) |
| 283 | CFLAGS="${CFLAGS} -mieee" |
| 284 | ;; |
Daniel Veillard | 14839d5 | 2001-06-06 16:11:56 +0000 | [diff] [blame] | 285 | esac |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 286 | fi |
Daniel Veillard | b0426ca | 2000-10-11 23:39:43 +0000 | [diff] [blame] | 287 | case ${host} in |
| 288 | *-*-solaris*) |
Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 289 | XML_LIBDIR="${XML_LIBDIR} -R${libdir}" |
| 290 | ;; |
Daniel Veillard | d30be4a | 2002-03-28 18:25:31 +0000 | [diff] [blame] | 291 | hppa*-hp-mpeix) |
| 292 | NEED_TRIO=1 |
| 293 | ;; |
Daniel Veillard | d2ade93 | 2000-09-30 14:39:55 +0000 | [diff] [blame] | 294 | esac |
| 295 | |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 296 | |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 297 | dnl |
| 298 | dnl check for python |
| 299 | dnl |
| 300 | |
| 301 | PYTHON= |
| 302 | PYTHON_VERSION= |
| 303 | PYTHON_INCLUDES= |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 304 | PYTHON_SITE_PACKAGES= |
Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 305 | pythondir= |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 306 | AC_ARG_WITH(python, |
| 307 | [ --with-python[[=DIR]] build Python bindings if found]) |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 308 | if test "$with_python" != "no" ; then |
| 309 | if test -x "$with_python/bin/python" |
| 310 | then |
| 311 | echo Found python in $with_python/bin/python |
| 312 | PYTHON="$with_python/bin/python" |
Daniel Veillard | 9b731d7 | 2002-04-14 12:56:08 +0000 | [diff] [blame] | 313 | else |
Daniel Veillard | a8a89fe | 2002-04-12 21:03:34 +0000 | [diff] [blame] | 314 | if test -x "$with_python" |
| 315 | then |
Daniel Veillard | 4efd3be | 2002-11-18 09:11:13 +0000 | [diff] [blame] | 316 | echo Found python in $with_python |
| 317 | PYTHON="$with_python" |
Daniel Veillard | a8a89fe | 2002-04-12 21:03:34 +0000 | [diff] [blame] | 318 | else |
Daniel Veillard | 4efd3be | 2002-11-18 09:11:13 +0000 | [diff] [blame] | 319 | AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) |
Daniel Veillard | a8a89fe | 2002-04-12 21:03:34 +0000 | [diff] [blame] | 320 | fi |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 321 | fi |
| 322 | if test "$PYTHON" != "" |
| 323 | then |
| 324 | PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` |
| 325 | echo Found Python version $PYTHON_VERSION |
| 326 | fi |
| 327 | if test "$PYTHON_VERSION" != "" |
| 328 | then |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 329 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ |
| 330 | -d $with_python/lib/python$PYTHON_VERSION/site-packages |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 331 | then |
| 332 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 333 | PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 334 | else |
| 335 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h |
| 336 | then |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 337 | PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' |
Daniel Veillard | e3b7d9a | 2002-08-14 14:11:30 +0000 | [diff] [blame] | 338 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 339 | else |
| 340 | if test -r /usr/include/python$PYTHON_VERSION/Python.h |
| 341 | then |
| 342 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
Daniel Veillard | e3b7d9a | 2002-08-14 14:11:30 +0000 | [diff] [blame] | 343 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 344 | else |
| 345 | echo could not find python$PYTHON_VERSION/Python.h |
| 346 | fi |
| 347 | fi |
Daniel Veillard | b6984ef | 2002-08-14 16:55:31 +0000 | [diff] [blame] | 348 | if ! test -d "$PYTHON_SITE_PACKAGES" |
| 349 | then |
| 350 | PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` |
| 351 | fi |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 352 | fi |
| 353 | fi |
Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 354 | if test "$with_python" != "" |
| 355 | then |
| 356 | pythondir='$(PYTHON_SITE_PACKAGES)' |
| 357 | else |
| 358 | pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' |
| 359 | fi |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 360 | fi |
| 361 | AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") |
Daniel Veillard | 40b1134 | 2002-09-20 12:01:39 +0000 | [diff] [blame] | 362 | if test "$PYTHON_INCLUDES" != "" |
| 363 | then |
| 364 | PYTHON_SUBDIR=python |
| 365 | else |
| 366 | PYTHON_SUBDIR= |
| 367 | fi |
Daniel Veillard | 38b80a8 | 2003-05-14 18:59:00 +0000 | [diff] [blame] | 368 | AC_SUBST(pythondir) |
Daniel Veillard | 40b1134 | 2002-09-20 12:01:39 +0000 | [diff] [blame] | 369 | AC_SUBST(PYTHON_SUBDIR) |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 370 | |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 371 | dnl |
| 372 | dnl Tester makes use of readline if present |
| 373 | dnl |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 374 | _cppflags="${CPPFLAGS}" |
| 375 | _ldflags="${LDFLAGS}" |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 376 | |
Daniel Veillard | 0310929 | 2000-08-14 14:58:22 +0000 | [diff] [blame] | 377 | AC_ARG_WITH(readline, |
| 378 | [ --with-readline=DIR use readline in DIR],[ |
| 379 | if test "$withval" != "no" -a "$withval" != "yes"; then |
| 380 | RDL_DIR=$withval |
| 381 | CPPFLAGS="${CPPFLAGS} -I$withval/include" |
| 382 | LDFLAGS="${LDFLAGS} -L$withval/lib" |
| 383 | fi |
| 384 | ]) |
| 385 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 386 | dnl |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 387 | dnl specific tests to setup DV's devel environment with debug etc ... |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 388 | dnl (-Wunreachable-code) |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 389 | dnl |
| 390 | if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then |
| 391 | if test "${with_mem_debug}" = "" ; then |
| 392 | with_mem_debug="yes" |
| 393 | fi |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 394 | if test "${with_docbook}" = "" ; then |
| 395 | with_docbook="yes" |
| 396 | fi |
Daniel Veillard | 0ba5923 | 2002-02-10 13:20:39 +0000 | [diff] [blame] | 397 | 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 -Wredundant-decls " |
Daniel Veillard | 2e9b165 | 2003-02-19 13:29:45 +0000 | [diff] [blame] | 398 | STATIC_BINARIES="-static" |
Daniel Veillard | c86a4fa | 2001-03-26 16:28:29 +0000 | [diff] [blame] | 399 | dnl -Wcast-qual -ansi |
Daniel Veillard | 2e9b165 | 2003-02-19 13:29:45 +0000 | [diff] [blame] | 400 | else |
| 401 | STATIC_BINARIES= |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 402 | fi |
Daniel Veillard | 2e9b165 | 2003-02-19 13:29:45 +0000 | [diff] [blame] | 403 | AC_SUBST(STATIC_BINARIES) |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 404 | |
| 405 | dnl |
| 406 | dnl Check for trio string functions |
| 407 | dnl |
| 408 | |
| 409 | if test "${NEED_TRIO}" = "1" ; then |
| 410 | echo Adding trio library for string functions |
| 411 | WITH_TRIO=1 |
| 412 | else |
| 413 | WITH_TRIO=0 |
| 414 | fi |
Daniel Veillard | 01ef738 | 2001-05-08 07:31:43 +0000 | [diff] [blame] | 415 | AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1") |
Daniel Veillard | 92ad210 | 2001-03-27 12:47:33 +0000 | [diff] [blame] | 416 | AC_SUBST(WITH_TRIO) |
| 417 | |
Daniel Veillard | f6eea27 | 2001-01-18 12:17:12 +0000 | [diff] [blame] | 418 | dnl |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 419 | dnl Allow to enable/disable various pieces |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 420 | dnl |
| 421 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 422 | THREAD_LIBS="" |
| 423 | WITH_THREADS=0 |
| 424 | THREAD_CFLAGS="" |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 425 | TEST_THREADS="" |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 426 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 427 | AC_ARG_WITH(threads, |
| 428 | [ --with-threads add multithread support(on)]) |
Daniel Veillard | 8494271 | 2003-04-18 14:40:05 +0000 | [diff] [blame] | 429 | if test "$with_threads" = "no" ; then |
| 430 | echo Disabling multithreaded support |
| 431 | else |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 432 | echo Enabling multithreaded support |
| 433 | |
| 434 | AC_CHECK_HEADER(pthread.h, |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 435 | AC_CHECK_LIB(pthread, pthread_join,[ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 436 | THREAD_LIBS="-lpthread" |
| 437 | AC_DEFINE(HAVE_LIBPTHREAD) |
| 438 | AC_DEFINE(HAVE_PTHREAD_H) |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 439 | WITH_THREADS="1"])) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 440 | |
| 441 | if test "$WITH_THREADS" = "1" ; then |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 442 | THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" |
| 443 | TEST_THREADS="Threadtests" |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 444 | fi |
| 445 | fi |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 446 | AC_ARG_WITH(thread-alloc, |
| 447 | [ --with-thread-alloc add per-thread memory(off)]) |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 448 | if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then |
| 449 | THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED" |
Daniel Veillard | 64a411c | 2001-10-15 12:32:07 +0000 | [diff] [blame] | 450 | fi |
| 451 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 452 | AC_SUBST(THREAD_LIBS) |
| 453 | AC_SUBST(WITH_THREADS) |
| 454 | AC_SUBST(THREAD_CFLAGS) |
Daniel Veillard | ab7488e | 2001-10-17 11:30:37 +0000 | [diff] [blame] | 455 | AC_SUBST(TEST_THREADS) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 456 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 457 | AC_ARG_WITH(history, |
| 458 | [ --with-history add history support to xmllint shell(off)]) |
Daniel Veillard | 259ff74 | 2001-10-06 13:49:59 +0000 | [diff] [blame] | 459 | if test "$with_history" = "yes" ; then |
Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 460 | echo Enabling xmllint shell history |
| 461 | dnl check for terminal library. this is a very cool solution |
| 462 | dnl from octave's configure.in |
| 463 | unset tcap |
| 464 | for termlib in ncurses curses termcap terminfo termlib; do |
| 465 | AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) |
| 466 | test -n "$tcap" && break |
| 467 | done |
| 468 | |
| 469 | AC_CHECK_HEADER(readline/history.h, |
| 470 | AC_CHECK_LIB(history, append_history,[ |
| 471 | RDL_LIBS="-lhistory" |
| 472 | AC_DEFINE(HAVE_LIBHISTORY)])) |
| 473 | AC_CHECK_HEADER(readline/readline.h, |
| 474 | AC_CHECK_LIB(readline, readline,[ |
| 475 | RDL_LIBS="-lreadline $RDL_LIBS $tcap" |
| 476 | AC_DEFINE(HAVE_LIBREADLINE)], , $tcap)) |
| 477 | if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then |
| 478 | CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" |
| 479 | RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" |
| 480 | else |
| 481 | CPPFLAGS=${_cppflags} |
| 482 | fi |
| 483 | LDFLAGS=${_ldflags} |
| 484 | fi |
| 485 | |
| 486 | AC_SUBST(WITH_FTP) |
| 487 | AC_SUBST(FTP_OBJ) |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 488 | AC_ARG_WITH(ftp, |
| 489 | [ --with-ftp add the FTP support (on)]) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 490 | if test "$with_ftp" = "no" ; then |
| 491 | echo Disabling FTP support |
| 492 | WITH_FTP=0 |
| 493 | FTP_OBJ= |
| 494 | else |
| 495 | WITH_FTP=1 |
| 496 | FTP_OBJ=nanoftp.o |
| 497 | fi |
| 498 | AC_SUBST(WITH_FTP) |
| 499 | AC_SUBST(FTP_OBJ) |
| 500 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 501 | AC_ARG_WITH(http, |
| 502 | [ --with-http add the HTTP support (on)]) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 503 | if test "$with_http" = "no" ; then |
| 504 | echo Disabling HTTP support |
| 505 | WITH_HTTP=0 |
| 506 | HTTP_OBJ= |
| 507 | else |
| 508 | WITH_HTTP=1 |
| 509 | HTTP_OBJ=nanohttp.o |
| 510 | fi |
| 511 | AC_SUBST(WITH_HTTP) |
| 512 | AC_SUBST(HTTP_OBJ) |
| 513 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 514 | AC_ARG_WITH(html, |
| 515 | [ --with-html add the HTML support (on)]) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 516 | if test "$with_html" = "no" ; then |
| 517 | echo Disabling HTML support |
| 518 | WITH_HTML=0 |
| 519 | HTML_OBJ= |
| 520 | else |
| 521 | WITH_HTML=1 |
| 522 | HTML_OBJ="HTMLparser.o HTMLtree.o" |
| 523 | fi |
| 524 | AC_SUBST(WITH_HTML) |
| 525 | AC_SUBST(HTML_OBJ) |
| 526 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 527 | AC_ARG_WITH(catalog, |
| 528 | [ --with-catalog add the Catalog support (on)]) |
Daniel Veillard | a737459 | 2001-05-10 14:17:55 +0000 | [diff] [blame] | 529 | if test "$with_catalog" = "no" ; then |
| 530 | echo Disabling Catalog support |
| 531 | WITH_CATALOG=0 |
| 532 | CATALOG_OBJ= |
| 533 | else |
| 534 | WITH_CATALOG=1 |
| 535 | CATALOG_OBJ="catalog.o" |
| 536 | fi |
| 537 | AC_SUBST(WITH_CATALOG) |
| 538 | AC_SUBST(CATALOG_OBJ) |
| 539 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 540 | AC_ARG_WITH(docbook, |
| 541 | [ --with-docbook add Docbook SGML support (on)]) |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 542 | if test "$with_docbook" = "no" ; then |
| 543 | echo Disabling Docbook support |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 544 | WITH_DOCB=0 |
| 545 | DOCB_OBJ= |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 546 | else |
| 547 | WITH_DOCB=1 |
| 548 | DOCB_OBJ="DOCBparser.o" |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 549 | fi |
| 550 | AC_SUBST(WITH_DOCB) |
| 551 | AC_SUBST(DOCB_OBJ) |
| 552 | |
| 553 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 554 | AC_ARG_WITH(xpath, |
| 555 | [ --with-xpath add the XPATH support (on)]) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 556 | if test "$with_xpath" = "no" ; then |
| 557 | echo Disabling XPATH support |
Daniel Veillard | 52afe80 | 2000-10-22 16:56:02 +0000 | [diff] [blame] | 558 | with_xptr="no" |
Daniel Veillard | 34de97f | 2002-04-30 14:29:22 +0000 | [diff] [blame] | 559 | with_c14n="no" |
Daniel Veillard | 070803b | 2002-05-03 07:29:38 +0000 | [diff] [blame] | 560 | with_xinclude="no" |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 561 | WITH_XPATH=0 |
| 562 | XPATH_OBJ= |
| 563 | else |
| 564 | WITH_XPATH=1 |
| 565 | XPATH_OBJ=xpath.o |
| 566 | fi |
| 567 | AC_SUBST(WITH_XPATH) |
| 568 | AC_SUBST(XPATH_OBJ) |
| 569 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 570 | AC_ARG_WITH(xptr, |
| 571 | [ --with-xptr add the XPointer support (on)]) |
Daniel Veillard | c8df0aa | 2000-10-10 23:50:30 +0000 | [diff] [blame] | 572 | if test "$with_xptr" = "no" ; then |
| 573 | echo Disabling XPointer support |
| 574 | WITH_XPTR=0 |
| 575 | XPTR_OBJ= |
| 576 | else |
| 577 | WITH_XPTR=1 |
| 578 | XPTR_OBJ=xpointer.o |
| 579 | fi |
| 580 | AC_SUBST(WITH_XPTR) |
| 581 | AC_SUBST(XPTR_OBJ) |
| 582 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 583 | AC_ARG_WITH(c14n, |
| 584 | [ --with-c14n add the Canonicalization support (on)]) |
Daniel Veillard | 044fc6b | 2002-03-04 17:09:44 +0000 | [diff] [blame] | 585 | if test "$with_c14n" = "no" ; then |
| 586 | echo Disabling C14N support |
| 587 | WITH_C14N=0 |
| 588 | C14N_OBJ= |
| 589 | else |
| 590 | WITH_C14N=1 |
| 591 | C14N_OBJ="c14n.c" |
| 592 | fi |
| 593 | AC_SUBST(WITH_C14N) |
| 594 | AC_SUBST(C14N_OBJ) |
| 595 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 596 | AC_ARG_WITH(xinclude, |
| 597 | [ --with-xinclude add the XInclude support (on)]) |
Daniel Veillard | 9e8bfae | 2000-11-06 16:43:11 +0000 | [diff] [blame] | 598 | if test "$with_xinclude" = "no" ; then |
| 599 | echo Disabling XInclude support |
| 600 | WITH_XINCLUDE=0 |
| 601 | XINCLUDE_OBJ= |
| 602 | with_xinclude="no" |
| 603 | else |
| 604 | WITH_XINCLUDE=1 |
| 605 | XINCLUDE_OBJ=xinclude.o |
| 606 | fi |
| 607 | AC_SUBST(WITH_XINCLUDE) |
| 608 | AC_SUBST(XINCLUDE_OBJ) |
| 609 | |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 610 | WITH_ICONV=0 |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 611 | AC_ARG_WITH(iconv, |
| 612 | [ --with-iconv[[=DIR]] add ICONV support (on)]) |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 613 | if test "$with_iconv" = "no" ; then |
| 614 | echo Disabling ICONV support |
Daniel Veillard | d574f78 | 2001-03-14 19:40:17 +0000 | [diff] [blame] | 615 | else |
Daniel Veillard | 220346d | 2001-12-07 11:33:54 +0000 | [diff] [blame] | 616 | if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 617 | CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" |
Daniel Veillard | f5b44e4 | 2001-09-17 17:19:54 +0000 | [diff] [blame] | 618 | # Export this since our headers include iconv.h |
| 619 | XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 620 | ICONV_LIBS="-L$with_iconv/lib" |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 621 | fi |
Daniel Veillard | 6e90d19 | 2001-07-03 16:37:49 +0000 | [diff] [blame] | 622 | |
| 623 | AC_CHECK_HEADER(iconv.h, |
| 624 | AC_MSG_CHECKING(for iconv) |
| 625 | AC_TRY_LINK([#include <stdlib.h> |
| 626 | #include <iconv.h>],[ |
| 627 | iconv_t cd = iconv_open ("",""); |
| 628 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
| 629 | AC_MSG_RESULT(yes) |
| 630 | WITH_ICONV=1],[ |
| 631 | AC_MSG_RESULT(no) |
| 632 | AC_MSG_CHECKING(for iconv in -liconv) |
| 633 | |
| 634 | _ldflags="${LDFLAGS}" |
| 635 | _libs="${LIBS}" |
| 636 | LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" |
| 637 | LIBS="${LIBS} -liconv" |
| 638 | |
| 639 | AC_TRY_LINK([#include <stdlib.h> |
| 640 | #include <iconv.h>],[ |
| 641 | iconv_t cd = iconv_open ("",""); |
| 642 | iconv (cd, NULL, NULL, NULL, NULL);],[ |
| 643 | AC_MSG_RESULT(yes) |
| 644 | WITH_ICONV=1 |
| 645 | ICONV_LIBS="${ICONV_LIBS} -liconv" |
| 646 | LIBS="${_libs}" |
| 647 | LDFLAGS="${_ldflags}"],[ |
| 648 | AC_MSG_RESULT(no) |
| 649 | LIBS="${_libs}" |
| 650 | LDFLAGS="${_ldflags}"])])) |
| 651 | fi |
Daniel Veillard | b82c166 | 2001-12-09 14:00:54 +0000 | [diff] [blame] | 652 | M_LIBS="-lm" |
| 653 | XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" |
Daniel Veillard | 90d165b | 2003-09-01 20:33:13 +0000 | [diff] [blame] | 654 | XML_LIBTOOLLIBS="libxml2.la" |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 655 | AC_SUBST(WITH_ICONV) |
| 656 | |
Daniel Veillard | 01fc1a9 | 2003-07-30 15:12:01 +0000 | [diff] [blame] | 657 | WITH_ISO8859X=1 |
| 658 | AC_ARG_WITH(iso8859x, |
| 659 | [ --with-iso8859x add ISO8859X support if no iconv (on)]) |
| 660 | if test "$WITH_ICONV" != "1" ; then |
| 661 | if test "$with_iso8859x" = "no" ; then |
| 662 | echo Disabling ISO8859X support |
| 663 | WITH_ISO8859X=0 |
| 664 | fi |
| 665 | fi |
| 666 | AC_SUBST(WITH_ISO8859X) |
| 667 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 668 | AC_ARG_WITH(schemas, |
| 669 | [ --with-schemas add experimental Schemas/RelaxNG support (on)]) |
Daniel Veillard | ef4d3bc | 2003-02-07 12:38:22 +0000 | [diff] [blame] | 670 | if test "$with_schemas" = "no" ; then |
| 671 | echo "Disabled Schemas/Relax-NG support" |
| 672 | WITH_SCHEMAS=0 |
| 673 | TEST_SCHEMAS= |
| 674 | else |
Daniel Veillard | 71531f3 | 2003-02-05 13:19:53 +0000 | [diff] [blame] | 675 | echo "Enabled Schemas/Relax-NG support" |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 676 | WITH_SCHEMAS=1 |
Daniel Veillard | 6eadf63 | 2003-01-23 18:29:16 +0000 | [diff] [blame] | 677 | TEST_SCHEMAS="Schemastests Relaxtests" |
Daniel Veillard | 23e7357 | 2002-09-19 19:56:43 +0000 | [diff] [blame] | 678 | with_regexps=yes |
Daniel Veillard | 4255d50 | 2002-04-16 15:50:10 +0000 | [diff] [blame] | 679 | fi |
| 680 | AC_SUBST(WITH_SCHEMAS) |
| 681 | AC_SUBST(TEST_SCHEMAS) |
| 682 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 683 | AC_ARG_WITH(regexps, |
| 684 | [ --with-regexps add Regular Expressions support (on)]) |
Daniel Veillard | 23e7357 | 2002-09-19 19:56:43 +0000 | [diff] [blame] | 685 | if test "$with_regexps" = "no" ; then |
| 686 | echo Disabling Regexps support |
| 687 | WITH_REGEXPS=0 |
| 688 | TEST_REGEXPS= |
| 689 | else |
| 690 | WITH_REGEXPS=1 |
| 691 | TEST_REGEXPS="Regexptests Automatatests" |
| 692 | fi |
| 693 | AC_SUBST(WITH_REGEXPS) |
| 694 | AC_SUBST(TEST_REGEXPS) |
| 695 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 696 | AC_ARG_WITH(debug, |
| 697 | [ --with-debug add the debugging module (on)]) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 698 | if test "$with_debug" = "no" ; then |
| 699 | echo Disabling DEBUG support |
| 700 | WITH_DEBUG=0 |
| 701 | DEBUG_OBJ= |
| 702 | else |
| 703 | WITH_DEBUG=1 |
| 704 | DEBUG_OBJ=debugXML.o |
| 705 | fi |
| 706 | AC_SUBST(WITH_DEBUG) |
| 707 | AC_SUBST(DEBUG_OBJ) |
| 708 | |
William M. Brack | 97ad4c7 | 2003-05-13 08:08:36 +0000 | [diff] [blame] | 709 | AC_ARG_WITH(mem_debug, |
| 710 | [ --with-mem-debug add the memory debugging module (off)]) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 711 | if test "$with_mem_debug" = "yes" ; then |
| 712 | echo Enabling memory debug support |
| 713 | WITH_MEM_DEBUG=1 |
| 714 | else |
| 715 | WITH_MEM_DEBUG=0 |
| 716 | fi |
| 717 | AC_SUBST(WITH_MEM_DEBUG) |
| 718 | |
Daniel Veillard | 1638a47 | 2003-08-14 01:23:25 +0000 | [diff] [blame] | 719 | |
| 720 | WIN32_EXTRA_LIBADD= |
| 721 | WIN32_EXTRA_LDFLAGS= |
| 722 | case "$host" in |
| 723 | *-*-mingw*) |
| 724 | WIN32_EXTRA_LIBADD="-lwsock32" |
| 725 | WIN32_EXTRA_LDFLAGS="-no-undefined" |
| 726 | AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation]) |
| 727 | AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around]) |
| 728 | AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around]) |
| 729 | ;; |
| 730 | esac |
| 731 | AC_SUBST(WIN32_EXTRA_LIBADD) |
| 732 | AC_SUBST(WIN32_EXTRA_LDFLAGS) |
| 733 | |
| 734 | |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 735 | AC_SUBST(CFLAGS) |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 736 | AC_SUBST(XML_CFLAGS) |
Daniel Veillard | d7e200c | 1999-11-15 17:53:11 +0000 | [diff] [blame] | 737 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 738 | AC_SUBST(XML_LIBDIR) |
| 739 | AC_SUBST(XML_LIBS) |
Daniel Veillard | 90d165b | 2003-09-01 20:33:13 +0000 | [diff] [blame] | 740 | AC_SUBST(XML_LIBTOOLLIBS) |
Daniel Veillard | 81418e3 | 2001-05-22 15:08:55 +0000 | [diff] [blame] | 741 | AC_SUBST(ICONV_LIBS) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 742 | AC_SUBST(XML_INCLUDEDIR) |
| 743 | AC_SUBST(HTML_DIR) |
| 744 | AC_SUBST(HAVE_ISNAN) |
| 745 | AC_SUBST(HAVE_ISINF) |
Daniel Veillard | f1d0e6b | 2002-01-31 23:42:44 +0000 | [diff] [blame] | 746 | AC_SUBST(PYTHON) |
| 747 | AC_SUBST(PYTHON_VERSION) |
| 748 | AC_SUBST(PYTHON_INCLUDES) |
Daniel Veillard | 253aa2c | 2002-02-02 09:17:16 +0000 | [diff] [blame] | 749 | AC_SUBST(PYTHON_SITE_PACKAGES) |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 750 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 751 | AC_SUBST(M_LIBS) |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 752 | AC_SUBST(RDL_LIBS) |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 753 | |
Daniel Veillard | 9715c17 | 2002-11-25 16:33:40 +0000 | [diff] [blame] | 754 | dnl for the spec file |
| 755 | RELDATE=`date +'%a %b %e %Y'` |
| 756 | AC_SUBST(RELDATE) |
| 757 | |
Daniel Veillard | c6e997c | 2003-01-27 12:35:42 +0000 | [diff] [blame] | 758 | rm -f COPYING.LIB COPYING |
Daniel Veillard | c575b99 | 2002-02-08 13:28:40 +0000 | [diff] [blame] | 759 | ln -s Copyright COPYING |
| 760 | |
Daniel Veillard | 580ced8 | 2003-03-21 21:22:48 +0000 | [diff] [blame] | 761 | AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile example/Makefile python/Makefile python/tests/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc xml2Conf.sh python/setup.py) |
Arturo Espinosa | 15fe6e7 | 1998-09-07 17:27:57 +0000 | [diff] [blame] | 762 | |
Daniel Veillard | 9b731d7 | 2002-04-14 12:56:08 +0000 | [diff] [blame] | 763 | chmod +x xml2-config xml2Conf.sh python/setup.py |