groff-commit
[Top][All Lists]
Advanced

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

[groff] 27/30: Support building without makeinfo(1) installed.


From: G. Branden Robinson
Subject: [groff] 27/30: Support building without makeinfo(1) installed.
Date: Sun, 22 Dec 2024 19:39:21 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 819c539061a7c357357aca8f4fb2b3a2023ebf69
Author: onf <onf@disroot.org>
AuthorDate: Mon Nov 25 03:26:15 2024 +0100

    Support building without makeinfo(1) installed.
    
    * m4/groff.m4 (GROFF_PROG_MAKEINFO): Simplify logic to not throw error
      if "groff.info" is older than "groff.texi"; that is now an accepted
      state of affairs during configuration.  (make(1) could fail later,
      though.)  Set new variable `groff_have_makeinfo`.
    
      (GROFF_MAKEINFO_PROGRAM_NOTICE): New macro warns user of the
      consequences of not having (a recent enough) makeinfo(1) installed.
    
    * configure.ac: Set Automake conditional `HAVE_MAKEINFO` if the
      corresponding new shell variable was assigned by
      `GROFF_PROG_MAKEINFO`.  Report in configuration summary whether the
      Info, plain text, and HTML forms of groff's Texinfo manual can be
      generated.  Call `GROFF_MAKEINFO_PROGRAM_NOTICE` macro.
    
    * doc/doc.am: Indirect the file names of the Info, plain text, and HTML
      forms of groff's Texinfo manual through new make(1) macros,
      `GROFF_INFO`, `GROFF_TXT`, and `GROFF_HTML`.  Assign them only if
      `HAVE_MAKEINFO` is true.
    
      (all): Expand the new macros in place of literals.
    
    Fixes <https://savannah.gnu.org/bugs/?66583>.
    
    Co-authored-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
---
 ChangeLog    | 28 ++++++++++++++++++++++++++++
 configure.ac |  5 ++++-
 doc/doc.am   | 11 ++++++++---
 m4/groff.m4  | 32 ++++++++++++++++++++------------
 4 files changed, 60 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 84a4a7570..bca7e9786 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2024-12-22  onf <onf@disroot.org>
+
+       Support building without makeinfo(1) installed.
+
+       * m4/groff.m4 (GROFF_PROG_MAKEINFO): Simplify logic to not throw
+       error if "groff.info" is older than "groff.texi"; that is now an
+       accepted state of affairs during configuration.  (make(1) could
+       fail later, though.)  Set new variable `groff_have_makeinfo`.
+       Stop `AC_MSG_WARN`-ing if it's absent.
+       (GROFF_MAKEINFO_PROGRAM_NOTICE): New macro warns user of the
+       consequences of not having (a recent enough) makeinfo(1)
+       installed.
+       * configure.ac: Set Automake conditional `HAVE_MAKEINFO` if the
+       corresponding new shell variable was assigned by
+       `GROFF_PROG_MAKEINFO`.  Report in configuration summary whether
+       the Info, plain text, and HTML forms of groff's Texinfo manual
+       can be generated.  Call `GROFF_MAKEINFO_PROGRAM_NOTICE` macro.
+       * doc/doc.am: Indirect the file names of the Info, plain text,
+       and HTML forms of groff's Texinfo manual through new make(1)
+       macros, `GROFF_INFO`, `GROFF_TXT`, and `GROFF_HTML`.  Assign
+       them only if `HAVE_MAKEINFO` is true.
+       (all): Expand the new macros in place of literals.
+
+       Fixes <https://savannah.gnu.org/bugs/?66583>.
+
+       Co-authored-by: "G. Branden Robinson"
+       <g.branden.robinson@gmail.com>
+
 2024-12-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/preproc/eqn/neqn.sh: Handle `-h` and `--help` options:
diff --git a/configure.ac b/configure.ac
index 8563dbc84..f9d52a45f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -195,6 +195,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 ])
 
@@ -242,7 +243,8 @@ then
 fi
 echo "\
  preconv can use uchardet library : $groff_have_uchardet
- can build groff.dvi, groff.pdf   : $groff_use_tex
+ can build groff.{info,html,txt}  : $groff_have_makeinfo
+ can build groff.{dvi,pdf}        : $groff_use_tex
 ----------------------------------------------------------------------"
 
 GROFF_APPDEFDIR_NOTICE
@@ -251,4 +253,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 625f9cace..a4f0df6cf 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -542,13 +542,18 @@ endif
 #info_TEXINFOS = doc/groff.texi
 #doc_groff_TEXINFOS = doc/fdl.texi
 
+if HAVE_MAKEINFO
+GROFF_INFO = doc/groff.info
+GROFF_TXT = doc/groff.txt
+GROFF_HTML = doc/groff.html
+endif
+
 if USE_TEX
 GROFF_DVI = doc/groff.dvi
 GROFF_PDF = doc/groff.pdf
-endif
+endif # USE_TEX
 
-all: doc/groff.info doc/groff.txt doc/groff.html \
-       $(GROFF_DVI) $(GROFF_PDF)
+all: $(GROFF_INFO) $(GROFF_TXT) $(GROFF_HTML) $(GROFF_DVI) $(GROFF_PDF)
 
 # Distribute the manual in source form as well.
 EXTRA_DIST += doc/groff.texi.in doc/groff.texi doc/fdl.texi
diff --git a/m4/groff.m4 b/m4/groff.m4
index 1eaeeeac9..aee7c8811 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -164,22 +164,13 @@ 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
 
-  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
-  fi
+  groff_have_makeinfo=yes
+  test -n "$missing" && groff_have_makeinfo=no
   AC_SUBST([MAKEINFO])
 ])
 
@@ -290,6 +281,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([groff's Texinfo manual will not be generated.
+
+  Because 'makeinfo' is either outdated or missing, the Texinfo manual
+  will not be generated in any of its output formats (GNU Info, HTML,
+  plain text, TeX DVI, or 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])
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]