On Tue, 14 Aug 2012, Daniel Veillard wrote:
Okay, thanks ! seems to work fine.
My last annoyance ATM with makefiles is devhelp files being rebuilt
systematically, even on a just built tree or if running "make check"
Any idea what might have introduced this ;-) ?
I believe some of my changes may be responsible, specifically the
replacement of plain wildcards in the dependencies for libxml2-api.xml to
GNU Make constructs that actually work :>
The problem there is that with an in-source build, one of the files
matched by
$(wildcard $(top_srcdir)/include/libxml/*.h)
is xmlversion.h, which is generated at configure time. Whoops!
I've rewritten that bit to filter out that particular file (and depend on
xmlversion.h.in instead), but there's another problem:
If you regenerate libxml2-api.xml in an out-of-source build, apibuild.py
does not see xmlversion.h, because the script runs in srcdir and that
header only exists in builddir. So libxml2-api.xml then does not include
anything about xmlversion.h.
Then, when you go to doc/devhelp/ and regenerate the HTML files, no
libxml2-xmlversion.html file is generated. Whatever old one existed
previously sticks around.
And when you go to install, it sees that libxml2-xmlversion.html is out of
date (or missing), so it regenerates the HTML files.
Repeat ad infinitum :(
Two patches are attached to this message. The first one is another round
of fixes/clean-up for the documentation build (including the above issue),
as well as the tests under doc/examples/. The second one is an update of
my earlier Autotools-obsolete-constructs patch.
This should make the devhelp rebuilds go away for in-source builds---let
me know if not---but apibuild.py really needs to be updated so that it
does the right thing in out-of-source builds.
Walk-through for libxml2-doc-example-fixes.patch:
doc/Makefile.am:
* Build what's in doc/ before doc/devhelp/, as the dependency graph flows
that way
* Add "--path $(srcdir)" so that xsltproc can find DTDs in srcdir
* Replaced $(top_srcdir)/doc with an equivalent $(srcdir)
* Qualified libxml2-api.xml with $(srcdir) as it's always generated there
* Rewrote the dependencies for libxml2-api.xml so that xmlversion.h
doesn't throw everything off
doc/devhelp/Makefile.am:
* Use Automake constructs to install the HTML files instead of an
install-data-local rule
* Reorganized the file a bit (hello whitespace!)
* EXTRA_DIST doesn't need to list so many files now that dist_devhelp_DATA
is being used
* Only print "Rebuilding devhelp files" if rebuilding is actually
occurring
doc/examples/index.py:
* Make the "this file is auto-generated" banner more prominent
* Autotools updates: Use AM_CPPFLAGS/AM_CFLAGS instead of INCLUDES
* Got rid of DEPS as it's not needed (Automake already sees the dependency
on libxml2.la by way of LDADD(S))
* Replaced LDADDS with LDADD, which is applied to all programs listed
in the file. Since all the test programs have the same link
dependencies, this way is more concise yet equivalent.
* Remove the *.tmp files via "make clean" instead of having the test
programs do it themselves (more on this later)
* Invoke index.py in srcdir, as it pretty much needs to run there
* Restructured the index.html rule so that only the xmllint invocation is
allowed to fail
* Use $(MKDIR_P) instead of $(mkinstalldirs), $(VAR) instead of @VAR@
* Remove symlinks for test?.xml in an out-of-source build
* Sort lists for neatness
* Better formatting for EXTRA_DIST and noinst_PROGRAMS variables
* Simplified the Automake bits printed for each program: *_LDFLAGS doesn't
need to be specified as it's empty anyway, *_DEPENDENCIES is redundant,
*_LDADD isn't needed due to the global LDADD
* Added a bit that symlinks in test?.xml from srcdir in out-of-source
builds. This allows the reader4 test to read these files in the current
directory, which ensures that the output always looks the same (i.e.
does not contain references to srcdir)
* Don't hide the test program invocation (or else it's hard to tell which
test failed), and don't use superfluous parentheses
* NOTE: If you check in these changes, be sure to run this script and also
check in the updated files that it generates!
doc/examples/*.c:
* Updated the test: lines so that
+ "&&" is used to separate commands instead of ";" so that errors are
not masked
+ reference files are qualified with $(srcdir)/
+ no "rm" takes place -- these are a problem because (1) if a test
fails, it's useful to have the output file ready for inspection; (2)
the "rm" invocation masks a potential non-zero exit status from diff
(This is why I added the CLEANFILES line above)
doc/examples/io1.res:
* Updated this ref file so that the test passes. (This is correct, right?)
doc/examples/reader4.res:
* Changed this back to its original form, as the symlinking of test?.xml
means this file no longer has to contain path prefixes on the filenames
doc/examples/testWriter.c:
* Changed the output filenames to *.tmp instead of *.res, partly for
consistency, partly to not have to add special cases to CLEANFILES
doc/examples/xpath1.c:
* Removed the "./" prefix on the test invocation, which is redundant as
index.py already adds one
Walk-through for libxml2-autotools-updates-2.patch:
Makefile.am, example/Makefile.am:
* Replaced the obsolete INCLUDES variable with AM_CPPFLAGS/AM_CFLAGS
acinclude.m4:
* autoupdate replaced AC_FD_CC with AS_MESSAGE_LOG_FD
autogen.sh:
* Added -Wall to the autoreconf invocation, which turned up a whole slew
of warnings that are fixed by this patch
configure.in:
* Most of the changes are due to autoupdate, with subsequent manual
tidying
* Note that autoupdate bumped the AC_PREREQ version from 2.59 to 2.68. If
you normally use an older version of Autoconf, and everything works fine
if you comment out that directive, feel free to bump down the version
accordingly.
* Ensure that #include directives in C fragments always have no whitespace
to the left of the '#' mark, as some preprocessors need that to be in
the first column
example/Makefile.am:
* Don't need DEPS
* Use plain LDADD instead of LDADDS; if all programs in this file need to
link against the same set of libraries, then this is all you need
--Daniel
--
Daniel Richard G. || [email protected] || Software Developer
Teragram Linguistic Technologies (a division of SAS)
http://www.teragram.com/diff --git a/doc/Makefile.am b/doc/Makefile.am
index b9ab1ad..e4b60a6 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,5 +1,5 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS=devhelp examples
+SUBDIRS = . devhelp examples
# The top-level SGML file.
DOC_MAIN_XML_FILE=gnome-xml.xml
@@ -256,25 +256,25 @@ web: $(PAGES)
$(PAGES): xml.html $(srcdir)/site.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML Web pages from xml.html" ; \
- $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/xml.html > index.html ; fi );
+ $(XSLTPROC) --nonet --html --path $(srcdir) $(srcdir)/site.xsl $(srcdir)/xml.html > index.html ; fi );
-@(if [ -x $(XMLLINT) ] ; then \
echo "Validating the HTML Web pages" ; \
$(XMLLINT) --nonet --valid --noout $(PAGES) ; fi );
-$(top_builddir)/NEWS: $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html
+$(top_builddir)/NEWS: $(srcdir)/news.xsl $(srcdir)/news.html
-@(if [ -x $(XSLTPROC) ] ; then \
- $(XSLTPROC) --nonet $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html > $(top_builddir)/NEWS ; fi );
+ $(XSLTPROC) --nonet $(srcdir)/news.xsl $(srcdir)/news.html > $(top_builddir)/NEWS ; fi );
-libxml2.xsa: $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html
+libxml2.xsa: $(srcdir)/xsa.xsl $(srcdir)/news.html
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the NEWS file" ; \
- $(XSLTPROC) --nonet $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html > libxml2.xsa ; fi );
+ $(XSLTPROC) --nonet $(srcdir)/xsa.xsl $(srcdir)/news.html > libxml2.xsa ; fi );
-$(APIPAGES): libxml2-api.xml libxml2-refs.xml $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/api.xsl
+$(APIPAGES): libxml2-api.xml libxml2-refs.xml $(srcdir)/site.xsl $(srcdir)/api.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML API pages from libxml2-refs.xml" ; \
- $(XSLTPROC) --nonet --html $(top_srcdir)/doc/api.xsl \
- $(top_srcdir)/doc/xml.html ; fi );
+ $(XSLTPROC) --nonet --html $(srcdir)/api.xsl \
+ $(srcdir)/xml.html ; fi );
-@(if [ -x $(XMLLINT) ] ; then \
echo "Validating the HTML API pages" ; \
$(XMLLINT) --nonet --valid --noout API*.html ; fi );
@@ -282,7 +282,7 @@ $(APIPAGES): libxml2-api.xml libxml2-refs.xml $(top_srcdir)/doc/site.xsl $(top_s
$(srcdir)/html/index.html: libxml2-api.xml $(srcdir)/newapi.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML pages from the XML API" ; \
- $(XSLTPROC) --nonet $(srcdir)/newapi.xsl libxml2-api.xml ; fi )
+ $(XSLTPROC) --nonet $(srcdir)/newapi.xsl $(srcdir)/libxml2-api.xml ; fi )
-@(if [ -x $(XMLLINT) ] ; then \
echo "Validating the resulting XHTML pages" ; \
$(XMLLINT) --nonet --valid --noout html/*.html ; fi );
@@ -290,15 +290,20 @@ $(srcdir)/html/index.html: libxml2-api.xml $(srcdir)/newapi.xsl
wiki: libxml2-api.xml $(srcdir)/wiki.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the wiki HTML pages from the XML API" ; \
- $(XSLTPROC) --nonet $(srcdir)/wiki.xsl libxml2-api.xml; fi )
+ $(XSLTPROC) --nonet $(srcdir)/wiki.xsl $(srcdir)/libxml2-api.xml; fi )
$(WIN32_DIR)/libxml2.def.src: libxml2-api.xml
-@(if [ -x $(XSLTPROC) ] ; then \
$(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 $(wildcard $(top_srcdir)/include/libxml/*.h) $(wildcard $(top_srcdir)/*.c)
- -($(srcdir)/apibuild.py)
+source_file_deps = \
+ $(filter-out %/xmlversion.h, $(wildcard $(top_srcdir)/include/libxml/*.h)) \
+ $(top_srcdir)/include/libxml/xmlversion.h.in \
+ $(wildcard $(top_srcdir)/*.c)
+
+libxml2-api.xml libxml2-refs.xml ../libxml2.syms: apibuild.py symbols.xml syms.xsl checkapisym.xsl $(source_file_deps)
+ (cd $(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)
diff --git a/doc/devhelp/Makefile.am b/doc/devhelp/Makefile.am
index 23c77b8..c904311 100644
--- a/doc/devhelp/Makefile.am
+++ b/doc/devhelp/Makefile.am
@@ -1,5 +1,15 @@
-DEVHELP_DIR=$(datadir)/gtk-doc/html/libxml2
-HTML_FILES=index.html general.html $(HTML_MODULES)
+devhelpdir = $(datadir)/gtk-doc/html/libxml2
+
+dist_devhelp_DATA = \
+ libxml2.devhelp \
+ $(HTML_FILES) \
+ $(EXTRA_FORMAT)
+
+HTML_FILES = \
+ general.html \
+ index.html \
+ $(HTML_MODULES)
+
HTML_MODULES= \
libxml2-c14n.html \
libxml2-catalog.html \
@@ -56,24 +66,9 @@ EXTRA_FORMAT= \
up.png \
style.css
-EXTRA_DIST=devhelp.xsl html.xsl libxml2.devhelp $(HTML_FILES) $(EXTRA_FORMAT)
-
-all: libxml2.devhelp $(HTML_FILES)
+EXTRA_DIST = devhelp.xsl html.xsl
libxml2.devhelp $(HTML_FILES): devhelp.xsl html.xsl $(top_srcdir)/doc/libxml2-api.xml
- -@(echo Rebuilding devhelp files)
-@(if [ -x $(XSLTPROC) ] ; then \
+ echo Rebuilding devhelp files ; \
$(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)
-
-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/index.py b/doc/examples/index.py
index 536d5dc..7b13d83 100755
--- a/doc/examples/index.py
+++ b/doc/examples/index.py
@@ -220,43 +220,56 @@ def dump_Makefile():
extras.append(file)
for file in glob.glob('*.res'):
extras.append(file)
- Makefile="""# Beware this is autogenerated by index.py
-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@
+ Makefile="""##
+## This file is auto-generated by index.py
+## DO NOT EDIT !!!
+##
+
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include
+AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS)
+LDADD = $(RDL_LIBS) $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(ICONV_LIBS) -lm $(WIN32_EXTRA_LIBADD)
+
+CLEANFILES = *.tmp
rebuild: examples.xml index.html
examples.xml: index.py $(noinst_PROGRAMS:=.c)
- -@($(srcdir)/index.py)
+ cd $(srcdir) && $(PYTHON) index.py
+ $(MAKE) Makefile
index.html: examples.xml examples.xsl
- -@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html)
+ cd $(srcdir) && xsltproc examples.xsl examples.xml && echo "Rebuilt web page"
+ -cd $(srcdir) && xmllint --valid --noout index.html
install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
- -@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
+ $(MKDIR_P) $(DESTDIR)$(HTML_DIR)
+ -$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
+
+clean-local:
+ test -f Makefile.am || rm -f test?.xml
"""
+ examples.sort()
+ extras.sort()
+ tests.sort()
EXTRA_DIST=""
for extra in extras:
- EXTRA_DIST = EXTRA_DIST + extra + " "
- Makefile = Makefile + "EXTRA_DIST=%s\n\n" % (EXTRA_DIST)
+ EXTRA_DIST = EXTRA_DIST + " \\\n\t" + extra
+ Makefile = Makefile + "EXTRA_DIST =%s\n\n" % (EXTRA_DIST)
noinst_PROGRAMS=""
for example in examples:
- noinst_PROGRAMS = noinst_PROGRAMS + example + " "
- Makefile = Makefile + "noinst_PROGRAMS=%s\n\n" % (noinst_PROGRAMS)
+ noinst_PROGRAMS = noinst_PROGRAMS + " \\\n\t" + example
+ Makefile = Makefile + "noinst_PROGRAMS =%s\n\n" % (noinst_PROGRAMS)
for example in examples:
- Makefile = Makefile + "%s_SOURCES=%s.c\n%s_LDFLAGS=\n%s_DEPENDENCIES= $(DEPS)\n%s_LDADD= @RDL_LIBS@ $(LDADDS)\n\n" % (example, example, example,
- example, example)
+ Makefile = Makefile + "%s_SOURCES = %s.c\n\n" % (example, example)
Makefile = Makefile + "valgrind: \n\t$(MAKE) CHECKER='valgrind' tests\n\n"
Makefile = Makefile + "tests: $(noinst_PROGRAMS)\n"
+ Makefile = Makefile + "\ttest -f Makefile.am || test -f test1.xml || $(LN_S) $(srcdir)/test?.xml .\n"
Makefile = Makefile + "\t@(echo '## examples regression tests')\n"
Makefile = Makefile + "\t@(echo > .memdump)\n"
for test in tests:
- Makefile = Makefile + "\t@($(CHECKER) %s)\n" % (test)
- Makefile = Makefile + '\t@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)\n'
- Makefile = Makefile + "\n\n"
+ Makefile = Makefile + "\t$(CHECKER) %s\n" % (test)
+ Makefile = Makefile + '\t@grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0\n'
try:
old = open("Makefile.am", "r").read()
if old != Makefile:
diff --git a/doc/examples/io1.c b/doc/examples/io1.c
index c8a47e3..d077cd8 100644
--- a/doc/examples/io1.c
+++ b/doc/examples/io1.c
@@ -6,7 +6,7 @@
* XInclude method context to show how dynamic document can
* be built in a clean way.
* usage: io1
- * test: io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp
+ * test: io1 > io1.tmp && diff io1.tmp $(srcdir)/io1.res
* author: Daniel Veillard
* copy: see Copyright for the status of this software.
*/
diff --git a/doc/examples/io1.res b/doc/examples/io1.res
index 4a4c036..adf65c7 100644
--- a/doc/examples/io1.res
+++ b/doc/examples/io1.res
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<document xmlns:xi="http://www.w3.org/2003/XInclude">
<p>List of people:</p>
- <list><people>a</people><people>b</people></list>
+ <list xml:base="sql://select_name_from_people"><people>a</people><people>b</people></list>
</document>
diff --git a/doc/examples/io2.c b/doc/examples/io2.c
index 814a27e..4676f4a 100644
--- a/doc/examples/io2.c
+++ b/doc/examples/io2.c
@@ -4,7 +4,7 @@
* purpose: Demonstrate the use of xmlDocDumpMemory
* to output document to a character buffer
* usage: io2
- * test: io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp
+ * test: io2 > io2.tmp && diff io2.tmp $(srcdir)/io2.res
* author: John Fleck
* copy: see Copyright for the status of this software.
*/
diff --git a/doc/examples/reader1.c b/doc/examples/reader1.c
index 90db2a1..e8a005a 100644
--- a/doc/examples/reader1.c
+++ b/doc/examples/reader1.c
@@ -6,7 +6,7 @@
* (Note that the XMLReader functions require libxml2 version later
* than 2.6.)
* usage: reader1 <filename>
- * test: reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp
+ * test: reader1 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res
* author: Daniel Veillard
* copy: see Copyright for the status of this software.
*/
diff --git a/doc/examples/reader2.c b/doc/examples/reader2.c
index c32ada5..043b137 100644
--- a/doc/examples/reader2.c
+++ b/doc/examples/reader2.c
@@ -7,7 +7,7 @@
* (Note that the XMLReader functions require libxml2 version later
* than 2.6.)
* usage: reader2 <valid_xml_filename>
- * test: reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp
+ * test: reader2 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res
* author: Daniel Veillard
* copy: see Copyright for the status of this software.
*/
diff --git a/doc/examples/reader3.c b/doc/examples/reader3.c
index 51f9d3b..3eeb61f 100644
--- a/doc/examples/reader3.c
+++ b/doc/examples/reader3.c
@@ -7,7 +7,7 @@
* (Note that the XMLReader functions require libxml2 version later
* than 2.6.)
* usage: reader3
- * test: reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp
+ * test: reader3 > reader3.tmp && diff reader3.tmp $(srcdir)/reader3.res
* author: Daniel Veillard
* copy: see Copyright for the status of this software.
*/
diff --git a/doc/examples/reader4.c b/doc/examples/reader4.c
index ed2726a..1289d0d 100644
--- a/doc/examples/reader4.c
+++ b/doc/examples/reader4.c
@@ -6,7 +6,7 @@
* and parser context. (Note that the XMLReader functions require
* libxml2 version later than 2.6.)
* usage: reader4 <filename> [ filename ... ]
- * test: reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp
+ * test: reader4 test1.xml test2.xml test3.xml > reader4.tmp && diff reader4.tmp $(srcdir)/reader4.res
* author: Graham Bennett
* copy: see Copyright for the status of this software.
*/
diff --git a/doc/examples/reader4.res b/doc/examples/reader4.res
index 9d0b359..b793f82 100644
--- a/doc/examples/reader4.res
+++ b/doc/examples/reader4.res
@@ -1,3 +1,3 @@
-./test1.xml: Processed ok
-./test2.xml: Processed ok
-./test3.xml: Processed ok
+test1.xml: Processed ok
+test2.xml: Processed ok
+test3.xml: Processed ok
diff --git a/doc/examples/testWriter.c b/doc/examples/testWriter.c
index 9bf590f..f662f76 100644
--- a/doc/examples/testWriter.c
+++ b/doc/examples/testWriter.c
@@ -7,7 +7,7 @@
* do encoding string conversions too. The resulting
* documents are then serialized.
* usage: testWriter
- * test: testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res
+ * test: testWriter && for i in 1 2 3 4 ; do diff $(srcdir)/writer.xml writer$$i.tmp || break ; done
* author: Alfred Mickautsch
* copy: see Copyright for the status of this software.
*/
@@ -37,16 +37,16 @@ main(void)
LIBXML_TEST_VERSION
/* first, the file version */
- testXmlwriterFilename("writer1.res");
+ testXmlwriterFilename("writer1.tmp");
/* next, the memory version */
- testXmlwriterMemory("writer2.res");
+ testXmlwriterMemory("writer2.tmp");
/* next, the DOM version */
- testXmlwriterDoc("writer3.res");
+ testXmlwriterDoc("writer3.tmp");
/* next, the tree version */
- testXmlwriterTree("writer4.res");
+ testXmlwriterTree("writer4.tmp");
/*
* Cleanup function for the XML library.
diff --git a/doc/examples/tree1.c b/doc/examples/tree1.c
index 8644cf1..e6faefc 100644
--- a/doc/examples/tree1.c
+++ b/doc/examples/tree1.c
@@ -5,7 +5,7 @@
* get the root element, then walk the document and print
* all the element name in document order.
* usage: tree1 filename_or_URL
- * test: tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp
+ * test: tree1 test2.xml > tree1.tmp && diff tree1.tmp $(srcdir)/tree1.res
* author: Dodji Seketeli
* copy: see Copyright for the status of this software.
*/
diff --git a/doc/examples/tree2.c b/doc/examples/tree2.c
index c40fc55..1cd1abe 100644
--- a/doc/examples/tree2.c
+++ b/doc/examples/tree2.c
@@ -3,7 +3,7 @@
* synopsis: Creates a tree
* purpose: Shows how to create document, nodes and dump it to stdout or file.
* usage: tree2 <filename> -Default output: stdout
- * test: tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp
+ * test: tree2 > tree2.tmp && diff tree2.tmp $(srcdir)/tree2.res
* author: Lucas Brasilino <[email protected]>
* copy: see Copyright for the status of this software
*/
diff --git a/doc/examples/xpath1.c b/doc/examples/xpath1.c
index f2f7406..0a31650 100644
--- a/doc/examples/xpath1.c
+++ b/doc/examples/xpath1.c
@@ -4,7 +4,7 @@
* purpose: Shows how to evaluate XPath expression and register
* known namespaces in XPath context.
* usage: xpath1 <xml-file> <xpath-expr> [<known-ns-list>]
- * test: ./xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp
+ * test: xpath1 test3.xml '//child2' > xpath1.tmp && diff xpath1.tmp $(srcdir)/xpath1.res
* author: Aleksey Sanin
* copy: see Copyright for the status of this software.
*/
diff --git a/doc/examples/xpath2.c b/doc/examples/xpath2.c
index 6ff4008..f604114 100644
--- a/doc/examples/xpath2.c
+++ b/doc/examples/xpath2.c
@@ -4,7 +4,7 @@
* said elements and save the resulting document.
* purpose: Shows how to make a full round-trip from a load/edit/save
* usage: xpath2 <xml-file> <xpath-expr> <new-value>
- * test: xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp
+ * test: xpath2 test3.xml '//discarded' discarded > xpath2.tmp && diff xpath2.tmp $(srcdir)/xpath2.res
* author: Aleksey Sanin and Daniel Veillard
* copy: see Copyright for the status of this software.
*/
diff --git a/Makefile.am b/Makefile.am
index c5e34ea..dcac0f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,7 +6,9 @@ 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)
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
+
+AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
testThreads testC14N testAutomata testRegexp \
diff --git a/acinclude.m4 b/acinclude.m4
index 4ff672e..7ad8630 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2,8 +2,8 @@ dnl Like AC_TRY_EVAL but also errors out if the compiler generates
dnl _any_ output. Some compilers might issue warnings which we want
dnl to catch.
AC_DEFUN([AC_TRY_EVAL2],
-[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl
-(eval [$]$1) 2>&AC_FD_CC; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
+[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AS_MESSAGE_LOG_FD; dnl
+(eval [$]$1) 2>&AS_MESSAGE_LOG_FD; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL
AC_DEFUN([AC_TRY_COMPILE2],
@@ -19,8 +19,8 @@ if AC_TRY_EVAL2(ac_compile); then
ifelse([$3], , :, [rm -rf conftest*
$3])
else
- echo "configure: failed program was:" >&AC_FD_CC
- cat conftest.$ac_ext >&AC_FD_CC
+ echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
ifelse([$4], , , [ rm -rf conftest*
$4
])dnl
diff --git a/autogen.sh b/autogen.sh
index a8c8e0c..8b47ea5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -65,7 +65,7 @@ if [ ! -d $srcdir/m4 ]; then
fi
# Replaced by autoreconf below
-autoreconf -if
+autoreconf -if -Wall
cd $THEDIR
diff --git a/configure.in b/configure.in
index 321b1f2..3ff8a3e 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,8 @@
dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.59)
-AC_INIT(entities.c)
-AM_CONFIG_HEADER(config.h)
+AC_PREREQ([2.68])
+AC_INIT
+AC_CONFIG_SRCDIR([entities.c])
+AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
@@ -116,11 +117,11 @@ AC_ARG_WITH(history,
AC_ARG_WITH(html,
[ --with-html add the HTML support (on)])
dnl Specific dir for HTML output ?
-AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
+AC_ARG_WITH(html-dir, AS_HELP_STRING([--with-html-dir=path],
[path to base html directory, default $datadir/doc/html]),
[HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
-AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
+AC_ARG_WITH(html-subdir, AS_HELP_STRING([--with-html-subdir=path],
[directory used under html-dir, default $PACKAGE-$VERSION/html]),
[test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
[HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
@@ -523,8 +524,8 @@ AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */
dnl Checking for va_copy availability
AC_MSG_CHECKING([for va_copy])
-AC_TRY_LINK([#include <stdarg.h>
-va_list ap1,ap2;], [va_copy(ap1,ap2);],
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
+va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])],
have_va_copy=yes,
have_va_copy=no)
AC_MSG_RESULT($have_va_copy)
@@ -532,8 +533,8 @@ if test x"$have_va_copy" = x"yes"; then
AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
else
AC_MSG_CHECKING([for __va_copy])
- AC_TRY_LINK([#include <stdarg.h>
- va_list ap1,ap2;], [__va_copy(ap1,ap2);],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
+ va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],
have___va_copy=yes,
have___va_copy=no)
AC_MSG_RESULT($have___va_copy)
@@ -584,13 +585,13 @@ then
fi
if test $enable_ipv6 = yes; then
have_ipv6=no
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <sys/socket.h>
- ], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+# include <sys/types.h>
+# include <sys/socket.h>
+ ]], [[
struct sockaddr_storage ss;
socket(AF_INET6, SOCK_STREAM, 0)
- ],
+ ]])],
have_ipv6=yes,
have_ipv6=no
)
@@ -608,26 +609,26 @@ if test $enable_ipv6 = yes; then
dnl present.
dnl ********************************************************************
AC_MSG_CHECKING([struct sockaddr::ss_family])
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <sys/socket.h>
- ], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+# include <sys/types.h>
+# include <sys/socket.h>
+ ]], [[
struct sockaddr_storage ss ;
ss.ss_family = 0 ;
- ],
+ ]])],
have_ss_family=yes,
have_ss_family=no
)
AC_MSG_RESULT($have_ss_family)
if test x$have_ss_family = xno ; then
AC_MSG_CHECKING([broken struct sockaddr::ss_family])
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <sys/socket.h>
- ], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+# include <sys/types.h>
+# include <sys/socket.h>
+ ]], [[
struct sockaddr_storage ss ;
ss.__ss_family = 0 ;
- ],
+ ]])],
have_broken_ss_family=yes,
have_broken_ss_family=no
)
@@ -1311,10 +1312,10 @@ else
AC_CHECK_HEADER(iconv.h,
AC_MSG_CHECKING(for iconv)
- AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],[
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+#include <iconv.h>]],[[
iconv_t cd = iconv_open ("","");
-iconv (cd, NULL, NULL, NULL, NULL);],[
+iconv (cd, NULL, NULL, NULL, NULL);]])],[
AC_MSG_RESULT(yes)
WITH_ICONV=1],[
AC_MSG_RESULT(no)
@@ -1325,10 +1326,10 @@ iconv (cd, NULL, NULL, NULL, NULL);],[
LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
LIBS="${LIBS} -liconv"
- AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],[
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+#include <iconv.h>]],[[
iconv_t cd = iconv_open ("","");
-iconv (cd, NULL, NULL, NULL, NULL);],[
+iconv (cd, NULL, NULL, NULL, NULL);]])],[
AC_MSG_RESULT(yes)
WITH_ICONV=1
ICONV_LIBS="${ICONV_LIBS} -liconv"
@@ -1341,7 +1342,7 @@ iconv (cd, NULL, NULL, NULL, NULL);],[
if test "$WITH_ICONV" = "1" ; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(xml_cv_iconv_arg2, [
- AC_TRY_COMPILE([#include <stdlib.h>
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
@@ -1352,7 +1353,7 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si
#else
size_t iconv();
#endif
-], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
+]], [])], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
AC_MSG_RESULT([${xml_xxx:-
@@ -1564,7 +1565,8 @@ rm -f COPYING.LIB 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)
+AC_CONFIG_FILES([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])
+AC_OUTPUT
chmod +x xml2-config python/setup.py
echo Done configuring
diff --git a/example/Makefile.am b/example/Makefile.am
index f8a137b..488ee6e 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -1,10 +1,7 @@
noinst_PROGRAMS = gjobread
-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)
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include
+AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS)
+LDADD = $(RDL_LIBS) $(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)
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml