From 20c204fdd9bed1ba05d5f362e50f5d6898013515 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 22 Oct 2016 23:04:03 +0200 Subject: [PATCH] iconv: Avoid compilation error when bootstrapping GNU libiconv. * m4/iconv.m4 (AM_ICONV): When the system does not have an iconv() declaration yet, define ICONV_CONST to empty. --- ChangeLog | 6 ++++++ m4/iconv.m4 | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf20d69c16..2f31849398 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-10-22 Bruno Haible + + iconv: Avoid compilation error when bootstrapping GNU libiconv. + * m4/iconv.m4 (AM_ICONV): When the system does not have an iconv() + declaration yet, define ICONV_CONST to empty. + 2016-10-15 Bruno Haible Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'. diff --git a/m4/iconv.m4 b/m4/iconv.m4 index aa159c539a..bdafc54e30 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,4 +1,4 @@ -# iconv.m4 serial 19 (gettext-0.18.2) +# iconv.m4 serial 20 dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -258,14 +258,18 @@ size_t iconv(); am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) - AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_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 - ICONV_CONST="const" - fi - ]) + 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="" fi + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_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 + ICONV_CONST="const" + fi + ]) ]) -- 2.39.5