mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-12 09:17:37 +03:00
496a1cf592
* encoding.[ch], xmlIO.[ch], parser.c, configure.in : revamped the encoding support, added iconv support, so now libxml if compiled with iconv automatically support japanese encodings among others. Work based on initial patch from Yuan-Chen Cheng I may have broken binary compat in the encoding handler registration scheme, but that was so utterly broken I don't expect anybody to have used this feature until now. * parserInternals.h: fixup on the CHAR range macro * xml-error.h, parser.c: catch URL/URI errors using the uri.c code. * tree.[ch]: added xmlBufferGrow(), was needed for iconv * uri.c: added xmlParseURI() I can't believe I forgot to implement this one in 2.0 !!! * SAX.c: moved doc->encoding update in the endDocument() call. * TODO: updated. Iconv rules :-) Daniel
268 lines
6.3 KiB
Plaintext
268 lines
6.3 KiB
Plaintext
dnl Process this file with autoconf to produce a configure script.
|
|
AC_PREREQ(2.2)
|
|
AC_INIT(entities.h)
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
LIBXML_MAJOR_VERSION=2
|
|
LIBXML_MINOR_VERSION=1
|
|
LIBXML_MICRO_VERSION=0
|
|
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
|
|
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
|
|
|
|
LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
|
|
|
|
AC_SUBST(LIBXML_MAJOR_VERSION)
|
|
AC_SUBST(LIBXML_MINOR_VERSION)
|
|
AC_SUBST(LIBXML_MICRO_VERSION)
|
|
AC_SUBST(LIBXML_VERSION)
|
|
AC_SUBST(LIBXML_VERSION_INFO)
|
|
AC_SUBST(LIBXML_VERSION_NUMBER)
|
|
|
|
VERSION=${LIBXML_VERSION}
|
|
|
|
AM_INIT_AUTOMAKE(libxml2, $VERSION)
|
|
|
|
AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
|
|
|
|
dnl Checks for programs.
|
|
AC_PROG_CC
|
|
AC_PROG_INSTALL
|
|
AC_PROG_CPP
|
|
AC_PATH_PROG(RM, rm, /bin/rm)
|
|
AC_PATH_PROG(MV, mv, /bin/mv)
|
|
AC_PATH_PROG(TAR, tar, /bin/tar)
|
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
dnl Checks for zlib library.
|
|
_cppflags="${CPPFLAGS}"
|
|
_ldflags="${LDFLAGS}"
|
|
|
|
AC_ARG_WITH(zlib,
|
|
[ --with-zlib[=DIR] use libz in DIR],[
|
|
if test "$withval" != "no"; then
|
|
Z_DIR=$withval
|
|
CPPFLAGS="${CPPFLAGS} -I$withval/include"
|
|
LDFLAGS="${LDFLAGS} -L$withval/lib"
|
|
fi
|
|
])
|
|
|
|
AC_CHECK_HEADERS(zlib.h,
|
|
AC_CHECK_LIB(z, gzread,[
|
|
AC_DEFINE(HAVE_LIBZ)
|
|
if test "x${Z_DIR}" != "x"; then
|
|
Z_CFLAGS="-I${Z_DIR}/include"
|
|
Z_LIBS="-L${Z_DIR}/lib -lz"
|
|
else
|
|
Z_LIBS="-lz"
|
|
fi]))
|
|
AC_SUBST(Z_CFLAGS)
|
|
AC_SUBST(Z_LIBS)
|
|
|
|
CPPFLAGS=${_cppflags}
|
|
LDFLAGS=${_ldflags}
|
|
|
|
dnl Checks for header files.
|
|
AC_HEADER_DIRENT
|
|
AC_HEADER_STDC
|
|
AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h)
|
|
AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h)
|
|
AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
|
|
AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h)
|
|
AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h)
|
|
|
|
dnl Specific dir for HTML output ?
|
|
if test "x$with_html_dir" = "x" ; then
|
|
HTML_DIR='${datadir}/gtk-doc/html'
|
|
else
|
|
HTML_DIR=$with_html_dir
|
|
fi
|
|
|
|
AC_SUBST(HTML_DIR)
|
|
|
|
AC_ARG_ENABLE(corba, [ --enable-corba Add Corba support (default)])
|
|
|
|
dnl
|
|
dnl Corba is enabled by default
|
|
dnl
|
|
if test "$enable_corba" = "no" ; then
|
|
CORBA_CFLAGS="-DWITHOUT_CORBA"
|
|
fi
|
|
AC_SUBST(CORBA_CFLAGS)
|
|
|
|
dnl Checks for library functions.
|
|
AC_FUNC_STRFTIME
|
|
AC_CHECK_FUNCS(strdup strndup strerror snprintf)
|
|
AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
|
|
AC_CHECK_FUNCS(strftime localtime)
|
|
|
|
dnl Checks for inet libraries:
|
|
AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
|
|
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
|
|
AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
|
|
|
|
dnl Checks for isnan in libm if not in libc
|
|
AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
|
|
[M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
|
|
|
|
AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
|
|
[M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
|
|
|
|
XML_LIBDIR='-L${libdir}'
|
|
XML_INCLUDEDIR='-I${includedir}/libxml -I${includedir}'
|
|
XML_LIBS="-lxml $Z_LIBS $M_LIBS $LIBS"
|
|
|
|
dnl
|
|
dnl Extra flags
|
|
dnl
|
|
XML_CFLAGS=""
|
|
|
|
dnl
|
|
dnl Workaround wor HP native compiler
|
|
dnl http://bugs.gnome.org/db/31/3163.html
|
|
dnl
|
|
if test "${CC}" != "gcc" ; then
|
|
case "${host}" in
|
|
*-*-hpux* )
|
|
CFLAGS="${CFLAGS} -Wp,-H16800 -Ae"
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
dnl
|
|
dnl Use buffers for content
|
|
dnl
|
|
|
|
AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content])
|
|
if test "$with_buffers" = "yes" ; then
|
|
CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT"
|
|
XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT"
|
|
fi
|
|
|
|
dnl
|
|
dnl Tester makes use of readline if present
|
|
dnl
|
|
RDL_LIBS=""
|
|
AC_CHECK_LIB(history, append_history,
|
|
RDL_LIBS="-lhistory"; AC_DEFINE(HAVE_LIBHISTORY))
|
|
AC_CHECK_LIB(readline, readline,
|
|
RDL_LIBS="-lreadline ${RDL_LIBS}"; AC_DEFINE(HAVE_LIBREADLINE))
|
|
|
|
|
|
dnl
|
|
dnl Aloow to disable various pieces
|
|
dnl
|
|
|
|
AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)])
|
|
if test "$with_ftp" = "no" ; then
|
|
echo Disabling FTP support
|
|
WITH_FTP=0
|
|
FTP_OBJ=
|
|
else
|
|
WITH_FTP=1
|
|
FTP_OBJ=nanoftp.o
|
|
fi
|
|
AC_SUBST(WITH_FTP)
|
|
AC_SUBST(FTP_OBJ)
|
|
|
|
AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)])
|
|
if test "$with_http" = "no" ; then
|
|
echo Disabling HTTP support
|
|
WITH_HTTP=0
|
|
HTTP_OBJ=
|
|
else
|
|
WITH_HTTP=1
|
|
HTTP_OBJ=nanohttp.o
|
|
fi
|
|
AC_SUBST(WITH_HTTP)
|
|
AC_SUBST(HTTP_OBJ)
|
|
|
|
AC_ARG_WITH(html, [ --with-html Add the HTML support (on)])
|
|
if test "$with_html" = "no" ; then
|
|
echo Disabling HTML support
|
|
WITH_HTML=0
|
|
HTML_OBJ=
|
|
else
|
|
WITH_HTML=1
|
|
HTML_OBJ="HTMLparser.o HTMLtree.o"
|
|
fi
|
|
AC_SUBST(WITH_HTML)
|
|
AC_SUBST(HTML_OBJ)
|
|
|
|
AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)])
|
|
if test "$with_xpath" = "no" ; then
|
|
echo Disabling XPATH support
|
|
WITH_XPATH=0
|
|
XPATH_OBJ=
|
|
else
|
|
WITH_XPATH=1
|
|
XPATH_OBJ=xpath.o
|
|
fi
|
|
AC_SUBST(WITH_XPATH)
|
|
AC_SUBST(XPATH_OBJ)
|
|
|
|
AC_ARG_WITH(iconv, [ --with-iconv Add the ICONV support (on)])
|
|
if test "$with_iconv" = "no" ; then
|
|
echo Disabling ICONV support
|
|
WITH_ICONV=0
|
|
else
|
|
if test "$have_iconv" != "" ; then
|
|
echo Iconv support not found
|
|
WITH_ICONV=0
|
|
else
|
|
WITH_ICONV=1
|
|
fi
|
|
fi
|
|
AC_SUBST(WITH_ICONV)
|
|
|
|
AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)])
|
|
if test "$with_debug" = "no" ; then
|
|
echo Disabling DEBUG support
|
|
WITH_DEBUG=0
|
|
DEBUG_OBJ=
|
|
else
|
|
WITH_DEBUG=1
|
|
DEBUG_OBJ=debugXML.o
|
|
fi
|
|
AC_SUBST(WITH_DEBUG)
|
|
AC_SUBST(DEBUG_OBJ)
|
|
|
|
AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
|
|
if test "$with_mem_debug" = "yes" ; then
|
|
echo Enabling memory debug support
|
|
WITH_MEM_DEBUG=1
|
|
else
|
|
WITH_MEM_DEBUG=0
|
|
fi
|
|
AC_SUBST(WITH_MEM_DEBUG)
|
|
|
|
AC_SUBST(CFLAGS)
|
|
AC_SUBST(XML_CFLAGS)
|
|
|
|
AC_SUBST(XML_LIBDIR)
|
|
AC_SUBST(XML_LIBS)
|
|
AC_SUBST(XML_INCLUDEDIR)
|
|
AC_SUBST(HTML_DIR)
|
|
AC_SUBST(HAVE_ISNAN)
|
|
AC_SUBST(HAVE_ISINF)
|
|
|
|
AC_SUBST(M_LIBS)
|
|
AC_SUBST(RDL_LIBS)
|
|
|
|
dnl
|
|
dnl create the libxml link needed to get dependencies right
|
|
dnl
|
|
if test -f $srcdir/libxml
|
|
then
|
|
rm -f $srcdir/libxml libxml
|
|
(cd $srcdir ; ln -s . libxml)
|
|
(ln -s . libxml)
|
|
else
|
|
(cd $srcdir ; rm -f libxml ; ln -s . libxml)
|
|
(rm -f libxml ; ln -s . libxml)
|
|
fi
|
|
AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xmlversion.h xml-config win32config.h)
|
|
|