diff options
author | Akira TAGOH <akira@tagoh.org> | 2012-07-03 14:13:59 +0900 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2012-08-28 22:03:16 +0800 |
commit | 961b535c10c7d07d7919c58c1d0c6762b35503a1 (patch) | |
tree | a6d3305e1fba5e28560adfc4877bcbb0a6bbc06d | |
parent | 236ea1ea90aca35489be3f86c6314a306f2271af (diff) | |
download | android_external_libxml2-961b535c10c7d07d7919c58c1d0c6762b35503a1.tar.gz android_external_libxml2-961b535c10c7d07d7919c58c1d0c6762b35503a1.tar.bz2 android_external_libxml2-961b535c10c7d07d7919c58c1d0c6762b35503a1.zip |
Bug 676544 - fails to build with --without-sax1
Added some ifdef'd LIBXML_SAX1_ENABLED to make it buildable with
--without-sax1 configure option.
-rw-r--r-- | Makefile.am | 24 | ||||
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | globals.c | 2 | ||||
-rw-r--r-- | python/libxml.c | 2 | ||||
-rw-r--r-- | testXPath.c | 2 |
5 files changed, 19 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am index ea9d9502..1cca0808 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,27 +33,29 @@ libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \ -version-info $(LIBXML_VERSION_INFO) \ $(MODULE_PLATFORM_LIBS) +if WITH_SAX1_SOURCES +docb_sources = DOCBparser.c +else +docb_sources = +endif + if WITH_TRIO_SOURCES -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 \ - 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 +trio_sources = triostr.c trio.c else +trio_sources = +endif + 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 \ 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 \ xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ + $(trio_sources) \ xmlreader.c relaxng.c dict.c SAX2.c \ xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ xmlmodule.c schematron.c xzlib.c -endif 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) diff --git a/configure.in b/configure.in index 3ff8a3ee..72562241 100644 --- a/configure.in +++ b/configure.in @@ -1146,6 +1146,7 @@ else TEST_SAX=SAXtests fi AC_SUBST(WITH_SAX1) +AM_CONDITIONAL(WITH_SAX1_SOURCES, test "${WITH_TRIO}" = "1") AC_SUBST(TEST_SAX) if test "$with_push" = "no" ; then @@ -509,7 +509,7 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs) #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED) initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); #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); #endif diff --git a/python/libxml.c b/python/libxml.c index ea4998bc..a556160f 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -1365,6 +1365,7 @@ libxml_htmlCreatePushParser(ATTRIBUTE_UNUSED PyObject * self, PyObject * libxml_xmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) { +#ifdef LIBXML_SAX1_ENABLED int recover; const char *URI; PyObject *pyobj_SAX = NULL; @@ -1386,6 +1387,7 @@ libxml_xmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) Py_INCREF(pyobj_SAX); /* The reference is released in pythonEndDocument() */ xmlSAXUserParseFile(SAX, pyobj_SAX, URI); +#endif /* LIBXML_SAX1_ENABLED */ Py_INCREF(Py_None); return (Py_None); } diff --git a/testXPath.c b/testXPath.c index 677419aa..8b8efd4f 100644 --- a/testXPath.c +++ b/testXPath.c @@ -172,10 +172,12 @@ int main(int argc, char **argv) { xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS; xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; xmlSubstituteEntitiesDefaultValue = 1; +#ifdef LIBXML_SAX1_ENABLED if (nocdata != 0) { xmlDefaultSAXHandlerInit(); xmlDefaultSAXHandler.cdataBlock = NULL; } +#endif if (document == NULL) { if (filename == NULL) document = xmlReadDoc(buffer,NULL,NULL,XML_PARSE_COMPACT); |