gbranden pushed a commit to branch master
in repository groff.

commit 142b8d93fc2e325d0f22aca5b683292304105002
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Oct 8 06:06:19 2026 -0500

    m4/groff.m4 (GROFF_G): Rewrite test.
    
    ...to rebalance its sensitivity vs. validity.
    
    * m4/groff.m4 (GROFF_G): The test _was_ deciding that a build system's
      installed `troff` was not GNU troff if, when given some *roff syntax
      as input, it wrote `0` to its standard output.  This means that a
      `troff` that produced no output or interpolated `2` as the value of
      the `.g` register would pass the test and make our configuration
      process decide that a non-groff troff was _not_ installed.  Flip the
      sense of the test and check the `troff` command's output for an exact
      match of `1`--that means the `troff` claims GNU troff compatibility.
---
 ChangeLog   | 13 +++++++++++++
 m4/groff.m4 | 15 +++++++++------
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 421e7e29c..0c26571e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2026-10-08  G. Branden Robinson <[email protected]>
+
+       * m4/groff.m4 (GROFF_G): Revise test to rebalance its
+       sensitivity vs. validity.  The test _was_ deciding that a build
+       system's installed `troff` was not GNU troff if, when given some
+       *roff syntax as input, it wrote `0` to its standard output.
+       This means that a `troff` that produced no output or
+       interpolated `2` as the value of the `.g` register would pass
+       the test and make our configuration process decide that a
+       non-groff troff was _not_ installed.  Flip the sense of the test
+       and check the `troff` command's output for an exact match of
+       `1`--that means the `troff` claims GNU troff compatibility.
+
 2026-10-08  G. Branden Robinson <[email protected]>
 
        * tmac/tmac.am ($(M4CHECK)): Revise recipe to work with what
diff --git a/m4/groff.m4 b/m4/groff.m4
index 07a9871e0..e4b952c97 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -1057,18 +1057,21 @@ AC_DEFUN([GROFF_TMAC],
 ])
 
 
-# Searching if a non-GNU Troff is installed.  The built-in register
-# \n[.g] is always 1 in GNU Troff.
+# Check the build environment for a `troff` executable that defines a
+# built-in register `.g`.  It always interpolates `1` in GNU troff.
+# If the build environment's troff does not thus advertise GNU troff
+# compatibility, assume that parallel installation of GNU troff
+# alongside the system's is desired.
 AC_DEFUN([GROFF_G], [
   g=
-  AC_MSG_CHECKING([for existing troff installation])
+  AC_MSG_CHECKING([for an installed groff-incompatible troff])
   if test "`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>&1) \
-    2>/dev/null`" = 0
+    2>/dev/null`" = 1
   then
+    AC_MSG_RESULT([no])
+  else
     AC_MSG_RESULT([yes])
     g=g
-  else
-    AC_MSG_RESULT([no])
   fi
   AC_SUBST([g])
 ])

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to