configure: Entirely avoid broken Texinfo.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 2 Jan 2019 17:20:51 +0000 (09:20 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 2 Jan 2019 17:21:38 +0000 (09:21 -0800)
Texinfo 4.13 was still causing problems on SuSE despite the implemented
workarounds, so this commit removes the workaround in favor of just using
the distributed pspp.xml if makeinfo is broken.

Requested by opensuse.lietuviu.kalba <opensuse.lietuviu.kalba@gmail.com>.

acinclude.m4
configure.ac
doc/automake.mk

index e6c1adbf3d0c92302dc833549c0e27ff5d4c543b..42e9ac891069240dc334a4dc6d10264ece56c155 100644 (file)
@@ -281,6 +281,21 @@ EOF
        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.
index cc0cfff67eb02e6acfb32e10dc21f560e01b2f6b..78853a84d8522bebb57bc76c0eb77234a82b8fec 100644 (file)
@@ -36,6 +36,7 @@ AC_HEADER_TIOCGWINSZ
 PKG_PROG_PKG_CONFIG
 m4_pattern_forbid([PKG_CHECK_MODULES])
 PSPP_CHECK_CLICKSEQUENCE
+PSPP_CHECK_MAKEINFO_DOCBOOK_XML
 PSPP_CHECK_DOT
 
 PSPP_ENABLE_WERROR
@@ -81,12 +82,7 @@ if test "$with_cairo" != no; then
     [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 && 
index c571a236d2fc240d8bd841a2ade937ae2791158d..7e3c5d49372d9974da9b87b075e1f887547889ee 100644 (file)
@@ -59,35 +59,14 @@ $(srcdir)/doc/tut.texi:
        $(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-\&amp;-Date/g' \
-               -e 's/&ldquo;/\&#8220;/g' \
-               -e 's/&rdquo;/\&#8221;/g' \
-               -e 's/&lsquo;/\&#8216;/g' \
-               -e 's/&rsquo;/\&#8217;/g' \
-               -e 's/&mdash;/\&#8212;/g' \
-               -e 's/&ndash;/\&#8242;/g' \
-                -e 's/&eacute;/\&#0233;/g' \
-               -e 's/&copy;/\&#0169;/g' \
-               -e 's/&minus;/\&#8722;/g' \
-               -e 's/&hellip;/\&#8230;/g' \
-               -e 's/&bull;/\&#2022;/g' \
-               -e 's/&period;/./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