[mkbundle] fix execution for X.Android on Windows regarding dos2unix.
authorAtsushi Eno <atsushieno@gmail.com>
Mon, 8 Dec 2014 15:40:52 +0000 (23:40 +0800)
committerAtsushi Eno <atsushieno@gmail.com>
Mon, 8 Dec 2014 15:40:52 +0000 (23:40 +0800)
This fixes bug #25086 (Xamarin.Android). Details described there.

To fix the issue, we use #if XAMARIN_ANDROID to avoid that old cygwin-only
code path. (We are not sure if simply removing the old code still works,
so we don't remove that for now.)

mcs/tools/mkbundle/mkbundle.cs

index 6e1189953777686f059a4cf8fc24af6649dcf390..3677bcea8ead9abbf3f4681e3b5e070ee378f357 100755 (executable)
@@ -704,6 +704,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                        return system (cmdLine);
                }
                
+#if XAMARIN_ANDROID
                // on Windows, we have to pipe the output of a
                // `cmd` interpolation to dos2unix, because the shell does not
                // strip the CRLFs generated by the native pkg-config distributed
@@ -732,6 +733,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                }
                // and if there is no dos2unix, just run cmd /c.
                if (use_dos2unix == false) {
+#endif
                        Console.WriteLine (cmdLine);
                        ProcessStartInfo dos2unix = new ProcessStartInfo ();
                        dos2unix.UseShellExecute = false;
@@ -742,15 +744,19 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                p.WaitForExit ();
                                return p.ExitCode;
                        }
+#if XAMARIN_ANDROID
                }
+#endif
 
                StringBuilder b = new StringBuilder ();
                int count = 0;
                for (int i = 0; i < cmdLine.Length; i++) {
                        if (cmdLine [i] == '`') {
+#if XAMARIN_ANDROID
                                if (count % 2 != 0) {
                                        b.Append ("|dos2unix");
                                }
+#endif
                                count++;
                        }
                        b.Append (cmdLine [i]);