mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 20:39:14 +02:00
fixed rtl include path
git-svn-id: trunk@3966 -
This commit is contained in:
parent
5dd9773ab8
commit
d3228efcfd
@ -2365,7 +2365,7 @@ var
|
|||||||
// UnitSearchPath: string;
|
// UnitSearchPath: string;
|
||||||
// UnitLinkListValid: boolean; var UnitLinkList: string): TDefineTemplate;
|
// UnitLinkListValid: boolean; var UnitLinkList: string): TDefineTemplate;
|
||||||
var
|
var
|
||||||
DefTempl, MainDir, FCLDir, RTLDir, PackagesDir, CompilerDir,
|
DefTempl, MainDir, FCLDir, RTLDir, RTLOSDir, PackagesDir, CompilerDir,
|
||||||
UtilsDir, DebugSvrDir: TDefineTemplate;
|
UtilsDir, DebugSvrDir: TDefineTemplate;
|
||||||
s: string;
|
s: string;
|
||||||
begin
|
begin
|
||||||
@ -2422,15 +2422,24 @@ begin
|
|||||||
+';'+Dir+'rtl'+DS+'objpas'+DS
|
+';'+Dir+'rtl'+DS+'objpas'+DS
|
||||||
+';'+Dir+'rtl'+DS+'inc'+DS
|
+';'+Dir+'rtl'+DS+'inc'+DS
|
||||||
+';'+Dir+'rtl'+DS+TargetProcessor+DS
|
+';'+Dir+'rtl'+DS+TargetProcessor+DS
|
||||||
+';'+Dir+'rtl'+DS+SrcOS+DS
|
+';'+Dir+'rtl'+DS+SrcOS+DS;
|
||||||
+';'+Dir+'rtl'+DS+TargetOS+DS+TargetProcessor+DS
|
|
||||||
+';'+Dir+'rtl'+DS+SrcOS+DS+TargetProcessor+DS;
|
|
||||||
if (TargetOS<>'') and (TargetOS<>SrcOS) then
|
if (TargetOS<>'') and (TargetOS<>SrcOS) then
|
||||||
s:=s+';'+Dir+'rtl'+DS+TargetOS+DS;
|
s:=s+';'+Dir+'rtl'+DS+TargetOS+DS;
|
||||||
RTLDir.AddChild(TDefineTemplate.Create('Include Path',
|
RTLDir.AddChild(TDefineTemplate.Create('Include Path',
|
||||||
Format(ctsIncludeDirectoriesPlusDirs,
|
Format(ctsIncludeDirectoriesPlusDirs,
|
||||||
['objpas, inc,'+TargetProcessor+','+SrcOS]),
|
['objpas, inc,'+TargetProcessor+','+SrcOS]),
|
||||||
ExternalMacroStart+'IncPath',s,da_DefineRecurse));
|
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
|
// define 'i386' ToDo: other types like m68k
|
||||||
DefTempl:=TDefineTemplate.Create('Define i386',
|
DefTempl:=TDefineTemplate.Create('Define i386',
|
||||||
ctsDefineProzessorType,'i386','',da_DefineRecurse);
|
ctsDefineProzessorType,'i386','',da_DefineRecurse);
|
||||||
|
@ -119,12 +119,14 @@ end;
|
|||||||
|
|
||||||
function FindDefaultCompilerPath: string;
|
function FindDefaultCompilerPath: string;
|
||||||
begin
|
begin
|
||||||
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':');
|
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':',
|
||||||
|
[sffDontSearchInBasePath]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindDefaultMakePath: string;
|
function FindDefaultMakePath: string;
|
||||||
begin
|
begin
|
||||||
Result:=SearchFileInPath('make','',GetEnv('PATH'),':');
|
Result:=SearchFileInPath('make','',GetEnv('PATH'),':',
|
||||||
|
[sffDontSearchInBasePath]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CreateCompilerTestPascalFilename: string;
|
function CreateCompilerTestPascalFilename: string;
|
||||||
@ -149,6 +151,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
Revision 1.9 2003/02/07 17:49:21 mattias
|
||||||
added ReadAllLinks
|
added ReadAllLinks
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ end;
|
|||||||
function FindDefaultCompilerPath: string;
|
function FindDefaultCompilerPath: string;
|
||||||
begin
|
begin
|
||||||
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':',
|
Result:=SearchFileInPath('ppc386','',GetEnv('PATH'),':',
|
||||||
[sffSearchNotInBasePath]);
|
[sffDontSearchInBasePath]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{---------------------------------------------------------------------------
|
{---------------------------------------------------------------------------
|
||||||
@ -145,7 +145,7 @@ end;
|
|||||||
function FindDefaultMakePath: string;
|
function FindDefaultMakePath: string;
|
||||||
begin
|
begin
|
||||||
Result:=SearchFileInPath('make','',GetEnv('PATH'),':',
|
Result:=SearchFileInPath('make','',GetEnv('PATH'),':',
|
||||||
[sffSearchNotInBasePath]);
|
[sffDontSearchInBasePath]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{---------------------------------------------------------------------------
|
{---------------------------------------------------------------------------
|
||||||
@ -161,6 +161,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
Revision 1.12 2003/02/07 19:13:57 mattias
|
||||||
fixed searching lazarus in current dir
|
fixed searching lazarus in current dir
|
||||||
|
|
||||||
|
@ -117,16 +117,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
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;
|
function CreateCompilerTestPascalFilename: string;
|
||||||
var
|
var
|
||||||
fs: TFileStream;
|
fs: TFileStream;
|
||||||
@ -138,6 +128,24 @@ begin
|
|||||||
end;
|
end;
|
||||||
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;
|
procedure InternalInit;
|
||||||
---------------------------------------------------------------------------}
|
---------------------------------------------------------------------------}
|
||||||
@ -149,6 +157,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
Revision 1.6 2003/02/07 17:49:21 mattias
|
||||||
added ReadAllLinks
|
added ReadAllLinks
|
||||||
|
|
||||||
|
@ -542,8 +542,7 @@ begin
|
|||||||
if Assigned(OnGetIncludePath) then begin
|
if Assigned(OnGetIncludePath) then begin
|
||||||
// search with include path of directory
|
// search with include path of directory
|
||||||
IncludePath:=OnGetIncludePath(FullDir);
|
IncludePath:=OnGetIncludePath(FullDir);
|
||||||
Result:=IDEProcs.SearchFileInPath(ShortIncFilename,FullDir,IncludePath,
|
Result:=SearchFileInPath(ShortIncFilename,FullDir,IncludePath,';',[]);
|
||||||
';',[]);
|
|
||||||
if Result<>'' then begin
|
if Result<>'' then begin
|
||||||
if LeftStr(Result,length(fCurrentDirectory))=fCurrentDirectory then
|
if LeftStr(Result,length(fCurrentDirectory))=fCurrentDirectory then
|
||||||
Result:=RightStr(Result,length(Result)-length(fCurrentDirectory));
|
Result:=RightStr(Result,length(Result)-length(fCurrentDirectory));
|
||||||
|
@ -62,6 +62,7 @@ function DirectoryExists(const FileName: String): Boolean;
|
|||||||
function ForceDirectory(DirectoryName: string): boolean;
|
function ForceDirectory(DirectoryName: string): boolean;
|
||||||
function DeleteDirectory(const DirectoryName: string;
|
function DeleteDirectory(const DirectoryName: string;
|
||||||
OnlyChilds: boolean): boolean;
|
OnlyChilds: boolean): boolean;
|
||||||
|
function ProgramDirectory: string;
|
||||||
|
|
||||||
// filename parts
|
// filename parts
|
||||||
function ExtractFileNameOnly(const AFilename: string): string;
|
function ExtractFileNameOnly(const AFilename: string): string;
|
||||||
@ -75,8 +76,15 @@ function CleanAndExpandDirectory(const Filename: string): string;
|
|||||||
function FileIsInPath(const Filename, Path: string): boolean;
|
function FileIsInPath(const Filename, Path: string): boolean;
|
||||||
|
|
||||||
// file search
|
// file search
|
||||||
|
type
|
||||||
|
TSearchFileInPathFlag = (
|
||||||
|
sffDontSearchInBasePath,
|
||||||
|
sffSearchLoUpCase
|
||||||
|
);
|
||||||
|
TSearchFileInPathFlags = set of TSearchFileInPathFlag;
|
||||||
|
|
||||||
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
||||||
Delimiter: string; SearchLoUpCase: boolean): string;
|
Delimiter: string; Flags: TSearchFileInPathFlags): string;
|
||||||
|
|
||||||
// file actions
|
// file actions
|
||||||
function ReadFileToString(const Filename: string): string;
|
function ReadFileToString(const Filename: string): string;
|
||||||
@ -114,6 +122,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
Revision 1.13 2003/02/26 12:44:52 mattias
|
||||||
readonly flag is now only saved if user set
|
readonly flag is now only saved if user set
|
||||||
|
|
||||||
|
@ -644,6 +644,23 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
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;
|
function CleanAndExpandFilename(const Filename: string): string;
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
@ -724,10 +741,10 @@ end;
|
|||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
||||||
Delimiter: string; SearchLoUpCase: boolean): string;
|
Delimiter: string; Flags: TSearchFileInPathFlags): string;
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
||||||
Delimiter: string; SearchLoUpCase: boolean): string;
|
Delimiter: string; Flags: TSearchFileInPathFlags): string;
|
||||||
|
|
||||||
function FileDoesExists(const AFilename: string): boolean;
|
function FileDoesExists(const AFilename: string): boolean;
|
||||||
var s: string;
|
var s: string;
|
||||||
@ -739,7 +756,7 @@ function SearchFileInPath(const Filename, BasePath, SearchPath,
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
{$IFNDEF Win32}
|
{$IFNDEF Win32}
|
||||||
if SearchLoUpCase then begin
|
if sffSearchLoUpCase in Flags then begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -766,7 +783,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
Base:=ExpandFilename(AppendPathDelim(BasePath));
|
Base:=ExpandFilename(AppendPathDelim(BasePath));
|
||||||
// search in current directory
|
// search in current directory
|
||||||
if FileExists(Base+Filename) then begin
|
if (not (sffDontSearchInBasePath in Flags))
|
||||||
|
and FileExists(Base+Filename) then begin
|
||||||
Result:=Base+Filename;
|
Result:=Base+Filename;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -813,6 +831,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
Revision 1.16 2003/03/11 07:46:43 mattias
|
||||||
more localization for gtk- and win32-interface and lcl
|
more localization for gtk- and win32-interface and lcl
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user