+ cross compilation dir search added

This commit is contained in:
florian 2004-03-20 22:57:07 +00:00
parent 8621f97c1f
commit 292aa0175c

View File

@ -1919,12 +1919,22 @@ begin
{$ifdef Unix} {$ifdef Unix}
fpcdir:=FixPath(getenv('FPCDIR'),false); fpcdir:=FixPath(getenv('FPCDIR'),false);
if fpcdir='' then if fpcdir='' then
begin
if source_info.cpu<>target_info.cpu then
begin
if PathExists('/usr/local/lib/fpc/'+version_string+'/cross/'+cpu2str[target_info.cpu]+'-'+target_info.shortname) then
fpcdir:='/usr/local/lib/fpc/'+version_string+'/cross/'+cpu2str[target_info.cpu]+'-'+target_info.shortname+'/'
else
fpcdir:='/usr/lib/fpc/'+version_string+'/cross/'+cpu2str[target_info.cpu]+'-'+target_info.shortname+'/';
end
else
begin begin
if PathExists('/usr/local/lib/fpc/'+version_string) then if PathExists('/usr/local/lib/fpc/'+version_string) then
fpcdir:='/usr/local/lib/fpc/'+version_string+'/' fpcdir:='/usr/local/lib/fpc/'+version_string+'/'
else else
fpcdir:='/usr/lib/fpc/'+version_string+'/'; fpcdir:='/usr/lib/fpc/'+version_string+'/';
end; end;
end;
{$else} {$else}
fpcdir:=FixPath(getenv('FPCDIR'),false); fpcdir:=FixPath(getenv('FPCDIR'),false);
if fpcdir='' then if fpcdir='' then
@ -1937,6 +1947,18 @@ begin
{$endif} {$endif}
{ first try development RTL, else use the default installation path } { first try development RTL, else use the default installation path }
if not disable_configfile then if not disable_configfile then
begin
if source_info.cpu<>target_info.cpu then
begin
if PathExists(FpcDir+'rtl/'+lower(target_info.shortname)) then
UnitSearchPath.AddPath(FpcDir+'rtl/'+lower(target_info.shortname),false)
else
begin
UnitSearchPath.AddPath(FpcDir+'units/',false);
UnitSearchPath.AddPath(FpcDir+'units/rtl',false);
end;
end
else
begin begin
if PathExists(FpcDir+'rtl/'+lower(target_info.shortname)) then if PathExists(FpcDir+'rtl/'+lower(target_info.shortname)) then
UnitSearchPath.AddPath(FpcDir+'rtl/'+lower(target_info.shortname),false) UnitSearchPath.AddPath(FpcDir+'rtl/'+lower(target_info.shortname),false)
@ -1946,6 +1968,7 @@ begin
UnitSearchPath.AddPath(FpcDir+'units/'+lower(target_info.shortname)+'/rtl',false); UnitSearchPath.AddPath(FpcDir+'units/'+lower(target_info.shortname)+'/rtl',false);
end; end;
end; end;
end;
{ Add exepath if the exe is not in the current dir, because that is always searched already. { Add exepath if the exe is not in the current dir, because that is always searched already.
Do not add it when linking on the target because then we can maybe already find Do not add it when linking on the target because then we can maybe already find
.o files that are not for the target } .o files that are not for the target }
@ -2006,7 +2029,10 @@ finalization
end. end.
{ {
$Log$ $Log$
Revision 1.127 2004-03-10 22:52:57 peter Revision 1.128 2004-03-20 22:57:07 florian
+ cross compilation dir search added
Revision 1.127 2004/03/10 22:52:57 peter
* more stabs fixes * more stabs fixes
* special mode -gv for valgrind compatible stabs * special mode -gv for valgrind compatible stabs