[m-rev.] C# compiler.

Julien Fischer jfischer at opturion.com
Tue Jan 8 14:14:20 AEDT 2013


Hi,

On Tue, Jan 8, 2013 at 2:06 PM, Paul Bone <paul at bone.id.au> wrote:
>
> I have trouble buidling the csharp grade on my Debian Linux 6.0.6 system
> with mono-1.0-devel and mono-2.0-devel (there is no version 3 or 4 packages
> for this version of debian).
>
> I have to make the following change to m4/mercury.m4 before I can build
> mercury.  The symptom is that linking the standard library in the csharp grade
> fails as the choosen compiler 'mcs' does not support generics.

> diff --git a/m4/mercury.m4 b/m4/mercury.m4
> index 2435bc1..c7f3c2d 100644
> --- a/m4/mercury.m4
> +++ b/m4/mercury.m4
> @@ -252,7 +252,7 @@ GACUTIL=`basename "$GACUTIL"`
>  # dmcs is the Mono C# compiler targeting the 4.0 runtime
>  # gmcs is the Mono C# compiler targeting the 2.0 runtime (with generics).
>  # cscc is the DotGNU C# compiler.
> -AC_PATH_PROGS([CANDIDATE_CSC], [csc mcs dmcs gmcs cscc])
> +AC_PATH_PROGS([CANDIDATE_CSC], [csc dmcs gmcs mcs cscc])
>  CANDIDATE_CSC=`basename "$CANDIDATE_CSC"`
>
>  # The Microsoft C# compiler and the Chicken Scheme compiler share the same
>
> This change ensures that the version 2.0 compiler (gmcs) is used in preference
> to the 1.0 compiler mcs.  At least 2.0 is required as generics are required.
> The comment in m4/mercury.m4 says that the mcs executable should be generic
> (uses the latest available API?).
>
> Has anyone else experienced this?  On what systems is the mcs compiler
> preferred over gmcs or dmcs?  Finally, would it be better to remove mcs from
> this list altogether?  (or test when it is unsuitable)

According to <http://www.mono-project.com/CSharp_Compiler>, mcs is now the
official one, so it should be there.  I suggest two things:

(1) Test when it unsuitable -- IIRC, we don't do any testing of the C#
compiler in
configure at the moment anyway.  (Other than checking that csc is not
the Chicken
Scheme Compiler!)

(2) Add a --with-csharp-compiler option to configure that allows the
user to choose
which C# compiler to use.

Cheers,
Julien.



More information about the reviews mailing list