* target test fixed, resolves #6580

git-svn-id: trunk@5888 -
This commit is contained in:
florian 2007-01-11 15:09:39 +00:00
parent 901cc71411
commit 93c86bbaf2

View File

@ -39,15 +39,15 @@ uses
{$else unix} {$else unix}
dos, dos,
{$endif unix} {$endif unix}
ppu, cutils,ppu,systems,
getopts; getopts;
const const
Version = 'Version 2.0.2'; Version = 'Version 2.1.1';
Title = 'PPU-Mover'; Title = 'PPU-Mover';
Copyright = 'Copyright (c) 1998-2006 by the Free Pascal Development Team'; Copyright = 'Copyright (c) 1998-2007 by the Free Pascal Development Team';
ShortOpts = 'o:e:d:i:qhsvbw'; ShortOpts = 'o:e:d:i:qhsvb';
BufSize = 4096; BufSize = 4096;
PPUExt = 'ppu'; PPUExt = 'ppu';
ObjExt = 'o'; ObjExt = 'o';
@ -247,6 +247,7 @@ Var
f : file; f : file;
ext, ext,
s : string; s : string;
ppuversion : dword;
begin begin
DoPPU:=false; DoPPU:=false;
If Not Quiet then If Not Quiet then
@ -265,10 +266,11 @@ begin
Error('Error: Not a PPU File : '+PPUFn,false); Error('Error: Not a PPU File : '+PPUFn,false);
Exit; Exit;
end; end;
if inppu.GetPPUVersion<CurrentPPUVersion then ppuversion:=inppu.GetPPUVersion;
if ppuversion<CurrentPPUVersion then
begin begin
inppu.free; inppu.free;
Error('Error: Wrong PPU Version : '+PPUFn,false); Error('Error: Wrong PPU Version '+tostr(ppuversion)+' in '+PPUFn,false);
Exit; Exit;
end; end;
{ No .o file generated for this ppu, just skip } { No .o file generated for this ppu, just skip }
@ -294,6 +296,12 @@ begin
Error('Error: PPU is not static linked : '+PPUFn,false); Error('Error: PPU is not static linked : '+PPUFn,false);
Exit; Exit;
end; end;
{ Check if shared is allowed }
if tsystem(inppu.header.target) in [system_i386_go32v2] then
begin
Writeln('Warning: shared library not supported for ppu target, switching to static library');
MakeStatic:=true;
end;
{ Create the new ppu } { Create the new ppu }
if PPUFn=PPLFn then if PPUFn=PPLFn then
outppu:=tppufile.create('ppumove.$$$') outppu:=tppufile.create('ppumove.$$$')
@ -521,7 +529,7 @@ Procedure usage;
Print usage and exit. Print usage and exit.
} }
begin begin
Writeln(paramstr(0),': [-qhwvbsS] [-e ext] [-o name] [-d path] file [file ...]'); Writeln(paramstr(0),': [-qhvbsS] [-e ext] [-o name] [-d path] file [file ...]');
Halt(0); Halt(0);
end; end;
@ -560,10 +568,6 @@ begin
end; end;
'e' : PPLext:=OptArg; 'e' : PPLext:=OptArg;
'q' : Quiet:=True; 'q' : Quiet:=True;
'w' : begin
ArBin:='arw';
LdBin:='ldw';
end;
'b' : Batch:=true; 'b' : Batch:=true;
's' : DoStrip:=true; 's' : DoStrip:=true;
'?' : Usage; '?' : Usage;
@ -594,14 +598,6 @@ begin
Writeln(Copyright); Writeln(Copyright);
Writeln; Writeln;
end; end;
{ Check if shared is allowed }
{$ifndef unix}
if arbin<>'arw' then
begin
Writeln('Warning: shared library not supported for Go32, switching to static library');
MakeStatic:=true;
end;
{$endif}
{ fix the libext and outputfilename } { fix the libext and outputfilename }
if Makestatic then if Makestatic then
LibExt:=StaticLibExt LibExt:=StaticLibExt