]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
gettext.m4: Fix build on Cygwin with gcc 13 or newer.
authorBruno Haible <bruno@clisp.org>
Fri, 1 Aug 2025 13:17:31 +0000 (15:17 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 1 Aug 2025 20:23:22 +0000 (22:23 +0200)
This gcc version links with -lintl -liconv by default, making it appear as if
gettext() et al. were defined in libc. But GNU gettext still needs to build a
new libintl.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): On Cygwin, set
USE_INCLUDED_LIBINTL=yes regardless of the gcc version.

gettext-runtime/m4/gettext.m4

index 67c37d91535744098339d162fa34a584a244a639..b4c4afc9bf1d7c0a50ae7b6fe73bd8c3930e3c46 100644 (file)
@@ -330,7 +330,11 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
         fi
       fi
 
-      if test "$gt_cv_use_gnu_libintl" = "yes"; then
+      AC_REQUIRE([AC_CANONICAL_HOST])
+      if test "$gt_cv_use_gnu_libintl" = "yes" \
+         || case "$host_os" in cygwin*) true;; *) false;; esac; then
+        dnl GNU gettext is not found in the C library or is,
+        dnl like on Cygwin, a component of the C library.
         dnl Mark actions used to generate GNU NLS library.
         USE_INCLUDED_LIBINTL=yes
         LIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"