Parcourir la source

* default paths fixed

peter il y a 21 ans
Parent
commit
7d745c0483
3 fichiers modifiés avec 26 ajouts et 39 suppressions
  1. 6 3
      compiler/globals.pas
  2. 10 33
      compiler/options.pas
  3. 10 3
      compiler/systems.pas

+ 6 - 3
compiler/globals.pas

@@ -473,8 +473,8 @@ implementation
          Replace(s,'$FPCFULLVERSION',full_version_string);
          Replace(s,'$FPCDATE',date_string);
          Replace(s,'$FPCCPU',target_cpu_string);
-         Replace(s,'$FPCOS',target_path);
-         Replace(s,'$FPCTARGET',target_cpu_string+'-'+target_path);
+         Replace(s,'$FPCOS',target_os_string);
+         Replace(s,'$FPCTARGET',target_full_string);
        end;
 
 
@@ -2134,7 +2134,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.150  2004-10-31 18:54:24  peter
+  Revision 1.151  2004-10-31 19:09:54  peter
+    * default paths fixed
+
+  Revision 1.150  2004/10/31 18:54:24  peter
     * $fpctarget expands to <cpu>-<os>
     * allow * in middle of the path to support ../*/units/$fpctarget
 

+ 10 - 33
compiler/options.pas

@@ -1996,20 +1996,10 @@ begin
 {$ENDIF USE_SYSUTILS}
   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
+     if PathExists('/usr/local/lib/fpc/'+version_string) then
+       fpcdir:='/usr/local/lib/fpc/'+version_string+'/'
      else
-       begin
-         if PathExists('/usr/local/lib/fpc/'+version_string) then
-           fpcdir:='/usr/local/lib/fpc/'+version_string+'/'
-         else
-           fpcdir:='/usr/lib/fpc/'+version_string+'/';
-       end;
+       fpcdir:='/usr/lib/fpc/'+version_string+'/';
    end;
 {$else}
 {$IFDEF USE_SYSUTILS}
@@ -2028,26 +2018,10 @@ begin
   { first try development RTL, else use the default installation path }
   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
+      if PathExists(FpcDir+'rtl') then
+        UnitSearchPath.AddPath(FpcDir+'rtl/'+target_full_string,false)
       else
-        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/'+lower(target_info.shortname),false);
-             UnitSearchPath.AddPath(FpcDir+'units/'+lower(target_info.shortname)+'/rtl',false);
-           end;
-        end;
+        UnitSearchPath.AddPath(FpcDir+'units/'+target_full_string+'/rtl',false);
     end;
   { 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
@@ -2114,7 +2088,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.150  2004-10-26 15:11:01  peter
+  Revision 1.151  2004-10-31 19:09:54  peter
+    * default paths fixed
+
+  Revision 1.150  2004/10/26 15:11:01  peter
     * -Ch for heapsize added again
     * __heapsize contains the heapsize
 

+ 10 - 3
compiler/systems.pas

@@ -307,7 +307,9 @@ interface
        target_asm  : tasminfo;
        target_ar   : tarinfo;
        target_res  : tresinfo;
-       target_path : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
+       target_cpu_string,
+       target_os_string   : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
+       target_full_string : string[24];
 
     function set_target(t:tsystem):boolean;
     function set_target_asm(t:tasm):boolean;
@@ -397,8 +399,10 @@ begin
      set_target_asm(target_info.assem);
      set_target_ar(target_info.ar);
      set_target_res(target_info.res);
-     target_path:=lower(target_info.shortname);
      target_cpu:=target_info.cpu;
+     target_os_string:=lower(target_info.shortname);
+     target_cpu_string:=cpu2str[target_cpu];
+     target_full_string:=target_cpu_string+'-'+target_os_string;
      set_target:=true;
      exit;
    end;
@@ -702,7 +706,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.93  2004-10-25 15:38:41  peter
+  Revision 1.94  2004-10-31 19:09:54  peter
+    * default paths fixed
+
+  Revision 1.93  2004/10/25 15:38:41  peter
     * heap and heapsize removed
     * checkpointer fixes