[Top][All Lists]

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

iconv.m4: provide useful am_func_iconv 'no' string

From: Simon Josefsson
Subject: iconv.m4: provide useful am_func_iconv 'no' string
Date: Sun, 10 Jul 2022 00:16:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)


In libidn and libidn2 we (used to) print this during ./configure:

  Libiconv:          $am_cv_func_iconv $LTLIBICONV

It prints the right thing in most cases, that is, one of these:

  Libiconv:          yes -liconv ...
  Libiconv:          no, consider installing GNU libiconv

However on platforms that have iconv but it is broken, and thus ends up
not being used by iconv.m4, it will print this:

  Libiconv:          yes

Reading iconv.m4 suggests to me that I probably should have been using
the am_func_iconv variable instead, so I changed it into:

  Libiconv:          $am_func_iconv $LTLIBICONV

Now it prints one of these values:

  Libiconv:          yes -liconv ...
  Libiconv:          no

Thus the recommendation to install GNU libiconv is missing in the 'no'
case.  The patch below fixes that.

I can't find any uses of am_func_iconv in any M4 files in gnulib, so I'm
hoping that nobody is testing it for == 'no' strings but only uses !=
'yes' comparisons.



diff --git a/m4/iconv.m4 b/m4/iconv.m4
index 00057953e3..c9cbbeb9be 100644
--- a/m4/iconv.m4
+++ b/m4/iconv.m4
@@ -71,6 +71,7 @@ AC_DEFUN([AM_ICONV_LINK],
+  am_func_iconv="no, consider installing GNU libiconv"
   if test "$am_cv_func_iconv" = yes; then
     AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
       dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
@@ -208,11 +209,11 @@ AC_DEFUN([AM_ICONV_LINK],
     case "$am_cv_func_iconv_works" in
-      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+      *no) am_cv_lib_iconv=no ;;
       *)   am_func_iconv=yes ;;
-    am_func_iconv=no am_cv_lib_iconv=no
+    am_cv_lib_iconv=no
   if test "$am_func_iconv" = yes; then

Attachment: signature.asc
Description: PGP signature

reply via email to

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