git-svn-id: trunk@8344 -
This commit is contained in:
mattias 2005-12-19 19:08:57 +00:00
parent bb99f5f64e
commit 51d6b1a88a
7 changed files with 39 additions and 28 deletions

View File

@ -480,7 +480,7 @@ type
function DefineActionNameToAction(const s: string): TDefineAction; function DefineActionNameToAction(const s: string): TDefineAction;
begin begin
for Result:=Low(TDefineAction) to High(TDefineAction) do for Result:=Low(TDefineAction) to High(TDefineAction) do
if AnsiCompareText(s,DefineActionNames[Result])=0 then exit; if CompareText(s,DefineActionNames[Result])=0 then exit;
Result:=da_None; Result:=da_None;
end; end;
@ -501,13 +501,13 @@ var Link1, Link2: TUnitNameLink;
begin begin
Link1:=TUnitNameLink(NodeData1); Link1:=TUnitNameLink(NodeData1);
Link2:=TUnitNameLink(NodeData2); Link2:=TUnitNameLink(NodeData2);
Result:=AnsiCompareText(Link1.UnitName,Link2.UnitName); Result:=CompareText(Link1.UnitName,Link2.UnitName);
end; end;
function CompareUnitNameWithUnitLinkNode(UnitName: Pointer; function CompareUnitNameWithUnitLinkNode(UnitName: Pointer;
NodeData: pointer): integer; NodeData: pointer): integer;
begin begin
Result:=AnsiCompareText(String(UnitName),TUnitNameLink(NodeData).UnitName); Result:=CompareText(String(UnitName),TUnitNameLink(NodeData).UnitName);
end; end;
function CompareDirectoryDefines(NodeData1, NodeData2: pointer): integer; function CompareDirectoryDefines(NodeData1, NodeData2: pointer): integer;
@ -1289,7 +1289,7 @@ begin
// node has a name -> test if already exists // node has a name -> test if already exists
PosNode:=FirstSibling; PosNode:=FirstSibling;
while (PosNode<>nil) while (PosNode<>nil)
and (AnsiCompareText(PosNode.Name,NewNode.Name)<>0) do and (CompareText(PosNode.Name,NewNode.Name)<>0) do
PosNode:=PosNode.Next; PosNode:=PosNode.Next;
if PosNode<>nil then begin if PosNode<>nil then begin
// node with same name already exists -> check if it is a copy // node with same name already exists -> check if it is a copy
@ -1314,7 +1314,7 @@ begin
// -> search MergeNameInFront // -> search MergeNameInFront
PosNode:=LastSibling; PosNode:=LastSibling;
while (PosNode<>nil) while (PosNode<>nil)
and (AnsiCompareText(PosNode.Name,NewNode.MergeNameInFront)<>0) do and (CompareText(PosNode.Name,NewNode.MergeNameInFront)<>0) do
PosNode:=PosNode.Prior; PosNode:=PosNode.Prior;
if PosNode<>nil then begin if PosNode<>nil then begin
// MergeNameInFront found -> insert behind // MergeNameInFront found -> insert behind
@ -1328,7 +1328,7 @@ begin
// -> search MergeNameBehind // -> search MergeNameBehind
PosNode:=FirstSibling; PosNode:=FirstSibling;
while (PosNode<>nil) while (PosNode<>nil)
and (AnsiCompareText(PosNode.Name,NewNode.MergeNameBehind)<>0) do and (CompareText(PosNode.Name,NewNode.MergeNameBehind)<>0) do
PosNode:=PosNode.Next; PosNode:=PosNode.Next;
if PosNode<>nil then begin if PosNode<>nil then begin
// MergeNameBehind found -> insert in front // MergeNameBehind found -> insert in front
@ -1601,7 +1601,7 @@ function TDefineTemplate.FindByName(const AName: string; WithSubChilds,
WithNextSiblings: boolean): TDefineTemplate; WithNextSiblings: boolean): TDefineTemplate;
var ANode: TDefineTemplate; var ANode: TDefineTemplate;
begin begin
if AnsiCompareText(AName,Name)=0 then begin if CompareText(AName,Name)=0 then begin
Result:=Self; Result:=Self;
end else begin end else begin
if WithSubChilds and (FirstChild<>nil) then if WithSubChilds and (FirstChild<>nil) then
@ -2679,7 +2679,7 @@ var
begin begin
Result:=LastDefTempl; Result:=LastDefTempl;
while (Result<>nil) while (Result<>nil)
and (AnsiComparetext(Result.Variable,SymbolName)<>0) do and (Comparetext(Result.Variable,SymbolName)<>0) do
Result:=Result.Prior; Result:=Result.Prior;
end; end;
@ -2715,7 +2715,7 @@ var
UpLine:=UpperCaseStr(Line); UpLine:=UpperCaseStr(Line);
i:=length(ShortTestFile); i:=length(ShortTestFile);
if (length(Line)>i) if (length(Line)>i)
and (AnsiCompareText(LeftStr(Line,i),ShortTestFile)=0) and (CompareText(LeftStr(Line,i),ShortTestFile)=0)
and (Line[i+1]='(') then begin and (Line[i+1]='(') then begin
inc(i); inc(i);
while (i<length(Line)) and (Line[i]<>')') do inc(i); while (i<length(Line)) and (Line[i]<>')') do inc(i);
@ -2766,7 +2766,7 @@ var CmdLine: string;
SrcOS: string; SrcOS: string;
SrcOS2: String; SrcOS2: String;
begin begin
//DebugLn('CreateFPCTemplate ',PPC386Path,' ',PPCOptions); //DebugLn('TDefinePool.CreateFPCTemplate PPC386Path="',PPC386Path,'" PPCOptions="',PPCOptions,'"');
Result:=nil; Result:=nil;
UnitSearchPath:=''; UnitSearchPath:='';
TargetOS:=''; TargetOS:='';
@ -2775,15 +2775,16 @@ begin
if (PPC386Path='') or (not FileIsExecutable(PPC386Path)) then exit; if (PPC386Path='') or (not FileIsExecutable(PPC386Path)) then exit;
LastDefTempl:=nil; LastDefTempl:=nil;
// find all initial compiler macros and all unit paths // find all initial compiler macros and all unit paths
// -> ask compiler with the -va switch // -> ask compiler with the -vm -vt switch
SetLength(Buf,1024); SetLength(Buf,1024);
try try
CmdLine:=PPC386Path+' -va '; CmdLine:=PPC386Path+' -vm -vt ';
if FileExistsCached(EnglishErrorMsgFilename) then if FileExistsCached(EnglishErrorMsgFilename) then
CmdLine:=CmdLine+'-Fr'+EnglishErrorMsgFilename+' '; CmdLine:=CmdLine+'-Fr'+EnglishErrorMsgFilename+' ';
if PPCOptions<>'' then if PPCOptions<>'' then
CmdLine:=CmdLine+PPCOptions+' '; CmdLine:=CmdLine+PPCOptions+' ';
CmdLine:=CmdLine+TestPascalFile; CmdLine:=CmdLine+TestPascalFile;
//DebugLn('TDefinePool.CreateFPCTemplate CmdLine="',CmdLine,'"');
ShortTestFile:=ExtractFileName(TestPascalFile); ShortTestFile:=ExtractFileName(TestPascalFile);
TheProcess := TProcess.Create(nil); TheProcess := TProcess.Create(nil);
@ -2794,9 +2795,9 @@ begin
TheProcess.Execute; TheProcess.Execute;
OutputLine:=''; OutputLine:='';
repeat repeat
if TheProcess.Output<>nil then if (TheProcess.Output<>nil) then begin
OutLen:=TheProcess.Output.Read(Buf[1],length(Buf)) OutLen:=TheProcess.Output.Read(Buf[1],length(Buf));
else end else
OutLen:=0; OutLen:=0;
LineStart:=1; LineStart:=1;
i:=1; i:=1;
@ -2816,8 +2817,10 @@ begin
until OutLen=0; until OutLen=0;
TheProcess.WaitOnExit; TheProcess.WaitOnExit;
finally finally
//DebugLn('TDefinePool.CreateFPCTemplate OutputLine="',OutputLine,'"');
TheProcess.Free; TheProcess.Free;
end; end;
//DebugLn('TDefinePool.CreateFPCTemplate First done');
// ask for target operating system -> ask compiler with switch -iTO // ask for target operating system -> ask compiler with switch -iTO
CmdLine:=PPC386Path; CmdLine:=PPC386Path;
@ -2831,7 +2834,7 @@ begin
TheProcess.ShowWindow := swoNone; TheProcess.ShowWindow := swoNone;
try try
TheProcess.Execute; TheProcess.Execute;
if TheProcess.Output<>nil then if (TheProcess.Output<>nil) then
OutLen:=TheProcess.Output.Read(Buf[1],length(Buf)) OutLen:=TheProcess.Output.Read(Buf[1],length(Buf))
else else
OutLen:=0; OutLen:=0;
@ -2863,6 +2866,7 @@ begin
inc(i); inc(i);
end; end;
TheProcess.WaitOnExit; TheProcess.WaitOnExit;
//DebugLn('TDefinePool.CreateFPCTemplate target OS done');
finally finally
TheProcess.Free; TheProcess.Free;
end; end;
@ -2896,6 +2900,7 @@ begin
inc(i); inc(i);
end; end;
TheProcess.WaitOnExit; TheProcess.WaitOnExit;
//DebugLn('TDefinePool.CreateFPCTemplate target CPU done');
finally finally
TheProcess.Free; TheProcess.Free;
end; end;
@ -2906,6 +2911,7 @@ begin
ctsFreePascalCompilerInitialMacros,'','',da_Block); ctsFreePascalCompilerInitialMacros,'','',da_Block);
Result.AddChild(LastDefTempl.GetFirstSibling); Result.AddChild(LastDefTempl.GetFirstSibling);
Result.SetFlags([dtfAutoGenerated],[],false); Result.SetFlags([dtfAutoGenerated],[],false);
//DebugLn('TDefinePool.CreateFPCTemplate FPC defines done');
end; end;
except except
on E: Exception do begin on E: Exception do begin
@ -2938,7 +2944,7 @@ var
ANode:=UnitTree.Root; ANode:=UnitTree.Root;
while ANode<>nil do begin while ANode<>nil do begin
Result:=TUnitNameLink(ANode.Data); Result:=TUnitNameLink(ANode.Data);
cmp:=AnsiCompareText(AnUnitName,Result.UnitName); cmp:=CompareText(AnUnitName,Result.UnitName);
if cmp<0 then if cmp<0 then
ANode:=ANode.Left ANode:=ANode.Left
else if cmp>0 then else if cmp>0 then

View File

@ -995,7 +995,7 @@ uses
{$ENDIF} {$ENDIF}
{$IFNDEF SYN_LAZARUS} {$IFNDEF SYN_LAZARUS}
// ToDo ShellAPI // ToDo ShellAPI
ShellAPI, SynEditStrConst ShellAPI, SynEditStrConst,
{$ENDIF} {$ENDIF}
Clipbrd; Clipbrd;

View File

@ -72,17 +72,17 @@ implementation
{ TCompiler } { TCompiler }
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------
{ TCompiler Constructor } TCompiler Constructor
{------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
constructor TCompiler.Create; constructor TCompiler.Create;
begin begin
inherited Create; inherited Create;
end; end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------
{ TCompiler Destructor } TCompiler Destructor
{------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
destructor TCompiler.Destroy; destructor TCompiler.Destroy;
begin begin
FreeAndNil(FTheProcess); FreeAndNil(FTheProcess);

View File

@ -378,6 +378,8 @@ resourcestring
lisTheFileWasNotFoundIgnoreWillGoOnLoadingTheProject = 'The file %s%s%s%' lisTheFileWasNotFoundIgnoreWillGoOnLoadingTheProject = 'The file %s%s%s%'
+'swas not found.%sIgnore will go on loading the project,%sAbort will ' +'swas not found.%sIgnore will go on loading the project,%sAbort will '
+'stop the loading.'; +'stop the loading.';
lisSkipFileAndContinueLoading = 'Skip file and continue loading';
lisAbortLoadingProject = 'Abort loading project';
lisFileNotFound2 = 'File %s%s%s not found.%s'; lisFileNotFound2 = 'File %s%s%s not found.%s';
lisFileNotFoundDoYouWantToCreateIt = 'File %s%s%s not found.%sDo you want ' lisFileNotFoundDoYouWantToCreateIt = 'File %s%s%s not found.%sDo you want '
+'to create it?%s'; +'to create it?%s';

View File

@ -4308,10 +4308,12 @@ var
begin begin
if ofProjectLoading in Flags then begin if ofProjectLoading in Flags then begin
// this is a file, that was loaded last time, but was removed from disk // this is a file, that was loaded last time, but was removed from disk
Result:=MessageDlg(lisFileNotFound, Result:=QuestionDlg(lisFileNotFound,
Format(lisTheFileWasNotFoundIgnoreWillGoOnLoadingTheProject, ['"', Format(lisTheFileWasNotFoundIgnoreWillGoOnLoadingTheProject, ['"',
AFilename, '"', #13, #13, #13]), AFilename, '"', #13, #13, #13]),
mtError, [mbIgnore, mbAbort], 0); mtError, [mrIgnore, lisSkipFileAndContinueLoading,
mrAbort, lisAbortLoadingProject],
0);
exit; exit;
end; end;

View File

@ -79,12 +79,13 @@ fi
if [ $BuildCrossFPC = "yes" ]; then if [ $BuildCrossFPC = "yes" ]; then
Params="$Params buildcrossfpc" Params="$Params buildcrossfpc"
fi fi
if [ ! -z $Params ]; then if [ "x$Params" == "x" ]; then
Params="$Params targets=i386-win32" Params="$Params targets=i386-win32"
echo "calling update_cross_fpc.sh $Params ..." echo "calling update_cross_fpc.sh $Params ..."
./update_cross_fpc.sh $Params ./update_cross_fpc.sh $Params
fi fi
#=============================================================================== #===============================================================================
# build fpc_crosswin32 rpm # build fpc_crosswin32 rpm
if [ $BuildCrossWin32RPM = "yes" ]; then if [ $BuildCrossWin32RPM = "yes" ]; then

View File

@ -107,7 +107,7 @@ if [ $InstallAsDefault = "yes" ]; then
echo "Either prepend it to \$PATH or define another with installbin=<path>" echo "Either prepend it to \$PATH or define another with installbin=<path>"
exit -1 exit -1
fi fi
# check if $InstallBin is in before the system compiler # check if $InstallBin is in PATH before the system compiler
mkdir -p $InstallBin mkdir -p $InstallBin
NewCompilerName=$InstallBin/$CompilerName NewCompilerName=$InstallBin/$CompilerName
if [ ! -f $NewCompilerName ]; then if [ ! -f $NewCompilerName ]; then