groff-commit
[Top][All Lists]
Advanced

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

[groff] 06/09: [build]: Detangle pdfroff, gropdf config (2/2).


From: G. Branden Robinson
Subject: [groff] 06/09: [build]: Detangle pdfroff, gropdf config (2/2).
Date: Sat, 18 Feb 2023 18:00:43 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 8316578166a73de1db05c555e640e9153ddc8d5d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Feb 18 11:55:02 2023 -0600

    [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`.
---
 ChangeLog                  | 20 ++++++++++++++++++++
 configure.ac               |  5 ++++-
 contrib/pdfmark/pdfmark.am |  4 ++--
 m4/groff.m4                | 44 ++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 68 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f32bfc9cf..e7f9cd342 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2023-02-18  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [build]: Detangle "pdfroff" and "gropdf" configuration (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`.
+
 2023-02-18  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [build]: Detangle "pdfroff" and "gropdf" configuration (1/2).
diff --git a/configure.ac b/configure.ac
index 24082e5c9..b4e992162 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 # Autoconf configuration file for groff.
-# Copyright (C) 1989-2020 Free Software Foundation, Inc.
+# Copyright (C) 1989-2023 Free Software Foundation, Inc.
 #
 # This file is part of groff.
 #
@@ -167,6 +167,7 @@ GROFF_TMAC
 GROFF_WITH_COMPATIBILITY_WRAPPERS
 GROFF_TARGET_PATH_SEPARATOR
 GROFF_CHECK_GROHTML_PROGRAMS
+GROFF_PDFROFF_DEPENDENCIES_CHECK
 GROFF_GROPDF_DEPENDENCIES_CHECK
 GROFF_PNMTOOLS_CAN_BE_QUIET
 GROFF_PNMTOPS_NOSETPAGE
@@ -201,6 +202,7 @@ AM_CONDITIONAL([MAKE_DEFINES_RM], [test 
"$groff_make_defines_rm" = yes])
 AM_CONDITIONAL([USEPROGRAMPREFIX], [test "$g" = g])
 
 AM_CONDITIONAL([USE_GROHTML], [test "$use_grohtml" = yes])
+AM_CONDITIONAL([USE_PDFROFF], [test "$use_pdfroff" = yes])
 AM_CONDITIONAL([USE_GROPDF], [test "$use_gropdf" = yes])
 AM_CONDITIONAL([USE_GROFF_ALLOCATOR],
                [test "$groff_use_own_allocator" = yes])
@@ -264,4 +266,5 @@ GROFF_GHOSTSCRIPT_VERSION_NOTICE
 GROFF_URW_FONTS_NOTICE
 GROFF_UCHARDET_NOTICE
 GROFF_GROHTML_PROGRAM_NOTICE
+GROFF_PDFROFF_PROGRAM_NOTICE
 GROFF_GROPDF_PROGRAM_NOTICE
diff --git a/contrib/pdfmark/pdfmark.am b/contrib/pdfmark/pdfmark.am
index 82bd4ff4c..9589a8bc3 100644
--- a/contrib/pdfmark/pdfmark.am
+++ b/contrib/pdfmark/pdfmark.am
@@ -35,7 +35,7 @@ dist_pdfmarktmac_DATA = $(TMACFILES)
 # Files installed in $(pdfdocdir)
 PDFDOCFILES = \
   contrib/pdfmark/pdfmark.pdf
-if USE_GROPDF
+if USE_PDFROFF
 pdfmarkpdfdocdir = $(pdfdocdir)
 nodist_pdfmarkpdfdoc_DATA = $(PDFDOCFILES)
 MOSTLYCLEANFILES += $(PDFDOCFILES)
@@ -87,7 +87,7 @@ mostlyclean_pdfmark:
 
 uninstall_groffdirs: uninstall-pdfmark-hook
 uninstall-pdfmark-hook:
-if USE_GROPDF
+if USE_PDFROFF
        if test -d $(DESTDIR)$(pdfmarkpdfdocdir); then \
          rmdir $(DESTDIR)$(pdfmarkpdfdocdir); \
        fi
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
 ])



reply via email to

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