]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: On mingw, avoid link dependency from xgettext.exe to libstdc++.
authorBruno Haible <bruno@clisp.org>
Wed, 9 Jul 2025 06:02:21 +0000 (08:02 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 9 Jul 2025 06:29:56 +0000 (08:29 +0200)
Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-10/msg00007.html>.

* gettext-tools/src/Makefile.am (xgettext_CXXFLAGS): New variable.

gettext-tools/src/Makefile.am

index 4ce51af0a27af34dd0af403bb9728d8c66e82fdc..1b7faf125cbd6c441c9483e9d721e17a487f1bd1 100644 (file)
@@ -480,6 +480,16 @@ endif
 # Compile-time flags for particular source files.
 msgmerge_CFLAGS = $(AM_CFLAGS) $(OPENMP_CFLAGS)
 msgmerge_CXXFLAGS = $(AM_CXXFLAGS) $(OPENMP_CFLAGS)
+# On mingw, the compiler option '-fno-threadsafe-statics' avoids requiring
+# the symbols __cxa_guard_acquire and __cxa_guard_release, which in turn
+# avoids a dependency towards libstdc++.
+if WOE32DLL
+if WINDOWS_NATIVE
+if !WINDOWS_MSVC
+xgettext_CXXFLAGS = $(AM_CXXFLAGS) -fno-threadsafe-statics
+endif
+endif
+endif
 
 # Link dependencies.
 # INTL_MACOSX_LIBS is needed because the programs depend on libintl.la