build: Simplify handling of exported symbols on Windows, part 2.

* gettext-tools/configure.ac (WINDOWS_MSVC): New conditional.
* gnulib-local/modules/gettext-tools-misc (Makefile.am): Re-add the
--export-all-symbols linker option.
* gettext-tools/src/Makefile.am (libgettextsrc_la_LDFLAGS): Re-add the
--export-all-symbols linker option.
This commit is contained in:
Bruno Haible 2025-06-08 23:09:37 +02:00
parent 8000b5d9e3
commit 3dbf4a9b3b
3 changed files with 29 additions and 0 deletions

View File

@ -178,6 +178,21 @@ case "$host_os" in
esac
AM_CONDITIONAL([WINDOWS_NATIVE], [test $is_windows_native = yes])
dnl Linking a shared library works slightly differently on MSVC than on
dnl Cygwin and mingw.
is_msvc=false
case "$host_os" in
windows*-msvc*) is_msvc=true ;;
mingw* | windows*)
AC_EGREP_CPP([Special], [
#ifdef _MSC_VER
Special
#endif
], [is_msvc=true])
;;
esac
gl_CONDITIONAL([WINDOWS_MSVC], [$is_msvc])
dnl Package-private libraries do not need to be installed when we build only
dnl static libraries. Don't install them in this case. This avoids a build
dnl error on AIX with --enable-shared, when some other version of GNU gettext,

View File

@ -463,6 +463,13 @@ libgettextsrc_la_CPPFLAGS = $(AM_CPPFLAGS) $(INCXML)
# Needed for the expansion of LIBGETTEXTSRC_DLL_VARIABLE on MSVC.
libgettextsrc_la_CPPFLAGS += -DIN_LIBGETTEXTSRC
# Tell the mingw or Cygwin linker which symbols to export.
if WOE32DLL
if !WINDOWS_MSVC
libgettextsrc_la_LDFLAGS += -Wl,--export-all-symbols
endif
endif
# Specify installation directory, for --enable-relocatable.
if RELOCATABLE_VIA_LD
# This is needed, because libgettextsrc depends on libgettextlib and libintl.

View File

@ -29,6 +29,13 @@ endif
lib_LDFLAGS += -release @VERSION@
# Tell the mingw or Cygwin linker which symbols to export.
if WOE32DLL
if !WINDOWS_MSVC
lib_LDFLAGS += -Wl,--export-all-symbols
endif
endif
Include:
License: