Replace cat $RESby $CATRES and call CatFileContent method

git-svn-id: trunk@19649 -
This commit is contained in:
pierre 2011-11-18 21:33:24 +00:00
parent 5d6a7dc03d
commit b1bd1d29ec
4 changed files with 23 additions and 20 deletions

View File

@ -39,7 +39,7 @@ unit i_win;
tf_winlikewidestring,tf_no_pic_supported, tf_winlikewidestring,tf_no_pic_supported,
tf_no_generic_stackcheck,tf_has_winlike_resources, tf_no_generic_stackcheck,tf_has_winlike_resources,
tf_dwarf_only_local_labels, tf_dwarf_only_local_labels,
tf_safecall_exceptions]; tf_safecall_exceptions,tf_no_backquote_support];
cpu : cpu_i386; cpu : cpu_i386;
unit_env : 'WIN32UNITS'; unit_env : 'WIN32UNITS';
extradefines : 'MSWINDOWS;WINDOWS'; extradefines : 'MSWINDOWS;WINDOWS';
@ -105,7 +105,7 @@ unit i_win;
tf_winlikewidestring,tf_no_pic_supported, tf_winlikewidestring,tf_no_pic_supported,
tf_dwarf_only_local_labels, tf_dwarf_only_local_labels,
tf_no_generic_stackcheck,tf_has_winlike_resources, tf_no_generic_stackcheck,tf_has_winlike_resources,
tf_safecall_exceptions]; tf_safecall_exceptions,tf_no_backquote_support];
cpu : cpu_x86_64; cpu : cpu_x86_64;
unit_env : 'WIN64UNITS'; unit_env : 'WIN64UNITS';
extradefines : 'MSWINDOWS;WINDOWS'; extradefines : 'MSWINDOWS;WINDOWS';
@ -169,7 +169,7 @@ unit i_win;
flags : [tf_files_case_aware{,tf_winlikewidestring}, flags : [tf_files_case_aware{,tf_winlikewidestring},
tf_smartlink_sections,tf_requires_proper_alignment,tf_no_pic_supported, tf_smartlink_sections,tf_requires_proper_alignment,tf_no_pic_supported,
tf_has_winlike_resources, tf_has_winlike_resources,
tf_safecall_exceptions]; tf_safecall_exceptions,tf_no_backquote_support];
cpu : cpu_arm; cpu : cpu_arm;
unit_env : ''; unit_env : '';
extradefines : 'UNDER_CE;WINDOWS;UNICODE'; extradefines : 'UNDER_CE;WINDOWS;UNICODE';
@ -233,7 +233,7 @@ unit i_win;
flags : [tf_files_case_aware flags : [tf_files_case_aware
{,tf_winlikewidestring},tf_smartlink_sections,tf_no_pic_supported, {,tf_winlikewidestring},tf_smartlink_sections,tf_no_pic_supported,
tf_has_winlike_resources, tf_has_winlike_resources,
tf_safecall_exceptions]; tf_safecall_exceptions,tf_no_backquote_support];
cpu : cpu_i386; cpu : cpu_i386;
unit_env : ''; unit_env : '';
extradefines : 'UNDER_CE;WINDOWS;UNICODE'; extradefines : 'UNDER_CE;WINDOWS;UNICODE';

View File

@ -191,8 +191,8 @@ procedure TLinkerBeOS.SetDefaultInfo;
begin begin
with Info do with Info do
begin begin
ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $STRIP -L. -o $EXE `cat $RES`'; ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $STRIP -L. -o $EXE $CATRES';
DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE `cat $RES`'; DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $CATRES';
DllCmd[2]:='strip --strip-unneeded $EXE'; DllCmd[2]:='strip --strip-unneeded $EXE';
(* (*
ExeCmd[1]:='sh $RES $EXE $OPT $STATIC $STRIP -L.'; ExeCmd[1]:='sh $RES $EXE $OPT $STATIC $STRIP -L.';
@ -403,6 +403,7 @@ begin
SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr); SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^)); Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
Replace(cmdstr,'$OPT',Info.ExtraOptions); Replace(cmdstr,'$OPT',Info.ExtraOptions);
Replace(cmdstr,'$CATRES',CatFileContent(outputexedir+Info.ResName));
Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName)); Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
Replace(cmdstr,'$STATIC',StaticStr); Replace(cmdstr,'$STATIC',StaticStr);
Replace(cmdstr,'$STRIP',StripStr); Replace(cmdstr,'$STRIP',StripStr);

View File

@ -145,8 +145,8 @@ begin
begin begin
if not(target_info.system in systems_darwin) then if not(target_info.system in systems_darwin) then
begin begin
ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE `cat $RES`'; ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE $CATRES';
DllCmd[1]:='ld $OPT -shared -L. -o $EXE `cat $RES`' DllCmd[1]:='ld $OPT -shared -L. -o $EXE $CATRES'
end end
else else
begin begin
@ -155,7 +155,7 @@ begin
is loaded below that address. This avoids problems with the is loaded below that address. This avoids problems with the
strange Windows-compatible resource handling that assumes strange Windows-compatible resource handling that assumes
that addresses below 64kb do not exist. that addresses below 64kb do not exist.
On 64bit systems, page zero is 4GB by default, so no problems On 64bit systems, page zero is 4GB by default, so no problems
there. there.
} }
@ -165,16 +165,16 @@ begin
programs with problems that require Valgrind will have more programs with problems that require Valgrind will have more
than 60KB of data (first 4KB of address space is always invalid) than 60KB of data (first 4KB of address space is always invalid)
} }
ExeCmd[1]:='ld $PRTOBJ $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -multiply_defined suppress -L. -o $EXE `cat $RES`'; ExeCmd[1]:='ld $PRTOBJ $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -multiply_defined suppress -L. -o $EXE $CATRES';
if not(cs_gdb_valgrind in current_settings.globalswitches) then if not(cs_gdb_valgrind in current_settings.globalswitches) then
ExeCmd[1]:=ExeCmd[1]+' -pagezero_size 0x10000'; ExeCmd[1]:=ExeCmd[1]+' -pagezero_size 0x10000';
{$else ndef cpu64bitaddr} {$else ndef cpu64bitaddr}
ExeCmd[1]:='ld $PRTOBJ $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -multiply_defined suppress -L. -o $EXE `cat $RES`'; ExeCmd[1]:='ld $PRTOBJ $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -multiply_defined suppress -L. -o $EXE $CATRES';
{$endif ndef cpu64bitaddr} {$endif ndef cpu64bitaddr}
if (apptype<>app_bundle) then if (apptype<>app_bundle) then
DllCmd[1]:='ld $PRTOBJ $OPT $GCSECTIONS -dynamic -dylib -multiply_defined suppress -L. -o $EXE `cat $RES`' DllCmd[1]:='ld $PRTOBJ $OPT $GCSECTIONS -dynamic -dylib -multiply_defined suppress -L. -o $EXE $CATRES'
else else
DllCmd[1]:='ld $PRTOBJ $OPT $GCSECTIONS -dynamic -bundle -multiply_defined suppress -L. -o $EXE `cat $RES`' DllCmd[1]:='ld $PRTOBJ $OPT $GCSECTIONS -dynamic -bundle -multiply_defined suppress -L. -o $EXE $CATRES'
end end
end end
else else
@ -248,7 +248,7 @@ begin
end; end;
end; end;
result:=maybequoted(result); result:=maybequoted(result);
end; end;
Function TLinkerBSD.WriteResponseFile(isdll:boolean) : Boolean; Function TLinkerBSD.WriteResponseFile(isdll:boolean) : Boolean;
@ -502,7 +502,7 @@ begin
if not LdSupportsNoResponseFile then if not LdSupportsNoResponseFile then
LinkRes.Add(')'); LinkRes.Add(')');
end; end;
{ frameworks for Darwin } { frameworks for Darwin }
if IsDarwin then if IsDarwin then
while not FrameworkFiles.empty do while not FrameworkFiles.empty do
@ -510,7 +510,7 @@ begin
LinkRes.Add('-framework'); LinkRes.Add('-framework');
LinkRes.Add(FrameworkFiles.GetFirst); LinkRes.Add(FrameworkFiles.GetFirst);
end; end;
{ objects which must be at the end } { objects which must be at the end }
if linklibc and if linklibc and
not IsDarwin Then not IsDarwin Then
@ -597,6 +597,7 @@ begin
SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr); SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^)); Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
Replace(cmdstr,'$OPT',Info.ExtraOptions); Replace(cmdstr,'$OPT',Info.ExtraOptions);
Replace(cmdstr,'$CATRES',CatFileContent(outputexedir+Info.ResName));
Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName)); Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
Replace(cmdstr,'$STATIC',StaticStr); Replace(cmdstr,'$STATIC',StaticStr);
Replace(cmdstr,'$STRIP',StripStr); Replace(cmdstr,'$STRIP',StripStr);
@ -646,7 +647,7 @@ begin
begin begin
DeleteFile(linkscript.fn); DeleteFile(linkscript.fn);
linkscript.free linkscript.free
end; end;
end; end;
MakeExecutable:=success; { otherwise a recursive call to link method } MakeExecutable:=success; { otherwise a recursive call to link method }
@ -770,7 +771,7 @@ begin
end; end;
if (target_info.system in systems_darwin) then if (target_info.system in systems_darwin) then
DeleteFile(outputexedir+'linksyms.fpc'); DeleteFile(outputexedir+'linksyms.fpc');
end; end;
MakeSharedLibrary:=success; { otherwise a recursive call to link method } MakeSharedLibrary:=success; { otherwise a recursive call to link method }
end; end;

View File

@ -192,8 +192,8 @@ procedure TLinkerHaiku.SetDefaultInfo;
begin begin
with Info do with Info do
begin begin
ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $STRIP -L. -o $EXE `cat $RES`'; ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $STRIP -L. -o $EXE $CATRES';
DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE `cat $RES`'; DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $CATRES';
DllCmd[2]:='strip --strip-unneeded $EXE'; DllCmd[2]:='strip --strip-unneeded $EXE';
(* (*
ExeCmd[1]:='sh $RES $EXE $OPT $STATIC $STRIP -L.'; ExeCmd[1]:='sh $RES $EXE $OPT $STATIC $STRIP -L.';
@ -403,6 +403,7 @@ begin
SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr); SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^)); Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
Replace(cmdstr,'$OPT',Info.ExtraOptions); Replace(cmdstr,'$OPT',Info.ExtraOptions);
Replace(cmdstr,'$CATRES',CatFileContent(outputexedir+Info.ResName));
Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName)); Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
Replace(cmdstr,'$STATIC',StaticStr); Replace(cmdstr,'$STATIC',StaticStr);
Replace(cmdstr,'$STRIP',StripStr); Replace(cmdstr,'$STRIP',StripStr);