Merge pull request #1991 from esdrubal/seq_test_fix
[mono.git] / mcs / tools / mkbundle / mkbundle.cs
index f13ce63d029438bedb9bb1c7ebd96c6530d93191..ec5c1f10aabad6e73e5b4e84fa54d1b42b21a954 100755 (executable)
@@ -19,9 +19,7 @@ using System.Text;
 using IKVM.Reflection;
 
 
-#if NET_4_5
 using System.Threading.Tasks;
-#endif
 
 class MakeBundle {
        static string output = "a.out";
@@ -158,6 +156,13 @@ class MakeBundle {
                                }
                                ctor_func = args [++i];
                                break;
+                       case "--dos2unix":
+                       case "--dos2unix=true":
+                               use_dos2unix = true;
+                               break;
+                       case "--dos2unix=false":
+                               use_dos2unix = false;
+                               break;
                        default:
                                sources.Add (args [i]);
                                break;
@@ -413,9 +418,11 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                ts.WriteLine ();
                        }
                        ts.Close ();
+
+                       string assembler = GetEnv ("AS", IsUnix ? "as" : "i686-pc-mingw32-as");
                        
                        Console.WriteLine ("Compiling:");
-                       string cmd = String.Format ("{0} -o {1} {2} ", GetEnv ("AS", "as"), temp_o, temp_s);
+                       string cmd = String.Format ("{0} -o {1} {2} ", assembler, temp_o, temp_s);
                        int ret = Execute (cmd);
                        if (ret != 0){
                                Error ("[Fail]");
@@ -651,6 +658,10 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                   "    -L path             Adds `path' to the search path for assemblies\n" +
                                   "    --nodeps            Turns off automatic dependency embedding (default)\n" +
                                   "    --deps              Turns on automatic dependency embedding\n" +
+                                  "    --dos2unix[=true|false]\n" +
+                                  "                        When no value provided, or when `true` specified\n" +
+                                  "                        `dos2unix` will be invoked to convert paths on Windows.\n" +
+                                  "                        When `--dos2unix=false` used, dos2unix is NEVER used.\n" +
                                   "    --keeptemp          Keeps the temporary files\n" +
                                   "    --config F          Bundle system config file `F'\n" +
                                   "    --config-dir D      Set MONO_CFG_DIR to `D'\n" +
@@ -715,9 +726,14 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                if (use_dos2unix == null) {
                        use_dos2unix = false;
                        try {
-                               var dos2unix = Process.Start ("dos2unix");
+                               var info = new ProcessStartInfo ("dos2unix");
+                               info.CreateNoWindow = true;
+                               info.RedirectStandardInput = true;
+                               info.UseShellExecute = false;
+                               var dos2unix = Process.Start (info);
                                dos2unix.StandardInput.WriteLine ("aaa");
                                dos2unix.StandardInput.WriteLine ("\u0004");
+                               dos2unix.StandardInput.Close ();
                                dos2unix.WaitForExit ();
                                if (dos2unix.ExitCode == 0)
                                        use_dos2unix = true;