From: Bruno Haible Date: Tue, 9 Oct 2018 00:44:00 +0000 (+0200) Subject: C# support: Remove pnet choice. X-Git-Tag: v0.20~363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88582a13837753ad25749abbfbb95f436fee744c;p=thirdparty%2Fgettext.git C# support: Remove pnet choice. * DEPENDENCIES: Don't mention pnet. * PACKAGING: Likewise. * gettext-tools/src/format-csharp.c: Simplify comment. * gettext-tools/src/msgfmt.cs: Remove workarounds for cscc. * gettext-tools/src/write-csharp.c (write_csharp_code): Update comment. * gettext-tools/doc/gettext.texi (C#): Don't mention resgen. * gettext-tools/tests/lang-csharp: Rely on mono, not pnet. * gettext-tools/examples/hello-csharp/INSTALL: Likewise. * gettext-tools/examples/hello-csharp-forms/INSTALL: Likewise. * gettext-tools/examples/hello-csharp-forms/BUGS: Remove file. --- diff --git a/DEPENDENCIES b/DEPENDENCIES index 19e41f532..7a29efffe 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -51,7 +51,7 @@ The following packages should be installed before GNU gettext is installed http://openjdk.java.net/install/index.html https://github.com/kaffe/kaffe -* A C# runtime and compiler (e.g. pnet or mono). +* A C# runtime and compiler (e.g. mono). + Recommended. Needed for building GNU.Gettext.dll. Also needed for 'msgfmt' and 'msgunfmt', so that they can handle C# resources and assemblies. diff --git a/PACKAGING b/PACKAGING index 00a2dab0c..419e7edbc 100644 --- a/PACKAGING +++ b/PACKAGING @@ -168,8 +168,4 @@ the Java virtual machine (OpenJDK, Oracle Java, IBM Java, or other). C# support: ----------- -For C# support, one of pnet or mono must be available at build time; it must -also be available at run time. If you have both available, choose the desired -one through the configure option. Note there is no interoperability currently -between pnet and mono: Programs compiled with pnet don't run with mono, and -vice versa. +For C# support, mono must be available at build time and at run time. diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi index 49b284bd4..5409cd59c 100644 --- a/gettext-tools/doc/gettext.texi +++ b/gettext-tools/doc/gettext.texi @@ -10599,12 +10599,10 @@ To convert a PO file to a @code{.resources} file, the @code{msgfmt} program can be used with the option @samp{--csharp-resources}. To convert a @code{.resources} file back to a PO file, the @code{msgunfmt} program can be used with the option @samp{--csharp-resources}. You can also, in some cases, -use the @code{resgen} program (from the @code{pnet} package) or the -@code{monoresgen} program (from the @code{mono}/@code{mcs} package). These -programs can also convert a @code{.resources} file back to a PO file. But +use the @code{monoresgen} program (from the @code{mono}/@code{mcs} package). +This program can also convert a @code{.resources} file back to a PO file. But beware: as of this writing (January 2004), the @code{monoresgen} converter is -quite buggy and the @code{resgen} converter ignores the encoding of the PO -files. +quite buggy. To convert a PO file to a @code{.dll} file, the @code{msgfmt} program can be used with the option @code{--csharp}. The result will be a @code{.dll} file diff --git a/gettext-tools/examples/hello-csharp-forms/BUGS b/gettext-tools/examples/hello-csharp-forms/BUGS deleted file mode 100644 index af7009ab9..000000000 --- a/gettext-tools/examples/hello-csharp-forms/BUGS +++ /dev/null @@ -1,2 +0,0 @@ -Correct display of characters depends on the C# execution engine. For example, -in pnet 0.6.0.1, Western fonts display fine but East Asian fonts don't work. diff --git a/gettext-tools/examples/hello-csharp-forms/INSTALL b/gettext-tools/examples/hello-csharp-forms/INSTALL index 011cc8169..31c44e480 100644 --- a/gettext-tools/examples/hello-csharp-forms/INSTALL +++ b/gettext-tools/examples/hello-csharp-forms/INSTALL @@ -1,5 +1,5 @@ This example relies on: - - a C# implementation with System.Windows.Forms library, e.g. pnet+pnetlib + - a C# implementation with System.Windows.Forms library: mono Installation: ./autogen.sh diff --git a/gettext-tools/examples/hello-csharp/INSTALL b/gettext-tools/examples/hello-csharp/INSTALL index ea09f7ac9..aacf6bc37 100644 --- a/gettext-tools/examples/hello-csharp/INSTALL +++ b/gettext-tools/examples/hello-csharp/INSTALL @@ -1,5 +1,5 @@ This example relies on: - - a C# implementation: either pnet+pnetlib or mono+mcs + - a C# implementation: mono Installation: ./autogen.sh diff --git a/gettext-tools/src/format-csharp.c b/gettext-tools/src/format-csharp.c index 70588b49c..899818179 100644 --- a/gettext-tools/src/format-csharp.c +++ b/gettext-tools/src/format-csharp.c @@ -1,5 +1,5 @@ /* C# format strings. - Copyright (C) 2003-2004, 2006-2007, 2009, 2015-2016 Free Software + Copyright (C) 2003-2004, 2006-2007, 2009, 2015-2016, 2018 Free Software Foundation, Inc. Written by Bruno Haible , 2003. @@ -32,10 +32,7 @@ #define _(str) gettext (str) /* C# format strings are described in the description of the .NET System.String - class and implemented in - pnetlib-0.5.6/runtime/System/String.cs - and - mcs-0.28/class/corlib/System/String.cs + class and implemented in mcs-0.28/class/corlib/System/String.cs . A format string consists of literal text (that is output verbatim), doubled braces ('{{' and '}}', that lead to a single brace when output), and directives. diff --git a/gettext-tools/src/msgfmt.cs b/gettext-tools/src/msgfmt.cs index 6bf58d2e7..f7295d1dd 100644 --- a/gettext-tools/src/msgfmt.cs +++ b/gettext-tools/src/msgfmt.cs @@ -1,5 +1,5 @@ /* GNU gettext for C# - * Copyright (C) 2003, 2015-2016 Free Software Foundation, Inc. + * Copyright (C) 2003, 2015-2016, 2018 Free Software Foundation, Inc. * Written by Bruno Haible , 2003. * * This program is free software: you can redistribute it and/or modify @@ -68,41 +68,13 @@ namespace GNU.Gettext { MemoryStream tmpoutput = new MemoryStream(); ResourceWriter rw = new ResourceWriter(tmpoutput); ReadAllInput(rw); -#if __CSCC__ - // Use the ResourceReader to check against pnet-0.6.0 ResourceWriter - // bug. - try { - ResourceReader rr = new ResourceReader(new MemoryStream(tmpoutput.ToArray())); - foreach (System.Collections.DictionaryEntry entry in rr); - } catch (IOException e) { - throw new Exception("class ResourceWriter is buggy", e); - } -#endif tmpoutput.WriteTo(output); rw.Close(); output.Close(); } else { -#if __CSCC__ - MemoryStream tmpoutput = new MemoryStream(); - ResourceWriter rw = new ResourceWriter(tmpoutput); - ReadAllInput(rw); - // Use the ResourceReader to check against pnet-0.6.0 ResourceWriter - // bug. - try { - ResourceReader rr = new ResourceReader(new MemoryStream(tmpoutput.ToArray())); - foreach (System.Collections.DictionaryEntry entry in rr); - } catch (IOException e) { - throw new Exception("class ResourceWriter is buggy", e); - } - BufferedStream output = new BufferedStream(new FileStream(filename, FileMode.Create, FileAccess.Write)); - tmpoutput.WriteTo(output); - rw.Close(); - output.Close(); -#else ResourceWriter rw = new ResourceWriter(filename); ReadAllInput(rw); rw.Close(); -#endif } } public static int Main (String[] args) { diff --git a/gettext-tools/src/write-csharp.c b/gettext-tools/src/write-csharp.c index 1a8efde52..1e39d4a03 100644 --- a/gettext-tools/src/write-csharp.c +++ b/gettext-tools/src/write-csharp.c @@ -1,5 +1,5 @@ /* Writing C# satellite assemblies. - Copyright (C) 2003-2010, 2015-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2010, 2015-2016, 2018 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software: you can redistribute it and/or modify @@ -507,7 +507,7 @@ write_csharp_code (FILE *stream, const char *culture_name, const char *class_nam fprintf (stream, "/* Automatically generated by GNU msgfmt. Do not modify! */\n"); - /* We have to use a "using" statement here, to avoid a bug in the pnet-0.6.0 + /* We chose to use a "using" statement here, to avoid a bug in the pnet-0.6.0 compiler. */ fprintf (stream, "using GNU.Gettext;\n"); diff --git a/gettext-tools/tests/lang-csharp b/gettext-tools/tests/lang-csharp index eac133268..065489607 100755 --- a/gettext-tools/tests/lang-csharp +++ b/gettext-tools/tests/lang-csharp @@ -3,11 +3,7 @@ # Test of gettext facilities in the C# language. # Assumes an fr_FR locale is installed. -# Assumes the following packages are installed: pnet, pnetlib. - -# Note: This test fails with mono-0.28 because the CultureInfo.Parent pointers -# are wrong for locales containing a language and a territory. This is fixed -# in mono-0.29. +# Assumes the following packages are installed: mono, mcs. # Test whether we can build and test C# programs. test "${CSHARP_CHOICE}" != no || {