Rev 7991 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
# An input file for autoconf to configure# the XML parsing facilities for both R and S.# Currently this works for R.## This was originally implemented by Friedrich Leisch# with modifications for subsequent versions# by Duncan Temple Lang.#AC_INITAC_CONFIG_SRCDIR([DESCRIPTION])dnl The different command line arguments for configure.dnl They can also be specified by setting environment variables.dnldnl Establish the command line arguments accepted by this script.dnldnldnl whether to use Splus.AC_ARG_WITH(splus,[ --with-splus Compile as an SPlus library (rather than R). Value can be the (fully qualified) name of the Splus script.], USE_SPLUS=1)dnl explicitly force the use of the old names. If this doesn't match the headerdnl files that are actually found, thenAC_ARG_WITH(oldlibxml,[], USE_OLD_ROOT_CHILD_NAMES=1; FORCE_OLD=1;echo "Using old libxml names")dnl tell the configuration that we are using libxml2.AC_ARG_WITH(libxml2,[ --with-libxml2 indicate that the libxml version is 2.0 or higher],[ if test "${withval}" = "yes" ; thenLIBXML2="-DLIBXML2=1";USE_XML2="yes" ;fi], USE_XML2="yes")AC_ARG_WITH(xml-config,[ --with-xml-config the name of the xml-config program to use.],[ XML_CONFIG=${withval}])dnl compile for use with libxml. This is the default.AC_ARG_WITH(libxml, [ --with-libxml use the libxml library (default)],[ if test "${withval}" = no; thenUSE_LIBXML=false;elseUSE_LIBXML=true;fi],USE_LIBXML=true)# Default is false for expat since we can# do event driven parsing with libxml.AC_ARG_WITH(expat,[ --with-expat use expat library (off by default)],[ if test "${withval}" = no; thenUSE_EXPAT= ;elseUSE_EXPAT=true;fi],USE_EXPAT= )dnl Here we add a flag which we will use below in the case thatdnl the user declaratively adds this option in.AC_ARG_WITH(xml_output_buffer,[ --with-xml-output-buffer use ADD_XML_OUTPUT_BUFFER_CODE (conditionally on)],[ if test "${withval}" = "yes" ; thenADD_XML_OUTPUT_BUFFER="yes";elseADD_XML_OUTPUT_BUFFER="no";fi],ADD_XML_OUTPUT_BUFFER=no)dnldnl End of command line argument declarations.dnl Now compute the relevant settings.dnldnl Get the C compiler, including any values set by the userdnl We need this to perform compilation and link checks.AC_PROG_CCAC_PROG_CPPdnl ======================================================AC_ARG_WITH(xmlsec, [ --with-xmlsec add support (experimental) for XML security with xmlsec. Specify no, xmlsec1 or xmlsec1-openssl],[ if test "${withval}" = no; thenUSE_XMLSEC=falseelseUSE_XMLSEC=${withval}fi],USE_XMLSEC=true)dnldnl Redirection: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.htmlif test -n "" ; then# turned off for now#XXX get the redirection correct"$R_HOME/bin/R" CMD SHLIB testRemoveFinalizers.c &> AS_MESSAGE_FDif test "$?" = 0 ; then$R_HOME/bin/R --no-echo --vanilla < testRemoveFinalizers.R &> AS_MESSAGE_FDfiif ! test "$?" = 0 ; thenecho "No ability to remove finalizers on externalptr objects in this verison of R";EXPORT_MEMORY_MANAGEMENT="FALSE"elseecho "Have R_RemoveExtPtrWeakRef" ;PKG_CPPFLAGS="$PKG_CPPFLAGS -DR_HAS_REMOVE_FINALIZERS=1";EXPORT_MEMORY_MANAGEMENT="TRUE"fielseEXPORT_MEMORY_MANAGEMENT="FALSE"fidnl ======================================================AC_PATH_PROGS(SED, sed)AC_PATH_PROGS(PKG_CONFIG, pkg-config)dnl In this section, we try to find the differentdnl characteristics of the libxml library.dnl We are looking to see ifdnl a) it is version 1.8.* or version 2.*dnl b) whether it is installed with include files in <wherever>/gnome-xmldnl or in a private, uninstalled form in which case the includednl directory is usually libxml/if test -n "${USE_LIBXML}" ; thendnl If the user gave us xml*-config, then use that.if test -n "${XML_CONFIG}" && test -x "${XML_CONFIG}" ; thenUSING_USER_XML_CONFIG="yes"XML_VERSION="`${XML_CONFIG} --version | ${SED} -e 's/\..*//g'`"if test "${XML_VERSION}" = "2" ; thenUSE_XML2="yes"LIBXML2="-DLIBXML2=1";fiecho "User defined xml-config: ${XML_CONFIG}, XML Version: ${XML_VERSION}, XML2: ${USE_XML2}"fiLANGUAGE_DEFS="${LANGUAGE_DEFS} -DHAVE_VALIDITY=1"dnl if the user has not specified anything about libxml,dnl then lets look for xml-config. We let the user give thisdnl as an environment variable `XML_CONFIG'.if test -z "${LIBXML_INCDIR}" && test -z "${LIBXML_LIBDIR}" ; thendnl find xml*-configdnl If they ask explicitly for xml2, find it or fail otherwise.if test "${USE_XML2}" = "yes" ; thenif test -z "${XML_CONFIG}" ; thenAC_PATH_PROGS(XML_CONFIG, xml2-config)if test -z "${XML_CONFIG}" ; thenecho "Cannot find xml2-config"exit 1fififidnl Otherwise, if they implicitly ask for xml-configdnl find that.if test -z "${XML_CONFIG}" ; thenAC_PATH_PROGS(XML_CONFIG, xml-config)fidnl and if they don't have libxml version 1, see if theydnl have libxml2if test "${USE_XML2}" = "maybe" ; thenif test -z "${XML_CONFIG}" ; thenAC_PATH_PROGS(XML_CONFIG, xml2-config)if test -z "${XML_CONFIG}" ; thenecho "Cannot find xml2-config"exit 1elseecho "Using libxml version `$XML_CONFIG --version`"fififiif test -n "${XML_CONFIG}" ; thenecho "USE_XML2 = ${USE_XML2}"if test "${USE_XML2}" != "no" && test -z "${FORCE_XML2}"; thendnl This is not needed now, but is a way to test whether we should use -E or -r to getdnl extended regular expression usage with this version of sed.echo "foo" | sed -Ee 's/foo/bar/' > /dev/null 2>&1if test "$?" = "0" ; thenSED_EXTENDED_ARG="-E"elseSED_EXTENDED_ARG="-r"fiecho "SED_EXTENDED_ARG: ${SED_EXTENDED_ARG}"MINOR=`${XML_CONFIG} --version | ${SED} -e 's/^2\.\([[0-9]]\{1,\}\).*/\1/'`PATCH=`${XML_CONFIG} --version | ${SED} -e 's/^2\.[[0-9]]\{1,\}\.\([[0-9]]\{1,\}\)$/\1/'`echo "Minor $MINOR, Patch $PATCH for `$XML_CONFIG --version`"if test $MINOR -lt 6 ; thenecho ""echo "**** You should use a recent version of libxml2, i.e. 2.6.22 or higher ****"echo ""exit 1fiif test "$MINOR" -eq 6 && test "$PATCH" -lt 3 ; thenecho ""echo "**** There are problems compiling this package with libxml2-2.6.1 or libmxml2-2.6.2. ****"echo "**** You will probably encounter compilation errors, so we are terminating the build. ****"echo ""exit 1fifiLIBXML_INCDIR=`${XML_CONFIG} --cflags`LIBXML_LIBDIR=`${XML_CONFIG} --libs`FOUND_LIBXML_INCLUDES="Ok"fifi dnl USE_XML2dnl If the user has specified LIBXML_INCDIR, thendnl we use that.dnl Otherwise, we try to find the parser.h file.if test -n "${LIBXML_INCDIR}" && test -z "${XML_CONFIG}" ; thenecho "Checking directory of LIBXML_INCDIR"if test -d $LIBXML_INCDIR ; thendnl Maybe also test for ${LIBXML_INCDIR}/parser.hdnl in case somebody points us directly at the include directory.if test -r ${LIBXML_INCDIR}/libxml/parser.h ; thenFOUND_LIBXML_INCLUDES="Ok"elif test -r ${LIBXML_INCDIR}/gnome-xml/parser.h ; thenFOUND_LIBXML_INCLUDES="Ok"PKG_CPPFLAGS="${PKG_CPPFLAGS} -DFROM_GNOME_XML_DIR=1"elseecho "You specified LIBXML_INCDIR, but we couldn't find parser.h"echo "Please specify it correctly and re-run the INSTALL'ation."exit 1fielseecho "The LIBXML_INCDIR value you specified ($LIBXML_INCDIR) is not a directory."echo "Please specify it correctly and re-run the INSTALL'ation."exit 1fifidnl We should have exited if we cannot find parser.hdnl LIBXML_INCDIR.if test -z "${FOUND_LIBXML_INCLUDES}" ; thendnl the idea is that we loop over different directoriesdnl looking for parser.h. We look in the sub-directorydnl gnome-xml/TMP_CPPFLAGS=${CPPFLAGS}for dir in ${LIBXML_INCDIR} /usr/local/include /usr/include ; doCPPFLAGS="${TMP_CPPFLAGS} -I${dir}"AC_CHECK_HEADER(libxml/parser.h, FROM_LIBXML_DIR=1)if test -n "${FROM_LIBXML_DIR}" ; thenLIBXML_INCDIR="-I${dir}"CPPFLAGS="${TMP_CPPFLAGS} -I${dir} -I${dir}/libxml"PKG_CPPFLAGS="${TMP_CPPFLAGS} -I${dir} -I${dir}/libxml"echo "Found the libxml parser.h in $dir/libxml/"breakfiCPPFLAGS="${TMP_CPPFLAGS} -I${dir}/gnome-xml"AC_CHECK_HEADER(gnome-xml/parser.h, FROM_GNOME_XML_DIR=1)if test -n "${FROM_GNOME_XML_DIR}" ; thenPKG_CPPFLAGS="${PKG_CPPFLAGS} -DFROM_GNOME_XML_DIR=1"CPPFLAGS="${CPPFLAGS} -DFROM_GNOME_XML_DIR=1"LIBXML_INCDIR="-I${dir}"echo "Found the gnome-xml parser in $dir"breakfidoneif test -z "${FROM_GNOME_XML_DIR}" ; thenCPPFLAGS=${TMP_CPPFLAGS}fifi # end of -z FOUND_LIBXML_INCLUDESif test -z "${LIBXML_INCDIR}"; thenAC_CHECK_HEADER(libxml/parser.h, LIBXML_INCDIR="libxml/")fiif test -z "${LIBXML_INCDIR}" ; thenecho "Cannot find parser.h. Set the value of the environment variable"echo " LIBXML_INCDIR"echo "to point to where it can be found."exit 1;elseecho "Located parser file ${LIBXML_INCDIR}/parser.h"fidnl Do we need this? XXX#LIBS="${LIBS} ${LIBXML_INCDIR}"if test -z "${LIBXML2}" ; thenCPPFLAGS="${PKG_CPPFLAGS} ${LIBXML_INCDIR}"echo "Checking for 1.8: ${CPPFLAGS}"AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/parser.h>#else#include <libxml/parser.h>#endif]], [[ xmlAttr *attr;attr->val = NULL;]])],[echo "Using libxml 1.8.*!"],[LIBXML2="-DLIBXML2=1"; echo "Using libxml2.*" ])fi# AC_EGREP_HEADER(xmlParseFile, ${LIBXML_INCDIR}parser.h,# HAVE_LIBXML_HEADER=true,# AC_MSG_ERROR("header files for libxml seem to be incorrect"))AC_CHECK_LIB(z, gzopen)if test -n "${LIBXML2}" ; thenAC_CHECK_LIB(xml2, xmlParseFile, LIBS="${LIBS} -lxml2"; USE_XMLLIB_NAME=xml2, NO_XML_LIB=1, "${LIBXML_LIBDIR--L.}")elseNO_XML_LIB=1fiif test -n "${NO_XML_LIB}" ; thenAC_CHECK_LIB(xml, xmlParseFile, LIBS="${LIBS} -lxml";USE_XMLLIB_NAME=xml, AC_MSG_ERROR("libxml not found"), "${LIBXML_LIBDIR--L.}")fiif test -n "${LIBXML_LIBDIR}" ; thenLIBS="${LIBXML_LIBDIR--L.} ${LIBS}"LD_PATH="${LIBXML_LIBDIR-.}"fiPKG_CPPFLAGS="${PKG_CPPFLAGS} -DLIBXML"if test -z "${FROM_GNOME_XML_DIR}" ; thenPKG_CPPFLAGS="${PKG_CPPFLAGS} ${LIBXML_INCDIR--I.}"fiif test -z "${LIBXML2}" ; thendnl Now we try to test whether we have a really old libxmldnl which uses childs and root instead of xmlChildren and xmlRootNodeif test -z "${USE_OLD_ROOT_CHILD_NAMES}" ; thenCPPFLAGS=${PKG_CPPFLAGS}AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/parser.h>#else#include <libxml/parser.h>#endif]], [[ xmlDocPtr node;node->xmlRootNode = NULL;]])],[echo "New style libxml!"],[USE_OLD_ROOT_CHILD_NAMES=1; echo "Need to use old-style libxml names"])echo "Using old root child names? ${USE_OLD_ROOT_CHILD_NAMES-0}"fi # USE_OLD_ROOT_CHILD_NAMESelse # -z "${LIBXML2}"CPPFLAGS=${PKG_CPPFLAGS}if test -d "${LIBXML_LIBDIR}" ; thenLD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${LIBXML_LIBDIR}export LD_LIBRARY_PATHfiAC_RUN_IFELSE([AC_LANG_SOURCE([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/parser.h>#else#include <libxml/parser.h>#endifintmain(int argc, char *argv[]){xmlCheckVersion(20000);return(0);}]])],[ LIBXML2_OK=1],[LIBXML2_OK=0],[])if test "${LIBXML2_OK}" = "0" ; thenecho "You are trying to use a version 2.* edition of libxml"echo "but an incompatible library. The header files and library seem to be"echo "mismatched. If you have specified LIBXML_INCDIR, make certain to also"echo "specify an appropriate LIBXML_LIBDIR if the libxml2 library is not in the default"echo "directories."exit 1fifiif test -n "${USE_OLD_ROOT_CHILD_NAMES}" ; thenPKG_CPPFLAGS="${PKG_CPPFLAGS} -DUSE_OLD_ROOT_CHILD_NAMES=1"fifiif test "${USE_XMLLIB_NAME}" = "xml2" ; thenAC_CHECK_LIB(xml2, xmlHashSize, echo "Using built-in xmlHashSize", PKG_CPPFLAGS="${PKG_CPPFLAGS} -DOWN_XML_HASH_SIZE=1")fiif test "${USE_LIBXML}" ; thenecho "Checking DTD parsing (presence of externalSubset)..."AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/parser.h>#else#include <libxml/parser.h>#endif]], [[xmlParserCtxtPtr ctxt;ctxt->inSubset = 0;ctxt->sax->externalSubset = NULL;]])],[USE_EXT_SUBSET=1],[])if test -n "${USE_EXT_SUBSET}" ; thenPKG_CPPFLAGS="${PKG_CPPFLAGS} -DUSE_EXTERNAL_SUBSET=1"fiAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/parser.h>#else#include <libxml/parser.h>#endif]], [[xmlNodePtr node;int x;x = node->type == XML_DTD_NODE;]])],[ROOT_HAS_DTD_NODE=1],[echo "No XML_DTD_NODE defined"])if test -n "${ROOT_HAS_DTD_NODE}" ; thenPKG_CPPFLAGS="${PKG_CPPFLAGS} -DROOT_HAS_DTD_NODE=1"fiAC_CHECK_LIB(${USE_XMLLIB_NAME},xmlHashSize, echo "Found xmlHashSize", echo "No xmlHashSize")AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/parser.h>#else#include <libxml/parser.h>#endif]], [[xmlEntityPtr ent;ent->checked = 1;]])],[ENTITY_HAS_CHECKED="yes"],[ENTITY_HAS_CHECKED="no"])if test "${ENTITY_HAS_CHECKED}" = "no" ; thenPKG_CPPFLAGS="${PKG_CPPFLAGS} -DNO_CHECKED_ENTITY_FIELD=1"fifidnl Here we added the check of the flag to determine if the user wants to forcednl the XML_OUTPUT_BUFFER code in XMLTree.cAC_CHECK_LIB(${USE_XMLLIB_NAME}, xmlOutputBufferCreateBuffer, [echo "have xmlOutputBufferCreateBuffer()"; if test "${ADD_XML_OUTPUT_BUFFER}" = "yes" ; then PKG_CPPFLAGS="${PKG_CPPFLAGS} -DADD_XML_OUTPUT_BUFFER_CODE=1"; else ADD_XML_OUTPUT_BUFFER=no ; fi; ], [ echo "Using local xmlOutputBufferCreateBuffer. You might think about installing a newer version of libxml2, at least 2.6.23" ; PKG_CPPFLAGS="${PKG_CPPFLAGS} -DADD_XML_OUTPUT_BUFFER_CODE=1"; ADD_XML_OUTPUT_BUFFER=1])AC_CHECK_LIB(${USE_XMLLIB_NAME}, xmlDocDumpFormatMemoryEnc, PKG_CPPFLAGS="${PKG_CPPFLAGS} -DDUMP_WITH_ENCODING=1")if test -z "${FROM_GNOME_XML_DIR}" ; thenAC_CHECK_HEADER(libxml/xmlversion.h, PKG_CPPFLAGS="${PKG_CPPFLAGS} -DUSE_XML_VERSION_H=1")fiAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/tree.h>#else#include <libxml/tree.h>#endif]], [[xmlElementPtr el;int x;x = el->etype;]])],[PKG_CPPFLAGS="${PKG_CPPFLAGS} -DXML_ELEMENT_ETYPE=1"],[])AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/tree.h>#else#include <libxml/tree.h>#endif]], [[xmlAttributePtr el;int x;x = el->atype;]])],[PKG_CPPFLAGS="${PKG_CPPFLAGS} -DXML_ATTRIBUTE_ATYPE=1"],[])if test -n "${USE_EXPAT}" ; thenAC_CHECK_HEADER(xmltok/xmlparse.h, XMLPARSE_INCDIR="xmltok/")if test -z "${XMLPARSE_INCDIR}" ; thenAC_CHECK_HEADER(xmlparse/xmlparse.h, XMLPARSE_INCDIR="xmlparse/")fiAC_EGREP_HEADER(XML_Parse, ${XMLPARSE_INCDIR}xmlparse.h,HAVE_EXPAT_HEADER=true,AC_MSG_ERROR("header file xmlparse.h seems to be incorrect"))AC_CHECK_LIB(xmltok, XmlInitEncoding,,AC_MSG_ERROR("libxmltok not found"))AC_CHECK_LIB(xmlparse, XML_Parse,,AC_MSG_ERROR("libxmlparse not found"), -lxmltok)PKG_CPPFLAGS="${PKG_CPPFLAGS} -DLIBEXPAT -I${XMLPARSE_INCDIR}"LD_PATH="${LD_PATH}:${LIBXML_LIBDIR}"fiif test -n "${USE_EXPAT}" ; thenSUPPORTS_EXPAT="TRUE"elseSUPPORTS_EXPAT="FALSE"fiecho "Expat: ${USE_EXPAT} ${SUPPORTS_EXPAT}"if test -n "${USE_LIBXML}" ; thenSUPPORTS_LIBXML="TRUE"elseSUPPORTS_LIBXML="FALSE"fiLANGUAGE_DEFS="-DUSE_R=1 -D_R_=1 ${LANGUAGE_DEFS}"dnl PKG_SYS_FILE='system.file("scripts", name, pkg="RSPerl")'AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "parser.h"]], [[extern int xmlSkipBlankChars(xmlParserCtxtPtr ctxt);xmlParserCtxtPtr p;xmlSkipBlankChars(p);]])],[echo "No need for old SKIP_BLANKS definition"],[BLANKS_DEF="-DOLD_SKIP_BLANKS=1"])if test -n "LIBXML2" ; thenTMP_CFLAGS="${CFLAGS}"CFLAGS="${CFLAGS} -pedantic-errors"echo "Checking for return type of xmlHashScan element routine."AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/SAX.h>#include <gnome-xml/hash.h>#else#include <libxml/SAX.h>#include <libxml/hash.h>#endif]], [[void *(*foo)(void *, void *, xmlChar*);xmlElementTablePtr table;xmlHashScan(table, foo, NULL);]])],[echo "xmlHashScan wants a return value."],[echo "No return value for xmlHashScan"; PKG_CPPFLAGS="${PKG_CPPFLAGS} -DNO_XML_HASH_SCANNER_RETURN=1"])CFLAGS="${TMP_CFLAGS}"AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libxml/tree.h>]], [[xmlNsPtr ns;ns->context;]])],[PKG_CPPFLAGS="$PKG_CPPFLAGS -DLIBXML_NAMESPACE_HAS_CONTEXT=1"; echo "xmlNs has a context field"],[echo "No context field in xmlNs structure."])fiCPPFLAGS="$CPPFLAGS -I$R_HOME/include"echo "Checking for cetype_t enumeration"AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Rinternals.h>]], [[cetype_t t;]])],[PKG_CPPFLAGS="${PKG_CPPFLAGS} -DHAVE_R_CETYPE_T=1"; echo "Using recent version of R with cetype_t enumeration type for encoding"],[echo "No cetype_t enumeration defined in R headers."])AC_SUBST(DUMP_WITH_ENCODING)PKG_LIBS=${LIBS}dnl ----------------------------------------------------dnl Add -m to the linker flags (actually libraries)dnl to supress errors about multiple definitions ofdnl symbols.dnldnl This is not needed anymore as we no longer definednl xmlParserError in our code and override the onednl in libmxml. If we do find a situation (e.g. versiondnl of libxml that doesn't allow us to play with routinednl pointers to do this, we will need to definednl NEED_XML_PARSER_ERRORdnldnl AC_CANONICAL_HOSTdnl Doesn't work on my machine. Where do we find it - R?if test -n "${NEED_XML_PARSER_ERROR}" ; thenAC_PATH_PROG(UNAME, uname)if test -n "${UNAME}" ; thenhost_os=`${UNAME}`if test "${host_os}" = "Darwin" ; thenPKG_LIBS="-m $PKG_LIBS"fififidnl ---------------------------------------------------AC_PATH_PROGS(XMLSEC_CONFIG, xmlsec1-config)if test -n "$XMLSEC_CONFIG" ; thenPKG_CPPFLAGS="$PKG_CPPFLAGS `$XMLSEC_CONFIG --cflags`"PKG_LIBS="$PKG_LIBS `$XMLSEC_CONFIG --libs`"XMLSEC_DEFS=-DHAVE_LIBXML_SEC=1fiAC_ARG_ENABLE(nodegc, [ --enable-nodegc enable node garbage collection],[ if test "${enableval}" = "yes" || test "${enableval}" = "default" ; thenLANGUAGE_DEFS="${LANGUAGE_DEFS} -DXML_REF_COUNT_NODES=1"fi;echo "enabling nodegc? ${enableval}"],[echo "nodegc default $enableval"; LANGUAGE_DEFS="${LANGUAGE_DEFS} -DXML_REF_COUNT_NODES=1"])AC_ARG_ENABLE(xml-debug, [ --enable-xml-debug enable debugging information, primarily for memory management],[ if test "${enableval}" = "yes" || test "${enableval}" = "default" ; thenLANGUAGE_DEFS="${LANGUAGE_DEFS} -DR_XML_DEBUG=1"fi;echo "enabling xml-debug? ${enableval}"],[echo "xml-debug default $enableval"; LANGUAGE_DEFS="${LANGUAGE_DEFS}"])dnl ---------------------------------------------------AC_DEFUN([CHECK_ENUM], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/parser.h>#else#include <libxml/parser.h>#endif]], [[int val;val = $1;]])],[PKG_CPPFLAGS="$PKG_CPPFLAGS -DHAVE_$1=1"; echo "Version has $1"],[echo "No $1 enumeration value."])])CHECK_ENUM(XML_WITH_ZLIB)AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef FROM_GNOME_XML_DIR#include <gnome-xml/parser.h>#else#include <libxml/parser.h>#endif]], [[xmlFeature f;xmlHasFeature(f);]])],[PKG_CPPFLAGS="$PKG_CPPFLAGS -DHAVE_XML_HAS_FEATURE=1"; echo "Version has xmlHasFeature()"],[echo "No xmlHasFeature."])dnl ---------------------------------------------AC_SUBST(XMLSEC_DEFS)AC_SUBST(LIBXML2)AC_SUBST(LANGUAGE_DEFS)AC_SUBST(LIBXML_INCDIR)AC_SUBST(XMLPARSE_INCDIR)AC_SUBST(PKG_LIBS)AC_SUBST(PKG_CPPFLAGS)AC_SUBST(SUPPORTS_LIBXML)AC_SUBST(SUPPORTS_EXPAT)AC_SUBST(LD_PATH)AC_SUBST(EXPORT_MEMORY_MANAGEMENT)echo ""echo "****************************************"echo "Configuration information:"echo ""echo "Libxml settings"echo ""echo "libxml include directory: ${LIBXML_INCDIR}"echo "libxml library directory: ${LIBS}"echo "libxml 2: ${LIBXML2-no}"echo ""echo "Compilation flags: ${PKG_CPPFLAGS} ${LANGUAGE_DEFS} $XMLSEC_DEFS"echo "Link flags: ${PKG_LIBS}"echo ""echo "****************************************"if test "$ADD_XML_OUTPUT_BUFFER" = "no" ; thenADD_XML_OUTPUT_BUFFER=0fiif test "$ADD_XML_OUTPUT_BUFFER" = "yes" ; thenADD_XML_OUTPUT_BUFFER=1fiAC_SUBST(ADD_XML_OUTPUT_BUFFER)if test -n "${_R_CHECK_TIMINGS_}" ; thenPKG_CPPFLAGS="$PKG_CPPFLAGS -DNO_XML_MEMORY_SHOW_ROUTINE=1"fidnl create the different targetsdnl We had NAMESPACE here when were conditionally exporting the functions todnl remove finalizers on a node or document. Need to add NAMESPACE.in indnl Install/GNUmakefile.adminAC_CONFIG_FILES([src/Makevars R/supports.R inst/scripts/RSXML.csh inst/scripts/RSXML.bsh])AC_OUTPUTchmod +x cleanup