* use apptype to indicate that the target is a DOS .COM file, instead of introducing a new field in tsettings (as suggested by Sven)

git-svn-id: trunk@25544 -
This commit is contained in:
nickysn 2013-09-24 12:13:47 +00:00
parent 139b498296
commit 52a5ffc386
5 changed files with 25 additions and 24 deletions

View File

@ -156,7 +156,6 @@ interface
{$if defined(i8086)}
x86memorymodel : tx86memorymodel;
msdostargetformat : tmsdostargetformat;
{$endif defined(i8086)}
{$if defined(ARM)}
@ -488,7 +487,6 @@ interface
disabledircache : false;
{$if defined(i8086)}
x86memorymodel : mm_small;
msdostargetformat : msdos_exe;
{$endif defined(i8086)}
{$if defined(ARM)}
instructionset : is_arm;

View File

@ -400,7 +400,8 @@ interface
app_tool, { tool application, (MPW tool for MacOS, MacOS only) }
app_arm7, { for Nintendo DS target }
app_arm9, { for Nintendo DS target }
app_bundle { dynamically loadable bundle, Darwin only }
app_bundle, { dynamically loadable bundle, Darwin only }
app_com { DOS .COM file }
);
{ interface types }
@ -682,7 +683,6 @@ interface
type
tx86memorymodel = (mm_tiny,mm_small,mm_medium,mm_compact,mm_large,mm_huge);
tmsdostargetformat = (msdos_exe, msdos_com);
{ hide Sysutils.ExecuteProcess in units using this one after SysUtils}
const

View File

@ -1956,18 +1956,8 @@ begin
if (target_info.system in [system_i8086_msdos]) then
begin
case Upper(Copy(More,j+1,255)) of
'EXE':
begin
init_settings.msdostargetformat:=msdos_exe;
targetinfos[system_i8086_msdos]^.exeext:='.exe';
target_info.exeext:='.exe';
end;
'COM':
begin
init_settings.msdostargetformat:=msdos_com;
targetinfos[system_i8086_msdos]^.exeext:='.com';
target_info.exeext:='.com';
end;
'EXE': SetAppType(app_cui);
'COM': SetAppType(app_com);
else
IllegalPara(opt);
end;

View File

@ -633,10 +633,25 @@ implementation
procedure SetAppType(NewAppType:tapptype);
begin
if apptype=app_cui then
{$ifdef i8086}
if (target_info.system=system_i8086_msdos) and (apptype<>NewAppType) then
begin
if NewAppType=app_com then
begin
targetinfos[system_i8086_msdos]^.exeext:='.com';
target_info.exeext:='.com';
end
else
begin
targetinfos[system_i8086_msdos]^.exeext:='.exe';
target_info.exeext:='.exe';
end;
end;
{$endif i8086}
if apptype in [app_cui,app_com] then
undef_system_macro('CONSOLE');
apptype:=NewAppType;
if apptype=app_cui then
if apptype in [app_cui,app_com] then
def_system_macro('CONSOLE');
end;
{*****************************************************************************

View File

@ -268,12 +268,10 @@ begin
if s<>'' then
LinkRes.Add('library '+MaybeQuoted(s));
end;
case current_settings.msdostargetformat of
msdos_exe: LinkRes.Add('format dos');
msdos_com: LinkRes.Add('format dos com');
else
InternalError(2013092101);
end;
if apptype=app_com then
LinkRes.Add('format dos com')
else
LinkRes.Add('format dos');
LinkRes.Add('option dosseg');
LinkRes.Add('name ' + maybequoted(current_module.exefilename));