From: Bruno Haible Date: Wed, 6 Jul 2005 10:55:49 +0000 (+0000) Subject: Support for mingw platform. X-Git-Tag: v0.15~500 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a69cbe421da51221a1f2d5f2970b4be57371a7b;p=thirdparty%2Fgettext.git Support for mingw platform. --- diff --git a/gettext-runtime/ChangeLog b/gettext-runtime/ChangeLog index f23c3ee95..a75195995 100644 --- a/gettext-runtime/ChangeLog +++ b/gettext-runtime/ChangeLog @@ -1,3 +1,8 @@ +2005-07-05 Bruno Haible + + * configure.ac (DLL_VARIABLE): Define also as nonempty when building + shared libraries with mingw. + 2005-05-23 Bruno Haible * gettext-0.14.5 released. diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index 497a10a8b..8efdc54c0 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -104,7 +104,7 @@ AM_GNU_GETTEXT(use-libtool, need-ngettext) dnl Put some default definitions into config.h. AH_BOTTOM([ /* On Windows, variables that may be in a DLL must be marked specially. */ -#if defined _MSC_VER && defined _DLL +#if (defined _MSC_VER && defined _DLL) || (defined __MINGW32__ && defined DLL_EXPORT) # define DLL_VARIABLE __declspec (dllimport) #else # define DLL_VARIABLE diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 63fc7bb4e..2551c9c1a 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,8 @@ +2005-07-05 Bruno Haible + + * printf-args.c (printf_fetchargs): Work around broken definition of + wint_t on mingw. + 2005-07-02 Bruno Haible * localcharset.c (get_charset_aliases) [WIN32]: Add CP65001 and others. diff --git a/gettext-runtime/intl/printf-args.c b/gettext-runtime/intl/printf-args.c index f97590147..5bb1ce1b0 100644 --- a/gettext-runtime/intl/printf-args.c +++ b/gettext-runtime/intl/printf-args.c @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -80,7 +80,13 @@ printf_fetchargs (va_list args, arguments *a) break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: - ap->a.a_wide_char = va_arg (args, wint_t); + /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by + default argument promotions", this is not the case in mingw32, + where wint_t is 'unsigned short'. */ + ap->a.a_wide_char = + (sizeof (wint_t) < sizeof (int) + ? va_arg (args, int) + : va_arg (args, wint_t)); break; #endif case TYPE_STRING: diff --git a/gettext-runtime/libasprintf/ChangeLog b/gettext-runtime/libasprintf/ChangeLog index 2dc6b714e..74865c728 100644 --- a/gettext-runtime/libasprintf/ChangeLog +++ b/gettext-runtime/libasprintf/ChangeLog @@ -1,3 +1,8 @@ +2005-07-05 Bruno Haible + + * printf-args.c (printf_fetchargs): Work around broken definition of + wint_t on mingw. + 2005-05-23 Bruno Haible * gettext-0.14.5 released. diff --git a/gettext-runtime/libasprintf/printf-args.c b/gettext-runtime/libasprintf/printf-args.c index f97590147..5bb1ce1b0 100644 --- a/gettext-runtime/libasprintf/printf-args.c +++ b/gettext-runtime/libasprintf/printf-args.c @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -80,7 +80,13 @@ printf_fetchargs (va_list args, arguments *a) break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: - ap->a.a_wide_char = va_arg (args, wint_t); + /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by + default argument promotions", this is not the case in mingw32, + where wint_t is 'unsigned short'. */ + ap->a.a_wide_char = + (sizeof (wint_t) < sizeof (int) + ? va_arg (args, int) + : va_arg (args, wint_t)); break; #endif case TYPE_STRING: diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog index 7286c30c6..0f78c8825 100644 --- a/gettext-tools/ChangeLog +++ b/gettext-tools/ChangeLog @@ -1,3 +1,11 @@ +2005-07-05 Bruno Haible + + * mingw: New directory. + * configure.ac (LTNOUNDEF): New macro. + (MINGW): New conditional. + (DLL_VARIABLE): Define also as nonempty when building shared libraries + with mingw. + 2005-05-01 Bruno Haible * configure.ac: Call gt_CSHARPEXEC with parameters. diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 28ba1e17c..05cce2d0b 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -94,6 +94,11 @@ gl_USE_SYSTEM_EXTENSIONS dnl Check for build configuration. AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL +case "$host_os" in + nonexistent*) LTNOUNDEF='-no-undefined' ;; + *) LTNOUNDEF='' ;; +esac +AC_SUBST([LTNOUNDEF]) AC_RELOCATABLE @@ -166,6 +171,14 @@ dnl These are the only lines required to internationalize the package. dnl (OK, not quite, the AC_CONFIG_FILES has also some parts.) AM_GNU_GETTEXT(use-libtool, need-ngettext) +dnl Compilation on mingw needs special Makefile rules, because of variables +dnl being exported from or imported into shared libraries. +case "$host_os" in + mingw*) is_mingw=yes ;; + *) is_mingw=no ;; +esac +AM_CONDITIONAL([MINGW], [test $is_mingw = yes]) + dnl Put some default definitions into config.h. AH_TOP([ /* Default value for alignment of strings in .mo file. */ @@ -197,7 +210,7 @@ AH_BOTTOM([ #define PAGE_WIDTH 79 /* On Windows, variables that may be in a DLL must be marked specially. */ -#if defined _MSC_VER && defined _DLL +#if (defined _MSC_VER && defined _DLL) || (defined __MINGW32__ && defined DLL_EXPORT) # define DLL_VARIABLE __declspec (dllimport) #else # define DLL_VARIABLE diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 5112132aa..9e779a27f 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,7 @@ +2005-07-05 Bruno Haible + + * Makefile.am (libgettextlib_la_LDFLAGS): Use LTNOUNDEF. + 2005-07-02 Bruno Haible * localcharset.c (get_charset_aliases) [WIN32]: Add CP65001 and others. diff --git a/gettext-tools/lib/Makefile.am b/gettext-tools/lib/Makefile.am index cb41612e3..f96c19c50 100644 --- a/gettext-tools/lib/Makefile.am +++ b/gettext-tools/lib/Makefile.am @@ -121,7 +121,7 @@ libgettextlib_la_LIBADD = @LTLIBOBJS@ # Need @LTLIBICONV@ because linebreak.c uses iconv(). libgettextlib_la_LDFLAGS = \ -release @VERSION@ \ - @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined + @LTLIBINTL@ @LTLIBICONV@ -lc @LTNOUNDEF@ # No need to install libgettextlib.a, except on AIX. install-exec-local: install-libLTLIBRARIES install-exec-clean diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 1245b6089..6627c3b2e 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,15 @@ +2005-07-05 Bruno Haible + + * Makefile.am (msgmerge_SOURCES, xgettext_SOURCES, msgattrib_SOURCES, + msgcat_SOURCES, msgcomm_SOURCES, msgconv_SOURCES, msgen_SOURCES, + msgfilter_SOURCES, msggrep_SOURCES, msguniq_SOURCES): On mingw, use + C++ source code. + (libgettextsrc_la_LDFLAGS, libgettextpo_la_LDFLAGS): Use LTNOUNDEF. + (format_CFLAGS): New variable. + (format.lo): New rule. + (msg*_CFLAGS, xgettext_CFLAGS): Remove variables. + (msg*_CPPFLAGS, xgettext_CPPFLAGS): New variables. + 2005-05-27 Bruno Haible * write-po.c (wrap): Output \a and \v as an escape sequence, like diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index 962d38706..b41f07c8d 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -131,26 +131,71 @@ LIBUNINAME = ../libuniname/libuniname.a # Source dependencies. msgcmp_SOURCES = msgcmp.c -msgfmt_SOURCES = msgfmt.c \ +msgfmt_SOURCES = msgfmt.c +msgfmt_SOURCES += \ write-mo.c write-java.c write-csharp.c write-resources.c write-tcl.c \ write-qt.c plural-eval.c ../../gettext-runtime/intl/hash-string.c -msgmerge_SOURCES = msgmerge.c plural-count.c -msgunfmt_SOURCES = msgunfmt.c \ +if !MINGW +msgmerge_SOURCES = msgmerge.c +else +msgmerge_SOURCES = ../mingw/c++msgmerge.cc +endif +msgmerge_SOURCES += plural-count.c +msgunfmt_SOURCES = msgunfmt.c +msgunfmt_SOURCES += \ read-mo.c read-java.c read-csharp.c read-resources.c read-tcl.c -xgettext_SOURCES = xgettext.c \ +if !MINGW +xgettext_SOURCES = xgettext.c +else +xgettext_SOURCES = ../mingw/c++xgettext.cc +endif +xgettext_SOURCES += \ x-c.c x-po.c x-sh.c x-python.c x-lisp.c x-elisp.c x-librep.c x-scheme.c \ x-smalltalk.c x-java.c x-csharp.c x-awk.c x-ycp.c x-tcl.c x-perl.c x-php.c \ x-rst.c x-glade.c +if !MINGW msgattrib_SOURCES = msgattrib.c +else +msgattrib_SOURCES = ../mingw/c++msgattrib.cc +endif +if !MINGW msgcat_SOURCES = msgcat.c +else +msgcat_SOURCES = ../mingw/c++msgcat.cc +endif +if !MINGW msgcomm_SOURCES = msgcomm.c +else +msgcomm_SOURCES = ../mingw/c++msgcomm.cc +endif +if !MINGW msgconv_SOURCES = msgconv.c +else +msgconv_SOURCES = ../mingw/c++msgconv.cc +endif +if !MINGW msgen_SOURCES = msgen.c +else +msgen_SOURCES = ../mingw/c++msgen.cc +endif msgexec_SOURCES = msgexec.c +if !MINGW msgfilter_SOURCES = msgfilter.c +else +msgfilter_SOURCES = ../mingw/c++msgfilter.cc +endif +if !MINGW msggrep_SOURCES = msggrep.c -msginit_SOURCES = msginit.c plural-count.c ../../gettext-runtime/intl/localealias.c +else +msggrep_SOURCES = ../mingw/c++msggrep.cc +endif +msginit_SOURCES = msginit.c +msginit_SOURCES += plural-count.c ../../gettext-runtime/intl/localealias.c +if !MINGW msguniq_SOURCES = msguniq.c +else +msguniq_SOURCES = ../mingw/c++msguniq.cc +endif hostname_SOURCES = hostname.c urlget_SOURCES = urlget.c @@ -161,7 +206,16 @@ urlget_SOURCES = urlget.c # use iconv(). libgettextsrc_la_LDFLAGS = \ -release @VERSION@ \ - ../lib/libgettextlib.la @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined + ../lib/libgettextlib.la @LTLIBINTL@ @LTLIBICONV@ -lc @LTNOUNDEF@ + +# Special rules for mingw. +if MINGW +format_CFLAGS = -x c++ +# Work around an automake 1.9 bug: *_CFLAGS settings are ignored for elements +# of a libtool library. +format.lo: format.c + $(LTCOMPILE) $(format_CFLAGS) -c -o format.lo format.c +endif # No need to install libgettextsrc.a, except on AIX. install-exec-local: install-libLTLIBRARIES install-exec-clean @@ -177,7 +231,7 @@ install-exec-clean: libgettextpo_la_LDFLAGS = \ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ -rpath $(libdir) \ - libgettextsrc.la ../lib/libgettextlib.la @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined + libgettextsrc.la ../lib/libgettextlib.la @LTLIBINTL@ @LTLIBICONV@ -lc @LTNOUNDEF@ # Build order. Only needed for "make -j[N]". libgettextpo_la_DEPENDENCIES = libgettextsrc.la @@ -203,23 +257,23 @@ msginit_LDADD = ../intl/localename.@INTL_LIBTOOL_SUFFIX_PREFIX@o \ msguniq_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@ # Specify installation directory, for --enable-relocatable. -msgcmp_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgfmt_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgmerge_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgunfmt_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -xgettext_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgattrib_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgcat_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgcomm_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgconv_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgen_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgexec_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msgfilter_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msggrep_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msginit_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -msguniq_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -hostname_CFLAGS = -DINSTALLDIR=\"$(pkglibdir)\" -urlget_CFLAGS = -DINSTALLDIR=\"$(pkglibdir)\" +msgcmp_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgfmt_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgmerge_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgunfmt_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +xgettext_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgattrib_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgcat_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgcomm_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgconv_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgen_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgexec_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msgfilter_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msggrep_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msginit_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +msguniq_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" +hostname_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(pkglibdir)\" +urlget_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(pkglibdir)\" if RELOCATABLE_VIA_LD msgcmp_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)` msgfmt_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`