groff-commit
[Top][All Lists]
Advanced

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

[groff] 19/47: [build]: Use pnmtops's -quiet option if possible.


From: G. Branden Robinson
Subject: [groff] 19/47: [build]: Use pnmtops's -quiet option if possible.
Date: Tue, 11 Jan 2022 06:33:16 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 9b9ff77b9ecf7701e33f5f6fe669d3fb89144c02
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Jan 8 23:53:01 2022 +1100

    [build]: Use pnmtops's -quiet option if possible.
    
    ...to quieten build.
    
    * m4/groff.m4 (GROFF_PNMTOOLS_CAN_BE_QUIET): Add new macro to test
      pnmtops for support for (undocumented) '-quiet' option.
    
    * configure.ac: Perform the check.
    
    * doc/doc.am: Alter check of shell variable `pnmtops_nosetpage`
      (processed by AC_SUBST) to correctly match even if pnmtops accepts the
      '-quiet' option.
---
 ChangeLog    | 14 ++++++++++++++
 configure.ac |  1 +
 doc/doc.am   |  2 +-
 m4/groff.m4  | 25 +++++++++++++++++++++----
 4 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 07a80ee0..ab9b6fe3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2022-01-08  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [build]: Use pnmtops(1)'s -quiet option if possible, to quieten
+       build.
+
+       * m4/groff.m4 (GROFF_PNMTOOLS_CAN_BE_QUIET): Add new macro to
+       test pnmtops for support for (undocumented) '-quiet' option.
+
+       * configure.ac: Perform the check.
+
+       * doc/doc.am: Alter check of shell variable `pnmtops_nosetpage`
+       {processed by AC_SUBST} to correctly match even if pnmtops
+       accepts the '-quiet' option.
+
 2022-01-06  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [tmac]: Manage hyphenation mode more carefully in localization
diff --git a/configure.ac b/configure.ac
index 84a15fad..e205fca7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -165,6 +165,7 @@ GROFF_WITH_COMPATIBILITY_WRAPPERS
 GROFF_TARGET_PATH_SEPARATOR
 GROFF_HTML_PROGRAMS
 GROFF_PDFDOC_PROGRAMS
+GROFF_PNMTOOLS_CAN_BE_QUIET
 GROFF_PNMTOPS_NOSETPAGE
 GROFF_MAKE_RM
 GROFF_DIFF_D
diff --git a/doc/doc.am b/doc/doc.am
index 84d29f32..83c15812 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -525,7 +525,7 @@ gnu.eps:
            echo "program pnmtops is missing; can't generate $@" >&2;\
            exit 1; \
          fi; \
-         if test "$(pnmtops_nosetpage)" != "pnmtops -nosetpage"; then \
+         if ! echo "$(pnmtops_nosetpage)" | grep -q nosetpage; then \
            echo "program pnmtops can't handle -nosetpage option;" \
              "can't generate $@" >&2;\
            exit 1; \
diff --git a/m4/groff.m4 b/m4/groff.m4
index 45f1d23e..35c35852 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -419,16 +419,33 @@ AC_DEFUN([GROFF_URW_FONTS_CHECK],
   ])
 
 
+# Check whether the pnm tools accept the -quiet option.
+
+AC_DEFUN([GROFF_PNMTOOLS_CAN_BE_QUIET],
+  [AC_MSG_CHECKING([whether PNM tools accept the -quiet option])
+   if echo P2 2 2 255 0 1 2 0 | pnmtops -quiet > /dev/null 2>&1
+   then
+     AC_MSG_RESULT([yes])
+     pnmtools_quiet=-quiet
+   else
+     AC_MSG_RESULT([no])
+     pnmtools_quiet=
+   fi
+   AC_SUBST([pnmtools_quiet])])
+
+
 # Check whether pnmtops can handle the -nosetpage option.
 
 AC_DEFUN([GROFF_PNMTOPS_NOSETPAGE],
-  [AC_MSG_CHECKING([whether pnmtops can handle the -nosetpage option])
-   if echo P2 2 2 255 0 1 2 0 | pnmtops -nosetpage > /dev/null 2>&1 ; then
+  [AC_REQUIRE([GROFF_PNMTOOLS_CAN_BE_QUIET])
+   AC_MSG_CHECKING([whether pnmtops accepts the -nosetpage option])
+   if echo P2 2 2 255 0 1 2 0 | pnmtops -nosetpage > /dev/null 2>&1
+   then
      AC_MSG_RESULT([yes])
-     pnmtops_nosetpage="pnmtops -nosetpage"
+     pnmtops_nosetpage="pnmtops $pnmtools_quiet -nosetpage"
    else
      AC_MSG_RESULT([no])
-     pnmtops_nosetpage="pnmtops"
+     pnmtops_nosetpage="pnmtops $pnmtools_quiet"
    fi
    AC_SUBST([pnmtops_nosetpage])])
 



reply via email to

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