From: Bruno Haible Date: Sat, 18 May 2019 16:01:31 +0000 (+0200) Subject: build: Avoid trouble on mingw caused by mingw's *printf functions. X-Git-Tag: v0.21~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45500ab1765581d6a3b7d2e6a6c2595466de70af;p=thirdparty%2Fgettext.git build: Avoid trouble on mingw caused by mingw's *printf functions. Reported by Michele Locati in . * gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Define __USE_MINGW_ANSI_STDIO to 0. * gettext-runtime/libasprintf/Makefile.am (DEFS): Likewise. * libtextstyle/lib/Makefile.am (AM_CPPFLAGS): Likewise. --- diff --git a/gettext-runtime/intl/Makefile.am b/gettext-runtime/intl/Makefile.am index 9f6e576f1..4b0e70f66 100644 --- a/gettext-runtime/intl/Makefile.am +++ b/gettext-runtime/intl/Makefile.am @@ -52,6 +52,15 @@ AM_CPPFLAGS = \ -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL +if WOE32 +# On mingw, disable the declarations of *printf functions as aliases to the +# corresponding __mingw_*printf functions, because +# - these functions are useless for i18n purposes (not POSIX/XSI compliant), +# - they pull in a dependency to the libgcc_s_sjlj DLL (through the symbols +# __udivdi3, __umoddi3). +AM_CPPFLAGS += -D__USE_MINGW_ANSI_STDIO=0 +endif + # Parametrization of the 'relocatable-lib-lgpl' module. AM_CPPFLAGS += \ -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ diff --git a/gettext-runtime/libasprintf/Makefile.am b/gettext-runtime/libasprintf/Makefile.am index 4189ef1a1..be78f6835 100644 --- a/gettext-runtime/libasprintf/Makefile.am +++ b/gettext-runtime/libasprintf/Makefile.am @@ -26,6 +26,15 @@ RM = rm -f DEFS = -DIN_LIBASPRINTF @DEFS@ +if WOE32 +# On mingw, disable the declarations of *printf functions as aliases to the +# corresponding __mingw_*printf functions, because +# - these functions are useless for i18n purposes (not POSIX/XSI compliant), +# - they pull in a dependency to the libgcc_s_sjlj DLL (through the symbols +# __udivdi3, __umoddi3). +DEFS += -D__USE_MINGW_ANSI_STDIO=0 +endif + # Library include file. diff --git a/libtextstyle/lib/Makefile.am b/libtextstyle/lib/Makefile.am index 9f2cb0e17..32b1a7c4f 100644 --- a/libtextstyle/lib/Makefile.am +++ b/libtextstyle/lib/Makefile.am @@ -48,6 +48,13 @@ if INCLUDED_LIBXML AM_CPPFLAGS += -DLIBXML_STATIC endif +if WOE32 +# On mingw, disable the declarations of *printf functions as aliases to the +# corresponding __mingw_*printf functions, because they pull in a dependency +# to the libgcc_s_sjlj DLL (through the symbols __udivdi3, __umoddi3). +AM_CPPFLAGS += -D__USE_MINGW_ANSI_STDIO=0 +endif + # Rules generated and collected by gnulib-tool. include Makefile.gnulib