[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 03/12] docs: make xmllint & xsltproc compulsory



We already require libxml to be installed, so it is not unreasonable
to require xmllint and xsltproc to be installed too - any platform
with the former will have the latter too.

Signed-off-by: Daniel P. Berrange <berrange redhat com>
---
 docs/Makefile.am             | 44 +++++++++++++++-----------------------------
 m4/virt-external-programs.m4 | 12 ++++++++++--
 2 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/docs/Makefile.am b/docs/Makefile.am
index f478d9505..d6c9d0091 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -221,17 +221,14 @@ $(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \
 news.html.in: \
 	  $(srcdir)/news.xml \
 	  $(srcdir)/news-html.xsl
-	$(AM_V_GEN) \
-	if [ -x $(XSLTPROC) ]; then \
-	  $(XSLTPROC) --nonet \
+	$(AM_V_GEN)$(XSLTPROC) --nonet \
 	    $(srcdir)/news-html.xsl \
 	    $(srcdir)/news.xml \
 	  >$ -tmp \
 	    || { rm -f $ -tmp; exit 1; }; \
 	  sed 's/ xmlns=""//g' $ -tmp >$@ \
 	    || { rm -f $ -tmp; exit 1; }; \
-	  rm -f $ -tmp; \
-	fi
+	  rm -f $ -tmp
 EXTRA_DIST += \
 	$(srcdir)/news.xml \
 	$(srcdir)/news.rng \
@@ -244,9 +241,7 @@ MAINTAINERCLEANFILES += \
 
 %.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \
 		$(acl_generated)
-	@if [ -x $(XSLTPROC) ] ; then \
-	  echo "Generating $@"; \
-	  name=`echo $@ | sed -e 's/.tmp//'`; \
+	$(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \
 	  dir=`dirname $ ` ; \
 	  if test "$$dir" = "."; \
 	  then \
@@ -257,42 +252,33 @@ MAINTAINERCLEANFILES += \
 	  fi; \
 	  $(XSLTPROC) --stringparam pagename $$name --nonet \
 	    $(top_srcdir)/docs/$$style $< > $@ \
-	    || { rm $@ && exit 1; }; fi
+	    || { rm $@ && exit 1; }
 
 %.html: %.html.tmp
-	@if test -x $(XMLLINT) ; then \
-	  echo "Validating $@" ; \
-	  $(XMLLINT) --nonet --format $< > $(srcdir)/$@ \
-	  || { rm $(srcdir)/$@ && exit 1; }; fi
+	$(AM_V_GEN)$(XMLLINT) --nonet --format $< > $(srcdir)/$@ \
+	  || { rm $(srcdir)/$@ && exit 1; }
 
 %.php.tmp: %.php.in site.xsl page.xsl
-	@if [ -x $(XSLTPROC) ] ; then \
-	  echo "Generating $@"; \
-	  $(XSLTPROC) --stringparam pagename $(@:.tmp=) --nonet \
+	$(AM_V_GEN)$(XSLTPROC) --stringparam pagename $(@:.tmp=) --nonet \
 	    $(top_srcdir)/docs/site.xsl $< > $@ \
-	    || { rm $@ && exit 1; }; fi
+	    || { rm $@ && exit 1; }
 
 %.php: %.php.tmp %.php.code.in
-	@if [ -x $(XSLTPROC) ] ; then \
-	  echo "Scripting $@"; \
-	    sed -e '/<span id="php_placeholder"><\/span>/r '"$(srcdir)/$  code in" \
+	$(AM_V_GEN)sed -e '/<span id="php_placeholder"><\/span>/r '"$(srcdir)/$  code in" \
 	    -e /php_placeholder/d < $  tmp > $(srcdir)/$@ \
-	    || { rm $(srcdir)/$@ && exit 1; }; fi
+	    || { rm $(srcdir)/$@ && exit 1; }
 
 $(apihtml_generated): html/index.html
 
 html/index.html: libvirt-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP)
-	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
-	  $(XSLTPROC) --nonet -o $(srcdir)/ \
+	$(AM_V_GEN)$(XSLTPROC) --nonet -o $(srcdir)/ \
 	  --stringparam builddir '$(abs_top_builddir)' \
-	  $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \
-	if test -x $(XMLLINT) ; then \
-	  $(XMLLINT) --nonet --noout $(srcdir)/html/*.html ; fi
+	  $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml && \
+	  $(XMLLINT) --nonet --noout $(srcdir)/html/*.html
 
 $(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
-	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
-	  $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
-	  $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
+	$(AM_V_GEN)$(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
+	  $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml
 
 
 python_generated_files = \
diff --git a/m4/virt-external-programs.m4 b/m4/virt-external-programs.m4
index 4a10c85ad..ab6149288 100644
--- a/m4/virt-external-programs.m4
+++ b/m4/virt-external-programs.m4
@@ -23,8 +23,16 @@ AC_DEFUN([LIBVIRT_CHECK_EXTERNAL_PROGRAMS], [
   AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"])
 
   dnl Miscellaneous external programs.
-  AC_PATH_PROG([XMLLINT], [xmllint], [/usr/bin/xmllint])
-  AC_PATH_PROG([XSLTPROC], [xsltproc], [/usr/bin/xsltproc])
+  AC_PATH_PROG([XMLLINT], [xmllint], [])
+  if test -z "$XMLLINT"
+  then
+    AC_MSG_ERROR("xmllint is required to build libvirt")
+  fi
+  AC_PATH_PROG([XSLTPROC], [xsltproc], [])
+  if test -z "$XSLTPROC"
+  then
+    AC_MSG_ERROR("xsltproc is required to build libvirt")
+  fi
   AC_PATH_PROG([AUGPARSE], [augparse], [/usr/bin/augparse])
   AC_PROG_MKDIR_P
   AC_PROG_LN_S
-- 
2.13.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]