lazbuild: do not compile to lazarus.new.exe, bug #19474

git-svn-id: trunk@31034 -
This commit is contained in:
mattias 2011-06-03 21:56:24 +00:00
parent eabbb9d096
commit a39784ea7c
2 changed files with 9 additions and 16 deletions

View File

@ -68,7 +68,8 @@ type
blfOnlyIDE, // skip all but IDE
blfDontClean, // ignore clean up
blfWithStaticPackages, // build with IDE static design time packages
blfUseMakeIDECfg // use idemake.cfg
blfUseMakeIDECfg, // use idemake.cfg
blfReplaceExe // ignore OSLocksExecutables and do not create lazarus.new.exe
);
TBuildLazarusFlags = set of TBuildLazarusFlag;
@ -410,6 +411,7 @@ var
CrossCompiling: Boolean;
CurTargetFilename: String;
BundleDir: String;
ExeLocked: Boolean;
begin
Result:=mrOk;
Options:=Profiles.Current;
@ -472,6 +474,9 @@ begin
if NewTargetOS='' then NewTargetOS:=DefaultTargetOS;
if NewTargetCPU='' then NewTargetCPU:=DefaultTargetCPU;
CrossCompiling:=(CompareText(NewTargetOS,DefaultTargetOS)<>0) or (CompareText(NewTargetCPU,DefaultTargetCPU)<>0);
ExeLocked:=OSLocksExecutables and (not (blfReplaceExe in Flags))
and (not CrossCompiling);
//DebugLn(['CreateBuildLazarusOptions NewTargetOS=',NewTargetOS,' NewTargetCPU=',NewTargetCPU]);
if (Options.TargetDirectory<>'') then begin
// Case 1. the user has set a target directory
@ -485,7 +490,7 @@ begin
debugln('CreateBuildLazarusOptions Options.TargetDirectory=',NewTargetDirectory);
Result:=ForceDirectoryInteractive(NewTargetDirectory,[]);
if Result<>mrOk then exit;
if OSLocksExecutables and not CrossCompiling then begin
if ExeLocked then begin
// Allow for the case where this corresponds to the current executable
NewTargetFilename:='lazarus'+GetExecutableExt(NewTargetOS);
if FileExistsUTF8(AppendPathDelim(NewTargetDirectory)+NewTargetFilename) then
@ -529,7 +534,7 @@ begin
if Result<>mrOk then exit;
end else begin
// the lazarus directory is writable
if OSLocksExecutables then begin
if ExeLocked then begin
// Case 4. the current executable is locked
// => use a different output name
NewTargetFilename:='lazarus.new'+GetExecutableExt(NewTargetOS);

View File

@ -428,18 +428,6 @@ begin
exit;
end;
// first compile all lazarus components (LCL, SynEdit, CodeTools, ...)
// but not the IDE
CurResult:=BuildLazarus(BuildLazProfiles,
EnvironmentOptions.ExternalTools,GlobalMacroList,
'',EnvironmentOptions.CompilerFilename,
EnvironmentOptions.MakeFilename,
Flags+[blfWithoutCompilingIDE,blfWithoutLinkingIDE]);
if CurResult<>mrOk then begin
DebugLn('TLazBuildApplication.BuildLazarusIDE: Building standard components (LCL, SynEdit, CodeTools) failed.');
exit;
end;
// compile auto install static packages
if not CompileAutoInstallPackages then begin
DebugLn('TLazBuildApplication.BuildLazarusIDE: Compile AutoInstall Packages failed.');
@ -463,7 +451,7 @@ begin
EnvironmentOptions.ExternalTools,GlobalMacroList,
PkgOptions,EnvironmentOptions.CompilerFilename,
EnvironmentOptions.MakeFilename,
Flags+[blfUseMakeIDECfg,blfOnlyIDE]
Flags+[blfUseMakeIDECfg,blfOnlyIDE,blfReplaceExe]
);
if CurResult<>mrOk then begin
DebugLn('TLazBuildApplication.BuildLazarusIDE: Building IDE failed.');