AC_SUBST([AM_MAKEINFOFLAGS])
fi])
+dnl Texinfo 4.13 generates broken DocBook XML. Probably other old
+dnl versions do too, but that's the one that causes problems.
+AC_DEFUN([PSPP_CHECK_MAKEINFO_DOCBOOK_XML],
+ [AC_REQUIRE([AM_INIT_AUTOMAKE]) # Defines MAKEINFO
+ AC_CACHE_CHECK(
+ [whether makeinfo generates broken DocBook XML],
+ [pspp_cv_broken_docbook_xml],
+ [AS_CASE(
+ [$(eval "$MAKEINFO --version | head -1")],
+ [*texinfo*4.13*], [pspp_cv_broken_docbook_xml=yes],
+ [*texinfo*], [pspp_cv_broken_docbook_xml=no],
+ [*], [pspp_cv_broken_docbook_xml=yes])])
+ AM_CONDITIONAL(
+ [BROKEN_DOCBOOK_XML], [test "$pspp_cv_broken_docbook_xml" = yes])])
+
# The following comes from Open vSwitch:
# ----------------------------------------------------------------------
# Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
PKG_PROG_PKG_CONFIG
m4_pattern_forbid([PKG_CHECK_MODULES])
PSPP_CHECK_CLICKSEQUENCE
+PSPP_CHECK_MAKEINFO_DOCBOOK_XML
PSPP_CHECK_DOT
PSPP_ENABLE_WERROR
[PSPP_REQUIRED_PREREQ([cairo 1.5 or later and pango 1.22 or later (or use --without-cairo)])])
fi
-dnl Xmllint is used in the rules to build the documentation. It is not actually necessary,
-dnl but is used for post-build consistency checks. Thus, non-developers can live without it.
-dnl However for it to be useful, it needs to be a certain version and have certain features.
-dnl The macros below check that it the xmllint available is up to scratch. If it isn't
-dnl then a dummy /bin/echo is subsituted instead.
-
+dnl One of the tests uses xmllint.
AC_CACHE_CHECK([for an xmllint program which fits our needs],[ac_cv_path_XMLLINT],
[AC_PATH_PROGS_FEATURE_CHECK([XMLLINT], [xmllint],
[[$ac_path_XMLLINT --version 2>&1 | $GREP XPath > /dev/null &&
$(AM_V_GEN)echo "@set example-dir $(examplesdir)" > $@
-# The SED and AWK filters in this rule, are to work-around some nasty bugs in
-# makeinfo version 4.13, which produces broken docbook xml. These workarounds
-# are rather horrible and must be removed asap.
$(srcdir)/doc/pspp.xml: doc/pspp.texi $(doc_pspp_TEXINFOS) $(top_srcdir)/doc/help-pages-list
+if BROKEN_DOCBOOK_XML
+ touch $@
+else
@$(MKDIR_P) doc
$(AM_V_GEN)$(MAKEINFO) $(AM_MAKEINFOFLAGS) --docbook -I $(top_srcdir) \
- $(top_srcdir)/doc/pspp.texi -o - \
- | $(SED) -e 's/Time-&-Date/Time-\&-Date/g' \
- -e 's/“/\“/g' \
- -e 's/”/\”/g' \
- -e 's/‘/\‘/g' \
- -e 's/’/\’/g' \
- -e 's/—/\—/g' \
- -e 's/–/\′/g' \
- -e 's/é/\é/g' \
- -e 's/©/\©/g' \
- -e 's/−/\−/g' \
- -e 's/…/\…/g' \
- -e 's/•/\ߦ/g' \
- -e 's/././g' \
- -e 's%\(<figure [^>]*\)>%\1/>%g' \
- | $(AWK) '/<para>.*<table.*>.*<\/para>/{x=sub("</para>",""); print; s=1;next}/<\/table>/{print; if (s==1) print "</para>"; s=0; next}1' \
- > $@,tmp
- $(AM_V_at)$(XMLLINT) --output /dev/null $@,tmp
- $(AM_V_at)cat $(top_srcdir)/doc/help-pages-list | while read node ; do \
- $(XMLLINT) --xpath "$$node" $@,tmp > /dev/null; \
- if test $$? -ne 0 ; then echo "$$node does not appear in $@" ; exit 1; fi ; \
- done
- mv $@,tmp $@
+ $< -o $@
+endif
docbookdir = $(docdir)
dist_docbook_DATA = doc/pspp.xml