gbranden pushed a commit to branch master
in repository groff.

commit 4201c8d10650c64823fdc423db4ff66174f9b0d6
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Jan 25 17:12:09 2026 -0600

    [build]: Add "--without-urw-fonts" option (1/2).
    
    * m4/groff.m4 (GROFF_URW_FONTS_SUPPORT): New Autoconf macro creates a
      "with" configuration option, permitting the host environment to easily
      switch off the search for URW fonts and defeat all of the consequent
      features without the "configure" script issuing a lengthy warning
      about failure to find the aforementioned fonts.  New shell variable
      `urwfontsupport` indicates the configuration's desired status (which
      still defaults on).
    
      (GROFF_URW_FONTS_CHECK): Add dependency on the foregoing macro.
      Initialize `urwfontsdir` shell variable to empty unconditionally,
      permitting it to be updated later if the URW font feature isn't
      disabled.  Nest most of the work of this macro inside a conditional on
      `urwfontsupprt`.  Continue to unconditionally populate and
      `AC_SUBST`-itute `groff_have_urw_fonts` and `urwfontsdir`, because
      "configure.ac", "test-mom.sh.in", "mom.am", "font/devpdf/Foundry.in",
      "devpdf.am", and "check-urw-foundry.sh.in" variously rely on them to
      behave appropriately for the configuration.
    
    NEWS: Add item.
    
    This commit omits an indentation update to clarify the change in flow of
    control.
---
 ChangeLog    | 22 ++++++++++++++++++++++
 NEWS         |  8 ++++++++
 configure.ac |  3 ++-
 m4/groff.m4  | 20 +++++++++++++++++---
 4 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6f992f649..6672d4b54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2026-01-25  G. Branden Robinson <[email protected]>
+
+       * m4/groff.m4 (GROFF_URW_FONTS_SUPPORT): New Autoconf macro
+       creates a "with" configuration option, permitting the host
+       environment to easily switch off the search for URW fonts and
+       defeat all of the consequent features without the "configure"
+       script issuing a lengthy warning about failure to find the
+       aforementioned fonts.  New shell variable `urwfontsupport`
+       indicates the configuration's desired status (which still
+       defaults on).
+       (GROFF_URW_FONTS_CHECK): Add dependency on the foregoing macro.
+       Initialize `urwfontsdir` shell variable to empty
+       unconditionally, permitting it to be updated later if the URW
+       font feature isn't disabled.  Nest most of the work of this
+       macro inside a conditional on `urwfontsupprt`.  Continue to
+       unconditionally populate and `AC_SUBST`-itute
+       `groff_have_urw_fonts` and `urwfontsdir`, because
+       "configure.ac", "test-mom.sh.in", "mom.am",
+       "font/devpdf/Foundry.in", "devpdf.am", and
+       "check-urw-foundry.sh.in" variously rely on them to behave
+       appropriately for the configuration.
+
 2026-01-24  G. Branden Robinson <[email protected]>
 
        * doc/doc.am: Update `DOC_SED` macro to also perform substituion
diff --git a/NEWS b/NEWS
index d9e72ab26..4107f1dc9 100644
--- a/NEWS
+++ b/NEWS
@@ -932,6 +932,14 @@ Miscellaneous
    made its determination.  Any existing "/etc/papersize" file is one of
    the resources it consults.
 
+*  groff's "configure" script now supports a "--without-urw-fonts"
+   option, for use on systems where the URW replacement fonts for
+   PostScript and PDF standard fonts are unavailable or not desired.  It
+   also silences the lengthy warning the script issues when these fonts
+   and their metric files are not found.  Configuring without URW font
+   support reduces the gropdf(1) output driver's functionality; see
+   subsection "URW font support" of that man page for details.
+
 *  You can now specify any paper format you like--including the file
    specification "/etc/papersize" for systems using "libpaper"--as the
    default that the groff build writes to generated device description
diff --git a/configure.ac b/configure.ac
index 9c7941a98..fcbb65f6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,7 +140,8 @@ GROFF_TRADITIONAL_CPP
 # checks for operating system services
 GROFF_WCOREFLAG
 
-# URW fonts extra dir
+# URW fonts support and location
+GROFF_URW_FONTS_SUPPORT
 GROFF_URW_FONTS_PATH
 
 # use groff's own malloc-based allocator for C++ new/delete operators
diff --git a/m4/groff.m4 b/m4/groff.m4
index a434b6890..940bb580e 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -1,7 +1,7 @@
 # Autoconf macros for groff
 #
 # Copyright 1989-2017 Free Software Foundation, Inc.
-#           2021-2024 G. Branden Robinson
+#           2021-2026 G. Branden Robinson
 #
 # This file is part of groff, the GNU roff typesetting system.
 #
@@ -318,7 +318,16 @@ AC_DEFUN([GROFF_GROPDF_PROGRAM_NOTICE], [
   fi
 ])
 
-# Make URW font directory configurable.
+# Make URW font support configurable.
+
+AC_DEFUN([GROFF_URW_FONTS_SUPPORT], [
+  AC_ARG_WITH([urw-fonts],
+    [AS_HELP_STRING([--without-urw-fonts],
+      [disable support for URW fonts])],
+    [urwfontsupport="$withval"])
+])
+
+# Make URW font directory location configurable.
 
 AC_DEFUN([GROFF_URW_FONTS_PATH], [
   AC_ARG_WITH([urw-fonts-dir],
@@ -336,9 +345,13 @@ AC_DEFUN([GROFF_URW_FONTS_PATH], [
 # font/devpdf (along with groff's EURO font).
 
 AC_DEFUN([GROFF_URW_FONTS_CHECK], [
+  AC_REQUIRE([GROFF_URW_FONTS_SUPPORT])
   AC_REQUIRE([GROFF_URW_FONTS_PATH])
   AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
   groff_have_urw_fonts=no
+  urwfontsdir=
+  if test "$urwfontsupport" != no
+  then
   AC_MSG_CHECKING([for URW fonts in Type 1/PFB format])
 
 dnl Keep this list in sync with font/devpdf/Foundry.in.
@@ -383,13 +396,14 @@ dnl entry in font/devpdf/util/BuildFoundries.pl.
     AC_MSG_RESULT([none found])
     urwfontsdir=
   fi
+  fi
 
   AC_SUBST([groff_have_urw_fonts])
   AC_SUBST(urwfontsdir)
 ])
 
 AC_DEFUN([GROFF_URW_FONTS_NOTICE], [
-  if test "$groff_have_urw_fonts" = no
+  if test "$urwfontsupport" = yes && test "$groff_have_urw_fonts" = no
   then
     gs_verbiage=
     if test "$GHOSTSCRIPT" != missing

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to