From 4584eaea927c182ba403420701944022a222a29b Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 17 Jun 2015 22:52:24 +0200 Subject: build-sys: make SOURCE_XML_FILES array relative to $(top_srcdir) When calling the build commands from another directory than the toplevel: mkdir build cd build ../configure [...] ... the compilation fails with the following error: GEN man/systemd.directives.xml Traceback (most recent call last): File "../tools/make-directive-index.py", line 313, in make_page _extract_directives(directive_groups, formatting, page) File "../tools/make-directive-index.py", line 191, in _extract_directives t = xml_parse(page) File "/home/martin/upstream/systemd/tools/xml_helper.py", line 30, in xml_parse doc = tree.parse(page, _parser) File "lxml.etree.pyx", line 3301, in lxml.etree.parse (src/lxml/lxml.etree.c:72453) File "parser.pxi", line 1791, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:105915) File "parser.pxi", line 1817, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:106214) File "parser.pxi", line 1721, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:105213) File "parser.pxi", line 1122, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:100163) File "parser.pxi", line 580, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:94286) File "parser.pxi", line 690, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:95722) File "parser.pxi", line 618, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:94754) OSError: Error reading file 'man/bootup.xml': failed to load external entity "man/bootup.xml" That is because the file names in the XML_FILES array are not relative to $(top_srcdir), and hence ../tools/make-directive-index.py is called with non-existant arguments. To fix this, call patsubst when generating SOURCE_XML_FILES from NON_INDEX_XML_FILES. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 7dc57b18da..ba7f79b9c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -702,7 +702,7 @@ CLEANFILES += \ XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml) NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES)) -SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES)) +SOURCE_XML_FILES = ${patsubst %,$(top_srcdir)/%,$(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))} update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB) $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp -- cgit v1.2.3-54-g00ecf From 65d21ff344cb7013447e14cdcd83cf43b72fd6f8 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 18 Jun 2015 08:42:15 +0200 Subject: build-sys: don't dist man/systemd.directives.xml It depends on man/custom-entities.ent which is (and needs to be) a built file, so we need to always build man/systemd.directives.xml as well. We also need to drop this from update-man-list so that it doesn't get disted from Makefile-man.am. Fixes distcheck failure. https://github.com/systemd/systemd/issues/215 --- Makefile-man.am | 2 -- Makefile.am | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile-man.am b/Makefile-man.am index 7d31800345..76c9389835 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -2142,10 +2142,8 @@ EXTRA_DIST += \ man/systemd-vconsole-setup.service.xml \ man/systemd.automount.xml \ man/systemd.device.xml \ - man/systemd.directives.xml \ man/systemd.exec.xml \ man/systemd.generator.xml \ - man/systemd.index.xml \ man/systemd.journal-fields.xml \ man/systemd.kill.xml \ man/systemd.link.xml \ diff --git a/Makefile.am b/Makefile.am index ba7f79b9c6..532d5eeb86 100644 --- a/Makefile.am +++ b/Makefile.am @@ -700,11 +700,10 @@ noinst_DATA += \ CLEANFILES += \ man/index.html -XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml) NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES)) SOURCE_XML_FILES = ${patsubst %,$(top_srcdir)/%,$(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))} -update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB) +update-man-list: $(top_srcdir)/tools/make-man-rules.py $(SOURCE_XML_FILES) $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am @echo "Makefile-man.am has been regenerated" @@ -726,7 +725,7 @@ endif endif EXTRA_DIST += \ - $(XML_FILES) \ + $(filter-out man/systemd.directives.xml,$(XML_FILES)) \ $(HTML_FILES) \ $(HTML_ALIAS) \ $(man_MANS) \ @@ -735,7 +734,6 @@ EXTRA_DIST += \ tools/xml_helper.py \ man/systemd.index.xml \ man/index.html \ - man/systemd.directives.xml \ man/glib-event-glue.c \ $(NULL) -- cgit v1.2.3-54-g00ecf