mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 06:21:38 +01:00 
			
		
		
		
	+ added patch for the fixes branch with fixes for mulitple resources (e.g. version info and manifest) and nested checksynchronize (bug #9068 and #9079)
+ win installer: build script accepts a filename which contains a patch for fpc. git-svn-id: trunk@11360 -
This commit is contained in:
		
							parent
							
								
									d52f65f05a
								
							
						
					
					
						commit
						d7aba592b4
					
				
							
								
								
									
										2
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							| @ -3084,6 +3084,8 @@ tools/install/macosx/lazarus.packproj.template svneol=native#text/plain | ||||
| tools/install/macosx/makefpcsnapshot.sh svneol=native#text/plain | ||||
| tools/install/macosx/makefpcsrcsnapshot.sh svneol=native#text/plain | ||||
| tools/install/macosx/makelazsnapshot.sh svneol=native#text/plain | ||||
| tools/install/patches/fpc-fixes_2_2.patch svneol=native#text/plain | ||||
| tools/install/patches/readme.txt svneol=native#text/plain | ||||
| tools/install/replace_in_files.pl -text svneol=native#application/x-perl | ||||
| tools/install/rpm/create_gtk1_links.sh svneol=native#text/plain | ||||
| tools/install/rpm/create_nonroot_rpmmacros.sh svneol=native#text/plain | ||||
|  | ||||
							
								
								
									
										568
									
								
								tools/install/patches/fpc-fixes_2_2.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										568
									
								
								tools/install/patches/fpc-fixes_2_2.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,568 @@ | ||||
| Index: rtl/objpas/classes/classes.inc
 | ||||
| ===================================================================
 | ||||
| --- rtl/objpas/classes/classes.inc	(revision 7769)
 | ||||
| +++ rtl/objpas/classes/classes.inc	(working copy)
 | ||||
| @@ -177,12 +177,12 @@
 | ||||
|   | ||||
|          if DoSynchronizeMethod then | ||||
|            begin | ||||
| +            DoSynchronizeMethod:=false;
 | ||||
|              try | ||||
|                SynchronizeMethod; | ||||
|              except | ||||
|                SynchronizeException:=Exception(AcquireExceptionObject); | ||||
|              end; | ||||
| -            DoSynchronizeMethod:=false;
 | ||||
|              RtlEventSetEvent(ExecuteEvent); | ||||
|            end; | ||||
|        end; | ||||
| Index: compiler/fppu.pas
 | ||||
| ===================================================================
 | ||||
| --- compiler/fppu.pas	(revision 7769)
 | ||||
| +++ compiler/fppu.pas	(working copy)
 | ||||
| @@ -71,12 +71,14 @@
 | ||||
|            procedure writederefmap; | ||||
|            procedure writederefdata; | ||||
|            procedure writeImportSymbols; | ||||
| +          procedure writeResources;
 | ||||
|            procedure readsourcefiles; | ||||
|            procedure readloadunit; | ||||
|            procedure readlinkcontainer(var p:tlinkcontainer); | ||||
|            procedure readderefmap; | ||||
|            procedure readderefdata; | ||||
|            procedure readImportSymbols; | ||||
| +          procedure readResources;
 | ||||
|  {$IFDEF MACRO_DIFF_HINT} | ||||
|            procedure writeusedmacro(p:TNamedIndexItem;arg:pointer); | ||||
|            procedure writeusedmacros; | ||||
| @@ -624,6 +626,20 @@
 | ||||
|        end; | ||||
|   | ||||
|   | ||||
| +    procedure tppumodule.writeResources;
 | ||||
| +      var
 | ||||
| +        res : TCmdStrListItem;
 | ||||
| +      begin
 | ||||
| +        res:=TCmdStrListItem(ResourceFiles.First);
 | ||||
| +        while res<>nil do
 | ||||
| +          begin
 | ||||
| +            ppufile.putstring(res.FPStr);
 | ||||
| +            res:=TCmdStrListItem(res.Next);
 | ||||
| +          end;
 | ||||
| +        ppufile.writeentry(ibresources);
 | ||||
| +      end;
 | ||||
| +
 | ||||
| +
 | ||||
|  {$IFDEF MACRO_DIFF_HINT} | ||||
|   | ||||
|  { | ||||
| @@ -877,6 +893,13 @@
 | ||||
|        end; | ||||
|   | ||||
|   | ||||
| +    procedure tppumodule.readResources;
 | ||||
| +      begin
 | ||||
| +        while not ppufile.endofentry do
 | ||||
| +          resourcefiles.Insert(ppufile.getstring);
 | ||||
| +      end;
 | ||||
| +
 | ||||
| +
 | ||||
|      procedure tppumodule.load_interface; | ||||
|        var | ||||
|          b : byte; | ||||
| @@ -923,6 +946,8 @@
 | ||||
|                 readderefmap; | ||||
|               ibderefdata : | ||||
|                 readderefdata; | ||||
| +             ibresources:
 | ||||
| +               readResources;
 | ||||
|               ibendinterface : | ||||
|                 break; | ||||
|             else | ||||
| @@ -1006,6 +1031,7 @@
 | ||||
|           writelinkcontainer(linkotherstaticlibs,iblinkotherstaticlibs,true); | ||||
|           writelinkcontainer(linkothersharedlibs,iblinkothersharedlibs,true); | ||||
|           writeImportSymbols; | ||||
| +         writeResources;
 | ||||
|           ppufile.do_crc:=true; | ||||
|   | ||||
|           { generate implementation deref data, the interface deref data is | ||||
| Index: compiler/pmodules.pas
 | ||||
| ===================================================================
 | ||||
| --- compiler/pmodules.pas	(revision 7769)
 | ||||
| +++ compiler/pmodules.pas	(working copy)
 | ||||
| @@ -1474,6 +1474,9 @@
 | ||||
|           { create dwarf debuginfo } | ||||
|           create_dwarf; | ||||
|   | ||||
| +         { create global resource file by collecting all resource files }
 | ||||
| +         CollectResourceFiles;
 | ||||
| +         
 | ||||
|           { insert own objectfile } | ||||
|           insertobjectfile; | ||||
|   | ||||
| Index: compiler/comprsrc.pas
 | ||||
| ===================================================================
 | ||||
| --- compiler/comprsrc.pas	(revision 7769)
 | ||||
| +++ compiler/comprsrc.pas	(working copy)
 | ||||
| @@ -26,28 +26,44 @@
 | ||||
|  interface | ||||
|   | ||||
|    uses | ||||
| -    Systems;
 | ||||
| +    Systems, cstreams;
 | ||||
|   | ||||
|  type | ||||
| +   tresoutput = (roRES, roOBJ);
 | ||||
| +
 | ||||
|     tresourcefile = class(TAbstractResourceFile) | ||||
|     private | ||||
|        fname : ansistring; | ||||
|     public | ||||
|        constructor Create(const fn : ansistring);override; | ||||
| -      procedure Compile;virtual;
 | ||||
| +      procedure Compile(output: tresoutput; const OutName: ansistring);virtual;
 | ||||
|        procedure PostProcessResourcefile(const s : ansistring);virtual; | ||||
| +      function IsCompiled(const fn : ansistring) : boolean;virtual;
 | ||||
| +      procedure Collect(const fn : ansistring);virtual;
 | ||||
|     end; | ||||
| +   
 | ||||
| +   TWinLikeResourceFile = class(tresourcefile)
 | ||||
| +   private
 | ||||
| +      FOut: TCFileStream;
 | ||||
| +   public
 | ||||
| +      function IsCompiled(const fn : ansistring) : boolean;override;
 | ||||
| +      procedure Collect(const fn : ansistring);override;
 | ||||
| +   end;
 | ||||
|   | ||||
|  procedure CompileResourceFiles; | ||||
| +procedure CollectResourceFiles;
 | ||||
|   | ||||
|   | ||||
|  implementation | ||||
|   | ||||
|  uses | ||||
|    SysUtils, | ||||
| -  cutils,cfileutils,
 | ||||
| +  cutils,cfileutils,cclasses,
 | ||||
|    Globtype,Globals,Verbose,Fmodule, | ||||
|    Script; | ||||
| +  
 | ||||
| +const
 | ||||
| +  GlobalResName = 'fpc-res';
 | ||||
|   | ||||
|  {**************************************************************************** | ||||
|                                TRESOURCEFILE | ||||
| @@ -64,23 +80,42 @@
 | ||||
|  end; | ||||
|   | ||||
|   | ||||
| -procedure tresourcefile.compile;
 | ||||
| +function tresourcefile.IsCompiled(const fn: ansistring): boolean;
 | ||||
| +begin
 | ||||
| +  Result:=CompareText(ExtractFileExt(fn), target_info.resobjext) = 0;
 | ||||
| +end;
 | ||||
| +
 | ||||
| +
 | ||||
| +procedure tresourcefile.Collect(const fn: ansistring);
 | ||||
| +begin
 | ||||
| +  if fn='' then
 | ||||
| +    exit;
 | ||||
| +  fname:=fn;
 | ||||
| +  Compile(roOBJ, ChangeFileExt(fn, target_info.resobjext));
 | ||||
| +end;
 | ||||
| +
 | ||||
| +
 | ||||
| +procedure tresourcefile.compile(output: tresoutput; const OutName: ansistring);
 | ||||
|  var | ||||
|    respath, | ||||
|    srcfilepath, | ||||
| -  n,
 | ||||
|    s, | ||||
| -  resobj,
 | ||||
| +  bin,
 | ||||
|    resbin   : TCmdStr; | ||||
|    resfound, | ||||
|    objused  : boolean; | ||||
|  begin | ||||
| -  resbin:='';
 | ||||
| +  if output=roRES then
 | ||||
| +    bin:=target_res.rcbin
 | ||||
| +  else
 | ||||
| +    bin:=target_res.resbin;
 | ||||
| +  if bin='' then
 | ||||
| +    exit;
 | ||||
|    resfound:=false; | ||||
|    if utilsdirectory<>'' then | ||||
| -    resfound:=FindFile(utilsprefix+target_res.resbin+source_info.exeext,utilsdirectory,false,resbin);
 | ||||
| +    resfound:=FindFile(utilsprefix+bin+source_info.exeext,utilsdirectory,false,resbin);
 | ||||
|    if not resfound then | ||||
| -    resfound:=FindExe(utilsprefix+target_res.resbin,false,resbin);
 | ||||
| +    resfound:=FindExe(utilsprefix+bin,false,resbin);
 | ||||
|    { get also the path to be searched for the windres.h } | ||||
|    respath:=ExtractFilePath(resbin); | ||||
|    if (not resfound) and not(cs_link_nolink in current_settings.globalswitches) then | ||||
| @@ -89,18 +124,25 @@
 | ||||
|       current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink]; | ||||
|     end; | ||||
|    srcfilepath:=ExtractFilePath(current_module.mainsource^); | ||||
| -  resobj:=current_module.outputpath^+ChangeFileExt(ExtractFileName(fname),target_info.resobjext);
 | ||||
| -  if not path_absolute(fname) then
 | ||||
| -    fname:=srcfilepath+fname;
 | ||||
| -  s:=target_res.rescmd;
 | ||||
| -  ObjUsed:=(pos('$OBJ',s)>0);
 | ||||
| -  Replace(s,'$OBJ',maybequoted(resobj));
 | ||||
| -  Replace(s,'$RES',maybequoted(fname));
 | ||||
| +  if output=roRES then
 | ||||
| +    begin
 | ||||
| +      s:=target_res.rccmd;
 | ||||
| +      Replace(s,'$RES',maybequoted(OutName));
 | ||||
| +      Replace(s,'$RC',maybequoted(fname));
 | ||||
| +      ObjUsed:=False;
 | ||||
| +    end
 | ||||
| +  else
 | ||||
| +    begin
 | ||||
| +      s:=target_res.rescmd;
 | ||||
| +      ObjUsed:=(pos('$OBJ',s)>0);
 | ||||
| +      Replace(s,'$OBJ',maybequoted(OutName));
 | ||||
| +      Replace(s,'$RES',maybequoted(fname));
 | ||||
| +    end;
 | ||||
|    { windres doesn't like empty include paths } | ||||
|    if respath='' then | ||||
|      respath:='.'; | ||||
|    Replace(s,'$INC',maybequoted(respath)); | ||||
| -  if (target_info.system = system_i386_win32) and
 | ||||
| +  if (target_res.resbin='windres') and
 | ||||
|       (srcfilepath<>'') then | ||||
|      s:=s+' --include '+maybequoted(srcfilepath); | ||||
|  { Execute the command } | ||||
| @@ -123,35 +165,197 @@
 | ||||
|         end | ||||
|       end; | ||||
|      end; | ||||
| -  PostProcessResourcefile(maybequoted(resobj));
 | ||||
| +  if output=roOBJ then
 | ||||
| +    PostProcessResourcefile(OutName);
 | ||||
|    { Update asmres when externmode is set } | ||||
|    if cs_link_nolink in current_settings.globalswitches then | ||||
|      AsmRes.AddLinkCommand(resbin,s,''); | ||||
| -  if ObjUsed then
 | ||||
| -    current_module.linkunitofiles.add(resobj,link_always);
 | ||||
| +  if (output=roOBJ) and ObjUsed then
 | ||||
| +    current_module.linkunitofiles.add(OutName,link_always);
 | ||||
|  end; | ||||
|   | ||||
|   | ||||
| +function TWinLikeResourceFile.IsCompiled(const fn: ansistring): boolean;
 | ||||
| +const
 | ||||
| +  ResSignature : array [1..32] of byte =
 | ||||
| +  ($00,$00,$00,$00,$20,$00,$00,$00,$FF,$FF,$00,$00,$FF,$FF,$00,$00,
 | ||||
| +   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00);
 | ||||
| +var
 | ||||
| +  f : file;
 | ||||
| +  oldfmode : byte;
 | ||||
| +  buf: array[1..32] of byte;
 | ||||
| +  i: longint;
 | ||||
| +begin
 | ||||
| +  Result:=CompareText(ExtractFileExt(fn), target_info.resext) = 0;
 | ||||
| +  if Result then exit;
 | ||||
| +  oldfmode:=Filemode;
 | ||||
| +  Filemode:=0;
 | ||||
| +  assign(f,fn);
 | ||||
| +  reset(f,1);
 | ||||
| +  BlockRead(f, buf, SizeOf(buf), i);
 | ||||
| +  close(f);
 | ||||
| +  Filemode:=oldfmode;
 | ||||
| +  
 | ||||
| +  if i<>SizeOf(buf) then
 | ||||
| +    exit;
 | ||||
| +
 | ||||
| +  for i:=1 to 32 do
 | ||||
| +    if buf[i]<>ResSignature[i] then
 | ||||
| +      exit;
 | ||||
| +      
 | ||||
| +  Result:=True;
 | ||||
| +end;
 | ||||
| +
 | ||||
| +
 | ||||
| +procedure TWinLikeResourceFile.Collect(const fn: ansistring);
 | ||||
| +const
 | ||||
| +  zeroes: array[1..3] of byte = (0,0,0);
 | ||||
| +var
 | ||||
| +  fs: TCFileStream;
 | ||||
| +  i: longint;
 | ||||
| +begin
 | ||||
| +  if fn='' then
 | ||||
| +    begin
 | ||||
| +      if FOut<>nil then
 | ||||
| +        begin
 | ||||
| +          FOut.Free;
 | ||||
| +          Compile(roOBJ,ChangeFileExt(fname,target_info.resobjext));
 | ||||
| +        end;
 | ||||
| +    end
 | ||||
| +  else
 | ||||
| +    begin
 | ||||
| +      fs:=TCFileStream.Create(fn,fmOpenRead or fmShareDenyNone);
 | ||||
| +      if CStreamError<>0 then
 | ||||
| +        begin
 | ||||
| +          fs.Free;
 | ||||
| +          Comment(V_Error,'Can''t open resource file: '+fn);
 | ||||
| +          exit;
 | ||||
| +        end;
 | ||||
| +      if FOut=nil then
 | ||||
| +        FOut:=TCFileStream.Create(fname,fmCreate)
 | ||||
| +      else
 | ||||
| +        fs.Seek(32, soFromBeginning);
 | ||||
| +      FOut.CopyFrom(fs, fs.Size-fs.Position);
 | ||||
| +      fs.Free;
 | ||||
| +      { align resource to dword }
 | ||||
| +      i:=4 - FOut.Position mod 4;
 | ||||
| +      if i<4 then
 | ||||
| +        FOut.WriteBuffer(zeroes, i);
 | ||||
| +    end;
 | ||||
| +end;
 | ||||
| +
 | ||||
| +
 | ||||
|  procedure CompileResourceFiles; | ||||
|  var | ||||
|    resourcefile : tresourcefile; | ||||
| +  res: TCmdStrListItem;
 | ||||
| +  p,s : TCmdStr;
 | ||||
| +  src,dst : TCFileStream;
 | ||||
| +  outfmt : tresoutput;
 | ||||
|  begin | ||||
|    { OS/2 (EMX) must be processed elsewhere (in the linking/binding stage). | ||||
|      same with MacOS} | ||||
| -  if not (target_info.system in [system_i386_os2,
 | ||||
| -                                 system_i386_emx,system_powerpc_macos]) then
 | ||||
| -   While not current_module.ResourceFiles.Empty do
 | ||||
| -     begin
 | ||||
| -       if target_info.res<>res_none then
 | ||||
| -         begin
 | ||||
| -           resourcefile:=TResourceFile(resinfos[target_info.res]^.resourcefileclass.create(current_module.ResourceFiles.getfirst));
 | ||||
| -           resourcefile.compile;
 | ||||
| -           resourcefile.free;
 | ||||
| -         end
 | ||||
| -       else
 | ||||
| -         Message(scan_e_resourcefiles_not_supported);
 | ||||
| -     end;
 | ||||
| +  if target_info.system in [system_i386_os2,system_i386_emx,system_powerpc_macos] then exit;
 | ||||
| +
 | ||||
| +  p:=ExtractFilePath(current_module.mainsource^);
 | ||||
| +  res:=TCmdStrListItem(current_module.ResourceFiles.First);
 | ||||
| +  while res<>nil do
 | ||||
| +    begin
 | ||||
| +      if target_info.res=res_none then
 | ||||
| +        Message(scan_e_resourcefiles_not_supported);
 | ||||
| +      s:=res.FPStr;
 | ||||
| +      if not path_absolute(s) then
 | ||||
| +        s:=p+s;
 | ||||
| +      resourcefile:=TResourceFile(resinfos[target_info.res]^.resourcefileclass.create(s));
 | ||||
| +      if resourcefile.IsCompiled(s) then
 | ||||
| +        begin
 | ||||
| +          resourcefile.free;
 | ||||
| +          if CompareText(current_module.outputpath^, p) <> 0 then
 | ||||
| +            begin
 | ||||
| +              { Copy .res file to units output dir }
 | ||||
| +              res.FPStr:=ExtractFileName(res.FPStr);
 | ||||
| +              src:=TCFileStream.Create(s,fmOpenRead or fmShareDenyNone);
 | ||||
| +              if CStreamError<>0 then
 | ||||
| +                begin
 | ||||
| +                  Comment(V_Error,'Can''t open resource file: '+src.FileName);
 | ||||
| +                  exit;
 | ||||
| +                end;
 | ||||
| +              dst:=TCFileStream.Create(current_module.outputpath^+res.FPStr,fmCreate);
 | ||||
| +              if CStreamError<>0 then
 | ||||
| +                begin
 | ||||
| +                  Comment(V_Error,'Can''t create resource file: '+dst.FileName);
 | ||||
| +                  exit;
 | ||||
| +                end;
 | ||||
| +              dst.CopyFrom(src,src.Size);
 | ||||
| +              dst.Free;
 | ||||
| +              src.Free;
 | ||||
| +            end;
 | ||||
| +        end
 | ||||
| +      else
 | ||||
| +        begin
 | ||||
| +          res.FPStr:=ExtractFileName(res.FPStr);
 | ||||
| +          if target_res.rcbin='' then
 | ||||
| +            begin
 | ||||
| +              { if target does not have .rc to .res compiler, create obj }
 | ||||
| +              outfmt:=roOBJ;
 | ||||
| +              res.FPStr:=ChangeFileExt(res.FPStr,target_info.resobjext);
 | ||||
| +            end
 | ||||
| +          else
 | ||||
| +            begin
 | ||||
| +              outfmt:=roRES;
 | ||||
| +              res.FPStr:=ChangeFileExt(res.FPStr,target_info.resext);
 | ||||
| +            end;
 | ||||
| +          resourcefile.compile(outfmt, current_module.outputpath^+res.FPStr);
 | ||||
| +          resourcefile.free;
 | ||||
| +        end;
 | ||||
| +      res:=TCmdStrListItem(res.Next);
 | ||||
| +    end;
 | ||||
|  end; | ||||
|   | ||||
|   | ||||
| +procedure CollectResourceFiles;
 | ||||
| +var
 | ||||
| +  resourcefile : tresourcefile;
 | ||||
| +  
 | ||||
| +  procedure ProcessModule(u : tmodule);
 | ||||
| +  var
 | ||||
| +    res : TCmdStrListItem;
 | ||||
| +    s   : TCmdStr;
 | ||||
| +  begin
 | ||||
| +    res:=TCmdStrListItem(u.ResourceFiles.First);
 | ||||
| +    while assigned(res) do
 | ||||
| +      begin
 | ||||
| +        if path_absolute(res.FPStr) then
 | ||||
| +          s:=res.FPStr
 | ||||
| +        else
 | ||||
| +          begin
 | ||||
| +            s:=u.path^+res.FPStr;
 | ||||
| +            if not FileExists(s,True) then
 | ||||
| +              s:=u.outputpath^+res.FPStr;
 | ||||
| +          end;
 | ||||
| +        resourcefile.Collect(s);
 | ||||
| +        res:=TCmdStrListItem(res.Next);
 | ||||
| +      end;
 | ||||
| +  end;
 | ||||
| +  
 | ||||
| +var
 | ||||
| +  hp : tused_unit;
 | ||||
| +  s : TCmdStr;
 | ||||
| +begin
 | ||||
| +  if (target_info.res=res_none) or (target_res.rcbin='') then
 | ||||
| +    exit;
 | ||||
| +  s:=main_module.outputpath^+GlobalResName+target_info.resext;
 | ||||
| +  resourcefile:=TResourceFile(resinfos[target_info.res]^.resourcefileclass.create(s));
 | ||||
| +  hp:=tused_unit(usedunits.first);
 | ||||
| +  while assigned(hp) do
 | ||||
| +    begin
 | ||||
| +      ProcessModule(hp.u);
 | ||||
| +      hp:=tused_unit(hp.next);
 | ||||
| +    end;
 | ||||
| +  ProcessModule(current_module);
 | ||||
| +  { Finish collection }
 | ||||
| +  resourcefile.Collect('');
 | ||||
| +  resourcefile.free;
 | ||||
| +end;
 | ||||
| +
 | ||||
|  end. | ||||
| Index: compiler/ppu.pas
 | ||||
| ===================================================================
 | ||||
| --- compiler/ppu.pas	(revision 7769)
 | ||||
| +++ compiler/ppu.pas	(working copy)
 | ||||
| @@ -124,6 +124,7 @@
 | ||||
|    {implementation/ObjData} | ||||
|    ibnodetree       = 80; | ||||
|    ibasmsymbols     = 81; | ||||
| +  ibresources      = 82;
 | ||||
|   | ||||
|  { unit flags } | ||||
|    uf_init          = $1; | ||||
| Index: compiler/systems.pas
 | ||||
| ===================================================================
 | ||||
| --- compiler/systems.pas	(revision 7769)
 | ||||
| +++ compiler/systems.pas	(working copy)
 | ||||
| @@ -268,8 +268,13 @@
 | ||||
|         presinfo = ^tresinfo; | ||||
|         tresinfo = record | ||||
|            id      : tres; | ||||
| +          { Compiler for resource (.rc or .res) to obj }
 | ||||
|            resbin  : string[8]; | ||||
|            rescmd  : string[50]; | ||||
| +          { Optional compiler for resource script (.rc) to binary resource (.res). }
 | ||||
| +          { If it is not provided resbin and rescmd will be used.                 }
 | ||||
| +          rcbin   : string[8];
 | ||||
| +          rccmd   : string[50];
 | ||||
|            resourcefileclass : TAbstractResourceFileClass; | ||||
|         end; | ||||
|   | ||||
| Index: compiler/version.pas
 | ||||
| ===================================================================
 | ||||
| --- compiler/version.pas	(revision 7769)
 | ||||
| +++ compiler/version.pas	(working copy)
 | ||||
| @@ -30,7 +30,7 @@
 | ||||
|         version_nr = '2'; | ||||
|         release_nr = '1'; | ||||
|         patch_nr   = '5'; | ||||
| -       minorpatch = '';
 | ||||
| +       minorpatch = '-L';
 | ||||
|   | ||||
|         { word version for ppu file } | ||||
|         wordversion = ((ord(version_nr)-ord('0')) shl 14)+ | ||||
| Index: compiler/systems/i_linux.pas
 | ||||
| ===================================================================
 | ||||
| --- compiler/systems/i_linux.pas	(revision 7769)
 | ||||
| +++ compiler/systems/i_linux.pas	(working copy)
 | ||||
| @@ -31,14 +31,20 @@
 | ||||
|            ( | ||||
|               id     : res_elf; | ||||
|               resbin : 'fpcres'; | ||||
| -             rescmd : '-o $OBJ -i $RES'
 | ||||
| +             rescmd : '-o $OBJ -i $RES';
 | ||||
| +             { cross compiled windres can be used to compile .rc files on linux }
 | ||||
| +             rcbin  : 'windres';
 | ||||
| +             rccmd  : '--include $INC -O res -o $RES $RC';
 | ||||
|            ); | ||||
|   | ||||
|         res_elf64_info : tresinfo = | ||||
|            ( | ||||
|               id     : res_elf; | ||||
|               resbin : 'fpcres'; | ||||
| -             rescmd : '-o $OBJ -i $RES'
 | ||||
| +             rescmd : '-o $OBJ -i $RES';
 | ||||
| +             { cross compiled windres can be used to compile .rc files on linux }
 | ||||
| +             rcbin  : 'windres';
 | ||||
| +             rccmd  : '--include $INC -O res -o $RES $RC';
 | ||||
|            ); | ||||
|   | ||||
|         system_i386_linux_info : tsysteminfo = | ||||
| Index: compiler/systems/t_win.pas
 | ||||
| ===================================================================
 | ||||
| --- compiler/systems/t_win.pas	(revision 7769)
 | ||||
| +++ compiler/systems/t_win.pas	(working copy)
 | ||||
| @@ -91,7 +91,7 @@
 | ||||
|        end; | ||||
|   | ||||
|   | ||||
| -      TWinResourceFile = class(TResourceFile)
 | ||||
| +      TWinResourceFile = class(TWinLikeResourceFile)
 | ||||
|          procedure PostProcessResourcefile(const s : ansistring);override; | ||||
|        end; | ||||
|   | ||||
| @@ -110,14 +110,18 @@
 | ||||
|          ( | ||||
|            id     : res_gnu_windres; | ||||
|            resbin : 'windres'; | ||||
| -          rescmd : '--include $INC -O coff -o $OBJ $RES'
 | ||||
| +          rescmd : '--include $INC -O coff -o $OBJ $RES';
 | ||||
| +          rcbin  : 'windres';
 | ||||
| +          rccmd  : '--include $INC -O res -o $RES $RC';
 | ||||
|          ); | ||||
|   | ||||
|      res_gnu_wince_windres_info : tresinfo = | ||||
|          ( | ||||
|            id     : res_gnu_wince_windres; | ||||
|            resbin : 'windres'; | ||||
| -          rescmd : '--include $INC -O coff -o $OBJ $RES'
 | ||||
| +          rescmd : '--include $INC -O coff -o $OBJ $RES';
 | ||||
| +          rcbin  : 'windres';
 | ||||
| +          rccmd  : '--include $INC -O res -o $RES $RC';
 | ||||
|          ); | ||||
|   | ||||
|   | ||||
| Index: compiler/options.pas
 | ||||
| ===================================================================
 | ||||
| --- compiler/options.pas	(revision 7769)
 | ||||
| +++ compiler/options.pas	(working copy)
 | ||||
| @@ -1994,6 +1994,7 @@
 | ||||
|    def_system_macro('FPC_HAS_STR_CURRENCY'); | ||||
|    def_system_macro('FPC_REAL2REAL_FIXED'); | ||||
|    def_system_macro('FPC_STRTOCHARARRAYPROC'); | ||||
| +  def_system_macro('FPC_MULTIPLERESOURCES_FIXED');
 | ||||
|  {$ifdef SUPPORT_UNALIGNED} | ||||
|    def_system_macro('FPC_SUPPORTS_UNALIGNED'); | ||||
|  {$endif SUPPORT_UNALIGNED} | ||||
							
								
								
									
										10
									
								
								tools/install/patches/readme.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								tools/install/patches/readme.txt
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | ||||
| This directory contains patches for fpc. For more information about the reason | ||||
| for these patches, see | ||||
| http://wiki.lazarus.freepascal.org/Useful_changes_not_in_the_fixes_branch | ||||
| 
 | ||||
| 
 | ||||
| The file fpc-fixes_2_2.patch is a patch for the fixes_2_2 branch | ||||
| (http://svn.freepascal.org/svn/fpc/branches/fixes_2_2).  | ||||
| Details about this patch can be found at  | ||||
| http://wiki.lazarus.freepascal.org/Useful_changes_not_in_the_fixes_branch#Description_of_the_fixes_2_2_patch | ||||
| 
 | ||||
| @ -1,16 +1,35 @@ | ||||
| SET OLDCURDIR=%CD% | ||||
| SET OLDCURDRIVE=%CD:~,2% | ||||
| 
 | ||||
| SET SOURCE_DIR=%FPCSVNDIR%\fpcsrc | ||||
| SET FPCSRC_DIR=%FPCSVNDIR%\fpcsrc | ||||
| SET HASFCL=0 | ||||
| 
 | ||||
| SET SOURCE_DIR=%BUILDDIR%\fpc-patched | ||||
| %SVN% export %FPCSRC_DIR% %SOURCE_DIR% | ||||
| 
 | ||||
| :: to switch drive | ||||
| %SOURCE_DIR:~,2% | ||||
| cd %SOURCE_DIR% | ||||
| 
 | ||||
| :: apply patch | ||||
| if [%PATCHFILE]==[] GOTO NO_PATCH | ||||
| patch -p0 -i %PATCHDIR%\%PATCHFILE% | ||||
| 
 | ||||
| :NO_PATCH  | ||||
| 
 | ||||
| :: copy fpc source | ||||
| gmkdir -p %BUILDDIR%\fpc\source | ||||
| cp -pr %SOURCE_DIR%\rtl %BUILDDIR%\fpc\source\rtl >> %LOGFILE% | ||||
| IF %HASFCL%==1 cp -pr %SOURCE_DIR%\fcl %BUILDDIR%\fpc\source\fcl >> %LOGFILE% | ||||
| cp -pr %SOURCE_DIR%\packages %BUILDDIR%\fpc\source\packages >> %LOGFILE% | ||||
| 
 | ||||
| :: build compiler | ||||
| %MAKEEXE% clean PP=%RELEASE_PPC% >> %LOGFILE% 2>&1 | ||||
| %MAKEEXE% compiler_cycle PP=%RELEASE_PPC% >> %LOGFILE% 2>&1 | ||||
| 
 | ||||
| FOR /F %%L IN ('%SOURCE_DIR%\compiler\utils\fpc.exe -PB') DO SET COMPILER=%SOURCE_DIR%\compiler\%%L | ||||
| FOR /F %%L IN ('%COMPILER% -iV') DO SET FPCVERSION=%%L | ||||
| FOR /F %%L IN ('%COMPILER% -iW') DO SET FPCLONGVERSION=%%L | ||||
| IF "%FPCVERSION:~,3%"=="2.0" SET HASFCL=1 | ||||
| 
 | ||||
| %MAKEEXE% -C rtl clean PP=%COMPILER% >> %LOGFILE%  | ||||
| @ -28,7 +47,12 @@ SET INSTALL_BINDIR=%INSTALL_BASE%\bin\%FPCFULLTARGET% | ||||
| IF %HASFCL%==1 %MAKEEXE% fcl_install INSTALL_PREFIX=%INSTALL_BASE% PP=%COMPILER% FPCMAKE=%SOURCE_DIR%\utils\fpcm\fpcmake.exe >> %LOGFILE% | ||||
| 
 | ||||
| FOR /F %%L IN ('%INSTALL_BINDIR%\fpc.exe -PB') DO SET COMPILER=%%L | ||||
| ::%MAKEEXE% clean PP=%COMPILER% >> %LOGFILE% | ||||
| 
 | ||||
| :: move fpc source to final location | ||||
| gmkdir -p %INSTALL_BASE%\source | ||||
| mv %BUILDDIR%\fpc\source %INSTALL_BASE% >> %LOGFILE% | ||||
| 
 | ||||
| rm -rf %SOURCE_DIR% | ||||
| 
 | ||||
| %OLDCURDRIVE% | ||||
| cd %OLDCURDIR% | ||||
|  | ||||
| @ -27,6 +27,9 @@ SET LAZSVNDIR=%2 | ||||
| :: Path to latest release compiler | ||||
| SET RELEASE_PPC=%3 | ||||
| 
 | ||||
| :: Name of fpc patch file | ||||
| SET PATCHFILE=%4 | ||||
| 
 | ||||
| ::===================================================================== | ||||
| :: no change needed after this. | ||||
| 
 | ||||
| @ -38,6 +41,7 @@ SET FPCFULLTARGET=%FPCTARGETCPU%-%FPCTARGETOS% | ||||
| SET FPCBINDIR=%FPCSVNDIR%\install\binw%FPCTARGETOS:~-2% | ||||
| SET MAKEEXE=%FPCBINDIR%\make.exe | ||||
| SET LOGFILE=%CD%\installer.log | ||||
| SET PATCHDIR=%CD%\..\patches | ||||
| FOR /F %%L IN ('%FPCBINDIR%\gdate.exe +%%Y%%m%%d') DO SET DATESTAMP=%%L | ||||
| SET BUILDDRIVE=%BUILDDIR:~,2% | ||||
| SET CP=%FPCBINDIR%\cp.exe | ||||
| @ -63,12 +67,6 @@ mv %BUILDDIR%\fpcbins\*.* %INSTALL_BINDIR% | ||||
| %FPCBINDIR%\rm -rf %BUILDDIR%\fpcbins | ||||
| del %INSTALL_BINDIR%\gdb.exe | ||||
| 
 | ||||
| :: copy fpc source | ||||
| gmkdir -p %INSTALL_BASE%\source | ||||
| %SVN% export %FPCSVNDIR%\fpcsrc\rtl %INSTALL_BASE%\source\rtl >> %LOGFILE% | ||||
| IF %HASFCL%==1 %SVN% export %FPCSVNDIR%\fpcsrc\fcl %INSTALL_BASE%\source\fcl >> %LOGFILE% | ||||
| %SVN% export %FPCSVNDIR%\fpcsrc\packages %INSTALL_BASE%\source\packages >> %LOGFILE% | ||||
| 
 | ||||
| :: exit if no compiler has been made | ||||
| if not exist %INSTALL_BINDIR%\fpc.exe goto END | ||||
| 
 | ||||
| @ -107,9 +105,10 @@ goto STOP | ||||
| :USAGE | ||||
| @echo off | ||||
| echo Usage: | ||||
| echo create_installer.bat FPCSVNDIR LAZSVNDIR RELEASECOMPILER | ||||
| echo create_installer.bat FPCSVNDIR LAZSVNDIR RELEASECOMPILER [PATCHFILE] | ||||
| echo FPCSVNDIR: directory that contains a svn version of the fpcbuild repository | ||||
| echo LAZSVNDIR: directory that contains a svn version of the lazarus repository | ||||
| echo RELEASECOMPILER: bootstrapping compiler for building fpc | ||||
| echo PATCHFILE: optional patch file for the fpc sources | ||||
| 
 | ||||
| :STOP | ||||
| @ -3,6 +3,7 @@ EnableISX=true | ||||
| [Defines] | ||||
| #define AppVersion GetEnv('LazVersion') | ||||
| #define FPCVersion GetEnv('FPCVersion') | ||||
| #define FPCLongVersion GetEnv('FPCLongVersion') | ||||
| #define FPCTargetOS GetEnv('FPCTargetOS') | ||||
| #define FPCFullTarget GetEnv('FPCFullTarget') | ||||
| #define AppName "Lazarus" | ||||
| @ -18,7 +19,7 @@ AppUpdatesURL=http://www.lazarus.freepascal.org/ | ||||
| ArchitecturesInstallIn64BitMode=x64 | ||||
| DefaultDirName={code:GetDefDir|c:\lazarus} | ||||
| DefaultGroupName={#AppName} | ||||
| OutputBaseFilename={#AppName}-{#AppVersion}-fpc-{#FPCVersion}-{#SetupDate}-{#FPCTargetOS} | ||||
| OutputBaseFilename={#AppName}-{#AppVersion}-fpc-{#FPCLongVersion}-{#SetupDate}-{#FPCTargetOS} | ||||
| InternalCompressLevel=ultra | ||||
| SolidCompression=true | ||||
| VersionInfoVersion={#AppVersion} | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 vincents
						vincents