From af409c5cddb1bfdbc6a7f1db16a8d7c793d791ca Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 2 Jan 2019 09:20:51 -0800 Subject: [PATCH] configure: Entirely avoid broken Texinfo. 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 . --- acinclude.m4 | 15 +++++++++++++++ configure.ac | 8 ++------ doc/automake.mk | 31 +++++-------------------------- 3 files changed, 22 insertions(+), 32 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index e6c1adbf3d..42e9ac8910 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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. diff --git a/configure.ac b/configure.ac index cc0cfff67e..78853a84d8 100644 --- a/configure.ac +++ b/configure.ac @@ -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 && diff --git a/doc/automake.mk b/doc/automake.mk index c571a236d2..7e3c5d4937 100644 --- a/doc/automake.mk +++ b/doc/automake.mk @@ -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-\&-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%\(
]*\)>%\1/>%g' \ - | $(AWK) '/.*.*<\/para>/{x=sub("",""); print; s=1;next}/<\/table>/{print; if (s==1) print ""; 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 -- 2.30.2