diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-05-24 08:05:33 -0500 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-05-24 08:05:33 -0500 |
commit | faf3bd814f84f1280ae8ced9a54f5f94b0e695b3 (patch) | |
tree | 8441522d99866e10ffd899de412fa30ae0d20bc9 /m4 | |
parent | 35cf164afc718b1f7211da131a2668af656f3a5b (diff) | |
download | groff-git-faf3bd814f84f1280ae8ced9a54f5f94b0e695b3.tar.gz |
[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.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/groff.m4 | 80 |
1 files changed, 48 insertions, 32 deletions
diff --git a/m4/groff.m4 b/m4/groff.m4 index c42ca398e..e475d49af 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 |