1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-27 03:21:26 +03:00
libxml2/configure.in
Daniel Veillard a7084cd57e release of 2.4.20 updated and rebuilt the docs Daniel
* configure.in: release of 2.4.20
* doc/*: updated and rebuilt the docs
Daniel
2002-04-15 17:12:47 +00:00

561 lines
14 KiB
Plaintext

dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.2)
AC_INIT(entities.c)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
LIBXML_MAJOR_VERSION=2
LIBXML_MINOR_VERSION=4
LIBXML_MICRO_VERSION=20
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)
dnl Make sure we have an ANSI compiler
AM_C_PROTOTYPES
test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
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" -a "$withval" != "yes"; then
Z_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
])
if test "$with_zlib" = "no"; then
echo "Disabling compression support"
else
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"
[case ${host} in
*-*-solaris*)
Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
;;
esac]
else
Z_LIBS="-lz"
fi]))
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 ansidecl.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 sys/mman.h)
AC_CHECK_HEADERS(sys/timeb.h signal.h arpa/nameser.h resolv.h)
dnl Specific dir for HTML output ?
if test "x$with_html_dir" = "x" ; then
HTML_DIR='$(prefix)/doc'
else
HTML_DIR=$with_html_dir
fi
AC_SUBST(HTML_DIR)
dnl Checks for library functions.
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(strdup strndup strerror)
AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
AC_CHECK_FUNCS(stat _stat signal)
dnl Checking the standard string functions availability
AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
NEED_TRIO=1)
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 Determine what socket length (socklen_t) data type is
AC_MSG_CHECKING([for type of socket length (socklen_t)])
AC_TRY_COMPILE2([
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
AC_MSG_RESULT(socklen_t *)
SOCKLEN_T=socklen_t],[
AC_TRY_COMPILE2([
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
AC_MSG_RESULT(size_t *)
SOCKLEN_T=size_t],[
AC_TRY_COMPILE2([
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
AC_MSG_RESULT(int *)
SOCKLEN_T=int],[
AC_MSG_WARN(could not determine)])])])
AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T)
dnl Checks for isnan in libm if not in libc
AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
[AC_DEFINE(HAVE_ISNAN)]))
AC_CHECK_FUNC(isinf, AC_DEFINE(HAVE_ISINF) , AC_CHECK_LIB(m, isinf,
[AC_DEFINE(HAVE_ISINF)]))
XML_LIBDIR='-L${libdir}'
XML_INCLUDEDIR='-I${includedir}/libxml2'
dnl
dnl Extra flags
dnl
XML_CFLAGS=""
RDL_LIBS=""
dnl
dnl Workaround for native compilers
dnl HP : http://bugs.gnome.org/db/31/3163.html
dnl DEC : Enable NaN/Inf
dnl
if test "${GCC}" != "yes" ; then
case "${host}" in
*-*-hpux* )
CFLAGS="${CFLAGS} -Wp,-H30000"
;;
*-dec-osf* )
CFLAGS="${CFLAGS} -ieee"
;;
esac
else
CFLAGS="${CFLAGS} -Wall"
case "${host}" in
alpha*-*-linux* )
CFLAGS="${CFLAGS} -mieee"
;;
alpha*-*-osf* )
CFLAGS="${CFLAGS} -mieee"
;;
esac
fi
case ${host} in
*-*-solaris*)
XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
;;
hppa*-hp-mpeix)
NEED_TRIO=1
;;
esac
dnl
dnl check for python
dnl
PYTHON=
PYTHON_VERSION=
PYTHON_INCLUDES=
PYTHON_SITE_PACKAGES=
AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
if test "$with_python" != "no" ; then
if test -x "$with_python/bin/python"
then
echo Found python in $with_python/bin/python
PYTHON="$with_python/bin/python"
else
if test -x "$with_python"
then
echo Found python in $with_python/bin/python
PYTHON="$with_python/bin/python"
else
AC_PATH_PROG(PYTHON, python python2.2 python2.1 python2.0 python1.6 python1.5)
fi
fi
if test "$PYTHON" != ""
then
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
echo Found Python version $PYTHON_VERSION
fi
if test "$PYTHON_VERSION" != ""
then
if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
-d $with_python/lib/python$PYTHON_VERSION/site-packages
then
PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
else
if test -r $prefix/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages'
else
if test -r /usr/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages'
else
echo could not find python$PYTHON_VERSION/Python.h
fi
fi
fi
fi
fi
AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
dnl
dnl Tester makes use of readline if present
dnl
_cppflags="${CPPFLAGS}"
_ldflags="${LDFLAGS}"
AC_ARG_WITH(readline,
[ --with-readline=DIR use readline in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
RDL_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
])
dnl
dnl specific tests to setup DV's devel environment with debug etc ...
dnl (-Wunreachable-code)
dnl
if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then
if test "${with_mem_debug}" = "" ; then
with_mem_debug="yes"
fi
if test "${with_docbook}" = "" ; then
with_docbook="yes"
fi
if test "${with_xptr}" = "" ; then
with_xptr="yes"
fi
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 "
dnl -Wcast-qual -ansi
fi
dnl
dnl Check for trio string functions
dnl
if test "${NEED_TRIO}" = "1" ; then
echo Adding trio library for string functions
WITH_TRIO=1
else
WITH_TRIO=0
fi
AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
AC_SUBST(WITH_TRIO)
dnl
dnl Aloow to enable/disable various pieces
dnl
THREAD_LIBS=""
WITH_THREADS=0
THREAD_CFLAGS=""
TEST_THREADS=""
AC_ARG_WITH(threads, [ --with-threads Add multithread support(off)])
if test "$with_threads" = "yes" ; then
echo Enabling multithreaded support
AC_CHECK_HEADER(pthread.h,
AC_CHECK_LIB(pthread, pthread_join,[
THREAD_LIBS="-lpthread"
AC_DEFINE(HAVE_LIBPTHREAD)
AC_DEFINE(HAVE_PTHREAD_H)
WITH_THREADS="1"]))
if test "$WITH_THREADS" = "1" ; then
THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
TEST_THREADS="Threadtests"
fi
fi
AC_ARG_WITH(thread-alloc, [ --with-thread-alloc Add per-thread memory(off)])
if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
fi
AC_SUBST(THREAD_LIBS)
AC_SUBST(WITH_THREADS)
AC_SUBST(THREAD_CFLAGS)
AC_SUBST(TEST_THREADS)
AC_ARG_WITH(history, [ --with-history Add history support to xmllint shell(off)])
if test "$with_history" = "yes" ; then
echo Enabling xmllint shell history
dnl check for terminal library. this is a very cool solution
dnl from octave's configure.in
unset tcap
for termlib in ncurses curses termcap terminfo termlib; do
AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
test -n "$tcap" && break
done
AC_CHECK_HEADER(readline/history.h,
AC_CHECK_LIB(history, append_history,[
RDL_LIBS="-lhistory"
AC_DEFINE(HAVE_LIBHISTORY)]))
AC_CHECK_HEADER(readline/readline.h,
AC_CHECK_LIB(readline, readline,[
RDL_LIBS="-lreadline $RDL_LIBS $tcap"
AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
else
CPPFLAGS=${_cppflags}
fi
LDFLAGS=${_ldflags}
fi
AC_SUBST(WITH_FTP)
AC_SUBST(FTP_OBJ)
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(catalog, [ --with-catalog Add the Catalog support (on)])
if test "$with_catalog" = "no" ; then
echo Disabling Catalog support
WITH_CATALOG=0
CATALOG_OBJ=
else
WITH_CATALOG=1
CATALOG_OBJ="catalog.o"
fi
AC_SUBST(WITH_CATALOG)
AC_SUBST(CATALOG_OBJ)
AC_ARG_WITH(docbook, [ --with-docbook Add Docbook SGML support (on)])
if test "$with_docbook" = "no" ; then
echo Disabling Docbook support
WITH_DOCB=0
DOCB_OBJ=
else
WITH_DOCB=1
DOCB_OBJ="DOCBparser.o"
fi
AC_SUBST(WITH_DOCB)
AC_SUBST(DOCB_OBJ)
AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)])
if test "$with_xpath" = "no" ; then
echo Disabling XPATH support
with_xptr="no"
with-c14n="no"
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(xptr, [ --with-xptr Add the XPointer support (on)])
if test "$with_xptr" = "no" ; then
echo Disabling XPointer support
WITH_XPTR=0
XPTR_OBJ=
else
WITH_XPTR=1
XPTR_OBJ=xpointer.o
fi
AC_SUBST(WITH_XPTR)
AC_SUBST(XPTR_OBJ)
AC_ARG_WITH(c14n, [ --with-c14n Add the Canonicalization support (on)])
if test "$with_c14n" = "no" ; then
echo Disabling C14N support
WITH_C14N=0
C14N_OBJ=
else
WITH_C14N=1
C14N_OBJ="c14n.c"
fi
AC_SUBST(WITH_C14N)
AC_SUBST(C14N_OBJ)
AC_ARG_WITH(xinclude, [ --with-xinclude Add the XInclude support (on)])
if test "$with_xinclude" = "no" ; then
echo Disabling XInclude support
WITH_XINCLUDE=0
XINCLUDE_OBJ=
with_xinclude="no"
else
WITH_XINCLUDE=1
XINCLUDE_OBJ=xinclude.o
fi
AC_SUBST(WITH_XINCLUDE)
AC_SUBST(XINCLUDE_OBJ)
WITH_ICONV=0
AC_ARG_WITH(iconv, [ --with-iconv[=DIR] Add ICONV support (on)])
if test "$with_iconv" = "no" ; then
echo Disabling ICONV support
else
if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
# Export this since our headers include iconv.h
XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
ICONV_LIBS="-L$with_iconv/lib"
fi
AC_CHECK_HEADER(iconv.h,
AC_MSG_CHECKING(for iconv)
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],[
iconv_t cd = iconv_open ("","");
iconv (cd, NULL, NULL, NULL, NULL);],[
AC_MSG_RESULT(yes)
WITH_ICONV=1],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for iconv in -liconv)
_ldflags="${LDFLAGS}"
_libs="${LIBS}"
LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
LIBS="${LIBS} -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],[
iconv_t cd = iconv_open ("","");
iconv (cd, NULL, NULL, NULL, NULL);],[
AC_MSG_RESULT(yes)
WITH_ICONV=1
ICONV_LIBS="${ICONV_LIBS} -liconv"
LIBS="${_libs}"
LDFLAGS="${_ldflags}"],[
AC_MSG_RESULT(no)
LIBS="${_libs}"
LDFLAGS="${_ldflags}"])]))
fi
M_LIBS="-lm"
XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
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(ICONV_LIBS)
AC_SUBST(XML_INCLUDEDIR)
AC_SUBST(HTML_DIR)
AC_SUBST(HAVE_ISNAN)
AC_SUBST(HAVE_ISINF)
AC_SUBST(PYTHON)
AC_SUBST(PYTHON_VERSION)
AC_SUBST(PYTHON_INCLUDES)
AC_SUBST(PYTHON_SITE_PACKAGES)
AC_SUBST(M_LIBS)
AC_SUBST(RDL_LIBS)
rm -f rm COPYING.LIB COPYING
ln -s Copyright COPYING
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 python/setup.py)
chmod +x xml2-config xml2Conf.sh python/setup.py