[m-rev.] C# compiler.

Paul Bone paul at bone.id.au
Tue Jan 8 14:06:42 AEDT 2013


Hi Guys.

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)


-- 
Paul Bone
http://www.bone.id.au



More information about the reviews mailing list