]> Savannah Git Hosting - gnulib.git/commitdiff
iconv: Change configure message.
authorBruno Haible <bruno@clisp.org>
Wed, 26 Aug 2020 22:42:22 +0000 (00:42 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 26 Aug 2020 23:30:23 +0000 (01:30 +0200)
* m4/iconv.m4 (AM_ICONV): Say "checking whether iconv is compatible
with its POSIX signature..." instead of "checking for iconv
declaration...". Remove K&R C support.

ChangeLog
m4/iconv.m4

index a707a4b82f9dbaf06a224340fe8f2f45780c7186..b23b2f46c8d04c709b3d1ae68301d8465801cc7f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-08-26  Bruno Haible  <bruno@clisp.org>
+
+       iconv: Change configure message.
+       * m4/iconv.m4 (AM_ICONV): Say "checking whether iconv is compatible
+       with its POSIX signature..." instead of "checking for iconv
+       declaration...". Remove K&R C support.
+
 2020-08-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        getcwd: help the merge back into glibc
index 67dbfed64fac1c8d2442e1e48c2f87e5619fed99..f8a536b574861c2a583c96991c233d10c2df041e 100644 (file)
@@ -1,4 +1,4 @@
-# iconv.m4 serial 22
+# iconv.m4 serial 23
 dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -9,6 +9,10 @@ dnl From Bruno Haible.
 
 AC_PREREQ([2.64])
 
+dnl Note: AM_ICONV is documented in the GNU gettext manual
+dnl <https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html>.
+dnl Don't make changes that are incompatible with that documentation!
+
 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
 [
   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
@@ -239,41 +243,39 @@ AC_DEFUN_ONCE([AM_ICONV],
 [
   AM_ICONV_LINK
   if test "$am_cv_func_iconv" = yes; then
-    AC_MSG_CHECKING([for iconv declaration])
-    AC_CACHE_VAL([am_cv_proto_iconv], [
-      AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM(
-           [[
+    AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature],
+      [gl_cv_iconv_nonconst],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[
 #include <stdlib.h>
 #include <iconv.h>
 extern
 #ifdef __cplusplus
 "C"
 #endif
-#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#else
-size_t iconv();
-#endif
-           ]],
-           [[]])],
-        [am_cv_proto_iconv_arg1=""],
-        [am_cv_proto_iconv_arg1="const"])
-      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
-    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-    AC_MSG_RESULT([
-         $am_cv_proto_iconv])
+            ]],
+            [[]])],
+         [gl_cv_iconv_nonconst=yes],
+         [gl_cv_iconv_nonconst=no])
+      ])
   else
     dnl When compiling GNU libiconv on a system that does not have iconv yet,
     dnl pick the POSIX compliant declaration without 'const'.
-    am_cv_proto_iconv_arg1=""
+    gl_cv_iconv_nonconst=yes
+  fi
+  if test $gl_cv_iconv_nonconst = yes; then
+    iconv_arg1=""
+  else
+    iconv_arg1="const"
   fi
-  AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+  AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1],
     [Define as const if the declaration of iconv() needs const.])
   dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
   m4_ifdef([gl_ICONV_H_DEFAULTS],
     [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
-     if test -n "$am_cv_proto_iconv_arg1"; then
+     if test $gl_cv_iconv_nonconst != yes; then
        ICONV_CONST="const"
      fi
     ])