**** Merged r40732-r40872 from MCS ****
[mono.git] / mcs / gmcs / driver.cs
index 903810d2a333317f42e406b0110ff18ba55301af..4d74fe1cddae5ed9814fb48b9de6ac95a1f6eb9c 100644 (file)
@@ -220,8 +220,8 @@ namespace Mono.CSharp
                                "   -noconfig[+|-]     Disables implicit references to assemblies\n" +
                                "   -nostdlib[+|-]     Does not load core libraries\n" +
                                "   -nowarn:W1[,W2]    Disables one or more warnings\n" + 
+                               "   -optimize[+|-]     Enables code optimalizations" + Environment.NewLine +
                                "   -out:FNAME         Specifies output file\n" +
-                               "   -doc:XMLFILE         Generates xml documentation into specified file\n" +
                                "   -pkg:P1[,Pn]       References packages P1..Pn\n" + 
                                "   --expect-error X   Expect that error X will be encountered\n" +
                                "   -recurse:SPEC      Recursively compiles the files in SPEC ([dir]/file)\n" + 
@@ -256,7 +256,7 @@ namespace Mono.CSharp
                                "For more information on Mono, visit the project Web site\n" +
                                "   http://www.go-mono.com\n\n" +
 
-                               "The compiler was written by Miguel de Icaza, Ravi Pratap, Martin Baulig and Marek Safar");
+                               "The compiler was written by Miguel de Icaza, Ravi Pratap, Martin Baulig, Marek Safar, Raja R Harinath");
                        Environment.Exit (0);
                }
 
@@ -297,7 +297,7 @@ namespace Mono.CSharp
                                        a = Assembly.LoadFrom (assembly);
                                } else {
                                        string ass = assembly;
-                                       if (ass.EndsWith (".dll"))
+                                       if (ass.EndsWith (".dll") || ass.EndsWith (".exe"))
                                                ass = assembly.Substring (0, assembly.Length - 4);
                                        a = Assembly.Load (ass);
                                }
@@ -306,7 +306,7 @@ namespace Mono.CSharp
                        } catch (FileNotFoundException){
                                foreach (string dir in link_paths){
                                        string full_path = Path.Combine (dir, assembly);
-                                       if (!assembly.EndsWith (".dll"))
+                                       if (!assembly.EndsWith (".dll") && !assembly.EndsWith (".exe"))
                                                full_path += ".dll";
 
                                        try {
@@ -951,7 +951,13 @@ namespace Mono.CSharp
 
                        case "/optimize":
                        case "/optimize+":
+                               RootContext.Optimize = true;
+                               return true;
+
                        case "/optimize-":
+                               RootContext.Optimize = false;
+                               return true;
+
                        case "/incremental":
                        case "/incremental+":
                        case "/incremental-":