From: Jackson Harper Date: Thu, 29 Apr 2004 06:57:45 +0000 (-0000) Subject: * driver.cs: Prefer the corlib system version when looking for X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=a1a7a4de52fbc467c750966c61420ca4aeb34e0d;p=mono.git * driver.cs: Prefer the corlib system version when looking for assemblies in the GAC. This is still a hack, but its a better hack now. svn path=/trunk/mcs/; revision=26279 --- diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 5fdadb701aa..49943ddcc9e 100755 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,9 @@ +2004-04-29 Jackson Harper + + * driver.cs: Prefer the corlib system version when looking for + assemblies in the GAC. This is still a hack, but its a better hack + now. + 2004-04-29 Marek Safar * decl.cs, enum.cs: Improved error 3005 reporting. diff --git a/mcs/mcs/driver.cs b/mcs/mcs/driver.cs index 25202b3b856..8e10379c034 100755 --- a/mcs/mcs/driver.cs +++ b/mcs/mcs/driver.cs @@ -104,6 +104,12 @@ namespace Mono.CSharp // Whether the user has specified a different encoder manually // static bool using_default_encoder = true; + + // + // The system version we are using, if not specified on the commandline we + // will use the same version as corlib for looking for libraries in the GAC. + // + static string sys_version; public static void ShowTime (string msg) { @@ -344,8 +350,11 @@ namespace Mono.CSharp if (!Directory.Exists (asmb_path)) return null; - canidates = Directory.GetDirectories (asmb_path); - + canidates = Directory.GetDirectories (asmb_path, GetSysVersion () + "*"); + if (canidates.Length == 0) + canidates = Directory.GetDirectories (asmb_path); + if (canidates.Length == 0) + return null; try { Assembly a = Assembly.LoadFrom (Path.Combine (canidates [0], use_name + ".dll")); return a; @@ -354,6 +363,14 @@ namespace Mono.CSharp } } + static string GetSysVersion () + { + if (sys_version != null) + return sys_version; + sys_version = typeof (object).Assembly.GetName ().Version.ToString (); + return sys_version; + } + static public void LoadModule (MethodInfo adder_method, string module) { Module m;