* assembling via a pipe and regular assembling now both use the

same binary and command line

git-svn-id: trunk@2591 -
This commit is contained in:
Jonas Maebe 2006-02-15 11:01:25 +00:00
parent 21e604c1ea
commit 1e08396b0b

View File

@ -122,6 +122,9 @@ interface
to actually write all the different abstract assembler streams to actually write all the different abstract assembler streams
by calling for each stream type, the @var(WriteTree) method.} by calling for each stream type, the @var(WriteTree) method.}
procedure WriteAsmList;virtual; procedure WriteAsmList;virtual;
{# Constructs the command line for calling the assembler }
function MakeCmdLine: TCmdStr;
public public
Constructor Create(smart:boolean);override; Constructor Create(smart:boolean);override;
procedure MakeObject;override; procedure MakeObject;override;
@ -246,8 +249,8 @@ Implementation
Function DoPipe:boolean; Function DoPipe:boolean;
begin begin
DoPipe:=(cs_asm_pipe in aktglobalswitches) and DoPipe:=(cs_asm_pipe in aktglobalswitches) and
not(cs_asm_leave in aktglobalswitches) (([cs_asm_leave,cs_link_on_target] * aktglobalswitches) = []) and
and ((target_asm.id in [as_gas,as_darwin])); ((target_asm.id in [as_gas,as_darwin]));
end; end;
@ -440,24 +443,8 @@ Implementation
else else
Message1(exec_i_assembling,name); Message1(exec_i_assembling,name);
end; end;
s:=target_asm.asmcmd;
{$ifdef m68k} if CallAssembler(FindAssembler,MakeCmdLine) then
if aktoptprocessor = MC68020 then
s:='-m68020 '+s
else
s:='-m68000 '+s;
{$endif}
if (cs_link_on_target in aktglobalswitches) then
begin
Replace(s,'$ASM',maybequoted(ScriptFixFileName(AsmFile)));
Replace(s,'$OBJ',maybequoted(ScriptFixFileName(ObjFile)));
end
else
begin
Replace(s,'$ASM',maybequoted(AsmFile));
Replace(s,'$OBJ',maybequoted(ObjFile));
end;
if CallAssembler(FindAssembler,s) then
RemoveAsm RemoveAsm
else else
begin begin
@ -554,13 +541,33 @@ Implementation
end; end;
end; end;
{$ifdef i386}
const format_option='--32'; function TExternalAssembler.MakeCmdLine: TCmdStr;
{$else}{$ifdef x86_64} begin
const format_option='--64'; result:=target_asm.asmcmd;
{$else} {$ifdef m68k}
const format_option=''; if aktoptprocessor = MC68020 then
{$endif}{$endif} result:='-m68020 '+result
else
result:='-m68000 '+result;
{$endif}
if (cs_link_on_target in aktglobalswitches) then
begin
Replace(result,'$ASM',maybequoted(ScriptFixFileName(AsmFile)));
Replace(result,'$OBJ',maybequoted(ScriptFixFileName(ObjFile)));
end
else
begin
{$ifdef hasunix}
if DoPipe then
Replace(result,'$ASM','')
else
{$endif}
Replace(result,'$ASM',maybequoted(AsmFile));
Replace(result,'$OBJ',maybequoted(ObjFile));
end;
end;
procedure TExternalAssembler.AsmCreate(Aplace:tcutplace); procedure TExternalAssembler.AsmCreate(Aplace:tcutplace);
begin begin
@ -570,7 +577,7 @@ Implementation
if DoPipe then if DoPipe then
begin begin
Message1(exec_i_assembling_pipe,asmfile); Message1(exec_i_assembling_pipe,asmfile);
POpen(outfile,'as '+format_option+' -o '+objfile,'W'); POpen(outfile,FindAssembler+' '+MakeCmdLine,'W');
end end
else else
{$endif} {$endif}