<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      秋·風

        博客園 :: 首頁 :: 博問 :: 閃存 :: 新隨筆 :: 聯系 :: 訂閱 訂閱 :: 管理 ::
      龍芯的操作系統分abi1.0和2.0,這2個版本程序不兼容,使用lazarus寫了個龍芯程序時,如果涉及不同abi版本用手工切換挺麻煩的,今天寫了1個簡單插件用來切換abi版本。
      原理很簡單:
      切換時只需修改fpc.cfg龍芯對應的目錄就可以:

        

      unit loongxinabiswitch;
      
      {$mode objfpc}{$H+}
      
      interface
      
      uses
        Classes, SysUtils, LazLoggerBase, FileUtil, Forms, Controls, Graphics, 
        Dialogs,
        LCLProc, BaseIDEIntf ,
        LazConfigStorage,
        LCLType, StdCtrls, ComCtrls, IDECommands, IDEWindowIntf, LazIDEIntf, MenuIntf;
      
      type
      
        { TLoongxinABISwitching }
      
        TLoongxinABISwitching = class(TForm)
          ComboBox7: TComboBox;
          Label8: TLabel;
          StatusBar1: TStatusBar;
          procedure ComboBox7Change(Sender: TObject);
          procedure FormCreate(Sender: TObject);
        private
          { private declarations }
        public
          { public declarations }
        end;
      
      var
        LoongxinABISwitching: TLoongxinABISwitching;
        LoongxinABISwitchingCreator: TIDEWindowCreator; // set by Register procedure
      
      procedure ShowLoongxinABISwitching(Sender: TObject);
      procedure Register; // Check the "Register Unit" of this unit in the package editor.implementation
      
      implementation
      
      {$R *.lfm}
      
      procedure ShowLoongxinABISwitching(Sender: TObject);
      begin
        //IDEWindowCreators.ShowForm(LoongxinABISwitchingCreator.FormName, true);
        LoongxinABISwitching:=TLoongxinABISwitching.Create(nil);
        LoongxinABISwitching.ShowModal;
        LoongxinABISwitching.Free;
      end;
      
      procedure CreateLoongxinABISwitching(Sender: TObject; aFormName: string;
        var AForm: TCustomForm; DoDisableAutoSizing: boolean);
      begin
        if CompareText(aFormName, 'LoongxinABI')<>0 then begin
          DebugLn(['ERROR: CreateLoongxinABISwitching: there is already a form with '
            +'this name']);
          exit;
        end;
        IDEWindowCreators.CreateForm(AForm, TLoongxinABISwitching, 
          DoDisableAutoSizing,
          LazarusIDE.OwningComponent);
        AForm.Name:=aFormName;
        LoongxinABISwitching:=AForm as TLoongxinABISwitching;
      end;
      
      procedure Register;
      var
        CmdCatToolMenu: TIDECommandCategory;
        ToolLoongxinABISwitchingCommand: TIDECommand;
        MenuItemCaption: String;
      begin
        {$if not defined(cpuloongarch64)}
        // register shortcut and menu item
        MenuItemCaption:='龍芯ABI版本切換'; // <- this caption should be replaced by a resourcestring
        // search shortcut category
        CmdCatToolMenu:=IDECommandList.FindCategoryByName(CommandCategoryToolMenuName);
        // register shortcut
        ToolLoongxinABISwitchingCommand:=RegisterIDECommand(CmdCatToolMenu,
          'ABISwitching',
          MenuItemCaption,
          IDEShortCut(VK_UNKNOWN, []), // <- set here your default shortcut
          CleanIDEShortCut, nil, @ShowLoongxinABISwitching);
        // register menu item in Tool menu
        RegisterIDEMenuCommand(mnuProject,
          'ABISwitching',
          MenuItemCaption, nil, nil, ToolLoongxinABISwitchingCommand);
      
        // register dockable Window
        //LoongxinABISwitchingCreator:=IDEWindowCreators.Add(
        //  'LoongxinABI',
        //  @CreateLoongxinABISwitching, nil,
        //  '40%','40%','','',''  // default place at left=100, top=100, right=300, bottom=300
        //    // you can also define percentage values of screen or relative positions, see wiki
        //  );
        {$endif}
      end;
      
      { TLoongxinABISwitching }
      
      procedure TLoongxinABISwitching.FormCreate(Sender: TObject);
      var
        Config: TConfigStorage;
        cfg,Directory:String;
        fpccfg:TStringList;
        i:Integer;
      begin
        {$if not defined(cpuloongarch64)}
        try
          Directory := LazarusIDE.GetPrimaryConfigPath;
          Directory:=StringReplace(Directory,'config_lazarus','',[]);
      
          Config:=GetIDEConfigStorage('fpcdefines.xml',true);
          cfg:=Config.GetValue('FPCConfigs/Item1/Compiler/File','');
          {$ifdef windows}
          cfg:=StringReplace(cfg,'fpc.exe','fpc.cfg',[]);
          {$else}
          cfg:=cfg+'.cfg';
          {$endif}
        finally
          Config.Free;
        end;
        ComboBox7.ItemIndex:=-1;
        if FileExists(cfg) then
        begin
          fpccfg:=TStringList.Create;
          fpccfg.LoadFromFile(cfg);
          for i:=1 to fpccfg.Count-1 do
          begin
            if fpccfg[i]='#IFDEF CPULOONGARCH64' then
            begin
              if fpccfg[i+5]='-Fl'+SetDirSeparators(Directory+'cross\lib\loongarch64-linux_abi2.0') then
              begin
                ComboBox7.ItemIndex:=1;
                StatusBar1.SimpleText :='當前abi版本:2.0';
              end
              else
              begin
                StatusBar1.SimpleText:='當前abi版本:1.0';
                ComboBox7.ItemIndex:=0;
              end;
              Break;
            end;
          end;
          fpccfg.Free;
        end;
        {$else}
        ComboBox7.Enabled:=False;
        StatusBar1.SimpleText:='在龍芯系統上不能切換abi';
        {$endif}
      end;
      
      procedure TLoongxinABISwitching.ComboBox7Change(Sender: TObject);
      var
        Config: TConfigStorage;
        cfg:String;
        fpccfg:TStringList;
        longxin:Boolean;
        i:Integer;
        abi,Directory:String;
      begin
        {$if not defined(cpuloongarch64)}
        try
          Directory := LazarusIDE.GetPrimaryConfigPath;
          Directory:=StringReplace(Directory,'config_lazarus','',[]);
          Config:=GetIDEConfigStorage('fpcdefines.xml',true);
          cfg:=Config.GetValue('FPCConfigs/Item1/Compiler/File','');
          {$ifdef windows}
          cfg:=StringReplace(cfg,'fpc.exe','fpc.cfg',[]);
          {$else}
          cfg:=cfg+'.cfg';
          {$endif}
        finally
          Config.Free;
        end;
        if FileExists(cfg) then
        begin
          try
            longxin:=False;
            fpccfg:=TStringList.Create;
            fpccfg.LoadFromFile(cfg);
            for i:=1 to fpccfg.Count do
            begin
              if fpccfg[i]='#IFDEF CPULOONGARCH64' then
              begin
                longxin:=True;
                if ComboBox7.ItemIndex=1 then
                begin
                  abi:='abi 2.0';
                  StatusBar1.SimpleText:='當前abi版本:2.0';
                  fpccfg[i+5]:='-Fl'+SetDirSeparators(Directory+'cross\lib\loongarch64-linux_abi2.0');
                  fpccfg[i+7]:='-FL/lib64/ld-linux-loongarch-lp64d.so.1';
                end
                else
                begin
                  abi:='abi 1.0';
                  StatusBar1.SimpleText:='當前abi版本:1.0';
                  fpccfg[i+5]:='-Fl'+SetDirSeparators(Directory+'cross\lib\loongarch64-linux');
                  fpccfg[i+7]:='-FL/lib64/ld.so.1';
                end;
                fpccfg.SaveToFile(cfg);
                break;
              end;
            end;
            if longxin=False then
               ShowMessage('沒找到龍芯交叉編譯配置信息!');
          finally
            fpccfg.Free;
          end;
        end
        Else
          ShowMessage('沒安裝fpc!');
        {$endif}
      end;
      
      end.

       設置后就可以編譯為對應版本的程序了 

      posted on 2025-07-01 16:21  秋·風  閱讀(107)  評論(1)    收藏  舉報
      主站蜘蛛池模板: 99久久亚洲综合精品成人| 52熟女露脸国语对白视频| 97精品尹人久久大香线蕉| 国产a在视频线精品视频下载| 国产97色在线 | 免| 熟妇的奶头又大又长奶水视频| 激情文学一区二区国产区| 成人av一区二区三区| 最近中文国语字幕在线播放| 在线国产极品尤物你懂的| 一本大道久久香蕉成人网| 国产精品一二二区视在线| 又大又粗又爽18禁免费看| 网友偷拍视频一区二区三区| 九九热在线观看视频免费| 激情久久av一区av二区av三区| 亚洲精品香蕉一区二区| 日本少妇自慰免费完整版| 一区二区亚洲精品国产精华液| 日本一本无道码日韩精品| 国偷自产一区二区三区在线视频 | 成人啪精品视频网站午夜| 开心久久综合激情五月天| AV区无码字幕中文色| 国产一级黄色片在线观看| 国精品无码一区二区三区在线看| 日本东京热一区二区三区| www国产无套内射com| 国产av一区二区三区综合| 激情综合五月丁香亚洲| 实拍女处破www免费看| 日本久久精品一区二区三区| 四川丰满少妇无套内谢| 亚洲一区二区三区自拍天堂| 小鲜肉自慰网站| 国产偷国产偷亚洲高清人| 成人看的污污超级黄网站免费| 久久天天躁狠狠躁夜夜avapp| 深夜福利啪啪片| 亚洲国产精品第一二三区| 国产精品无码dvd在线观看|