void CompilerLocatorCLANG::AddTools(CompilerPtr compiler, const wxString &installFolder) { compiler->SetInstallationPath( installFolder ); wxFileName toolFile(installFolder, ""); toolFile.AppendDir("bin"); #ifdef __WXMSW__ toolFile.SetExt("exe"); #endif toolFile.SetName("clang++"); AddTool(compiler, "CXX", toolFile.GetFullPath()); AddTool(compiler, "LinkerName", toolFile.GetFullPath()); #ifdef __WXMAC__ AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-dynamiclib -fPIC"); #else AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-shared -fPIC"); #endif toolFile.SetName("clang"); AddTool(compiler, "CC", toolFile.GetFullPath()); // Add the archive tool toolFile.SetName("llvm-ar"); if ( toolFile.FileExists() ) { AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); } else { toolFile.SetName("ar"); AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); } #ifdef __WXMSW__ AddTool(compiler, "ResourceCompiler", "windres.exe"); #else AddTool(compiler, "ResourceCompiler", ""); #endif // Add the assembler tool toolFile.SetName("llvm-as"); if ( toolFile.FileExists() ) { AddTool(compiler, "AS", toolFile.GetFullPath()); } else { toolFile.SetName("as"); AddTool(compiler, "AS", toolFile.GetFullPath()); } wxString makeExtraArgs; if ( wxThread::GetCPUCount() > 1 ) { makeExtraArgs << "-j" << wxThread::GetCPUCount(); } #ifdef __WXMSW__ AddTool(compiler, "MAKE", "mingw32-make.exe", makeExtraArgs); #else AddTool(compiler, "MAKE", "make", makeExtraArgs); #endif }
void CompilerLocatorCygwin::AddTools(const wxString& binFolder, const wxString& name, const wxString& suffix) { wxFileName masterPath(binFolder, ""); masterPath.RemoveLastDir(); // Create an empty compiler CompilerPtr compiler( new Compiler(NULL) ); compiler->SetCompilerFamily(COMPILER_FAMILY_CYGWIN); compiler->SetGenerateDependeciesFile(true); compiler->SetName( name ); compiler->SetInstallationPath( masterPath.GetPath() ); m_compilers.push_back( compiler ); CL_DEBUG("Found Cygwin compiler under: %s. \"%s\"", masterPath.GetPath(), compiler->GetName()); wxFileName toolFile(binFolder, ""); toolFile.SetFullName( "g++-" + suffix + ".exe" ); AddTool(compiler, "CXX", toolFile.GetFullPath()); AddTool(compiler, "LinkerName", toolFile.GetFullPath()); AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-shared -fPIC"); toolFile.SetFullName( "gcc-" + suffix + ".exe" ); AddTool(compiler, "CC", toolFile.GetFullPath()); toolFile.SetFullName("ar.exe"); AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); toolFile.SetFullName("windres.exe"); AddTool(compiler, "ResourceCompiler", toolFile.GetFullPath()); toolFile.SetFullName("as.exe"); AddTool(compiler, "AS", toolFile.GetFullPath()); toolFile.SetFullName("make.exe"); wxString makeExtraArgs; if ( wxThread::GetCPUCount() > 1 ) { makeExtraArgs << "-j" << wxThread::GetCPUCount(); } if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath(), makeExtraArgs); } else { toolFile.SetFullName("mingw32-make.exe"); if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath(), makeExtraArgs); } } AddTool(compiler, "MakeDirCommand", "mkdir", "-p"); toolFile.SetFullName("gdb.exe"); if ( toolFile.FileExists() ) { AddTool(compiler, "Debugger", toolFile.GetFullPath()); } }
void CompilerLocatorCrossGCC::AddTools(CompilerPtr compiler, const wxString& binFolder, const wxString& prefix, const wxString& suffix) { compiler->SetName("Cross GCC ( " + prefix + " )"); compiler->SetInstallationPath(binFolder); CL_DEBUG("Found CrossGCC compiler under: %s. \"%s\"", binFolder, compiler->GetName()); wxFileName toolFile(binFolder, ""); toolFile.SetFullName(prefix + "-g++"); toolFile.SetExt(suffix); AddTool(compiler, "CXX", toolFile.GetFullPath(), suffix); AddTool(compiler, "LinkerName", toolFile.GetFullPath()); AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-shared -fPIC"); toolFile.SetFullName(prefix + "-gcc"); toolFile.SetExt(suffix); AddTool(compiler, "CC", toolFile.GetFullPath()); toolFile.SetFullName(prefix + "-ar"); toolFile.SetExt(suffix); AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); toolFile.SetFullName(prefix + "-windres"); toolFile.SetExt(suffix); if(toolFile.FileExists()) AddTool(compiler, "ResourceCompiler", toolFile.GetFullPath()); toolFile.SetFullName(prefix + "-as"); toolFile.SetExt(suffix); AddTool(compiler, "AS", toolFile.GetFullPath()); toolFile.SetFullName(prefix + "-gdb"); toolFile.SetExt(suffix); AddTool(compiler, "Debugger", toolFile.GetFullPath()); toolFile.SetFullName("make"); toolFile.SetExt(suffix); wxString makeExtraArgs; if(wxThread::GetCPUCount() > 1) { makeExtraArgs << "-j" << wxThread::GetCPUCount(); } // XXX Need this on Windows? // makeExtraArgs << " SHELL=cmd.exe "; // What to do if there's no make here? (on Windows) if(toolFile.FileExists()) AddTool(compiler, "MAKE", toolFile.GetFullPath(), makeExtraArgs); }
void CompilerLocatorGCC::AddTools(CompilerPtr compiler, const wxString& binFolder, const wxString& suffix) { wxFileName masterPath(binFolder, ""); wxString defaultBinFolder = "/usr/bin"; compiler->SetCompilerFamily(COMPILER_FAMILY_GCC); compiler->SetInstallationPath( binFolder ); CL_DEBUG("Found GNU GCC compiler under: %s. \"%s\"", masterPath.GetPath(), compiler->GetName()); wxFileName toolFile(binFolder, ""); // ++++----------------------------------------------------------------- // With XCode installation, only // g++, gcc, and make are installed under the Xcode installation folder // the rest (mainly ar and as) are taken from /usr/bin // ++++----------------------------------------------------------------- toolFile.SetFullName("g++"); AddTool(compiler, "CXX", toolFile.GetFullPath(), suffix); AddTool(compiler, "LinkerName", toolFile.GetFullPath(), suffix); #ifndef __WXMAC__ AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), suffix, "-shared -fPIC"); #else AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), suffix, "-dynamiclib -fPIC"); #endif toolFile.SetFullName("gcc"); AddTool(compiler, "CC", toolFile.GetFullPath(), suffix); toolFile.SetFullName("make"); wxString makeExtraArgs; if ( wxThread::GetCPUCount() > 1 ) { makeExtraArgs << "-j" << wxThread::GetCPUCount(); } AddTool(compiler, "MAKE", toolFile.GetFullPath(), "", makeExtraArgs); // ++++----------------------------------------------------------------- // From this point on, we use /usr/bin only // ++++----------------------------------------------------------------- toolFile.AssignDir( defaultBinFolder ); toolFile.SetFullName("ar"); AddTool(compiler, "AR", toolFile.GetFullPath(), "", "rcu"); toolFile.SetFullName("windres"); AddTool(compiler, "ResourceCompiler", "", ""); toolFile.SetFullName("as"); AddTool(compiler, "AS", toolFile.GetFullPath(), ""); }
void CompilerLocatorMinGW::AddTools(CompilerPtr compiler, const wxString& binFolder, const wxString& name) { wxFileName masterPath(binFolder, ""); masterPath.RemoveLastDir(); if ( m_locatedFolders.count(masterPath.GetPath()) ) { return; } m_locatedFolders.insert( masterPath.GetPath() ); if ( name.IsEmpty() ) { compiler->SetName("MinGW ( " + masterPath.GetDirs().Last() + " )"); } else { compiler->SetName("MinGW ( " + name + " )"); } CL_DEBUG("Found MinGW compiler under: %s. \"%s\"", masterPath.GetPath(), compiler->GetName()); wxFileName toolFile(binFolder, ""); toolFile.SetFullName("g++.exe"); AddTool(compiler, "CXX", toolFile.GetFullPath()); AddTool(compiler, "LinkerName", toolFile.GetFullPath()); AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-shared -fPIC"); toolFile.SetFullName("gcc.exe"); AddTool(compiler, "CC", toolFile.GetFullPath()); toolFile.SetFullName("ar.exe"); AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); toolFile.SetFullName("windres.exe"); AddTool(compiler, "ResourceCompiler", toolFile.GetFullPath()); toolFile.SetFullName("as.exe"); AddTool(compiler, "AS", toolFile.GetFullPath()); toolFile.SetFullName("make.exe"); if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath()); } else { toolFile.SetFullName("mingw32-make.exe"); if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath()); } } }
void CompilerLocatorMinGW::AddTools(const wxString& binFolder, const wxString& name) { wxFileName masterPath(binFolder, ""); masterPath.RemoveLastDir(); if ( m_locatedFolders.count(masterPath.GetPath()) ) { return; } // Create an empty compiler CompilerPtr compiler( new Compiler(NULL) ); compiler->SetCompilerFamily(COMPILER_FAMILY_MINGW); compiler->SetGenerateDependeciesFile(true); m_compilers.push_back( compiler ); m_locatedFolders.insert( masterPath.GetPath() ); if ( name.IsEmpty() ) { compiler->SetName("MinGW ( " + masterPath.GetDirs().Last() + " )"); } else { compiler->SetName("MinGW ( " + name + " )"); } compiler->SetInstallationPath( masterPath.GetPath() ); CL_DEBUG("Found MinGW compiler under: %s. \"%s\"", masterPath.GetPath(), compiler->GetName()); wxFileName toolFile(binFolder, ""); toolFile.SetFullName("g++.exe"); AddTool(compiler, "CXX", toolFile.GetFullPath()); AddTool(compiler, "LinkerName", toolFile.GetFullPath()); AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-shared -fPIC"); toolFile.SetFullName("gcc.exe"); AddTool(compiler, "CC", toolFile.GetFullPath()); toolFile.SetFullName("ar.exe"); AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); toolFile.SetFullName("windres.exe"); AddTool(compiler, "ResourceCompiler", toolFile.GetFullPath()); toolFile.SetFullName("as.exe"); AddTool(compiler, "AS", toolFile.GetFullPath()); toolFile.SetFullName("make.exe"); wxString makeExtraArgs; if ( wxThread::GetCPUCount() > 1 ) { makeExtraArgs << "-j" << wxThread::GetCPUCount(); } // This is needed under MinGW makeExtraArgs << " SHELL=cmd.exe "; if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath(), makeExtraArgs); } else { toolFile.SetFullName("mingw32-make.exe"); if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath(), makeExtraArgs); } } toolFile.SetFullName("gdb.exe"); if(toolFile.Exists()) { AddTool(compiler, "Debugger", toolFile.GetFullPath()); } }
void SystemTrayMenu::menuItemOnClick(QAction *action) { if (gettext("Online &Help!") == action->text()) { QDesktopServices::openUrl(QUrl("http://fcitx-im.org/")); } else if (gettext("ConfigureIM") == action->text()) { mAgent->triggerProperty(QString("/Fcitx/logo/configureim")); } else if (gettext("ConfigureIMPanel") == action->text()) { QFile toolFile(getQimpanelBinPath("fcitx-qimpanel-configtool")); if (!toolFile.exists()) { QMessageBox::warning(this,gettext("Warning"),gettext("Please install fcitx-qimpanel-configtool!")); } // getRunCmdOuput("fcitx-qimpanel-configtool"); if(configtoolPro->state()!=QProcess::Running) configtoolPro->start("fcitx-qimpanel-configtool"); } else if (gettext("ConfigureFcitx") == action->text()) { mAgent->configure(); } else if (gettext("Restart") == action->text()) { mAgent->restart(); this->restart(); } else if (gettext("Exit") == action->text()) { mAgent->exit(); exit(0); } else if (gettext("Character Map") == action->text()) { startChildApp("gucharmap"); } else if (gettext("Keyboard Layout Chart") == action->text()) { const char *argv[4] = { "gkbd-keyboard-display", "-l", NULL, NULL }; QString layout = "us"; QList<KimpanelProperty>::const_iterator i; for (i = mIMList.begin(); i != mIMList.end(); ++i) { if (i->label == mCurtIMLabel) { if (i->key.startsWith("/Fcitx/im/fcitx-keyboard-")) { layout = i->key.mid(strlen("/Fcitx/im/fcitx-keyboard-")); } break; } } QByteArray bytes = layout.toLatin1(); int separator = bytes.indexOf('-'); if (separator != -1) bytes[separator] = '\t'; argv[2] = bytes.constData(); startChildApp("gkbd-keyboard-display", argv); } else if (gettext("Text Entry Settings...") == action->text()) { const char *argv[4] = { "unity-control-center", "region", "layouts", NULL }; startChildApp("unity-control-center", argv); } else { MyAction *myAction = (MyAction *)action; if (SkinAction == myAction->getMyActionType()) { skinMenuItemOnClick(myAction); } else if (myAction->getProp().key != "") { // qDebug()<<"---------------------"<<myAction->getProp().key; mAgent->triggerProperty(myAction->getProp().key); } } this->clear(); }