Skip to content

Commit

Permalink
Fix 'undefined symbol: locale_charset' when libiconv-1.17 is installed.
Browse files Browse the repository at this point in the history
This allows the presence of locale_charset to indicate that -liconv is to be used.
Before libiconv-1.17, the locale_charset symbol was not exported (and
so locale_charset was not detected).

Fixes tlwg#25
  • Loading branch information
jhgit committed Mar 22, 2023
1 parent b174e65 commit 5d3e14e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,14 @@ if test $found_iconv = "no"; then
AC_MSG_ERROR([*** No usable iconv() implementation found])
fi

case $with_libiconv in
gnu|native)
ICONV_LIBS="-liconv"
;;
esac
AC_SUBST(ICONV_LIBS)

#
# Checks for locale_charset() and nl_langinfo(CODESET)
#
AC_CHECK_LIB(iconv, locale_charset,
[have_locale_charset=yes], [have_locale_charset=no])
if test x$have_locale_charset = xyes; then
AC_DEFINE(HAVE_LOCALE_CHARSET,1,[Have locale_charset()])
with_libiconv=yes
fi
AC_CACHE_CHECK(
[for nl_langinfo (CODESET)], datrie_cv_langinfo_codeset,
Expand All @@ -96,6 +90,13 @@ then
Please consider installing GNU libiconv.])
fi

case $with_libiconv in
gnu|native|yes)
ICONV_LIBS="-liconv"
;;
esac
AC_SUBST(ICONV_LIBS)


# Checks for header files.
AC_CHECK_HEADERS([limits.h stdlib.h stdio.h string.h])
Expand Down

0 comments on commit 5d3e14e

Please sign in to comment.