]> Savannah Git Hosting - gnulib.git/commitdiff
gettext: Recognize a statically built libintl on macOS and AIX.
authorBruno Haible <bruno@clisp.org>
Fri, 17 Nov 2023 11:49:40 +0000 (12:49 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 17 Nov 2023 11:49:40 +0000 (12:49 +0100)
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.

ChangeLog
m4/gettext.m4

index 8b9c3344eb45e03353cde4f4f353d499fd6f5298..a634e81232e69d8ff8bb6ffa9e125af29a4c8e1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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.
index 019d1adb5a306714218bbbaa09168ad704657bf8..16f9db187947991d295132f310e0bfee5a690ff2 100644 (file)
@@ -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