groff-commit
[Top][All Lists]
Advanced

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

[groff] 09/28: [build]: Add print spooler to ./configure report.


From: G. Branden Robinson
Subject: [groff] 09/28: [build]: Add print spooler to ./configure report.
Date: Wed, 25 May 2022 22:43:22 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit faf3bd814f84f1280ae8ced9a54f5f94b0e695b3
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue May 24 08:05:33 2022 -0500

    [build]: Add print spooler to ./configure report.
    
    [build]: Add print spooler determination to configuration report.
    
    * m4/groff.m4 (GROFF_PRINT): Add shell variable `groff_have_spooler` to
      house the name of the print spooler {"lp" or "lpr"} or the word "no".
    * configure.ac: Report determined spooler, or its absence.
    
    Also make code style more readable.
---
 ChangeLog    | 10 ++++++++
 configure.ac |  1 +
 m4/groff.m4  | 80 ++++++++++++++++++++++++++++++++++++------------------------
 3 files changed, 59 insertions(+), 32 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 26349de1..bc067939 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-05-24  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [build]: Add print spooler determination to configuration
+       report.
+
+       * m4/groff.m4 (GROFF_PRINT): Add shell variable
+       `groff_have_spooler` to house the name of the print spooler
+       {"lp" or "lpr"} or the word "no".
+       * configure.ac: Report determined spooler, or its absence.
+
 2022-05-24  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/preproc/preconv/tests/do-not-seek-the-unseekable.sh: Skip
diff --git a/configure.ac b/configure.ac
index 08dbf9cf..570f59db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -225,6 +225,7 @@ else
  X11 app defaults directory       : $appresdir"
 fi
 echo "\
+ 'groff -l' uses print spooler    : $groff_have_spooler
  use URW fonts for PDF output     : $groff_have_urw_fonts
  preconv can use uchardet library : $groff_have_uchardet
  tests can use PDF tools          : $groff_have_pdftools"
diff --git a/m4/groff.m4 b/m4/groff.m4
index c42ca398..e475d49a 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -16,38 +16,54 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_DEFUN([GROFF_PRINT],
-  [if test -z "$PSPRINT"; then
-     AC_CHECK_PROGS([LPR], [lpr])
-     AC_CHECK_PROGS([LP], [lp])
-     if test -n "$LPR" && test -n "$LP"; then
-       # HP-UX provides an lpr command that emulates lpr using lp,
-       # but it doesn't have lpq; in this case we want to use lp
-       # rather than lpr.
-       AC_CHECK_PROGS([LPQ], [lpq])
-       test -n "$LPQ" || LPR=
-     fi
-     if test -n "$LPR"; then
-       PSPRINT="$LPR"
-     elif test -n "$LP"; then
-       PSPRINT="$LP"
-     fi
-   fi
-   AC_SUBST([PSPRINT])
-   AC_MSG_CHECKING([for command to use for printing PostScript files])
-   AC_MSG_RESULT([$PSPRINT])
-
-   # Figure out DVIPRINT from PSPRINT.
-   AC_MSG_CHECKING([for command to use for printing dvi files])
-   if test -n "$PSPRINT" && test -z "$DVIPRINT"; then
-     if test "$PSPRINT" = lpr; then
-       DVIPRINT="lpr -d"
-     else
-       DVIPRINT="$PSPRINT"
-     fi
-   fi
-   AC_SUBST([DVIPRINT])
-   AC_MSG_RESULT([$DVIPRINT])])
+# Locate a print spooler for certain output formats.
+
+AC_DEFUN([GROFF_PRINT], [
+  groff_have_spooler=no
+  if test -z "$PSPRINT"
+  then
+    AC_CHECK_PROGS([LPR], [lpr])
+    AC_CHECK_PROGS([LP], [lp])
+    if test -n "$LPR" && test -n "$LP"
+     then
+      # HP-UX provides an lpr command that emulates lpr using lp,
+      # but it doesn't have lpq; in this case we want to use lp
+      # rather than lpr.
+      AC_CHECK_PROGS([LPQ], [lpq])
+      test -n "$LPQ" || LPR=
+    fi
+    if test -n "$LPR"
+    then
+      PSPRINT="$LPR"
+    elif test -n "$LP"
+    then
+      PSPRINT="$LP"
+    fi
+  fi
+
+  if test -n "$PSPRINT"
+  then
+    groff_have_spooler="$PSPRINT"
+  fi
+
+  AC_SUBST([PSPRINT])
+  AC_MSG_CHECKING([for command to use for spooling PostScript files])
+  AC_MSG_RESULT([$PSPRINT])
+
+  # Figure out DVIPRINT from PSPRINT.
+  AC_MSG_CHECKING([for command to use for spooling DVI files])
+  if test -n "$PSPRINT" && test -z "$DVIPRINT"
+  then
+    if test "$PSPRINT" = lpr
+    then
+      DVIPRINT="lpr -d"
+    else
+      DVIPRINT="$PSPRINT"
+    fi
+  fi
+  AC_SUBST([DVIPRINT])
+  AC_MSG_RESULT([$DVIPRINT])
+])
 
 # Bison-generated parsers have problems with C++ compilers other than
 # g++.  Thus, byacc is preferred over bison.  If no yacc program is



reply via email to

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