gbranden pushed a commit to branch master
in repository groff.

commit 0fefef5281b631380abbfca1add1cb7f2ffd0cd0
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Mar 28 05:10:01 2025 -0500

    m4/groff.m4: Try to measure the real /bin/sh.
    
    * m4/groff.m4 (GROFF_PROG_TEST_SUPPORTS_EF_OPTION): Force Autoconf to
      test "/bin/sh", not a more capable and more POSIX-conforming shell it
      might manage to scare up, because we need to know whether to update
      our script programs' declared shell interpreter.
---
 ChangeLog   |  8 ++++++++
 m4/groff.m4 | 10 +++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 1949813cf..4afbfbd6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-03-28  G. Branden Robinson <[email protected]>
+
+       * m4/groff.m4 (GROFF_PROG_TEST_SUPPORTS_EF_OPTION): Force
+       Autoconf to test "/bin/sh", not a more capable and more
+       POSIX-conforming shell it might manage to scare up, because we
+       need to know whether to update our script programs' declared
+       shell interpreter.
+
 2025-03-28  G. Branden Robinson <[email protected]>
 
        * m4/groff.m4 (GROFF_PROG_SH_IS_POSIX_8_CONFORMING): Add
diff --git a/m4/groff.m4 b/m4/groff.m4
index e62385c89..e3ef9af98 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -1796,11 +1796,19 @@ AC_DEFUN([GROFF_DIFF_D],
 # Check if 'test' supports the option `-ef`.  POSIX Issue 8 (2024)
 # mandates it.  It could be a shell builtin or a separate executable; we
 # don't care as long as it works.
+#
+# We want to truly test /bin/sh here, because that's what our script
+# programs identify as the interpreter unless overridden by
+# POSIX_SHELL_PROG; determination of that depends on _this_ test.
+#
+# Using plain 'sh' leads to false positives because Autoconf is good at
+# locating a capable shell.  But we want to test the rattletrap jalopy
+# that a system might have installed as /bin/sh (hello, Solaris 10).
 
 AC_DEFUN([GROFF_PROG_TEST_SUPPORTS_EF_OPTION],
   [AC_MSG_CHECKING(whether 'test' supports '-ef' option)
   test_ef_works=no
-  sh -c 'test /dev/null -ef /dev/null > /dev/null 2>&1' \
+  /bin/sh -c 'test /dev/null -ef /dev/null > /dev/null 2>&1' \
    && test_ef_works=yes
   AC_MSG_RESULT([$test_ef_works])
 ])

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

Reply via email to