summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-18 11:55:02 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-18 12:40:04 -0600
commit8316578166a73de1db05c555e640e9153ddc8d5d (patch)
treeccd5920c6daaed75be0fee03ad89b7474bfe4336 /m4
parentec001d2a23a3b1740e8d004006c0fc0d7fb6e288 (diff)
downloadgroff-git-8316578166a73de1db05c555e640e9153ddc8d5d.tar.gz
[build]: Detangle pdfroff, gropdf config (2/2).
* m4/groff.m4: Give pdfroff its own Autoconf macros to handle dependency checking, build objectives, and user notice. (GROFF_PDFROFF_DEPENDENCIES_CHECK): New macro requires `GROFF_AWK_PATH` and `GROFF_GHOSTSCRIPT_PATH`, determines whether pdfroff can be used at build time, and (if not) constructs part of message to be shown to user explaining why. (GROFF_PDFROFF_PROGRAM_NOTICE): New macro requires `GROFF_PDFROFF_DEPENDENCIES_CHECK` and emits message if needed. (GROFF_GHOSTSCRIPT_AVAILABILITY_NOTICE): Drop mention of impact on pdfroff since its dedicated notice covers this now. * configure.ac: Call the new macros at appropriate times. Produce a new Automake macro, `USE_PDFROFF`, to replace inapposite use of `USE_GROPDF` in pdfmark.am. * contrib/pdfmark/pdfmark.am: Use `USE_PDFROFF` instead of `USE_GROPDF`.
Diffstat (limited to 'm4')
-rw-r--r--m4/groff.m444
1 files changed, 42 insertions, 2 deletions
diff --git a/m4/groff.m4 b/m4/groff.m4
index a99691e41..fcc676f64 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -259,6 +259,35 @@ AC_DEFUN([GROFF_AWK_NOTICE], [
fi
])
+AC_DEFUN([GROFF_PDFROFF_DEPENDENCIES_CHECK], [
+ AC_REQUIRE([GROFF_AWK_PATH])
+ AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
+
+ use_pdfroff=no
+ pdfroff_missing_deps=
+
+ test "$AWK" = missing && pdfroff_missing_deps="awk"
+
+ if test "$GHOSTSCRIPT" = missing
+ then
+ verb=is
+
+ if test -n "$pdfroff_missing_deps"
+ then
+ pdfroff_missing_deps="$pdfroff_missing_deps and "
+ verb=are
+ fi
+ pdfroff_missing_deps="${pdfroff_missing_deps}Ghostscript $verb"
+ fi
+
+ if test -z "$pdfroff_missing_deps"
+ then
+ use_pdfroff=yes
+ fi
+
+ AC_SUBST([use_pdfroff])
+])
+
AC_DEFUN([GROFF_GROPDF_DEPENDENCIES_CHECK], [
AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
AC_REQUIRE([GROFF_URW_FONTS_CHECK])
@@ -275,6 +304,19 @@ AC_DEFUN([GROFF_GROPDF_DEPENDENCIES_CHECK], [
AC_SUBST([use_gropdf])
])
+AC_DEFUN([GROFF_PDFROFF_PROGRAM_NOTICE], [
+ AC_REQUIRE([GROFF_PDFROFF_DEPENDENCIES_CHECK])
+
+ if test "$use_pdfroff" = no
+ then
+ AC_MSG_NOTICE(['pdfroff' will not be functional.
+
+ Because $pdfroff_missing_deps missing, 'pdfroff' will not operate
+ and the 'pdfmark.pdf' document will not be available.
+])
+ fi
+])
+
AC_DEFUN([GROFF_GROPDF_PROGRAM_NOTICE], [
AC_REQUIRE([GROFF_GROPDF_DEPENDENCIES_CHECK])
@@ -487,8 +529,6 @@ AC_DEFUN([GROFF_GHOSTSCRIPT_AVAILABILITY_NOTICE], [
'grohtml' will have reduced function, being unable to produce
documents using the 'tbl' preprocessor.
-
- Further, 'pdroff' will not work.
])
fi
])