build: Fix "make installcheck" on MSVC.

Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00042.html>.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): New variable
INTL_WINDOWS_LIBS. Add it to LIBINTL and LTLIBINTL.
* gettext-runtime/configure.ac (INSTALLED_LIBINTL): Add $INTL_WINDOWS_LIBS.
* gettext-tools/configure.ac (INSTALLED_LIBINTL): Likewise.
* libtextstyle/configure.ac (INSTALLED_LIBTEXTSTYLE): New variable.
* libtextstyle/install-tests/Makefile.am (installcheck-local): Link with
$INSTALLED_LIBTEXTSTYLE instead of -ltextstyle.
This commit is contained in:
Bruno Haible 2026-01-15 12:32:43 +01:00
parent c8ee79bec0
commit d806d18eb3
5 changed files with 42 additions and 16 deletions

View File

@ -1,5 +1,5 @@
dnl Configuration for the gettext-runtime directory of GNU gettext
dnl Copyright (C) 1995-2025 Free Software Foundation, Inc.
dnl Copyright (C) 1995-2026 Free Software Foundation, Inc.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@ -241,7 +241,7 @@ AC_SUBST([ENABLE_SHARED])
dnl Test for features used in install-tests.
dnl shlibpath_var and PATH_SEPARATOR are set by LT_INIT.
if test $USE_INCLUDED_LIBINTL = yes; then
INSTALLED_LIBINTL="-lintl $LIBICONV $INTL_MACOSX_LIBS"
INSTALLED_LIBINTL="-lintl $LIBICONV $INTL_MACOSX_LIBS $INTL_WINDOWS_LIBS"
else
INSTALLED_LIBINTL=
fi

View File

@ -1,6 +1,6 @@
# gettext.m4
# serial 84 (gettext-1.0)
dnl Copyright (C) 1995-2025 Free Software Foundation, Inc.
# serial 85 (gettext-1.0)
dnl Copyright (C) 1995-2026 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -93,9 +93,18 @@ AC_DEFUN([AM_GNU_GETTEXT],
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
])
dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
dnl On Mac OS X, libintl requires linking with CoreFoundation.
gt_INTL_MACOSX
dnl On native Windows, libintl requires linking with advapi32,
dnl because langprefs.c (_nl_language_preferences_win32_95) uses functions
dnl from advapi32.dll.
AC_REQUIRE([AC_CANONICAL_HOST])
INTL_WINDOWS_LIBS=
case "$host_os" in
mingw* | windows*) INTL_WINDOWS_LIBS='-ladvapi32' ;;
esac
dnl Set USE_NLS.
AC_REQUIRE([AM_NLS])
@ -262,11 +271,13 @@ 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 or other
dnl OS dependent libraries, specifically on macOS and AIX.
gt_LIBINTL_EXTRA="$INTL_MACOSX_LIBS"
AC_REQUIRE([AC_CANONICAL_HOST])
dnl OS dependent libraries, specifically on macOS, AIX, and native
dnl Windows.
gt_LIBINTL_EXTRA=
case "$host_os" in
aix*) gt_LIBINTL_EXTRA="-lpthread" ;;
darwin*) gt_LIBINTL_EXTRA="$INTL_MACOSX_LIBS" ;;
aix*) gt_LIBINTL_EXTRA="-lpthread" ;;
mingw* | windows*) gt_LIBINTL_EXTRA="$INTL_WINDOWS_LIBS" ;;
esac
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } \
&& { test -n "$LIBICONV" || test -n "$gt_LIBINTL_EXTRA"; }; then
@ -353,12 +364,21 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
if test -n "$INTL_MACOSX_LIBS"; then
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$gt_cv_use_gnu_libintl" = "yes"; then
dnl Some extra flags are needed during linking.
dnl Some extra options are needed during linking.
LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
fi
fi
if test -n "$INTL_WINDOWS_LIBS"; then
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$gt_cv_use_gnu_libintl" = "yes"; then
dnl Some extra options are needed during linking.
LIBINTL="$LIBINTL $INTL_WINDOWS_LIBS"
LTLIBINTL="$LTLIBINTL $INTL_WINDOWS_LIBS"
fi
fi
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$gt_cv_use_gnu_libintl" = "yes"; then
AC_DEFINE([ENABLE_NLS], [1],

View File

@ -1,5 +1,5 @@
dnl Configuration for the gettext-tools directory of GNU gettext
dnl Copyright (C) 1995-2025 Free Software Foundation, Inc.
dnl Copyright (C) 1995-2026 Free Software Foundation, Inc.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@ -790,7 +790,7 @@ AC_SUBST([HAVE_JAVAEXEC])
dnl Test for features used in install-tests.
dnl shlibpath_var and PATH_SEPARATOR are set by LT_INIT.
if test $USE_INCLUDED_LIBINTL = yes; then
INSTALLED_LIBINTL="-lintl $LIBICONV $INTL_MACOSX_LIBS"
INSTALLED_LIBINTL="-lintl $LIBICONV $INTL_MACOSX_LIBS $INTL_WINDOWS_LIBS"
INSTALLED_LIBGETTEXTPO_DEPS="$INSTALLED_LIBINTL"
else
INSTALLED_LIBINTL=

View File

@ -1,5 +1,5 @@
dnl Configuration for the toplevel directory of GNU libtextstyle
dnl Copyright (C) 2009-2025 Free Software Foundation, Inc.
dnl Copyright (C) 2009-2026 Free Software Foundation, Inc.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@ -172,6 +172,12 @@ AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl])
dnl Test for features used in install-tests.
dnl shlibpath_var and PATH_SEPARATOR are set by LT_INIT.
INSTALLED_LIBTEXTSTYLE="-ltextstyle"
dnl Link dependencies: $(GETHOSTNAME_LIB).
case "$host_os" in
mingw* | windows*) INSTALLED_LIBTEXTSTYLE="$INSTALLED_LIBTEXTSTYLE -lws2_32" ;;
esac
AC_SUBST([INSTALLED_LIBTEXTSTYLE])
if test -n "${shlibpath_var}"; then
if test "${shlibpath_var}" = PATH; then
AUGMENT_SHLIBPATH="PATH='\$(bindir)'${PATH_SEPARATOR}\"\$\$PATH\";"

View File

@ -1,5 +1,5 @@
## Makefile for libtextstyle/install-tests.
## Copyright (C) 2025 Free Software Foundation, Inc.
## Copyright (C) 2025-2026 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@ -20,14 +20,14 @@ installcheck-local:
$(CC) -I$(includedir) -L$(libdir) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o test-version $(srcdir)/test-version.c -ltextstyle
-o test-version $(srcdir)/test-version.c $(INSTALLED_LIBTEXTSTYLE)
@AUGMENT_SHLIBPATH@ ./test-version
rm -rf test-version test-version$(EXEEXT)
$(CC) -I$(includedir) -L$(libdir) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-DTOP_SRCDIR=\"$(top_srcdir)/\" \
$(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o test-api $(srcdir)/test-api.c -ltextstyle
-o test-api $(srcdir)/test-api.c $(INSTALLED_LIBTEXTSTYLE)
@AUGMENT_SHLIBPATH@ ./test-api
rm -rf test-api test-api$(EXEEXT)