groff-commit
[Top][All Lists]
Advanced

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

[groff] 47/50: [build]: Refactor uchardet-related macros.


From: G. Branden Robinson
Subject: [groff] 47/50: [build]: Refactor uchardet-related macros.
Date: Sat, 21 May 2022 12:17:31 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 0b64b73c7a1b6001b46d2e083431320030fe96cc
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat May 21 08:01:01 2022 -0500

    [build]: Refactor uchardet-related macros.
    
    * m4/groff.m4 (GROFF_UCHARDET_CHECK): Rename this...
      (GROFF_UCHARDET_NOTICE): ...to this.
    
    * configure.ac: Update call site.
    
    * m4/groff.m4 (GROFF_UCHARDET_NOTICE): Tighten wording of message
      reported to user.
    
    Make code style more readable and use indentation style that (mostly)
    prevails in the file.
---
 ChangeLog    | 15 ++++++++++
 configure.ac |  4 +--
 m4/groff.m4  | 90 +++++++++++++++++++++++++++++++-----------------------------
 3 files changed, 64 insertions(+), 45 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9cdf93c8..48c8e840 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2022-05-21  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * m4/groff.m4 (GROFF_PDFTOOLS): Rename this...
+       (GROFF_POPPLER): ...to this.
+       * configure.ac: Update call site.
+
+2022-05-21  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * m4/groff.m4 (GROFF_UCHARDET_CHECK): Rename this...
+       (GROFF_UCHARDET_NOTICE): ...to this.
+       * configure.ac: Update call site.
+
+       * m4/groff.m4 (GROFF_UCHARDET_NOTICE): Tighten wording of
+       message reported to user.
+
 2022-05-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * m4/groff.m4 (GROFF_PNMTOOLS_CAN_BE_QUIET,
diff --git a/configure.ac b/configure.ac
index fb6c235d..08dbf9cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,7 +77,7 @@ AC_PROG_MKDIR_P
 GROFF_PROG_XPMTOPPM
 PKG_PROG_PKG_CONFIG
 GROFF_UCHARDET
-GROFF_PDFTOOLS
+GROFF_POPPLER
 
 # use a dummy substitution if no csh hack is necessary to avoid errors
 # with non-GNU sed programs
@@ -233,7 +233,7 @@ echo "\
 
 GROFF_APPRESDIR_CHECK
 GROFF_URW_FONTS_NOTICE
-GROFF_UCHARDET_CHECK
+GROFF_UCHARDET_NOTICE
 GROFF_GHOSTSCRIPT_VERSION_NOTICE
 GROFF_GROHTML_PROGRAM_NOTICE
 GROFF_GROPDF_PROGRAM_NOTICE
diff --git a/m4/groff.m4 b/m4/groff.m4
index 183f1310..35552884 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -1651,52 +1651,56 @@ AC_DEFUN([GROFF_BASH],
   fi
   AC_SUBST([BASH_PROG])])
 
-# Looking for uchardet library, used by preconv.
-AC_DEFUN([GROFF_UCHARDET],
-  [AC_ARG_WITH([uchardet],
-               AS_HELP_STRING([--with-uchardet],
-                              [Build 'preconv' with uchardet library for file \
-                               encoding automatic detection [=auto|no|yes]]))
-   AS_IF([test "$with_uchardet" != no],
-         [PKG_CHECK_MODULES([UCHARDET],
-                            [uchardet >= 0.0.1],
-                            [AC_DEFINE([HAVE_UCHARDET],
-                                       [1],
-                                       [uchardet library availability])
-                             groff_have_uchardet=yes],
-                            [if test "$with_uchardet" = yes; then
-                               AC_MSG_FAILURE([Could not found uchardet 
library])
-                             else
-                               AC_MSG_WARN([uchardet library not found, 
preconv \
-might not work properly])
-                             fi
-                             groff_have_uchardet=no])],
-          [groff_have_uchardet=no]
-          )])
-
-# Warning if uchardet library was not found
-AC_DEFUN([GROFF_UCHARDET_CHECK],
-  [if test "$groff_have_uchardet" = no -a "$with_uchardet" != no; then
-  AC_MSG_WARN([
-  uchardet library was not found; preprocessor 'preconv' will skip
-  this method of attempting to determine the input encoding.  (To
-  check how and in what order 'preconv' tries to determine the
-  encoding, see its man page.)
+# Search for uchardet library used by preconv.
+
+AC_DEFUN([GROFF_UCHARDET], [
+  AC_ARG_WITH([uchardet],
+    AS_HELP_STRING([--with-uchardet],
+      [Build 'preconv' with uchardet library to automatically detect \
+file encoding [=auto|no|yes]]))
+    AS_IF([test "$with_uchardet" != no],
+      [PKG_CHECK_MODULES([UCHARDET],
+        [uchardet >= 0.0.1],
+        [AC_DEFINE([HAVE_UCHARDET], [1],
+          [uchardet library availability])
+        groff_have_uchardet=yes], [
+          if test "$with_uchardet" = yes
+          then
+            AC_MSG_FAILURE([Could not found uchardet library])
+          else
+            AC_MSG_WARN([uchardet library not found; preconv will be \
+less functional])
+          fi
+          groff_have_uchardet=no])],
+      [groff_have_uchardet=no])
+])
+
+AC_DEFUN([GROFF_UCHARDET_NOTICE], [
+  if test "$groff_have_uchardet" = no -a "$with_uchardet" != no
+  then
+    AC_MSG_NOTICE([The uchardet library was not found.
+
+  The 'preconv' preprocessor program will be unable to attempt automatic
+  inference of an input file's character encoding.  See the preconv(1)
+  man page.
   ])
   fi
-  ])
+])
 
-# pdftools needed for sanity checks
-AC_DEFUN([GROFF_PDFTOOLS],
-  [AC_CHECK_PROG([PDFINFO], [pdfinfo], [found], [missing])
-   AC_CHECK_PROG([PDFFONTS], [pdffonts], [found], [missing])
-   AC_CHECK_PROG([PDFIMAGES], [pdfimages], [found], [missing])
-   if test "$PDFINFO" = found -a "$PDFFONTS" = found -a "$PDFIMAGES" = found; 
then
-      groff_have_pdftools=yes;
-   else
-      groff_have_pdftools=no;
-   fi
-   ])
+# Some automated tests use Poppler PDF tools for sanity checks.
+
+AC_DEFUN([GROFF_POPPLER], [
+  groff_have_pdftools=no
+  AC_CHECK_PROG([PDFINFO], [pdfinfo], [found], [missing])
+  AC_CHECK_PROG([PDFFONTS], [pdffonts], [found], [missing])
+  AC_CHECK_PROG([PDFIMAGES], [pdfimages], [found], [missing])
+  if test "$PDFINFO" = found \
+    -a "$PDFFONTS" = found \
+    -a "$PDFIMAGES" = found
+  then
+    groff_have_pdftools=yes
+  fi
+])
 
 AC_DEFUN([GROFF_USE_GROFF_ALLOCATOR], [
   AC_ARG_ENABLE([groff-allocator],



reply via email to

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