>From 6d4b69053bdeb5798069fd52cba2807b3f938828 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 26 Jul 2020 12:00:38 +0200 Subject: [PATCH 1/2] 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. --- ChangeLog | 7 +++++++ m4/iconv.m4 | 44 +++++++++++++++++++++++--------------------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc4b46e..87b873b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2020-07-26 Bruno Haible + 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-07-26 Bruno Haible + expl: Simplify autoconf test. * m4/expl.m4 (gl_FUNC_EXPL): Merge the "checking whether expl() breaks with small values..." test into the "checking whether expl works..." diff --git a/m4/iconv.m4 b/m4/iconv.m4 index e593b72..cd2fd23 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,4 +1,4 @@ -# iconv.m4 serial 21 +# iconv.m4 serial 22 dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -7,6 +7,10 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. +dnl Note: AM_ICONV is documented in the GNU gettext manual +dnl . +dnl Don't make changes that are incompatible with that documentation! + AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. @@ -247,41 +251,39 @@ gl_iconv_AC_DEFUN([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 #include 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 . 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 ]) -- 2.7.4