fixed rtl include path

git-svn-id: trunk@3966 -
This commit is contained in:
mattias 2003-03-26 11:39:08 +00:00
parent 5dd9773ab8
commit d3228efcfd
7 changed files with 84 additions and 25 deletions

View File

@ -2365,7 +2365,7 @@ var
// UnitSearchPath: string;
// UnitLinkListValid: boolean; var UnitLinkList: string): TDefineTemplate;
var
DefTempl, MainDir, FCLDir, RTLDir, PackagesDir, CompilerDir,
DefTempl, MainDir, FCLDir, RTLDir, RTLOSDir, PackagesDir, CompilerDir,
UtilsDir, DebugSvrDir: TDefineTemplate;
s: string;
begin
@ -2422,15 +2422,24 @@ begin
+';'+Dir+'rtl'+DS+'objpas'+DS
+';'+Dir+'rtl'+DS+'inc'+DS
+';'+Dir+'rtl'+DS+TargetProcessor+DS
+';'+Dir+'rtl'+DS+SrcOS+DS
+';'+Dir+'rtl'+DS+TargetOS+DS+TargetProcessor+DS
+';'+Dir+'rtl'+DS+SrcOS+DS+TargetProcessor+DS;
+';'+Dir+'rtl'+DS+SrcOS+DS;
if (TargetOS<>'') and (TargetOS<>SrcOS) then
s:=s+';'+Dir+'rtl'+DS+TargetOS+DS;
RTLDir.AddChild(TDefineTemplate.Create('Include Path',
Format(ctsIncludeDirectoriesPlusDirs,
['objpas, inc,'+TargetProcessor+','+SrcOS]),
ExternalMacroStart+'IncPath',s,da_DefineRecurse));
if TargetOS<>'' then begin
RTLOSDir:=TDefineTemplate.Create('TargetOS','Target OS','',
TargetOS,da_Directory);
s:=IncPathMacro
+';'+Dir+'rtl'+DS+TargetOS+DS+TargetProcessor+DS;
RTLOSDir.AddChild(TDefineTemplate.Create('Include Path',
Format(ctsIncludeDirectoriesPlusDirs,[TargetProcessor]),
ExternalMacroStart+'IncPath',s,da_DefineRecurse));
RTLDir.AddChild(RTLOSDir);
end;
// define 'i386' ToDo: other types like m68k
DefTempl:=TDefineTemplate.Create('Define i386',
ctsDefineProzessorType,'i386','',da_DefineRecurse);

View File

@ -119,12 +119,14 @@ end;
function FindDefaultCompilerPath: string;
begin
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':');
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':',
[sffDontSearchInBasePath]);
end;
function FindDefaultMakePath: string;
begin
Result:=SearchFileInPath('make','',GetEnv('PATH'),':');
Result:=SearchFileInPath('make','',GetEnv('PATH'),':',
[sffDontSearchInBasePath]);
end;
function CreateCompilerTestPascalFilename: string;
@ -149,6 +151,9 @@ end;
{
$Log$
Revision 1.10 2003/03/26 11:39:08 mattias
fixed rtl include path
Revision 1.9 2003/02/07 17:49:21 mattias
added ReadAllLinks

View File

@ -136,7 +136,7 @@ end;
function FindDefaultCompilerPath: string;
begin
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':',
[sffSearchNotInBasePath]);
[sffDontSearchInBasePath]);
end;
{---------------------------------------------------------------------------
@ -145,7 +145,7 @@ end;
function FindDefaultMakePath: string;
begin
Result:=SearchFileInPath('make','',GetEnv('PATH'),':',
[sffSearchNotInBasePath]);
[sffDontSearchInBasePath]);
end;
{---------------------------------------------------------------------------
@ -161,6 +161,9 @@ end;
{
$Log$
Revision 1.13 2003/03/26 11:39:08 mattias
fixed rtl include path
Revision 1.12 2003/02/07 19:13:57 mattias
fixed searching lazarus in current dir

View File

@ -117,16 +117,6 @@ begin
end;
end;
function FindDefaultCompilerPath: string;
begin
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':');
end;
function FindDefaultMakePath: string;
begin
Result:=SearchFileInPath('make','',GetEnv('PATH'),':');
end;
function CreateCompilerTestPascalFilename: string;
var
fs: TFileStream;
@ -138,6 +128,24 @@ begin
end;
end;
{---------------------------------------------------------------------------
function FindDefaultCompilerPath: string;
---------------------------------------------------------------------------}
function FindDefaultCompilerPath: string;
begin
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':',
[sffDontSearchInBasePath]);
end;
{---------------------------------------------------------------------------
function FindDefaultMakePath: string;
---------------------------------------------------------------------------}
function FindDefaultMakePath: string;
begin
Result:=SearchFileInPath('make','',GetEnv('PATH'),':',
[sffDontSearchInBasePath]);
end;
{---------------------------------------------------------------------------
procedure InternalInit;
---------------------------------------------------------------------------}
@ -149,6 +157,9 @@ end;
{
$Log$
Revision 1.7 2003/03/26 11:39:08 mattias
fixed rtl include path
Revision 1.6 2003/02/07 17:49:21 mattias
added ReadAllLinks

View File

@ -542,8 +542,7 @@ begin
if Assigned(OnGetIncludePath) then begin
// search with include path of directory
IncludePath:=OnGetIncludePath(FullDir);
Result:=IDEProcs.SearchFileInPath(ShortIncFilename,FullDir,IncludePath,
';',[]);
Result:=SearchFileInPath(ShortIncFilename,FullDir,IncludePath,';',[]);
if Result<>'' then begin
if LeftStr(Result,length(fCurrentDirectory))=fCurrentDirectory then
Result:=RightStr(Result,length(Result)-length(fCurrentDirectory));

View File

@ -62,6 +62,7 @@ function DirectoryExists(const FileName: String): Boolean;
function ForceDirectory(DirectoryName: string): boolean;
function DeleteDirectory(const DirectoryName: string;
OnlyChilds: boolean): boolean;
function ProgramDirectory: string;
// filename parts
function ExtractFileNameOnly(const AFilename: string): string;
@ -75,8 +76,15 @@ function CleanAndExpandDirectory(const Filename: string): string;
function FileIsInPath(const Filename, Path: string): boolean;
// file search
type
TSearchFileInPathFlag = (
sffDontSearchInBasePath,
sffSearchLoUpCase
);
TSearchFileInPathFlags = set of TSearchFileInPathFlag;
function SearchFileInPath(const Filename, BasePath, SearchPath,
Delimiter: string; SearchLoUpCase: boolean): string;
Delimiter: string; Flags: TSearchFileInPathFlags): string;
// file actions
function ReadFileToString(const Filename: string): string;
@ -114,6 +122,9 @@ end.
{
$Log$
Revision 1.14 2003/03/26 11:39:08 mattias
fixed rtl include path
Revision 1.13 2003/02/26 12:44:52 mattias
readonly flag is now only saved if user set

View File

@ -644,6 +644,23 @@ begin
Result:=true;
end;
{------------------------------------------------------------------------------
function ProgramDirectory: string;
------------------------------------------------------------------------------}
function ProgramDirectory: string;
begin
Result:=ParamStr(0);
if ExtractFilePath(Result)='' then begin
// program was started via PATH
Result:=SearchFileInPath(Result,'',GetEnv('PATH'),':',
[sffDontSearchInBasePath]);
end;
// resolve links
Result:=ReadAllLinks(Result,false);
// extract file path and expand to full name
Result:=ExpandFilename(ExtractFilePath(Result));
end;
{------------------------------------------------------------------------------
function CleanAndExpandFilename(const Filename: string): string;
------------------------------------------------------------------------------}
@ -724,10 +741,10 @@ end;
{------------------------------------------------------------------------------
function SearchFileInPath(const Filename, BasePath, SearchPath,
Delimiter: string; SearchLoUpCase: boolean): string;
Delimiter: string; Flags: TSearchFileInPathFlags): string;
------------------------------------------------------------------------------}
function SearchFileInPath(const Filename, BasePath, SearchPath,
Delimiter: string; SearchLoUpCase: boolean): string;
Delimiter: string; Flags: TSearchFileInPathFlags): string;
function FileDoesExists(const AFilename: string): boolean;
var s: string;
@ -739,7 +756,7 @@ function SearchFileInPath(const Filename, BasePath, SearchPath,
exit;
end;
{$IFNDEF Win32}
if SearchLoUpCase then begin
if sffSearchLoUpCase in Flags then begin
end;
{$ENDIF}
@ -766,7 +783,8 @@ begin
end;
Base:=ExpandFilename(AppendPathDelim(BasePath));
// search in current directory
if FileExists(Base+Filename) then begin
if (not (sffDontSearchInBasePath in Flags))
and FileExists(Base+Filename) then begin
Result:=Base+Filename;
exit;
end;
@ -813,6 +831,9 @@ end;
{
$Log$
Revision 1.17 2003/03/26 11:39:08 mattias
fixed rtl include path
Revision 1.16 2003/03/11 07:46:43 mattias
more localization for gtk- and win32-interface and lcl