diff --git a/Makefile.am b/Makefile.am index cb215433..c5e34ea1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,11 +2,11 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include . doc example xstc @PYTHON_SUBDIR@ +SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR) DIST_SUBDIRS = include . doc example python xstc -INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ @LZMA_CFLAGS@ +INCLUDES = -I$(top_builddir)/include -I$(srcdir)/include $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS) noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \ testThreads testC14N testAutomata testRegexp \ @@ -18,7 +18,7 @@ bin_PROGRAMS = xmllint xmlcatalog bin_SCRIPTS=xml2-config lib_LTLIBRARIES = libxml2.la -libxml2_la_LIBADD = @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ $(ICONV_LIBS) @M_LIBS@ @WIN32_EXTRA_LIBADD@ +libxml2_la_LIBADD = $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) if USE_VERSION_SCRIPT LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms @@ -26,10 +26,10 @@ else LIBXML2_VERSION_SCRIPT = endif -libxml2_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ \ - $(LIBXML2_VERSION_SCRIPT) \ - -version-info @LIBXML_VERSION_INFO@ \ - @MODULE_PLATFORM_LIBS@ +libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \ + $(LIBXML2_VERSION_SCRIPT) \ + -version-info $(LIBXML_VERSION_INFO) \ + $(MODULE_PLATFORM_LIBS) if WITH_TRIO_SOURCES libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ @@ -54,7 +54,7 @@ libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.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@ +LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) man_MANS = xml2-config.1 libxml.3 @@ -65,37 +65,37 @@ m4data_DATA = libxml.m4 runtest_SOURCES=runtest.c runtest_LDFLAGS = runtest_DEPENDENCIES = $(DEPS) -runtest_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS) +runtest_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) testrecurse_SOURCES=testrecurse.c testrecurse_LDFLAGS = testrecurse_DEPENDENCIES = $(DEPS) -testrecurse_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS) +testrecurse_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) testlimits_SOURCES=testlimits.c testlimits_LDFLAGS = testlimits_DEPENDENCIES = $(DEPS) -testlimits_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS) +testlimits_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) testchar_SOURCES=testchar.c testchar_LDFLAGS = testchar_DEPENDENCIES = $(DEPS) -testchar_LDADD= @RDL_LIBS@ $(LDADDS) +testchar_LDADD= $(RDL_LIBS) $(LDADDS) testdict_SOURCES=testdict.c testdict_LDFLAGS = testdict_DEPENDENCIES = $(DEPS) -testdict_LDADD= @RDL_LIBS@ $(LDADDS) +testdict_LDADD= $(RDL_LIBS) $(LDADDS) runsuite_SOURCES=runsuite.c runsuite_LDFLAGS = runsuite_DEPENDENCIES = $(DEPS) -runsuite_LDADD= @RDL_LIBS@ $(LDADDS) +runsuite_LDADD= $(RDL_LIBS) $(LDADDS) xmllint_SOURCES=xmllint.c xmllint_LDFLAGS = xmllint_DEPENDENCIES = $(DEPS) -xmllint_LDADD= @RDL_LIBS@ $(LDADDS) +xmllint_LDADD= $(RDL_LIBS) $(LDADDS) testSAX_SOURCES=testSAX.c testSAX_LDFLAGS = @@ -110,7 +110,7 @@ testHTML_LDADD= $(LDADDS) xmlcatalog_SOURCES=xmlcatalog.c xmlcatalog_LDFLAGS = xmlcatalog_DEPENDENCIES = $(DEPS) -xmlcatalog_LDADD= @RDL_LIBS@ $(LDADDS) +xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS) testXPath_SOURCES=testXPath.c testXPath_LDFLAGS = @@ -122,10 +122,14 @@ testC14N_LDFLAGS = testC14N_DEPENDENCIES = $(DEPS) testC14N_LDADD= $(LDADDS) -testThreads_SOURCES=testThreads@THREADS_W32@.c +if THREADS_W32 +testThreads_SOURCES = testThreadsWin32.c +else +testThreads_SOURCES = testThreads.c +endif testThreads_LDFLAGS = testThreads_DEPENDENCIES = $(DEPS) -testThreads_LDADD= @BASE_THREAD_LIBS@ $(LDADDS) +testThreads_LDADD= $(BASE_THREAD_LIBS) $(LDADDS) testURI_SOURCES=testURI.c testURI_LDFLAGS = @@ -177,6 +181,8 @@ testapi.c: $(srcdir)/gentest.py -@(if [ "$(PYTHON)" != "" ] ; then \ $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) +BUILT_SOURCES = testapi.c + testapi_SOURCES=testapi.c testapi_LDFLAGS = testapi_DEPENDENCIES = $(DEPS) @@ -193,9 +199,11 @@ runxmlconf_LDADD= $(LDADDS) #testOOM_LDADD= $(LDADDS) runtests: + [ -d test ] || $(LN_S) $(srcdir)/test . + [ -d result ] || $(LN_S) $(srcdir)/result . $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) - @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \ - $(MAKE) MAKEFLAGS+=--silent tests ; fi) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) check: all runtests @@ -206,10 +214,10 @@ check-valgrind: all testall : tests SVGtests SAXtests -tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_PATTERN@ @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_SCHEMATRON@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@ @TEST_MODULES@ - @(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \ - $(MAKE) MAKEFLAGS+=--silent tests ; fi) - @(cd doc/examples ; $(MAKE) MAKEFLAGS+=--silent tests) +tests: XMLtests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) + @(cd doc/examples ; $(MAKE) tests) valgrind: @echo '## Running the regression tests under Valgrind' @@ -1120,7 +1128,7 @@ SchemasPythonTests: echo "## It is normal to see 11 errors reported" ; \ $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ fi) - @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" MAKEFLAGS+=--silent pytests ; fi) + @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi) Patterntests: xmllint$(EXEEXT) @(echo > .memdump) @@ -1152,8 +1160,8 @@ ModuleTests: testModule$(EXEEXT) testdso.la cleanup: -@(find . -name .\#\* -exec rm {} \;) - -@(find . -name \*.gcda -o *.gcno -exec rm {} \;) - -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm {} \;) + -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;) + -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;) dist-hook: cleanup libxml2.spec -cp libxml2.spec $(distdir) @@ -1188,7 +1196,8 @@ xml2Conf.sh: xml2Conf.sh.in Makefile < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \ && mv xml2Conf.tmp xml2Conf.sh -CLEANFILES=xml2Conf.sh *.gcda *.gcno +CLEANFILES = runxmlconf.log test.out xml2Conf.sh *.gcda *.gcno *.res +DISTCLEANFILES = COPYING libxml2.syms missing.lst confexecdir=$(libdir) confexec_DATA = xml2Conf.sh @@ -1218,13 +1227,13 @@ DOC_MODULE=libxml2-$(VERSION) EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples install-data-local: - @MKDIR_P@ $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - -@INSTALL@ -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - @MKDIR_P@ $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) - -@INSTALL@ -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) + $(MKDIR_P) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + -$(INSTALL) -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + $(MKDIR_P) $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) + -$(INSTALL) -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) uninstall-local: rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c diff --git a/configure.in b/configure.in index 0fb49831..ccbc3309 100644 --- a/configure.in +++ b/configure.in @@ -58,6 +58,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL +AC_PROG_LN_S AC_PROG_MKDIR_P AC_PROG_CPP AC_PATH_PROG(RM, rm, /bin/rm) @@ -68,8 +69,7 @@ AC_PATH_PROG(WGET, wget, /usr/bin/wget) AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint) AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) -AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL +LT_INIT dnl dnl if the system support linker version scripts for symbol versioning @@ -205,8 +205,8 @@ AC_ARG_WITH(coverage, [ --with-coverage build for code coverage with GCC (off)]) AC_ARG_ENABLE(rebuild-docs, -[ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=yes]]]) -AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"]) +[ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=no]]]) +AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "yes"]) dnl dnl hard dependancies on options @@ -500,6 +500,11 @@ AC_CHECK_HEADERS([dl.h]) AC_CHECK_HEADERS([dlfcn.h]) +echo Checking types + +AC_TYPE_UINT32_T + + echo Checking libraries dnl Checks for library functions. @@ -509,6 +514,12 @@ AC_CHECK_FUNCS(finite isnand fp_class class fpclass) AC_CHECK_FUNCS(strftime localtime gettimeofday ftime) AC_CHECK_FUNCS(stat _stat signal) AC_CHECK_FUNCS(rand rand_r srand time) +AC_CHECK_FUNCS(isascii mmap munmap putenv) + +AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */ +#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) +# undef /**/ HAVE_MMAP +#endif]) dnl Checking for va_copy availability AC_MSG_CHECKING([for va_copy]) @@ -949,7 +960,7 @@ else case $host_os in *mingw32*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then WITH_THREADS="1" - THREADS_W32="Win32" + THREADS_W32="1" THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" fi ;; @@ -1010,7 +1021,7 @@ AC_SUBST(BASE_THREAD_LIBS) AC_SUBST(WITH_THREADS) AC_SUBST(THREAD_CFLAGS) AC_SUBST(TEST_THREADS) -AC_SUBST(THREADS_W32) +AM_CONDITIONAL(THREADS_W32, test -n "$THREADS_WIN32") dnl dnl xmllint shell history @@ -1550,7 +1561,7 @@ AC_SUBST(RELDATE) AC_SUBST(PYTHON_TESTS) rm -f COPYING.LIB COPYING -ln -s Copyright COPYING +ln -s $srcdir/Copyright COPYING # keep on one line for cygwin c.f. #130896 AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py) diff --git a/doc/Makefile.am b/doc/Makefile.am index dd39f693..b9ab1add 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -16,21 +16,229 @@ PAGES= architecture.html bugs.html contribs.html docs.html DOM.html \ tree.html xmldtd.html XMLinfo.html XSLT.html APIPAGES=APIconstructors.html APIfiles.html APIfunctions.html \ APIsymbols.html APIchunk0.html -EXTRA_DIST=xmlcatalog_man.xml tutorial/*.html tutorial/*.c tutorial/*.pdf \ - tutorial/images/*.png tutorial/images/callouts/*.png \ - API*.html *.1 *.xsl *.html *.gif w3c.png html/*.html \ - html/*.png libxml2-api.xml index.py search.php \ - apibuild.py libxml2.xsa xmllint.xml xmlcatalog_man.xml \ - README.docs symbols.xml +if REBUILD_DOCS +EXTRA_DIST_wc = xmlcatalog_man.xml $(wildcard tutorial/*.html) \ + $(wildcard tutorial/*.c) $(wildcard tutorial/*.pdf) \ + $(wildcard tutorial/images/*.png) \ + $(wildcard tutorial/images/callouts/*.png) $(wildcard API*.html) \ + $(wildcard *.1) $(wildcard *.xsl) $(wildcard *.html) \ + $(wildcard *.gif) w3c.png $(wildcard html/*.html) \ + $(wildcard html/*.png) libxml2-api.xml index.py search.php \ + apibuild.py libxml2.xsa xmllint.xml xmlcatalog_man.xml \ + README.docs symbols.xml +endif + +# Expanded form of EXTRA_DIST_wc +# +EXTRA_DIST = \ + APIchunk0.html \ + APIchunk1.html \ + APIchunk2.html \ + APIchunk3.html \ + APIchunk4.html \ + APIchunk5.html \ + APIchunk6.html \ + APIchunk7.html \ + APIchunk8.html \ + APIchunk9.html \ + APIchunk10.html \ + APIchunk11.html \ + APIchunk12.html \ + APIchunk13.html \ + APIchunk14.html \ + APIchunk15.html \ + APIchunk16.html \ + APIchunk17.html \ + APIchunk18.html \ + APIchunk19.html \ + APIchunk20.html \ + APIchunk21.html \ + APIchunk22.html \ + APIchunk23.html \ + APIchunk24.html \ + APIchunk25.html \ + APIchunk26.html \ + APIchunk27.html \ + APIchunk28.html \ + APIchunk29.html \ + APIconstructors.html \ + APIfiles.html \ + APIfunctions.html \ + APIsymbols.html \ + ChangeLog.xsl \ + DOM.gif \ + DOM.html \ + FAQ.html \ + Libxml2-Logo-180x168.gif \ + Libxml2-Logo-90x34.gif \ + README.docs \ + XMLinfo.html \ + XSLT.html \ + api.xsl \ + apibuild.py \ + architecture.html \ + bugs.html \ + catalog.gif \ + catalog.html \ + checkapisym.xsl \ + contribs.html \ + docs.html \ + downloads.html \ + elfgcchack.xsl \ + encoding.html \ + entities.html \ + example.html \ + guidelines.html \ + help.html \ + html/book1.html \ + html/home.png \ + html/index.html \ + html/left.png \ + html/libxml-DOCBparser.html \ + html/libxml-HTMLparser.html \ + html/libxml-HTMLtree.html \ + html/libxml-SAX.html \ + html/libxml-SAX2.html \ + html/libxml-c14n.html \ + html/libxml-catalog.html \ + html/libxml-chvalid.html \ + html/libxml-debugXML.html \ + html/libxml-dict.html \ + html/libxml-encoding.html \ + html/libxml-entities.html \ + html/libxml-globals.html \ + html/libxml-hash.html \ + html/libxml-lib.html \ + html/libxml-list.html \ + html/libxml-nanoftp.html \ + html/libxml-nanohttp.html \ + html/libxml-parser.html \ + html/libxml-parserInternals.html \ + html/libxml-pattern.html \ + html/libxml-relaxng.html \ + html/libxml-schemasInternals.html \ + html/libxml-schematron.html \ + html/libxml-threads.html \ + html/libxml-tree.html \ + html/libxml-uri.html \ + html/libxml-valid.html \ + html/libxml-xinclude.html \ + html/libxml-xlink.html \ + html/libxml-xmlIO.html \ + html/libxml-xmlautomata.html \ + html/libxml-xmlerror.html \ + html/libxml-xmlexports.html \ + html/libxml-xmlmemory.html \ + html/libxml-xmlmodule.html \ + html/libxml-xmlreader.html \ + html/libxml-xmlregexp.html \ + html/libxml-xmlsave.html \ + html/libxml-xmlschemas.html \ + html/libxml-xmlschemastypes.html \ + html/libxml-xmlstring.html \ + html/libxml-xmlunicode.html \ + html/libxml-xmlversion.html \ + html/libxml-xmlwriter.html \ + html/libxml-xpath.html \ + html/libxml-xpathInternals.html \ + html/libxml-xpointer.html \ + html/right.png \ + html/up.png \ + index.html \ + index.py \ + interface.html \ + intro.html \ + library.html \ + libxml.gif \ + libxml2-api.xml \ + libxml2.xsa \ + namespaces.html \ + newapi.xsl \ + news.html \ + news.xsl \ + python.html \ + redhat.gif \ + search.php \ + searches.html \ + searches.xsl \ + site.xsl \ + smallfootonly.gif \ + structure.gif \ + symbols.xml \ + syms.xsl \ + threads.html \ + tree.html \ + tutorial/apa.html \ + tutorial/apb.html \ + tutorial/apc.html \ + tutorial/apd.html \ + tutorial/ape.html \ + tutorial/apf.html \ + tutorial/apg.html \ + tutorial/aph.html \ + tutorial/api.html \ + tutorial/ar01s02.html \ + tutorial/ar01s03.html \ + tutorial/ar01s04.html \ + tutorial/ar01s05.html \ + tutorial/ar01s06.html \ + tutorial/ar01s07.html \ + tutorial/ar01s08.html \ + tutorial/ar01s09.html \ + tutorial/images/blank.png \ + tutorial/images/callouts/1.png \ + tutorial/images/callouts/10.png \ + tutorial/images/callouts/2.png \ + tutorial/images/callouts/3.png \ + tutorial/images/callouts/4.png \ + tutorial/images/callouts/5.png \ + tutorial/images/callouts/6.png \ + tutorial/images/callouts/7.png \ + tutorial/images/callouts/8.png \ + tutorial/images/callouts/9.png \ + tutorial/images/caution.png \ + tutorial/images/draft.png \ + tutorial/images/home.png \ + tutorial/images/important.png \ + tutorial/images/next.png \ + tutorial/images/note.png \ + tutorial/images/prev.png \ + tutorial/images/tip.png \ + tutorial/images/toc-blank.png \ + tutorial/images/toc-minus.png \ + tutorial/images/toc-plus.png \ + tutorial/images/up.png \ + tutorial/images/warning.png \ + tutorial/includeaddattribute.c \ + tutorial/includeaddkeyword.c \ + tutorial/includeconvert.c \ + tutorial/includegetattribute.c \ + tutorial/includekeyword.c \ + tutorial/includexpath.c \ + tutorial/index.html \ + tutorial/ix01.html \ + tutorial/xmltutorial.pdf \ + upgrade.html \ + w3c.png \ + wiki.xsl \ + xml.html \ + xmlcatalog.1 \ + xmlcatalog_man.html \ + xmlcatalog_man.xml \ + xmldtd.html \ + xmlio.html \ + xmllint.1 \ + xmllint.html \ + xmllint.xml \ + xmlmem.html \ + xmlreader.html \ + xsa.xsl man_MANS = xmllint.1 xmlcatalog.1 if REBUILD_DOCS -all: web $(top_builddir)/NEWS libxml2.xsa $(man_MANS) -else -all: -endif +docs: web $(top_builddir)/NEWS libxml2.xsa $(man_MANS) api: libxml2-api.xml libxml2-refs.xml $(APIPAGES) $(srcdir)/html/index.html $(WIN32_DIR)/libxml2.def.src ../elfgcchack.h $(srcdir)/site.xsl @@ -89,10 +297,10 @@ $(WIN32_DIR)/libxml2.def.src: libxml2-api.xml $(XSLTPROC) -o $(WIN32_DIR)/libxml2.def.src \ --nonet $(WIN32_DIR)/defgen.xsl libxml2-api.xml ; fi ) -libxml2-api.xml libxml2-refs.xml ../libxml2.syms: apibuild.py symbols.xml syms.xsl checkapisym.xsl ../include/libxml/*.h ../*.c - -(./apibuild.py) - ($(XSLTPROC) checkapisym.xsl libxml2-api.xml) - ($(XSLTPROC) -o ../libxml2.syms syms.xsl symbols.xml) +libxml2-api.xml libxml2-refs.xml ../libxml2.syms: apibuild.py symbols.xml syms.xsl checkapisym.xsl $(wildcard $(top_srcdir)/include/libxml/*.h) $(wildcard $(top_srcdir)/*.c) + -($(srcdir)/apibuild.py) + ($(XSLTPROC) $(srcdir)/checkapisym.xsl $(srcdir)/libxml2-api.xml) + ($(XSLTPROC) -o ../libxml2.syms $(srcdir)/syms.xsl $(srcdir)/symbols.xml) -@(cd .. ; $(MAKE) rebuild_testapi) @@ -102,28 +310,35 @@ xmllint.1: xmllint.xml xmlcatalog.1: xmlcatalog_man.xml -@($(XSLTPROC) --nonet xmlcatalog_man.xml) +check-extra-dist: + for f in $(EXTRA_DIST_wc) ; do echo $$f; done | sort -u >tmp.EXTRA_DIST_wc + for f in $(EXTRA_DIST) ; do echo $$f; done | sort >tmp.EXTRA_DIST + diff -u tmp.EXTRA_DIST_wc tmp.EXTRA_DIST + rm -f tmp.EXTRA_DIST_wc tmp.EXTRA_DIST +endif + clean-local: rm -f *~ *.bak *.hierarchy *.signals *-unused.txt maintainer-clean-local: clean-local rm -rf libxml-decl-list.txt libxml-decl.txt -rebuild: api all +rebuild: api docs install-data-local: - @MKDIR_P@ $(DESTDIR)$(HTML_DIR) - -@INSTALL@ -m 0644 $(srcdir)/xml.html $(srcdir)/encoding.html $(srcdir)/FAQ.html $(srcdir)/structure.gif $(srcdir)/DOM.gif $(srcdir)/smallfootonly.gif $(srcdir)/redhat.gif $(srcdir)/libxml.gif $(srcdir)/w3c.png $(srcdir)/Libxml2-Logo-180x168.gif $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR) - @MKDIR_P@ $(DESTDIR)$(HTML_DIR)/html - -@INSTALL@ -m 0644 $(srcdir)/html/*.html $(DESTDIR)$(HTML_DIR)/html - -@INSTALL@ -m 0644 $(srcdir)/html/*.png $(DESTDIR)$(HTML_DIR)/html - @MKDIR_P@ $(DESTDIR)$(HTML_DIR)/tutorial - -@INSTALL@ -m 0644 $(srcdir)/tutorial/*.* \ + $(MKDIR_P) $(DESTDIR)$(HTML_DIR) + -$(INSTALL) -m 0644 $(srcdir)/xml.html $(srcdir)/encoding.html $(srcdir)/FAQ.html $(srcdir)/structure.gif $(srcdir)/DOM.gif $(srcdir)/smallfootonly.gif $(srcdir)/redhat.gif $(srcdir)/libxml.gif $(srcdir)/w3c.png $(srcdir)/Libxml2-Logo-180x168.gif $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR) + $(MKDIR_P) $(DESTDIR)$(HTML_DIR)/html + -$(INSTALL) -m 0644 $(srcdir)/html/*.html $(DESTDIR)$(HTML_DIR)/html + -$(INSTALL) -m 0644 $(srcdir)/html/*.png $(DESTDIR)$(HTML_DIR)/html + $(MKDIR_P) $(DESTDIR)$(HTML_DIR)/tutorial + -$(INSTALL) -m 0644 $(srcdir)/tutorial/*.* \ $(DESTDIR)$(HTML_DIR)/tutorial - @MKDIR_P@ $(DESTDIR)$(HTML_DIR)/tutorial/images - -@INSTALL@ -m 0644 $(srcdir)/tutorial/images/*.* \ + $(MKDIR_P) $(DESTDIR)$(HTML_DIR)/tutorial/images + -$(INSTALL) -m 0644 $(srcdir)/tutorial/images/*.* \ $(DESTDIR)$(HTML_DIR)/tutorial/images - @MKDIR_P@ $(DESTDIR)$(HTML_DIR)/tutorial/images/callouts - -@INSTALL@ -m 0644 $(srcdir)/tutorial/images/callouts/*.* \ + $(MKDIR_P) $(DESTDIR)$(HTML_DIR)/tutorial/images/callouts + -$(INSTALL) -m 0644 $(srcdir)/tutorial/images/callouts/*.* \ $(DESTDIR)$(HTML_DIR)/tutorial/images/callouts .PHONY : html xml templates scan diff --git a/doc/devhelp/Makefile.am b/doc/devhelp/Makefile.am index 36852f91..23c77b85 100644 --- a/doc/devhelp/Makefile.am +++ b/doc/devhelp/Makefile.am @@ -63,11 +63,17 @@ all: libxml2.devhelp $(HTML_FILES) libxml2.devhelp $(HTML_FILES): devhelp.xsl html.xsl $(top_srcdir)/doc/libxml2-api.xml -@(echo Rebuilding devhelp files) -@(if [ -x $(XSLTPROC) ] ; then \ - $(XSLTPROC) --nonet -o $(srcdir)/libxml2.devhelp devhelp.xsl $(top_srcdir)/doc/libxml2-api.xml ; fi ); + $(XSLTPROC) --nonet -o $(srcdir)/libxml2.devhelp $(srcdir)/devhelp.xsl $(top_srcdir)/doc/libxml2-api.xml ; fi ); install-data-local: - -@MKDIR_P@ $(DESTDIR)$(DEVHELP_DIR) - -@INSTALL@ -m 0644 $(srcdir)/libxml2.devhelp $(DESTDIR)$(DEVHELP_DIR) - -@INSTALL@ -m 0644 $(EXTRA_FORMAT:%=$(srcdir)/%) $(DESTDIR)$(DEVHELP_DIR) - -@INSTALL@ -m 0644 $(HTML_FILES:%=$(srcdir)/%) $(DESTDIR)$(DEVHELP_DIR) + -$(MKDIR_P) $(DESTDIR)$(DEVHELP_DIR) + -$(INSTALL) -m 0644 $(srcdir)/libxml2.devhelp $(DESTDIR)$(DEVHELP_DIR) + -$(INSTALL) -m 0644 $(EXTRA_FORMAT:%=$(srcdir)/%) $(DESTDIR)$(DEVHELP_DIR) + -$(INSTALL) -m 0644 $(HTML_FILES:%=$(srcdir)/%) $(DESTDIR)$(DEVHELP_DIR) +uninstall-local: + rm -f $(DESTDIR)$(DEVHELP_DIR)/libxml2.devhelp + rm -f $(DESTDIR)$(DEVHELP_DIR)/*.css + rm -f $(DESTDIR)$(DEVHELP_DIR)/*.html + rm -f $(DESTDIR)$(DEVHELP_DIR)/*.png + -rmdir $(DESTDIR)$(DEVHELP_DIR) diff --git a/doc/examples/.cvsignore b/doc/examples/.cvsignore index 7097a62b..0c5a3b19 100644 --- a/doc/examples/.cvsignore +++ b/doc/examples/.cvsignore @@ -1,18 +1,18 @@ .memdump Makefile.in Makefile -xpath2 -reader1 -reader4 -parse2 -reader2 -parse3 -reader3 -tree2 -parse4 -io2 -testWriter -io1 xpath1 -parse1 +parse3 +reader2 +tree2 +io1 +parse4 +xpath2 +io2 +reader1 tree1 +reader3 +parse2 +parse1 +reader4 +testWriter diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index bdac7bbd..dadbd90a 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -5,130 +5,130 @@ LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(I rebuild: examples.xml index.html -examples.xml: index.py *.c +examples.xml: index.py $(noinst_PROGRAMS:=.c) -@($(srcdir)/index.py) index.html: examples.xml examples.xsl -@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html) install-data-local: - @MKDIR_P@ $(DESTDIR)$(HTML_DIR) + $(mkinstalldirs) $(DESTDIR)$(HTML_DIR) -@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) -EXTRA_DIST=examples.xsl index.py examples.xml writer.xml test3.xml tst.xml test1.xml test2.xml io2.res xpath2.res tree1.res reader4.res io1.res tree2.res reader3.res xpath1.res reader1.res +EXTRA_DIST=examples.xsl index.py test2.xml tst.xml examples.xml test1.xml writer.xml test3.xml io2.res reader4.res tree2.res xpath2.res xpath1.res reader3.res reader1.res tree1.res io1.res -noinst_PROGRAMS=xpath2 reader1 reader4 parse2 reader2 parse3 reader3 tree2 parse4 io2 testWriter io1 xpath1 parse1 tree1 - -xpath2_SOURCES=xpath2.c -xpath2_LDFLAGS= -xpath2_DEPENDENCIES= $(DEPS) -xpath2_LDADD= @RDL_LIBS@ $(LDADDS) - -reader1_SOURCES=reader1.c -reader1_LDFLAGS= -reader1_DEPENDENCIES= $(DEPS) -reader1_LDADD= @RDL_LIBS@ $(LDADDS) - -reader4_SOURCES=reader4.c -reader4_LDFLAGS= -reader4_DEPENDENCIES= $(DEPS) -reader4_LDADD= @RDL_LIBS@ $(LDADDS) - -parse2_SOURCES=parse2.c -parse2_LDFLAGS= -parse2_DEPENDENCIES= $(DEPS) -parse2_LDADD= @RDL_LIBS@ $(LDADDS) - -reader2_SOURCES=reader2.c -reader2_LDFLAGS= -reader2_DEPENDENCIES= $(DEPS) -reader2_LDADD= @RDL_LIBS@ $(LDADDS) - -parse3_SOURCES=parse3.c -parse3_LDFLAGS= -parse3_DEPENDENCIES= $(DEPS) -parse3_LDADD= @RDL_LIBS@ $(LDADDS) - -reader3_SOURCES=reader3.c -reader3_LDFLAGS= -reader3_DEPENDENCIES= $(DEPS) -reader3_LDADD= @RDL_LIBS@ $(LDADDS) - -tree2_SOURCES=tree2.c -tree2_LDFLAGS= -tree2_DEPENDENCIES= $(DEPS) -tree2_LDADD= @RDL_LIBS@ $(LDADDS) - -parse4_SOURCES=parse4.c -parse4_LDFLAGS= -parse4_DEPENDENCIES= $(DEPS) -parse4_LDADD= @RDL_LIBS@ $(LDADDS) - -io2_SOURCES=io2.c -io2_LDFLAGS= -io2_DEPENDENCIES= $(DEPS) -io2_LDADD= @RDL_LIBS@ $(LDADDS) - -testWriter_SOURCES=testWriter.c -testWriter_LDFLAGS= -testWriter_DEPENDENCIES= $(DEPS) -testWriter_LDADD= @RDL_LIBS@ $(LDADDS) - -io1_SOURCES=io1.c -io1_LDFLAGS= -io1_DEPENDENCIES= $(DEPS) -io1_LDADD= @RDL_LIBS@ $(LDADDS) +noinst_PROGRAMS=xpath1 parse3 reader2 tree2 io1 parse4 xpath2 io2 reader1 tree1 reader3 parse2 parse1 reader4 testWriter xpath1_SOURCES=xpath1.c xpath1_LDFLAGS= xpath1_DEPENDENCIES= $(DEPS) xpath1_LDADD= @RDL_LIBS@ $(LDADDS) -parse1_SOURCES=parse1.c -parse1_LDFLAGS= -parse1_DEPENDENCIES= $(DEPS) -parse1_LDADD= @RDL_LIBS@ $(LDADDS) +parse3_SOURCES=parse3.c +parse3_LDFLAGS= +parse3_DEPENDENCIES= $(DEPS) +parse3_LDADD= @RDL_LIBS@ $(LDADDS) + +reader2_SOURCES=reader2.c +reader2_LDFLAGS= +reader2_DEPENDENCIES= $(DEPS) +reader2_LDADD= @RDL_LIBS@ $(LDADDS) + +tree2_SOURCES=tree2.c +tree2_LDFLAGS= +tree2_DEPENDENCIES= $(DEPS) +tree2_LDADD= @RDL_LIBS@ $(LDADDS) + +io1_SOURCES=io1.c +io1_LDFLAGS= +io1_DEPENDENCIES= $(DEPS) +io1_LDADD= @RDL_LIBS@ $(LDADDS) + +parse4_SOURCES=parse4.c +parse4_LDFLAGS= +parse4_DEPENDENCIES= $(DEPS) +parse4_LDADD= @RDL_LIBS@ $(LDADDS) + +xpath2_SOURCES=xpath2.c +xpath2_LDFLAGS= +xpath2_DEPENDENCIES= $(DEPS) +xpath2_LDADD= @RDL_LIBS@ $(LDADDS) + +io2_SOURCES=io2.c +io2_LDFLAGS= +io2_DEPENDENCIES= $(DEPS) +io2_LDADD= @RDL_LIBS@ $(LDADDS) + +reader1_SOURCES=reader1.c +reader1_LDFLAGS= +reader1_DEPENDENCIES= $(DEPS) +reader1_LDADD= @RDL_LIBS@ $(LDADDS) tree1_SOURCES=tree1.c tree1_LDFLAGS= tree1_DEPENDENCIES= $(DEPS) tree1_LDADD= @RDL_LIBS@ $(LDADDS) +reader3_SOURCES=reader3.c +reader3_LDFLAGS= +reader3_DEPENDENCIES= $(DEPS) +reader3_LDADD= @RDL_LIBS@ $(LDADDS) + +parse2_SOURCES=parse2.c +parse2_LDFLAGS= +parse2_DEPENDENCIES= $(DEPS) +parse2_LDADD= @RDL_LIBS@ $(LDADDS) + +parse1_SOURCES=parse1.c +parse1_LDFLAGS= +parse1_DEPENDENCIES= $(DEPS) +parse1_LDADD= @RDL_LIBS@ $(LDADDS) + +reader4_SOURCES=reader4.c +reader4_LDFLAGS= +reader4_DEPENDENCIES= $(DEPS) +reader4_LDADD= @RDL_LIBS@ $(LDADDS) + +testWriter_SOURCES=testWriter.c +testWriter_LDFLAGS= +testWriter_DEPENDENCIES= $(DEPS) +testWriter_LDADD= @RDL_LIBS@ $(LDADDS) + valgrind: $(MAKE) CHECKER='valgrind' tests tests: $(noinst_PROGRAMS) @(echo '## examples regression tests') @(echo > .memdump) - @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse2 test2.xml) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) + @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./parse3) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp) + @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./parse4 test3.xml) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse1 test1.xml) + @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse2 test2.xml) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse1 test1.xml) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) diff --git a/doc/examples/examples.xml b/doc/examples/examples.xml index a237a0ee..681e8484 100644 --- a/doc/examples/examples.xml +++ b/doc/examples/examples.xml @@ -1,69 +1,4 @@ - - Parse and validate an XML file with an xmlReader - Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.) - reader2 <valid_xml_filename> - reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp - Daniel Veillard - see Copyright for the status of this software. -
xmlReader
- - <libxml/xmlreader.h> - - - - - - - - - - - - - - - - - - - - - -
- - Load a document, locate subelements with XPath, modify said elements and save the resulting document. - Shows how to make a full round-trip from a load/edit/save - xpath2 <xml-file> <xpath-expr> <new-value> - xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp - Aleksey Sanin and Daniel Veillard - see Copyright for the status of this software. -
XPath
- - <libxml/parser.h> - <libxml/xpath.h> - <libxml/xpathInternals.h> - <libxml/tree.h> - - - - - - - - - - - - - - - - - - - -
Evaluate XPath expression and prints result node set. Shows how to evaluate XPath expression and register known namespaces in XPath context. @@ -123,27 +58,36 @@ - - Output to char buffer - Demonstrate the use of xmlDocDumpMemory to output document to a character buffer - io2 - io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp - John Fleck + + Parse and validate an XML file with an xmlReader + Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.) + reader2 <valid_xml_filename> + reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp + Daniel Veillard see Copyright for the status of this software. -
InputOutput
+
xmlReader
- <libxml/parser.h> + <libxml/xmlreader.h> - - - - - - - - - + + + + + + + + + + + + + + + + + +
@@ -174,78 +118,30 @@ - - Parse an XML file with an xmlReader - Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.) - reader1 <filename> - reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp + + Example of custom Input/Output + Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way. + io1 + io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp Daniel Veillard see Copyright for the status of this software. -
xmlReader
+
InputOutput
- <libxml/xmlreader.h> + <libxml/parser.h> + <libxml/xmlIO.h> + <libxml/xinclude.h> + <libxml/tree.h> - - - - - - - - - - - - - - - -
- - use various APIs for the xmlWriter - tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized. - testWriter - testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res - Alfred Mickautsch - see Copyright for the status of this software. -
xmlWriter
- - <libxml/encoding.h> - <libxml/xmlwriter.h> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + +
@@ -263,11 +159,110 @@ + + + + + + Load a document, locate subelements with XPath, modify said elements and save the resulting document. + Shows how to make a full round-trip from a load/edit/save + xpath2 <xml-file> <xpath-expr> <new-value> + xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp + Aleksey Sanin and Daniel Veillard + see Copyright for the status of this software. +
XPath
+ + <libxml/parser.h> + <libxml/xpath.h> + <libxml/xpathInternals.h> + <libxml/tree.h> + + + + + + + + + + + + + + + + +
+ + Output to char buffer + Demonstrate the use of xmlDocDumpMemory to output document to a character buffer + io2 + io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp + John Fleck + see Copyright for the status of this software. +
InputOutput
+ + <libxml/parser.h> + + + + + + + + + + + +
+ + Parse an XML file with an xmlReader + Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.) + reader1 <filename> + reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp + Daniel Veillard + see Copyright for the status of this software. +
xmlReader
+ + <libxml/xmlreader.h> + + + + + + + + + + + + + + +
+ + Navigates a tree to print element names + Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order. + tree1 filename_or_URL + tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp + Dodji Seketeli + see Copyright for the status of this software. +
Tree
+ + <libxml/tree.h> + <libxml/parser.h> + + + + + + +
Show how to extract subdocuments with xmlReader Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.) @@ -289,25 +284,24 @@ - - Example of custom Input/Output - Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way. - io1 - io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp + + Parse and validate an XML file to a tree and free the result + Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree. + parse2 test2.xml + parse2 test2.xml Daniel Veillard see Copyright for the status of this software. -
InputOutput
+
Parsing
- <libxml/parser.h> - <libxml/xmlIO.h> - <libxml/xinclude.h> <libxml/tree.h> + <libxml/parser.h> - - - - + + + + +
@@ -326,24 +320,6 @@ - - Navigates a tree to print element names - Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order. - tree1 filename_or_URL - tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp - Dodji Seketeli - see Copyright for the status of this software. -
Tree
- - <libxml/tree.h> - <libxml/parser.h> - - - - - - -
Parse multiple XML files reusing an xmlReader Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context. (Note that the XMLReader functions require libxml2 version later than 2.6.) @@ -364,34 +340,58 @@ - - Parse and validate an XML file to a tree and free the result - Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree. - parse2 test2.xml - parse2 test2.xml - Daniel Veillard + + use various APIs for the xmlWriter + tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized. + testWriter + testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res + Alfred Mickautsch see Copyright for the status of this software. -
Parsing
+
xmlWriter
- <libxml/tree.h> - <libxml/parser.h> + <libxml/encoding.h> + <libxml/xmlwriter.h> - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - + - + + @@ -401,8 +401,8 @@ - + @@ -430,12 +430,12 @@ - - + - + + @@ -447,9 +447,9 @@ + - @@ -458,16 +458,16 @@ - - - + + + - + @@ -479,12 +479,12 @@ - - - + + + @@ -500,34 +500,34 @@ - + - - + - + + - + - + @@ -566,16 +566,16 @@ - + - + @@ -692,28 +692,28 @@ - + - + - + - + - + - + @@ -721,22 +721,22 @@
- +
- +
- +
diff --git a/doc/examples/index.py b/doc/examples/index.py index 11df6f0f..536d5dcc 100755 --- a/doc/examples/index.py +++ b/doc/examples/index.py @@ -227,7 +227,7 @@ LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(I rebuild: examples.xml index.html -examples.xml: index.py *.c +examples.xml: index.py $(noinst_PROGRAMS:=.c) -@($(srcdir)/index.py) index.html: examples.xml examples.xsl diff --git a/example/Makefile.am b/example/Makefile.am index 9eb6a76d..f8a137b6 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -1,10 +1,10 @@ noinst_PROGRAMS = gjobread -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ +INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include $(THREAD_CFLAGS) $(Z_CFLAGS) DEPS = $(top_builddir)/libxml2.la -LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@ +LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(ICONV_LIBS) -lm $(WIN32_EXTRA_LIBADD) gjobread_SOURCES=gjobread.c gjobread_LDFLAGS= gjobread_DEPENDENCIES= $(DEPS) -gjobread_LDADD= @RDL_LIBS@ $(LDADDS) +gjobread_LDADD = $(RDL_LIBS) $(LDADDS) diff --git a/include/libxml/nanoftp.h b/include/libxml/nanoftp.h index 397bbba7..abb4bf71 100644 --- a/include/libxml/nanoftp.h +++ b/include/libxml/nanoftp.h @@ -31,6 +31,7 @@ * macro used to provide portability of code to windows sockets * the value to be used when the socket is not valid */ +#undef INVALID_SOCKET #define INVALID_SOCKET (-1) #endif diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in index ddd46339..c98e7ca7 100644 --- a/include/libxml/xmlversion.h.in +++ b/include/libxml/xmlversion.h.in @@ -412,7 +412,11 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); */ #ifndef ATTRIBUTE_UNUSED -#define ATTRIBUTE_UNUSED __attribute__((unused)) +# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) +# define ATTRIBUTE_UNUSED __attribute__((unused)) +# else +# define ATTRIBUTE_UNUSED +# endif #endif /** diff --git a/python/Makefile.am b/python/Makefile.am index 68d2236d..f34aa988 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -21,7 +21,7 @@ EXTRA_DIST = \ libxml.py \ libxml2-python-api.xml -libxml2mod_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -module -avoid-version +libxml2mod_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) -module -avoid-version if WITH_PYTHON mylibs = \ @@ -31,7 +31,7 @@ python_LTLIBRARIES = libxml2mod.la libxml2mod_la_SOURCES = $(srcdir)/libxml.c $(srcdir)/types.c nodist_libxml2mod_la_SOURCES = libxml2-py.c -libxml2mod_la_LIBADD = $(mylibs) @CYGWIN_EXTRA_PYTHON_LIBADD@ @WIN32_EXTRA_PYTHON_LIBADD@ @PYTHON_LIBS@ -lpython$(PYTHON_VERSION) +libxml2mod_la_LIBADD = $(mylibs) $(CYGWIN_EXTRA_PYTHON_LIBADD) $(WIN32_EXTRA_PYTHON_LIBADD) $(PYTHON_LIBS) -lpython$(PYTHON_VERSION) $(srcdir)/libxml.c: libxml2-py.h # to generate before to compile @@ -53,7 +53,7 @@ GENERATED= libxml2class.py \ libxml2-py.c \ libxml2-py.h -CLEANFILES= $(GENERATED) gen_prog libxml2.py +CLEANFILES = $(GENERATED) gen_prog libxml2.py *.pyc $(GENERATED): gen_prog @@ -63,5 +63,5 @@ gen_prog: $(srcdir)/$(GENERATE) $(API_DESC) endif tests test: all - cd tests && $(MAKE) MAKEFLAGS+=--silent tests + cd tests && $(MAKE) tests diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am index 52c89fc3..ca72fdda 100644 --- a/python/tests/Makefile.am +++ b/python/tests/Makefile.am @@ -55,6 +55,8 @@ XMLS= \ invalid.xml \ test.dtd +CLEANFILES = core tmp.xml *.pyc + if WITH_PYTHON tests: $(PYTESTS) @echo "## running Python regression tests" @@ -69,6 +71,3 @@ tests: $(PYTESTS) else tests: endif - -clean: - rm -f *.pyc core diff --git a/testRelax.c b/testRelax.c index e18b3c2f..61333483 100644 --- a/testRelax.c +++ b/testRelax.c @@ -49,7 +49,7 @@ static int debug = 0; #endif static int noout = 0; static int tree = 0; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP static int memory = 0; #endif @@ -65,7 +65,7 @@ int main(int argc, char **argv) { debug++; else #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) { memory++; } else @@ -84,7 +84,7 @@ int main(int argc, char **argv) { if (schema == NULL) { xmlRelaxNGParserCtxtPtr ctxt; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { int fd; struct stat info; @@ -174,7 +174,7 @@ int main(int argc, char **argv) { #endif printf("\t--noout : do not print the result\n"); printf("\t--tree : print the intermediate Relax-NG document tree\n"); -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP printf("\t--memory : test the schemas in memory parsing\n"); #endif } diff --git a/testSchemas.c b/testSchemas.c index 47f8b39a..b1cb7535 100644 --- a/testSchemas.c +++ b/testSchemas.c @@ -49,7 +49,7 @@ static int debug = 0; #endif static int noout = 0; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP static int memory = 0; #endif @@ -65,7 +65,7 @@ int main(int argc, char **argv) { debug++; else #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) { memory++; } else @@ -80,7 +80,7 @@ int main(int argc, char **argv) { if (schema == NULL) { xmlSchemaParserCtxtPtr ctxt; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { int fd; struct stat info; @@ -164,7 +164,7 @@ int main(int argc, char **argv) { printf("\t--debug : dump a debug tree of the in-memory document\n"); #endif printf("\t--noout : do not print the result\n"); -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP printf("\t--memory : test the schemas in memory parsing\n"); #endif } diff --git a/testapi.c b/testapi.c index 4f4b39b6..25e47be7 100644 --- a/testapi.c +++ b/testapi.c @@ -127,8 +127,10 @@ int main(int argc, char **argv) { int ret; int blocks, mem; +#ifdef HAVE_PUTENV /* access to the proxy can slow up regression tests a lot */ putenv((char *) "http_proxy="); +#endif memset(chartab, 0, sizeof(chartab)); strncpy((char *) chartab, " chartab\n", 20); diff --git a/threads.c b/threads.c index 1eeac0e1..6d25565a 100644 --- a/threads.c +++ b/threads.c @@ -439,7 +439,7 @@ __xmlGlobalInitMutexLock(void) /* Make sure the global init lock is initialized and then lock it. */ #ifdef HAVE_PTHREAD_H /* The mutex is statically initialized, so we just lock it. */ - if (pthread_mutex_lock) + if (pthread_mutex_lock != NULL) pthread_mutex_lock(&global_init_lock); #elif defined HAVE_WIN32_THREADS LPCRITICAL_SECTION cs; @@ -509,7 +509,7 @@ void __xmlGlobalInitMutexUnlock(void) { #ifdef HAVE_PTHREAD_H - if (pthread_mutex_unlock) + if (pthread_mutex_unlock != NULL) pthread_mutex_unlock(&global_init_lock); #elif defined HAVE_WIN32_THREADS if (global_init_lock != NULL) { diff --git a/trio.c b/trio.c index b116ccc3..a0e3d4d6 100644 --- a/trio.c +++ b/trio.c @@ -307,6 +307,10 @@ typedef trio_longlong_t trio_int64_t; #define NAN_LOWER "nan" #define NAN_UPPER "NAN" +#if !defined(HAVE_ISASCII) && !defined(isascii) +# define isascii(x) ((unsigned int)(x) < 128) +#endif + /* Various constants */ enum { TYPE_PRINT = 1, diff --git a/trio.h b/trio.h index eab1b6d8..108a7097 100644 --- a/trio.h +++ b/trio.h @@ -28,7 +28,7 @@ * Use autoconf defines if present. Packages using trio must define * HAVE_CONFIG_H as a compiler option themselves. */ -#if defined(HAVE_CONFIG_H) +#if defined(TRIO_HAVE_CONFIG_H) # include "config.h" #endif diff --git a/win32/Makefile.bcb b/win32/Makefile.bcb index d612e2dc..a374b712 100644 --- a/win32/Makefile.bcb +++ b/win32/Makefile.bcb @@ -68,6 +68,9 @@ CFLAGS = $(CFLAGS) -DHAVE_PTHREAD_H !if "$(WITH_ZLIB)" == "1" CFLAGS = $(CFLAGS) -DHAVE_ZLIB_H !endif +!if "$(WITH_LZMA)" == "1" +CFLAGS = $(CFLAGS) -DHAVE_LZMA_H +!endif # The linker and its options. LD = ilink32.exe @@ -92,6 +95,9 @@ LIBS = $(LIBS) iconvomf.lib !if "$(WITH_ZLIB)" == "1" LIBS = $(LIBS) zlibomf.lib !endif +!if "$(WITH_LZMA)" == "1" +LIBS = $(LIBS) liblzma.lib +!endif !if "$(WITH_THREADS)" == "posix" LIBS = $(LIBS) pthreadVC.lib !endif @@ -250,10 +256,11 @@ distclean : clean rebuild : clean all install-libs : all - if not exist "$(INCPREFIX)\libxml" mkdir "$(INCPREFIX)\libxml" + if not exist "$(INCPREFIX)\libxml2" mkdir "$(INCPREFIX)\libxml2" + if not exist "$(INCPREFIX)\libxml2\libxml" mkdir "$(INCPREFIX)\libxml2\libxml" if not exist "$(BINPREFIX)" mkdir "$(BINPREFIX)" if not exist "$(LIBPREFIX)" mkdir "$(LIBPREFIX)" - copy $(XML_SRCDIR)\include\libxml\*.h "$(INCPREFIX)\libxml" + copy $(XML_SRCDIR)\include\libxml\*.h "$(INCPREFIX)\libxml2\libxml" copy $(BINDIR)\$(XML_SO) "$(SOPREFIX)" copy $(BINDIR)\$(XML_A) "$(LIBPREFIX)" copy $(BINDIR)\$(XML_IMP) "$(LIBPREFIX)" diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw index 0f8198b9..dbe967d7 100644 --- a/win32/Makefile.mingw +++ b/win32/Makefile.mingw @@ -60,6 +60,9 @@ endif ifeq ($(WITH_ZLIB),1) CFLAGS += -DHAVE_ZLIB_H endif +ifeq ($(WITH_LZMA),1) +CFLAGS += -DHAVE_LZMA_H +endif # The linker and its options. LD = gcc.exe @@ -83,6 +86,9 @@ ifeq ($(WITH_ZLIB),1) # LIBS += -lzdll LIBS += -lz endif +ifeq ($(WITH_LZMA),1) +LIBS += -llzma +endif ifeq ($(WITH_THREADS),posix) LIBS += -lpthreadGC endif @@ -254,10 +260,11 @@ distclean : clean rebuild : clean all install-libs : all - cmd.exe /C "if not exist $(INCPREFIX)\libxml mkdir $(INCPREFIX)\libxml" + cmd.exe /C "if not exist $(INCPREFIX)\libxml2 mkdir $(INCPREFIX)\libxml2" + cmd.exe /C "if not exist $(INCPREFIX)\libxml2\libxml mkdir $(INCPREFIX)\libxml2\libxml" cmd.exe /C "if not exist $(BINPREFIX) mkdir $(BINPREFIX)" cmd.exe /C "if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)" - cmd.exe /C "copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml" + cmd.exe /C "copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml2\libxml" cmd.exe /C "copy $(BINDIR)\$(XML_SO) $(SOPREFIX)" cmd.exe /C "copy $(BINDIR)\$(XML_A) $(LIBPREFIX)" cmd.exe /C "copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)" diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc index cc933721..8ef4f5e4 100644 --- a/win32/Makefile.msvc +++ b/win32/Makefile.msvc @@ -299,11 +299,12 @@ distclean : clean rebuild : clean all install-libs : all - if not exist $(INCPREFIX)\libxml mkdir $(INCPREFIX)\libxml + if not exist $(INCPREFIX)\libxml2 mkdir $(INCPREFIX)\libxml2 + if not exist $(INCPREFIX)\libxml2\libxml mkdir $(INCPREFIX)\libxml2\libxml if not exist $(BINPREFIX) mkdir $(BINPREFIX) if not exist $(LIBPREFIX) mkdir $(LIBPREFIX) if not exist $(SOPREFIX) mkdir $(SOPREFIX) - copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml + copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml2\libxml copy $(BINDIR)\$(XML_SO) $(SOPREFIX) copy $(BINDIR)\$(XML_A) $(LIBPREFIX) copy $(BINDIR)\$(XML_A_DLL) $(LIBPREFIX) diff --git a/xml2-config.in b/xml2-config.in index 29893250..19574864 100644 --- a/xml2-config.in +++ b/xml2-config.in @@ -86,12 +86,12 @@ while test $# -gt 0; do then if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = "-L/usr/lib64" ] then - echo @XML_LIBS@ + echo @XML_LIBS@ @MODULE_PLATFORM_LIBS@ else - echo @XML_LIBDIR@ @XML_LIBS@ + echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ fi else - echo @XML_LIBDIR@ @XML_LIBS@ @WIN32_EXTRA_LIBADD@ + echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ @WIN32_EXTRA_LIBADD@ fi ;; diff --git a/xmllint.c b/xmllint.c index 3edeccb1..8c1ca8a0 100644 --- a/xmllint.c +++ b/xmllint.c @@ -169,7 +169,7 @@ static int nodefdtd = 0; #ifdef LIBXML_PUSH_ENABLED static int push = 0; #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP static int memory = 0; #endif static int testIO = 0; @@ -1823,7 +1823,7 @@ static void processNode(xmlTextReaderPtr reader) { static void streamFile(char *filename) { xmlTextReaderPtr reader; int ret; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP int fd = -1; struct stat info; const char *base = NULL; @@ -1974,7 +1974,7 @@ static void streamFile(char *filename) { patstream = NULL; } #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { xmlFreeParserInputBuffer(input); munmap((char *) base, info.st_size); @@ -2212,7 +2212,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { } } #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP else if ((html) && (memory)) { int fd; struct stat info; @@ -2327,7 +2327,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { if (rectxt == NULL) xmlFreeParserCtxt(ctxt); } -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP } else if (memory) { int fd; struct stat info; @@ -2591,7 +2591,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { } } else #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { xmlChar *result; int len; @@ -2619,7 +2619,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { } } else -#endif /* HAVE_SYS_MMAN_H */ +#endif /* HAVE_MMAP */ if (compress) { xmlSaveFile(output ? output : "-", doc); } else if (oldout) { @@ -3017,7 +3017,7 @@ static void usage(const char *name) { #ifdef LIBXML_PUSH_ENABLED printf("\t--push : use the push mode of the parser\n"); #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP printf("\t--memory : parse from memory\n"); #endif printf("\t--maxmem nbbytes : limits memory allocation to nbbytes bytes\n"); @@ -3247,7 +3247,7 @@ main(int argc, char **argv) { (!strcmp(argv[i], "--push"))) push++; #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP else if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) memory++; diff --git a/xstc/Makefile.am b/xstc/Makefile.am index 966a8ded..5ef18192 100644 --- a/xstc/Makefile.am +++ b/xstc/Makefile.am @@ -118,7 +118,7 @@ pytests: $(PYSCRIPTS) $(TESTDIRS) tests: -@(if [ -x $(PYTHON) ] ; then \ - $(MAKE) MAKEFLAGS+=--silent pytests ; fi); + $(MAKE) pytests ; fi); # # Heavy, works well only on RHEL3 @@ -126,7 +126,7 @@ tests: valgrind: -@(if [ -x $(PYTHON) ] ; then \ echo '## Running the regression tests under Valgrind' ; \ - $(MAKE) CHECKER='valgrind -q' MAKEFLAGS+=--silent pytests ; fi); + $(MAKE) CHECKER='valgrind -q' pytests ; fi); CLEANFILES=$(PYSCRIPTS) test.log