Browse Source

Merged revisions 2258,2264 via svnmerge from
http://[email protected]/svn/fpc/trunk

........
r2258 | florian | 2006-01-11 22:43:12 +0100 (Wed, 11 Jan 2006) | 2 lines

* prefix and extension handling fixed

........
r2264 | florian | 2006-01-12 09:18:22 +0100 (Thu, 12 Jan 2006) | 4 lines

* fixed building on non unix targets
* increased copyright
* changed version to 2.0.2

........

git-svn-id: branches/fixes_2_0@2450 -

peter 19 years ago
parent
commit
2369167701
1 changed files with 25 additions and 7 deletions
  1. 25 7
      compiler/utils/ppumove.pp

+ 25 - 7
compiler/utils/ppumove.pp

@@ -23,6 +23,7 @@
 {$endif}
 Program ppumove;
 uses
+  sysutils,
 {$ifdef unix}
   Baseunix,Unix, UnixUtil,
 {$else unix}
@@ -32,9 +33,9 @@ uses
   getopts;
 
 const
-  Version   = 'Version 1.0.2';
+  Version   = 'Version 2.0.2';
   Title     = 'PPU-Mover';
-  Copyright = 'Copyright (c) 1998-2005 by the Free Pascal Development Team';
+  Copyright = 'Copyright (c) 1998-2006 by the Free Pascal Development Team';
 
   ShortOpts = 'o:e:d:i:qhsvbw';
   BufSize = 4096;
@@ -65,6 +66,7 @@ Type
 
 Var
   ArBin,LDBin,StripBin,
+  OutputFileForPPU,
   OutputFile,
   OutputFileForLink,  { the name of the output file needed when linking }
   InputPath,
@@ -237,6 +239,7 @@ Var
   untilb : byte;
   l,m    : longint;
   f      : file;
+  ext,
   s      : string;
 begin
   DoPPU:=false;
@@ -355,13 +358,13 @@ begin
 { just add a new entry with the new lib }
   if MakeStatic then
    begin
-     outppu.putstring(outputfileforlink);
+     outppu.putstring(OutputfileForPPU);
      outppu.putlongint(link_static);
      outppu.writeentry(iblinkunitstaticlibs)
    end
   else
    begin
-     outppu.putstring(outputfileforlink);
+     outppu.putstring(OutputfileForPPU);
      outppu.putlongint(link_shared);
      outppu.writeentry(iblinkunitsharedlibs);
    end;
@@ -377,8 +380,22 @@ begin
              begin
                s:=inppu.getstring;
                m:=inppu.getlongint;
-               libs:=libs+' -l'+s;
+
                outppu.putstring(s);
+
+               { strip lib prefix }
+               if copy(s,1,3)='lib' then
+                 delete(s,1,3);
+
+               { strip lib prefix }
+               if copy(s,1,3)='lib' then
+                 delete(s,1,3);
+               ext:=ExtractFileExt(s);
+               if ext<>'' then
+                 delete(s,length(s)-length(ext)+1,length(ext));
+
+               libs:=libs+' -l'+s;
+
                outppu.putlongint(m);
              end;
          end
@@ -488,7 +505,7 @@ begin
   if DestPath<>'' then
    begin
      Assign(F, OutputFile);
-     Rename(F,DestPath+'/'+OutputFile);
+     Rename(F,DestPath+DirectorySeparator+OutputFile);
    end;
 end;
 
@@ -585,7 +602,8 @@ begin
   else
    LibExt:=SharedLibExt;
   if OutputFile='' then
-   OutPutFile:=Paramstr(OptInd);
+   OutputFile:=Paramstr(OptInd);
+  OutputFileForPPU:=OutputFile;
 { fix filename }
 {$ifdef unix}
   if Copy(OutputFile,1,3)<>'lib' then