[m-rev.] diff: further work towards building the compiler in the csharp grade

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Jan 27 16:20:58 AEDT 2011


For post-commit review by Peter.

The following gets us to the point where we top_level.exe is built -- 
things fall over after that because the .exe extension is always present
in the csharp grade but the Mmakefile in the compiler directory doesn't 
expect that (at least on non-Windows systems).  I will fix this 
separately.

Branches: main, 11.01

A step towards getting the compiler to build in the csharp grade.

compiler/Mmakefile:
 	Tell the C# compiler where the assemblies for the standard library
 	and the mdbcomp library are.

compiler/pickle.m:
 	Provide C# implementations of some foreign procs.

Julien.

Index: Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/Mmakefile,v
retrieving revision 1.110
diff -u -r1.110 Mmakefile
--- Mmakefile	26 Jan 2011 07:38:02 -0000	1.110
+++ Mmakefile	27 Jan 2011 05:14:46 -0000
@@ -249,6 +249,14 @@

  #-----------------------------------------------------------------------------#

+# Tell the C# compiler where the stdlib and mdbcomp assemblies are.
+#
+ifneq ("$(filter csharp%,$(GRADE))","")
+CSCFLAGS=-lib:../library -r:mer_std -lib:../mdbcomp -r:mer_mdbcomp
+endif
+
+#-----------------------------------------------------------------------------#
+
  # Add some additional dependencies, so that Mmake knows to remake the
  # compiler if one of the libraries changes.

Index: pickle.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pickle.m,v
retrieving revision 1.5
diff -u -r1.5 pickle.m
--- pickle.m	19 Jan 2011 07:01:49 -0000	1.5
+++ pickle.m	27 Jan 2011 05:14:46 -0000
@@ -205,6 +205,13 @@
      B = A;
  ").

+:- pragma foreign_proc("C#",
+    pickler_inst_cast(A::in, B::out(pickler_pred)),
+    [will_not_call_mercury, thread_safe, promise_pure],
+"
+    B = A;
+").
+
  %-----------------------------------------------------------------------------%
  %
  % Unpickling
@@ -338,6 +345,13 @@
      B = A;
  ").

+:- pragma foreign_proc("C#",
+    unpickler_inst_cast(A::in, B::out(unpickler_pred)),
+    [will_not_call_mercury, thread_safe, promise_pure],
+"
+    B = A;
+").
+
  %-----------------------------------------------------------------------------%
  %
  % Basic types picklers/unpicklers



--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list