Browse Source

* Handling of -Sf parameter fixed
* Fixed definition of FPC_HAS_FEATURE_xxx macros for targets not supporting the full range of features
* Added DYNLIBS feature

git-svn-id: trunk@10932 -

giulio 17 years ago
parent
commit
9203f46e1a
4 changed files with 23 additions and 9 deletions
  1. 2 2
      compiler/globtype.pas
  2. 20 1
      compiler/options.pas
  3. 0 6
      compiler/parser.pas
  4. 1 0
      rtl/inc/systemh.inc

+ 2 - 2
compiler/globtype.pas

@@ -160,7 +160,7 @@ interface
          f_heap,f_init_final,f_rtti,f_classes,f_exceptions,f_exitcode,
          f_heap,f_init_final,f_rtti,f_classes,f_exceptions,f_exitcode,
          f_ansistrings,f_widestrings,f_textio,f_consoleio,f_fileio,
          f_ansistrings,f_widestrings,f_textio,f_consoleio,f_fileio,
          f_random,f_variants,f_objects,f_dynarrays,f_threading,f_commandargs,
          f_random,f_variants,f_objects,f_dynarrays,f_threading,f_commandargs,
-         f_processes,f_stackcheck
+         f_processes,f_stackcheck,f_dynlibs
        );
        );
        tfeatures = set of tfeature;
        tfeatures = set of tfeature;
 
 
@@ -193,7 +193,7 @@ interface
          'HEAP','INITFINAL','RTTI','CLASSES','EXCEPTIONS','EXITCODE',
          'HEAP','INITFINAL','RTTI','CLASSES','EXCEPTIONS','EXITCODE',
          'ANSISTRINGS','WIDESTRINGS','TEXTIO','CONSOLEIO','FILEIO',
          'ANSISTRINGS','WIDESTRINGS','TEXTIO','CONSOLEIO','FILEIO',
          'RANDOM','VARIANTS','OBJECTS','DYNARRAYS','THREADING','COMMANDARGS',
          'RANDOM','VARIANTS','OBJECTS','DYNARRAYS','THREADING','COMMANDARGS',
-         'PROCESSES','STACKCHECK'
+         'PROCESSES','STACKCHECK','DYNLIBS'
        );
        );
 
 
     type
     type

+ 20 - 1
compiler/options.pas

@@ -1155,7 +1155,9 @@ begin
                              end
                              end
                            else
                            else
                              begin
                              begin
-                               if not(IncludeFeature(upper(copy(more,j,length(more)-j+1)))) then
+                               if (IncludeFeature(upper(copy(more,j,length(more)-j+1)))) then
+                                 j:=length(more)
+                               else
                                  IllegalPara(opt);
                                  IllegalPara(opt);
                              end;
                              end;
                          end;
                          end;
@@ -1958,6 +1960,7 @@ procedure TOption.TargetOptions(def:boolean);
 var
 var
   s : string;
   s : string;
   i : integer;
   i : integer;
+  target_unsup_features : tfeatures;
 begin
 begin
   if def then
   if def then
    def_system_macro(target_info.shortname)
    def_system_macro(target_info.shortname)
@@ -2020,6 +2023,22 @@ begin
       def_system_macro('FPC_HAS_WINLIKERESOURCES')
       def_system_macro('FPC_HAS_WINLIKERESOURCES')
     else
     else
       undef_system_macro('FPC_HAS_WINLIKERESOURCES');
       undef_system_macro('FPC_HAS_WINLIKERESOURCES');
+
+  { Features }
+  case target_info.system of
+    system_arm_gba:
+      target_unsup_features:=[f_threading,f_commandargs,f_fileio,f_textio,f_consoleio,f_dynlibs];
+    system_arm_nds:
+      target_unsup_features:=[f_threading,f_commandargs,f_fileio,f_textio,f_consoleio,f_dynlibs];
+    system_i386_go32v2:
+      target_unsup_features:=[f_threading,f_dynlibs]
+    else
+      target_unsup_features:=[];
+  end;
+  if def then
+    features:=features-target_unsup_features
+  else
+    features:=features+target_unsup_features;
 end;
 end;
 
 
 
 

+ 0 - 6
compiler/parser.pas

@@ -121,12 +121,6 @@ implementation
              include(supported_calling_conventions,pocall_syscall);
              include(supported_calling_conventions,pocall_syscall);
            system_m68k_amiga:
            system_m68k_amiga:
              include(supported_calling_conventions,pocall_syscall);
              include(supported_calling_conventions,pocall_syscall);
-           system_arm_gba:
-             features:=features-[f_threading,f_commandargs,f_fileio,f_textio,f_consoleio];
-           system_arm_nds:
-             features:=features-[f_threading,f_commandargs,f_fileio,f_textio,f_consoleio];
-           system_i386_go32v2:
-             features:=features-[f_threading];
          end;
          end;
       end;
       end;
 
 

+ 1 - 0
rtl/inc/systemh.inc

@@ -72,6 +72,7 @@
 {$define FPC_HAS_FEATURE_COMMANDARGS}
 {$define FPC_HAS_FEATURE_COMMANDARGS}
 {$define FPC_HAS_FEATURE_PROCESSES}
 {$define FPC_HAS_FEATURE_PROCESSES}
 {$define FPC_HAS_FEATURE_STACKCHECK}
 {$define FPC_HAS_FEATURE_STACKCHECK}
+{$define FPC_HAS_FEATURE_DYNLIBS}
 {$endif FPC_HAS_FEATURE_SUPPORT}
 {$endif FPC_HAS_FEATURE_SUPPORT}
 
 
 {****************************************************************************
 {****************************************************************************