1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-13 13:17:36 +03:00

Bug 676544 - fails to build with --without-sax1

Added some ifdef'd LIBXML_SAX1_ENABLED to make it buildable with
--without-sax1 configure option.
This commit is contained in:
Akira TAGOH 2012-07-03 14:13:59 +09:00 committed by Daniel Veillard
parent 236ea1ea90
commit 961b535c10
5 changed files with 20 additions and 13 deletions

View File

@ -33,27 +33,29 @@ libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \
-version-info $(LIBXML_VERSION_INFO) \ -version-info $(LIBXML_VERSION_INFO) \
$(MODULE_PLATFORM_LIBS) $(MODULE_PLATFORM_LIBS)
if WITH_TRIO_SOURCES if WITH_SAX1_SOURCES
libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ docb_sources = DOCBparser.c
parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \
xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \
xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
xmlmodule.c schematron.c xzlib.c
else else
docb_sources =
endif
if WITH_TRIO_SOURCES
trio_sources = triostr.c trio.c
else
trio_sources =
endif
libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \ xpointer.c xinclude.c nanohttp.c nanoftp.c \
$(docb_sources) \
catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \ catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \
xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
$(trio_sources) \
xmlreader.c relaxng.c dict.c SAX2.c \ xmlreader.c relaxng.c dict.c SAX2.c \
xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
xmlmodule.c schematron.c xzlib.c xmlmodule.c schematron.c xzlib.c
endif
DEPS = $(top_builddir)/libxml2.la DEPS = $(top_builddir)/libxml2.la
LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD)

View File

@ -1146,6 +1146,7 @@ else
TEST_SAX=SAXtests TEST_SAX=SAXtests
fi fi
AC_SUBST(WITH_SAX1) AC_SUBST(WITH_SAX1)
AM_CONDITIONAL(WITH_SAX1_SOURCES, test "${WITH_TRIO}" = "1")
AC_SUBST(TEST_SAX) AC_SUBST(TEST_SAX)
if test "$with_push" = "no" ; then if test "$with_push" = "no" ; then

View File

@ -509,7 +509,7 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs)
#if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED) #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
#endif #endif
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
#endif #endif

View File

@ -1365,6 +1365,7 @@ libxml_htmlCreatePushParser(ATTRIBUTE_UNUSED PyObject * self,
PyObject * PyObject *
libxml_xmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) libxml_xmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
{ {
#ifdef LIBXML_SAX1_ENABLED
int recover; int recover;
const char *URI; const char *URI;
PyObject *pyobj_SAX = NULL; PyObject *pyobj_SAX = NULL;
@ -1386,6 +1387,7 @@ libxml_xmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
Py_INCREF(pyobj_SAX); Py_INCREF(pyobj_SAX);
/* The reference is released in pythonEndDocument() */ /* The reference is released in pythonEndDocument() */
xmlSAXUserParseFile(SAX, pyobj_SAX, URI); xmlSAXUserParseFile(SAX, pyobj_SAX, URI);
#endif /* LIBXML_SAX1_ENABLED */
Py_INCREF(Py_None); Py_INCREF(Py_None);
return (Py_None); return (Py_None);
} }

View File

@ -172,10 +172,12 @@ int main(int argc, char **argv) {
xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS; xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;
xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
xmlSubstituteEntitiesDefaultValue = 1; xmlSubstituteEntitiesDefaultValue = 1;
#ifdef LIBXML_SAX1_ENABLED
if (nocdata != 0) { if (nocdata != 0) {
xmlDefaultSAXHandlerInit(); xmlDefaultSAXHandlerInit();
xmlDefaultSAXHandler.cdataBlock = NULL; xmlDefaultSAXHandler.cdataBlock = NULL;
} }
#endif
if (document == NULL) { if (document == NULL) {
if (filename == NULL) if (filename == NULL)
document = xmlReadDoc(buffer,NULL,NULL,XML_PARSE_COMPACT); document = xmlReadDoc(buffer,NULL,NULL,XML_PARSE_COMPACT);