C.ICompilerTool.IncludePaths( Bam.Core.BaseTarget baseTarget) { // TODO: sort this out... it required a call to the InstallPath to get the right paths this.toolset.InstallPath(baseTarget); return((this.toolset as Toolset).GccDetail.IncludePaths); }
GetInstallPath( Bam.Core.BaseTarget baseTarget) { if (null != this.installPath) { return; } if (Bam.Core.State.HasCategory("Mingw") && Bam.Core.State.Has("Mingw", "InstallPath")) { this.installPath = Bam.Core.State.Get("Mingw", "InstallPath") as string; Bam.Core.Log.DebugMessage("Mingw install path set from command line to '{0}'", this.installPath); } if (null == this.installPath) { using (var key = Bam.Core.Win32RegistryUtilities.Open32BitLMSoftwareKey(@"Microsoft\Windows\CurrentVersion\Uninstall\MinGW")) { if (null == key) { throw new Bam.Core.Exception("Mingw 3.4.5 was not installed"); } this.installPath = key.GetValue("InstallLocation") as string; Bam.Core.Log.DebugMessage("Mingw: Install path from registry '{0}'", this.installPath); } } this.binPath = System.IO.Path.Combine(this.installPath, "bin"); this.environment.Add(this.binPath); this.details = MingwCommon.MingwDetailGatherer.DetermineSpecs(baseTarget, this); }
Bam.Core.ITool.Executable( Bam.Core.BaseTarget baseTarget) { var installPath = this.toolset.BinPath(baseTarget); var executablePath = System.IO.Path.Combine(installPath, "icpc"); return(executablePath); }
protected override string SpecificInstallPath(Bam.Core.BaseTarget baseTarget) { if (Bam.Core.OSUtilities.IsWindowsHosting) { return(@"D:\dev\Thirdparty\Clang\3.1\build\bin\Release"); } else { return(@"/usr/bin"); } }
GetBinPath( Bam.Core.BaseTarget baseTarget) { this.GetInstallPath(); if (baseTarget.HasPlatform(Bam.Core.EPlatform.Win64)) { // VS2012 does not have a pure 64-bit compiler return(this.bin6432Folder); } else { return(this.bin32Folder); } }
BinPath( Bam.Core.BaseTarget baseTarget) { string binPath; if (Bam.Core.OSUtilities.Is64Bit(baseTarget)) { binPath = bin64Path; } else { binPath = bin32Path; } return(binPath); }
GetInstallPath( Bam.Core.BaseTarget baseTarget) { if (null != this.installPath) { return; } string installPath = null; if (Bam.Core.State.HasCategory("ComposerXE") && Bam.Core.State.Has("ComposerXE", "InstallPath")) { installPath = Bam.Core.State.Get("ComposerXE", "InstallPath") as string; Bam.Core.Log.DebugMessage("ComposerXE install path set from command line to '{0}'", installPath); } if (null == installPath) { installPath = "/opt/intel"; } this.installPath = installPath; this.gccDetail = ComposerXECommon.GccDetailGatherer.DetermineSpecs(baseTarget, this); }
Bam.Core.IToolset.BinPath( Bam.Core.BaseTarget baseTarget) { this.GetInstallPath(baseTarget); return(System.IO.Path.Combine(this.installPath, "bin")); }
Bam.Core.IToolset.InstallPath( Bam.Core.BaseTarget baseTarget) { this.GetInstallPath(baseTarget); return(this.installPath); }
Bam.Core.IToolset.Version( Bam.Core.BaseTarget baseTarget) { return(this.Version); }
GetVersion( Bam.Core.BaseTarget baseTarget) { return(this.GetVersionString("8.0")); }
DetermineSpecs( Bam.Core.BaseTarget baseTarget, Bam.Core.IToolset toolset) { // get version string gccVersion = null; { var processStartInfo = new System.Diagnostics.ProcessStartInfo(); processStartInfo.FileName = toolset.Tool(typeof(C.ICompilerTool)).Executable(baseTarget); processStartInfo.ErrorDialog = true; processStartInfo.UseShellExecute = false; processStartInfo.RedirectStandardOutput = true; processStartInfo.Arguments = "-dumpversion"; System.Diagnostics.Process process = null; try { process = System.Diagnostics.Process.Start(processStartInfo); } catch (System.ComponentModel.Win32Exception ex) { throw new Bam.Core.Exception("'{0}': process filename '{1}'", ex.Message, processStartInfo.FileName); } if (null == process) { throw new Bam.Core.Exception("Unable to execute '{0}'", processStartInfo.FileName); } gccVersion = process.StandardOutput.ReadToEnd(); process.WaitForExit(); gccVersion = gccVersion.Trim(); } // get target string gccTarget = null; { var processStartInfo = new System.Diagnostics.ProcessStartInfo(); processStartInfo.FileName = toolset.Tool(typeof(C.ICompilerTool)).Executable(baseTarget); processStartInfo.ErrorDialog = true; processStartInfo.UseShellExecute = false; processStartInfo.RedirectStandardOutput = true; processStartInfo.Arguments = "-dumpmachine"; System.Diagnostics.Process process = null; try { process = System.Diagnostics.Process.Start(processStartInfo); } catch (System.ComponentModel.Win32Exception ex) { throw new Bam.Core.Exception("'{0}': process filename '{1}'", ex.Message, processStartInfo.FileName); } if (null == process) { throw new Bam.Core.Exception("Unable to execute '{0}'", processStartInfo.FileName); } gccTarget = process.StandardOutput.ReadToEnd(); process.WaitForExit(); gccTarget = gccTarget.Trim(); } // get paths and targets string pathPrefix = null; string gxxIncludeDir = null; string libDir = null; var includePaths = new Bam.Core.StringArray(); { var processStartInfo = new System.Diagnostics.ProcessStartInfo(); processStartInfo.FileName = toolset.Tool(typeof(C.ICompilerTool)).Executable(baseTarget); processStartInfo.ErrorDialog = true; processStartInfo.UseShellExecute = false; processStartInfo.RedirectStandardOutput = true; processStartInfo.RedirectStandardError = true; processStartInfo.Arguments = "-v"; System.Diagnostics.Process process = null; try { process = System.Diagnostics.Process.Start(processStartInfo); } catch (System.ComponentModel.Win32Exception ex) { throw new Bam.Core.Exception("'{0}': process filename '{1}'", ex.Message, processStartInfo.FileName); } if (null == process) { throw new Bam.Core.Exception("Unable to execute '{0}'", processStartInfo.FileName); } var details = process.StandardOutput.ReadToEnd(); process.WaitForExit(); var splitDetails = details.Split(new string[] { System.Environment.NewLine }, System.StringSplitOptions.None); foreach (var detail in splitDetails) { const string configuredWith = "Configured with: "; if (detail.StartsWith(configuredWith)) { var configuredOptions = detail.Substring(configuredWith.Length); var splitConfigureOptions = configuredOptions.Split(' '); const string pathPrefixKey = "--prefix="; const string gxxIncludeDirKey = "--with-gxx-include-dir="; const string targetKey = "--target="; const string libexecKey = "--libexecdir="; const string slibDirKey = "--with-slibdir="; foreach (var option in splitConfigureOptions) { if (option.StartsWith(pathPrefixKey)) { pathPrefix = option.Substring(pathPrefixKey.Length).Trim();; } else if (option.StartsWith(gxxIncludeDirKey)) { gxxIncludeDir = option.Substring(gxxIncludeDirKey.Length).Trim(); } else if (option.StartsWith(targetKey)) { gccTarget = option.Substring(targetKey.Length).Trim(); } else if (option.StartsWith(libexecKey)) { if (null != libDir) { throw new Bam.Core.Exception("lib dir already defined"); } libDir = option.Substring(libexecKey.Length).Trim(); } else if (option.StartsWith(slibDirKey)) { if (null != libDir) { throw new Bam.Core.Exception("lib dir already defined"); } libDir = option.Substring(slibDirKey.Length).Trim(); } } break; } } if (null == gccTarget) { foreach (var detail in splitDetails) { var targetKey = "Target: "; if (detail.StartsWith(targetKey)) { gccTarget = detail.Substring(targetKey.Length).Trim(); } } } if ((null != gxxIncludeDir) && !gxxIncludeDir.StartsWith(pathPrefix)) { // remove any prefix directory separator so that Combine works gxxIncludeDir = gxxIncludeDir.TrimStart(System.IO.Path.DirectorySeparatorChar); gxxIncludeDir = System.IO.Path.Combine(pathPrefix, gxxIncludeDir); } // C include paths (http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html) includePaths.Add("/usr/local/include"); includePaths.Add("/usr/include"); // TODO: this looks like the targetIncludeFolder, and has been necessary { // this is for some Linux distributions var path = System.String.Format("/usr/include/{0}", gccTarget); if (System.IO.Directory.Exists(path)) { includePaths.Add(path); } } } var gccDetails = new GccDetailData(gccVersion, includePaths, gxxIncludeDir, gccTarget, libDir); gccDetailsForTarget[baseTarget] = gccDetails; Bam.Core.Log.DebugMessage("Gcc version for target '{0}' is '{1}'", baseTarget.ToString(), gccDetails.Version); Bam.Core.Log.DebugMessage("Gcc machine type for target '{0}' is '{1}'", baseTarget.ToString(), gccDetails.Target); Bam.Core.Log.DebugMessage("Gxx include path for target '{0}' is '{1}'", baseTarget.ToString(), gccDetails.GxxIncludePath); return(gccDetails); }
Bam.Core.IToolset.Version( Bam.Core.BaseTarget baseTarget) { return("dev"); }
Bam.Core.IToolset.InstallPath( Bam.Core.BaseTarget baseTarget) { throw new System.NotImplementedException(); }
protected override string SpecificVersion(Bam.Core.BaseTarget baseTarget) { return("3.1"); }
Bam.Core.ITool.Executable( Bam.Core.BaseTarget baseTarget) { throw new System.NotImplementedException(); }