From 901e427d75ff4390ac0364f3714767c5e3d8ce0f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 17 Nov 2023 12:49:40 +0100 Subject: [PATCH] gettext: Recognize a statically built libintl on macOS and AIX. Reported by David Edelsohn in . * 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. --- ChangeLog | 9 +++++++++ m4/gettext.m4 | 19 +++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0edd1e7aed..39d214759d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2023-11-17 Bruno Haible + + gettext: Recognize a statically built libintl on macOS and AIX. + Reported by David Edelsohn in + . + * 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-15 Paul Eggert striconveha: pacify gcc -Wcast-align diff --git a/m4/gettext.m4 b/m4/gettext.m4 index 019d1adb5a..16f9db1879 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -1,4 +1,4 @@ -# 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, @@ -210,9 +210,16 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [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( [[ @@ -234,8 +241,8 @@ $gt_revision_test_code 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 -- 2.39.5