[m-rev.] diff: another fix for csc

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Feb 2 01:00:12 AEDT 2011


Branches: main, 11.01

Fix a problem that has prevented the standard libraries building
in the csharp grade with the Microsoft C# compiler.

compiler/compile_target_code.m:
 	When referencing an assembly on the command line we must
 	include the .dll extension in the name since csc requires that.
 	(Mono doesn't appear to care whether it is present or not.)

Julien.

Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.165
diff -u -r1.165 compile_target_code.m
--- compiler/compile_target_code.m	31 Jan 2011 06:31:40 -0000	1.165
+++ compiler/compile_target_code.m	1 Feb 2011 13:55:49 -0000
@@ -2461,11 +2461,13 @@
          ; Target = target_x86_64
          ),
          globals.lookup_string_option(Globals, mercury_linkage, MercuryLinkage),
-        LinkOpt = "-l"
+        LinkOpt = "-l",
+        LibSuffix = ""
      ;
          Target = target_csharp,
          MercuryLinkage = "shared",
-        LinkOpt = "/r:"
+        LinkOpt = "/r:",
+        LibSuffix = ".dll"
      ;
          Target = target_il,
          unexpected(this_file, "process_link_library: target_java")
@@ -2506,7 +2508,7 @@
              !:Succeeded = no
          )
      ;
-        LinkerOpt = LinkOpt ++ LibName
+        LinkerOpt = LinkOpt ++ LibName ++ LibSuffix
      ).

  :- pred create_archive(globals::in, io.output_stream::in, file_name::in,



--------------------------------------------------------------------------
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