+2023-11-17 Bruno Haible <bruno@clisp.org>
+
+ gettext: Recognize a statically built libintl on macOS and AIX.
+ Reported by David Edelsohn <dje.gcc@gmail.com> in
+ <https://gcc.gnu.org/pipermail/gcc-patches/2023-November/636558.html>.
+ * m4/gettext.m4 (AM_GNU_GETTEXT): In the
+ "checking for GNU gettext in libintl..." test, add also the special
+ system library dependencies needed on macOS and AIX.
+
2023-11-16 Bruno Haible <bruno@clisp.org>
boot-time: Make it work on Adélie Linux.
-# gettext.m4 serial 77 (gettext-0.22)
+# gettext.m4 serial 78 (gettext-0.22.4)
dnl Copyright (C) 1995-2014, 2016, 2018-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
]])],
[eval "$gt_func_gnugettext_libintl=yes"],
[eval "$gt_func_gnugettext_libintl=no"])
- dnl Now see whether libintl exists and depends on libiconv.
- if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
- LIBS="$LIBS $LIBICONV"
+ dnl Now see whether libintl exists and depends on libiconv or other
+ dnl OS dependent libraries, specifically on macOS and AIX.
+ gt_LIBINTL_EXTRA="$INTL_MACOSX_LIBS"
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ aix*) gt_LIBINTL_EXTRA="-lpthread" ;;
+ esac
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } \
+ && { test -n "$LIBICONV" || test -n "$gt_LIBINTL_EXTRA"; }; then
+ LIBS="$LIBS $LIBICONV $gt_LIBINTL_EXTRA"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
bindtextdomain ("", "");
return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
]])],
- [LIBINTL="$LIBINTL $LIBICONV"
- LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ [LIBINTL="$LIBINTL $LIBICONV $gt_LIBINTL_EXTRA"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV $gt_LIBINTL_EXTRA"
eval "$gt_func_gnugettext_libintl=yes"
])
fi