From 4119870eef5d4a0601dd0d374da96858016f3142 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 5 Mar 2022 10:33:06 +0200 Subject: [PATCH 20/20] configure: Try to link against libcharset when detecting it See osdn #43600 Signed-off-by: Marko Lindqvist --- m4/locale.m4 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/m4/locale.m4 b/m4/locale.m4 index 2f8fd96c89..688fc83125 100644 --- a/m4/locale.m4 +++ b/m4/locale.m4 @@ -1,12 +1,18 @@ -#serial 1 +#serial 2 AC_DEFUN([FC_LIBCHARSET], [ AC_CACHE_CHECK([for libcharset], am_cv_libcharset, [lc_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[locale_charset()]])],[am_cv_libcharset=yes],[am_cv_libcharset=no]) - LIBS="$lc_save_LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[locale_charset()]])], [am_cv_libcharset=yes], + [LIBS="$LIBS -lcharset" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[locale_charset()]])], + [dnl Link against libcharset also when building actual freeciv + lc_save_LIBS="$LIBS -lcharset" + am_cv_libcharset=yes], + [am_cv_libcharset=no])]) + LIBS="$lc_save_LIBS" ]) if test $am_cv_libcharset = yes; then AC_DEFINE([HAVE_LIBCHARSET], [1], -- 2.34.1