Author: mmarin
Date: 2007-09-14 15:35:02 -0400 (Fri, 14 Sep 2007)
New Revision: 85837

Modified:
   trunk/monodevelop/Extras/CBinding/ChangeLog
   trunk/monodevelop/Extras/CBinding/Compiler/GNUCompiler.cs
Log:
2007-09-14  Martin Dederer <[EMAIL PROTECTED]>

* Compiler/GNUCompiler.cs: Added method to expand backticked portions
  in compiler-/ linker-arguments


Modified: trunk/monodevelop/Extras/CBinding/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/CBinding/ChangeLog 2007-09-14 19:33:18 UTC (rev 
85836)
+++ trunk/monodevelop/Extras/CBinding/ChangeLog 2007-09-14 19:35:02 UTC (rev 
85837)
@@ -1,3 +1,8 @@
+2007-09-14  Martin Dederer <[EMAIL PROTECTED]>
+
+       * Compiler/GNUCompiler.cs: Added method to expand backticked portions
+       in compiler-/ linker-arguments
+
 2007-09-07  Marcos David MarĂ­n Amador <[EMAIL PROTECTED]>
 
        * CBinding.Autotools: Set svn:ignore property on

Modified: trunk/monodevelop/Extras/CBinding/Compiler/GNUCompiler.cs
===================================================================
--- trunk/monodevelop/Extras/CBinding/Compiler/GNUCompiler.cs   2007-09-14 
19:33:18 UTC (rev 85836)
+++ trunk/monodevelop/Extras/CBinding/Compiler/GNUCompiler.cs   2007-09-14 
19:35:02 UTC (rev 85837)
@@ -141,7 +141,7 @@
                        args.Append ("-O" + cp.OptimizationLevel + " ");
                        
                        if (cp.ExtraCompilerArguments != null && 
cp.ExtraCompilerArguments.Length > 0) {
-                               string extraCompilerArgs = 
cp.ExtraCompilerArguments.Replace ('\n', ' ');
+                               string extraCompilerArgs = 
ExpandBacktickedParameters(cp.ExtraCompilerArguments.Replace ('\n', ' '));
                                args.Append (extraCompilerArgs + " ");
                        }
                        
@@ -288,7 +288,7 @@
                                
(CCompilationParameters)configuration.CompilationParameters;
                        
                        if (cp.ExtraLinkerArguments != null && 
cp.ExtraLinkerArguments.Length > 0) {
-                               string extraLinkerArgs = 
cp.ExtraLinkerArguments.Replace ('\n', ' ');
+                               string extraLinkerArgs = 
ExpandBacktickedParameters(cp.ExtraLinkerArguments.Replace ('\n', ' '));
                                args.Append (extraLinkerArgs + " ");
                        }
                        
@@ -359,7 +359,7 @@
                                
(CCompilationParameters)configuration.CompilationParameters;
                        
                        if (cp.ExtraLinkerArguments != null && 
cp.ExtraLinkerArguments.Length > 0) {
-                               string extraLinkerArgs = 
cp.ExtraLinkerArguments.Replace ('\n', ' ');
+                               string extraLinkerArgs = 
ExpandBacktickedParameters(cp.ExtraLinkerArguments.Replace ('\n', ' '));
                                args.Append (extraLinkerArgs + " ");
                        }
                        
@@ -572,5 +572,21 @@
                        
                        return error;
                }
+
+               // expands backticked portions of the parameter-list using "sh" 
and "echo"
+               public string ExpandBacktickedParameters(string tmp)
+               {
+                       string parameters = "-c \"echo -n " + tmp + "\"";
+                       Process p = new Process();
+                       
+                       p.StartInfo.FileName = "sh";
+                       p.StartInfo.Arguments = parameters;
+                       p.StartInfo.UseShellExecute = false;
+                       p.StartInfo.RedirectStandardOutput = true;
+                       p.Start();
+                       p.WaitForExit();
+
+                       return p.StandardOutput.ReadToEnd();
+               }
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to