Browse Source

* support of apptype native for windows after a suggestion of Brian Bi

git-svn-id: trunk@977 -
florian 20 years ago
parent
commit
d9f6a5a374
5 changed files with 19 additions and 3 deletions
  1. 1 0
      compiler/globtype.pas
  2. 7 0
      compiler/options.pas
  3. 3 1
      compiler/scandir.pas
  4. 2 0
      compiler/systems.pas
  5. 6 2
      compiler/systems/t_win.pas

+ 1 - 0
compiler/globtype.pas

@@ -160,6 +160,7 @@ than 255 characters. That's why using Ansi Strings}
        { Win32, OS/2 & MacOS application types }
        { Win32, OS/2 & MacOS application types }
        tapptype = (
        tapptype = (
          app_none,
          app_none,
+         app_native,
          app_gui,               { graphic user-interface application}
          app_gui,               { graphic user-interface application}
          app_cui,       { console application}
          app_cui,       { console application}
          app_fs,        { full-screen type application (OS/2 and EMX only) }
          app_fs,        { full-screen type application (OS/2 and EMX only) }

+ 7 - 0
compiler/options.pas

@@ -1101,6 +1101,13 @@ begin
                while j<=length(More) do
                while j<=length(More) do
                 begin
                 begin
                   case More[j] of
                   case More[j] of
+                    'A':
+                      begin
+                        if UnsetBool(More, j) then
+                          apptype:=app_native
+                        else
+                          apptype:=app_cui;
+                      end;
                     'B':
                     'B':
                       begin
                       begin
                         {  -WB200000 means set trefered base address
                         {  -WB200000 means set trefered base address

+ 3 - 1
compiler/scandir.pas

@@ -236,6 +236,8 @@ implementation
                apptype:=app_gui
                apptype:=app_gui
              else if hs='CONSOLE' then
              else if hs='CONSOLE' then
                apptype:=app_cui
                apptype:=app_cui
+             else if (hs='NATIVE') and (target_info.system in system_windows) then
+               apptype:=app_native
              else if (hs='FS') and (target_info.system in [system_i386_os2,
              else if (hs='FS') and (target_info.system in [system_i386_os2,
                                                          system_i386_emx]) then
                                                          system_i386_emx]) then
                apptype:=app_fs
                apptype:=app_fs
@@ -853,7 +855,7 @@ implementation
             Message(scan_w_only_one_resourcefile_supported)
             Message(scan_w_only_one_resourcefile_supported)
           else
           else
             current_module.resourcefiles.insert(FixFileName(s));
             current_module.resourcefiles.insert(FixFileName(s));
-          end 
+          end
         else
         else
           Message(scan_e_resourcefiles_not_supported);
           Message(scan_e_resourcefiles_not_supported);
       end;
       end;

+ 2 - 0
compiler/systems.pas

@@ -306,6 +306,8 @@ interface
        system_linux : set of tsystem = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,
        system_linux : set of tsystem = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,
                                         system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux,
                                         system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux,
                                         system_x86_6432_linux];
                                         system_x86_6432_linux];
+       { all real windows systems, no cripple ones like wince, wdosx et. al. }
+       system_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64];
 
 
        cpu2str : array[TSystemCpu] of string =
        cpu2str : array[TSystemCpu] of string =
             ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
             ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',

+ 6 - 2
compiler/systems/t_win.pas

@@ -1037,7 +1037,7 @@ begin
   AsBinStr:=FindUtil(utilsprefix+'as');
   AsBinStr:=FindUtil(utilsprefix+'as');
   if RelocSection then
   if RelocSection then
    RelocStr:='--base-file base.$$$';
    RelocStr:='--base-file base.$$$';
-  if target_info.system in [system_arm_wince,system_i386_wince] then 
+  if target_info.system in [system_arm_wince,system_i386_wince] then
     begin
     begin
       AppTypeStr:='--subsystem wince';
       AppTypeStr:='--subsystem wince';
       if apptype <> app_gui then
       if apptype <> app_gui then
@@ -1285,6 +1285,8 @@ begin
   if (cs_link_extern in aktglobalswitches) then
   if (cs_link_extern in aktglobalswitches) then
    begin
    begin
      case apptype of
      case apptype of
+       app_native :
+         cmdstr:='--subsystem native';
        app_gui :
        app_gui :
          cmdstr:='--subsystem gui';
          cmdstr:='--subsystem gui';
        app_cui :
        app_cui :
@@ -1325,6 +1327,8 @@ begin
     peheader.Subsystem:=9
     peheader.Subsystem:=9
   else
   else
     case apptype of
     case apptype of
+      app_native :
+        peheader.Subsystem:=1;
       app_gui :
       app_gui :
         peheader.Subsystem:=2;
         peheader.Subsystem:=2;
       app_cui :
       app_cui :
@@ -1662,7 +1666,7 @@ initialization
   RegisterDLLScanner(system_i386_win32,TDLLScannerWin32);
   RegisterDLLScanner(system_i386_win32,TDLLScannerWin32);
   RegisterRes(res_gnu_windres_info);
   RegisterRes(res_gnu_windres_info);
   RegisterTarget(system_i386_win32_info);
   RegisterTarget(system_i386_win32_info);
-  
+
   RegisterExternalLinker(system_i386_wince_info,TLinkerWin32);
   RegisterExternalLinker(system_i386_wince_info,TLinkerWin32);
   RegisterImport(system_i386_wince,TImportLibWin32);
   RegisterImport(system_i386_wince,TImportLibWin32);
   RegisterExport(system_i386_wince,TExportLibWin32);
   RegisterExport(system_i386_wince,TExportLibWin32);