~ubuntu-branches/ubuntu/lucid/mono/lucid

« back to all changes in this revision

Viewing changes to mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs

  • Committer: Bazaar Package Importer
  • Author(s): Mirco Bauer
  • Date: 2009-07-30 19:35:10 UTC
  • mto: (5.2.2 squeeze)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20090730193510-cdttfvqokq2kmdvh
Tags: upstream-2.4.2.3+dfsg
ImportĀ upstreamĀ versionĀ 2.4.2.3+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        using System;
35
35
        using System.CodeDom;
36
36
        using System.CodeDom.Compiler;
 
37
        using System.ComponentModel;
37
38
        using System.IO;
38
39
        using System.Text;
39
40
        using System.Reflection;
216
217
                        mcsOutput = new StringCollection ();
217
218
                        mcsOutMutex = new Mutex ();
218
219
#endif
 
220
 
 
221
                        string monoPath = Environment.GetEnvironmentVariable ("MONO_PATH");
 
222
                        if (monoPath == null)
 
223
                                monoPath = String.Empty;
 
224
                        
 
225
                        string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
 
226
                        if (privateBinPath != null && privateBinPath.Length > 0)
 
227
                                monoPath = String.Format ("{0}:{1}", privateBinPath, monoPath);
 
228
 
 
229
                        if (monoPath.Length > 0) {
 
230
                                StringDictionary dict = mcs.StartInfo.EnvironmentVariables;
 
231
                                if (dict.ContainsKey ("MONO_PATH"))
 
232
                                        dict ["MONO_PATH"] = monoPath;
 
233
                                else
 
234
                                        dict.Add ("MONO_PATH", monoPath);
 
235
                        }
219
236
                        
220
237
                        mcs.StartInfo.CreateNoWindow=true;
221
238
                        mcs.StartInfo.UseShellExecute=false;
227
244
                        
228
245
                        try {
229
246
                                mcs.Start();
 
247
                        } catch (Exception e) {
 
248
                                Win32Exception exc = e as Win32Exception;
 
249
                                if (exc != null) {
 
250
                                        throw new SystemException (String.Format ("Error running {0}: {1}", mcs.StartInfo.FileName,
 
251
                                                                        Win32Exception.W32ErrorMessage (exc.NativeErrorCode)));
 
252
                                }
 
253
                                throw;
 
254
                        }
230
255
 
 
256
                        try {
231
257
#if NET_2_0
232
258
                                mcs.BeginOutputReadLine ();
233
259
                                mcs.BeginErrorReadLine ();
321
347
                        else
322
348
                                args.Append("/target:library ");
323
349
 
 
350
                        string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
 
351
                        if (privateBinPath != null && privateBinPath.Length > 0)
 
352
                                args.AppendFormat ("/lib:\"{0}\" ", privateBinPath);
 
353
                        
324
354
                        if (options.Win32Resource != null)
325
355
                                args.AppendFormat("/win32res:\"{0}\" ",
326
356
                                        options.Win32Resource);