[System] Always use mcs as CodeDOM backend compiler
authorMarek Safar <marek.safar@gmail.com>
Mon, 12 Dec 2016 14:48:36 +0000 (15:48 +0100)
committerMarek Safar <marek.safar@gmail.com>
Mon, 12 Dec 2016 14:48:36 +0000 (15:48 +0100)
mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs
mcs/class/System/System/MonoToolsLocator.cs
runtime/Makefile.am

index 3d4e7970ea1a6be711663c7f2db8dafe34885543..26dd47b4c95820975ae3d952a8722031ebfec4c8 100644 (file)
@@ -133,9 +133,9 @@ namespace Mono.CSharp
                        // FIXME: these lines had better be platform independent.
                        if (Path.DirectorySeparatorChar == '\\') {
                                mcs.StartInfo.FileName = MonoToolsLocator.Mono;
-                               mcs.StartInfo.Arguments = "\"" + MonoToolsLocator.CSharpCompiler + "\" ";
+                               mcs.StartInfo.Arguments = "\"" + MonoToolsLocator.McsCSharpCompiler + "\" ";
                        } else {
-                               mcs.StartInfo.FileName = MonoToolsLocator.CSharpCompiler;
+                               mcs.StartInfo.FileName = MonoToolsLocator.McsCSharpCompiler;
                        }
 
                        mcs.StartInfo.Arguments += BuildArgs (options, fileNames, ProviderOptions);
@@ -169,7 +169,7 @@ namespace Mono.CSharp
                        mcs.StartInfo.UseShellExecute=false;
                        mcs.StartInfo.RedirectStandardOutput=true;
                        mcs.StartInfo.RedirectStandardError=true;
-                       mcs.OutputDataReceived += new DataReceivedEventHandler (McsStderrDataReceived);
+                       mcs.ErrorDataReceived += new DataReceivedEventHandler (McsStderrDataReceived);
 
                        // Use same text decoder as mcs and not user set values in Console
                        mcs.StartInfo.StandardOutputEncoding =
@@ -268,7 +268,7 @@ namespace Mono.CSharp
                                        options.Win32Resource);
 
                        if (options.IncludeDebugInformation)
-                               args.Append("/debug:portable /optimize- ");
+                               args.Append("/debug+ /optimize- ");
                        else
                                args.Append("/debug- /optimize+ ");
 
@@ -327,9 +327,7 @@ namespace Mono.CSharp
 
                        args.Append ("/noconfig ");
 
-                       args.Append ("/nologo ");
-
-                       // args.Append (" -- ");
+                       args.Append (" -- ");
                        foreach (string source in fileNames)
                                args.AppendFormat("\"{0}\" ",source);
                        return args.ToString();
index 8ac5c54b8a0974c16f82dc588a8da8ab8152f3e0..7c1e9ab7911fbc79ce1fcfa8ec6279da25ebed5b 100755 (executable)
@@ -11,7 +11,7 @@ namespace System {
        static class MonoToolsLocator
        {
                public static readonly string Mono;
-               public static readonly string CSharpCompiler;
+               public static readonly string McsCSharpCompiler;
                public static readonly string VBCompiler;
                public static readonly string AssemblyLinker;
 
@@ -46,11 +46,10 @@ namespace System {
                                //if (!File.Exists (Mono))
                                //      throw new FileNotFoundException ("Windows mono path not found: " + Mono);
 
-                               CSharpCompiler = Path.Combine (GacPath, "4.5", "csc.exe");
-                               if (!File.Exists (CSharpCompiler)) {
+                               McsCSharpCompiler = Path.Combine (GacPath, "4.5", "mcs.exe");
+                               if (!File.Exists (McsCSharpCompiler)) {
                                        // Starting from mono\mcs\class
-                                       CSharpCompiler = Path.Combine (Path.GetDirectoryName (GacPath), "..", "..", "external", "roslyn-binaries",
-                                               "Microsoft.Net.Compilers", "Microsoft.Net.Compilers.1.3.2", "tools", "csc.exe");
+                                       McsCSharpCompiler = Path.Combine (Path.GetDirectoryName (GacPath), "lib", "net_4_x", "mcs.exe");
                                }
 
                                //if (!File.Exists (CSharpCompiler))
@@ -70,9 +69,9 @@ namespace System {
                                        Mono = "mono";
 
                                var mscorlibPath = new Uri (typeof (object).Assembly.CodeBase).LocalPath;
-                               CSharpCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "csc"));
-                               if (!File.Exists (CSharpCompiler))
-                                       CSharpCompiler = "csc";
+                               McsCSharpCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "mcs"));
+                               if (!File.Exists (McsCSharpCompiler))
+                                       McsCSharpCompiler = "mcs";
 
                                VBCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "vbnc"));
                                if (!File.Exists (VBCompiler))
index 7af06ebeee507c8dbd07d0b1d21d414bd3175374..5224c91837ff9bb9dd665d43987db121b7285be7 100644 (file)
@@ -29,7 +29,7 @@ build_profiles =
 
 if INSTALL_4_x
 build_profiles += binary_reference_assemblies net_4_x xbuild_12 xbuild_14
-al_profile = net_4_x
+net_profile = net_4_x
 endif
 
 if INSTALL_MONODROID
@@ -92,7 +92,7 @@ clean-local:
 
 endif BUILD_MCS
 
-TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/csc $(tmpinst)/bin/al
+TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/csc $(tmpinst)/bin/mcs $(tmpinst)/bin/al
 
 mcs-do-test-profiles:
        cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles
@@ -187,6 +187,12 @@ $(tmpinst)/bin/csc: $(tmpinst)/bin/mono Makefile
        echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$(CSC)"'" "$$@"' >> $@ ; \
        chmod +x $@
 
+$(tmpinst)/bin/mcs: $(tmpinst)/bin/mono Makefile
+       echo '#! /bin/sh' > $@ ; \
+       r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
+       echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/mcs.exe"'" "$$@"' >> $@ ; \
+       chmod +x $@
+
 $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
        echo '#! /bin/sh' > $@ ; \
        r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
@@ -196,7 +202,7 @@ $(tmpinst)/bin/ilasm: $(tmpinst)/bin/mono Makefile
 $(tmpinst)/bin/al: $(tmpinst)/bin/mono Makefile
        echo '#! /bin/sh' > $@ ; \
        r=`pwd`; m=`cd $(mcs_topdir) && pwd`; \
-       echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(al_profile)/al.exe"'" "$$@"' >> $@ ; \
+       echo 'exec "'"$$r/$(tmpinst)/bin/mono"'" "'"$$m/class/lib/$(net_profile)/al.exe"'" "$$@"' >> $@ ; \
        chmod +x $@
 
 test-support-files: $(TEST_SUPPORT_FILES)