Hi Paul,

Paul Eggert <egg...@cs.ucla.edu> writes:

> @@ -82,7 +82,7 @@ AC_DEFUN([AM_ICONV_LINK]
>          LIBS="$LIBS $LIBICONV"
>        fi
>        am_cv_func_iconv_works=no
> -      for ac_iconv_const in '' 'const'; do
> +      for ac_iconv_const in '/*empty*/' 'const'; do
>          AC_RUN_IFELSE(
>            [AC_LANG_PROGRAM(
>               [[

This change breaks building GNU libiconv on some systems. On Fedora 42
with GCC 15.0, for example, you will get the following:

    /bin/sh ../libtool --mode=compile gcc -I. -I. -I../include -I./../include 
-I.. -I./..  -g -O2 -fvisibility=hidden -DBUILDING_LIBICONV 
-DBUILDING_LIBCHARSET -DHAVE_CONFIG_H -c ./iconv.c
    libtool: compile:  gcc -I. -I. -I../include -I./../include -I.. -I./.. -g 
-O2 -fvisibility=hidden -DBUILDING_LIBICONV -DBUILDING_LIBCHARSET 
-DHAVE_CONFIG_H -c ./iconv.c  -fPIC -DPIC -o .libs/iconv.o
    In file included from ./iconv.c:20:
    ../include/iconv.h:101:15: error: conflicting types for 'libiconv'; have 
'size_t(void *, char **, size_t *, char **, size_t *)' {aka 'long unsigned 
int(void *, char **, long unsigned int *, char **, long unsigned int *)'}
      101 | #define iconv libiconv
          |               ^~~~~~~~
    ./iconv.c:264:8: note: in expansion of macro 'iconv'
      264 | size_t iconv (iconv_t icd,
          |        ^~~~~
    ../include/iconv.h:101:15: note: previous declaration of 'libiconv' with 
type 'size_t(void *, const char **, size_t *, char **, size_t *)' {aka 'long 
unsigned int(void *, const char **, long unsigned int *, char **, long unsigned 
int *)'}
      101 | #define iconv libiconv
          |               ^~~~~~~~
    ../include/iconv.h:102:39: note: in expansion of macro 'iconv'
      102 | extern LIBICONV_SHLIB_EXPORTED size_t iconv (iconv_t cd, const 
char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
          |                                       ^~~~~
    make[1]: *** [Makefile:80: iconv.lo] Error 1

This is because in libiconv's configure.ac there is:

    AM_ICONV
    [...]
    if test "$am_cv_func_iconv" = yes -a -n "$iconv_arg1"; then
      ICONV_CONST="const"
    else
      ICONV_CONST=""
    fi
    AC_SUBST([ICONV_CONST])

But now test -n "$iconv_arg1" will always be true.

Bruno, I have attached a patch to adjust libiconv to this change.

Also, another patch since ACLOCAL was updated in Makefile.devel to
aclocal-1.17. But libcharset/Makefile.devel had it set to aclocal-1.16.
I assume this was unintentional, feel free to ignore if it was though.

Collin

>From d4da8510b4cc6f09ede9a3787e334b0326872b4d Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Thu, 17 Apr 2025 22:06:24 -0700
Subject: [PATCH 1/2] Switch to automake 1.17, part 3.

* autogen.sh (ACLOCAL): Use Automake 1.17.
---
 libcharset/ChangeLog      | 5 +++++
 libcharset/Makefile.devel | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libcharset/ChangeLog b/libcharset/ChangeLog
index 2ee84bb..89abb4a 100644
--- a/libcharset/ChangeLog
+++ b/libcharset/ChangeLog
@@ -1,3 +1,8 @@
+2025-04-17  Collin Funk  <collin.fu...@gmail.com>
+
+	Switch to automake 1.17, part 3.
+	* autogen.sh (ACLOCAL): Use Automake 1.17.
+
 2024-12-14  Bruno Haible  <br...@clisp.org>
 
 	Switch to automake 1.17.
diff --git a/libcharset/Makefile.devel b/libcharset/Makefile.devel
index 7f237a4..ef90e85 100644
--- a/libcharset/Makefile.devel
+++ b/libcharset/Makefile.devel
@@ -5,7 +5,7 @@ SHELL = /bin/sh
 MAKE = make
 AUTOCONF = autoconf
 AUTOHEADER = autoheader
-ACLOCAL = aclocal-1.16
+ACLOCAL = aclocal-1.17
 CP = cp
 RM = rm -f
 
-- 
2.49.0

>From 1077f8fbe777357a3081d44e139f71fc93c37fc3 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Thu, 17 Apr 2025 23:00:38 -0700
Subject: [PATCH 2/2] Update after gnulib changed.

* configure.ac: Check if $iconv_arg1 is set to '/*empty*/' instead of an
empty string.
---
 ChangeLog    | 6 ++++++
 configure.ac | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 16c0d05..70e0582 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-17  Collin Funk  <collin.fu...@gmail.com>
+
+	Update after gnulib changed.
+	* configure.ac: Check if $iconv_arg1 is set to '/*empty*/' instead of an
+	empty string.
+
 2025-04-16  Bruno Haible  <br...@clisp.org>
 
 	Update after gnulib changed.
diff --git a/configure.ac b/configure.ac
index 25af6a5..f13331d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,7 +104,7 @@ AC_TYPE_MBSTATE_T
 
 dnl           checks for header files, functions and declarations
 
-if test "$am_cv_func_iconv" = yes -a -n "$iconv_arg1"; then
+if test "$am_cv_func_iconv" = yes && test "$iconv_arg1" != '/*empty*/'; then
   ICONV_CONST="const"
 else
   ICONV_CONST=""
-- 
2.49.0

Reply via email to