./configure:
* don't fail if makeinfo is outdated or missing
* don't emit a make target for the Texinfo manual if makeinfo
  is outdated or missing
* emit a notice if the Texinfo manual cannot be built due to
  missing or outdated makeinfo
* don't ignore missing or outdated makeinfo when the manual's
  info output (doc/groff.info) exists and is up-to-date
---
The previous version of the patch didn't emit a warning if the Texinfo
manual already existed and was up to date. This matched the original
behavior, which didn't error out under such conditions either.

This behavior was likely a workaround for the requirement of having
working makeinfo to compile groff. I removed it as it's no longer
needed and only reduces the code's clarity.

I also rewrote the commit message to be in line with the established
style.

 configure.ac |  3 +++
 doc/doc.am   |  5 +++++
 m4/groff.m4  | 30 +++++++++++++++++++++---------
 3 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index c30dd9a39..ac37d08eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,6 +196,7 @@ AM_CONDITIONAL([USE_GROFF_ALLOCATOR],
 AM_CONDITIONAL([HAVE_GHOSTSCRIPT], [test "$GHOSTSCRIPT" != no \
                 && test "$GHOSTSCRIPT" != missing])
 AM_CONDITIONAL([HAVE_URW_FONTS], [test "$groff_have_urw_fonts" = yes ])
+AM_CONDITIONAL([HAVE_MAKEINFO], [test "$groff_have_makeinfo" = yes ])
 AM_CONDITIONAL([HAVE_TEXI2DVI], [test "$groff_have_texi2dvi" = yes ])
 AM_CONDITIONAL([USE_TEX], [test "$groff_use_tex" = yes ])
 
@@ -243,6 +244,7 @@ then
 fi
 echo "\
  preconv can use uchardet library : $groff_have_uchardet
+ can build texinfo manual         : $groff_have_makeinfo
  can build groff.dvi, groff.pdf   : $groff_use_tex
 ----------------------------------------------------------------------"
 
@@ -252,4 +254,5 @@ GROFF_GHOSTSCRIPT_VERSION_NOTICE
 GROFF_URW_FONTS_NOTICE
 GROFF_UCHARDET_NOTICE
 GROFF_GROHTML_PROGRAM_NOTICE
+GROFF_MAKEINFO_PROGRAM_NOTICE
 GROFF_GROPDF_PROGRAM_NOTICE
diff --git a/doc/doc.am b/doc/doc.am
index 49da8f26a..bb586f3e1 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -542,6 +542,9 @@ endif
 #info_TEXINFOS = doc/groff.texi
 #doc_groff_TEXINFOS = doc/fdl.texi
 
+# Do not generate the manual if 'makeinfo' is not functional.
+if HAVE_MAKEINFO
+
 if USE_TEX
 GROFF_DVI = doc/groff.dvi
 GROFF_PDF = doc/groff.pdf
@@ -744,6 +747,8 @@ uninstall-html:
 uninstall-txt:
        $(RM) $(DESTDIR)$(docdir)/groff.txt
 
+endif # HAVE_MAKEINFO
+
 # An image of a gnu in enscapsulated PostScript is generated during the
 # build process if necessary.  Our configure script assumes pnmdepth is
 # available if xpmtoppm is (see macro "GROFF_PROG_XPMTOPPM").
diff --git a/m4/groff.m4 b/m4/groff.m4
index 164c5065a..ab477e8ad 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -164,21 +164,16 @@ AC_DEFUN([GROFF_PROG_MAKEINFO], [
       expr ${makeinfo_version_major}000 + $makeinfo_version_minor`
     if test $makeinfo_version_numeric -lt 5000
     then
-      missing="'makeinfo' is too old."
+      missing="'makeinfo' is too old; version 5.0 or newer needed"
       MAKEINFO=
     fi
   fi
 
+  groff_have_makeinfo=yes
   if test -n "$missing"
   then
-    infofile=doc/groff.info
-    test -f $infofile || infofile="$srcdir"/$infofile
-    if test ! -f $infofile \
-     || test "$srcdir"/doc/groff.texi -nt $infofile
-    then
-      AC_MSG_ERROR($missing
-[Get the 'texinfo' package version 5.0 or newer.])
-    fi
+    groff_have_makeinfo=no
+    AC_MSG_WARN($missing)
   fi
   AC_SUBST([MAKEINFO])
 ])
@@ -290,6 +285,23 @@ AC_DEFUN([GROFF_GROPDF_DEPENDENCIES_CHECK], [
   AC_SUBST([use_gropdf])
 ])
 
+AC_DEFUN([GROFF_MAKEINFO_PROGRAM_NOTICE], [
+  AC_REQUIRE([GROFF_PROG_MAKEINFO])
+
+  if test "$groff_have_makeinfo" = no
+  then
+    AC_MSG_NOTICE([texinfo documentation will not be generated.
+
+  Because 'makeinfo' is either outdated or missing, the Texinfo manual
+  will not be generated in any of its output formats (texinfo, html,
+  txt, dvi, pdf).
+
+  Get the 'texinfo' package version 5.0 or newer to build the manual.
+])
+  fi
+])
+
+
 AC_DEFUN([GROFF_GROPDF_PROGRAM_NOTICE], [
   AC_REQUIRE([GROFF_GROPDF_DEPENDENCIES_CHECK])
 
-- 
2.47.0


Reply via email to