1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 -- The following package declares the data types for GNAT project.
27 -- These data types may be used by GNAT Project-aware tools.
29 -- Children of these package implements various services on these data types.
30 -- See in particular Prj.Pars and Prj.Env.
32 with Casing
; use Casing
;
33 with Namet
; use Namet
;
35 with Scans
; use Scans
;
36 with Types
; use Types
;
38 with GNAT
.Dynamic_HTables
; use GNAT
.Dynamic_HTables
;
39 with GNAT
.Dynamic_Tables
;
40 with GNAT
.OS_Lib
; use GNAT
.OS_Lib
;
44 procedure Add_Restricted_Language
(Name
: String);
45 -- Call by gprbuild for each language specify by switch
46 -- --restricted-to-languages=.
48 procedure Remove_All_Restricted_Languages
;
49 -- Call by gprbuild in CodePeer mode to ignore switches
50 -- --restricted-to-languages=.
52 function Is_Allowed_Language
(Name
: Name_Id
) return Boolean;
53 -- Returns True if --restricted-to-languages= is not used or if Name
54 -- is one of the restricted languages.
56 All_Other_Names
: constant Name_Id
:= Names_High_Bound
;
57 -- Name used to replace others as an index of an associative array
58 -- attribute in situations where this is allowed.
60 Subdirs
: String_Ptr
:= null;
61 -- The value after the equal sign in switch --subdirs=...
62 -- Contains the relative subdirectory.
64 type Library_Support
is (None
, Static_Only
, Full
);
65 -- Support for Library Project File.
66 -- - None: Library Project Files are not supported at all
67 -- - Static_Only: Library Project Files are only supported for static
69 -- - Full: Library Project Files are supported for static and dynamic
70 -- (shared) libraries.
72 type Yes_No_Unknown
is (Yes
, No
, Unknown
);
73 -- Tri-state to decide if -lgnarl is needed when linking
75 pragma Warnings
(Off
);
76 type Project_Qualifier
is
79 -- The following clash with Standard is OK, and justified by the context
80 -- which really wants to use the same set of qualifiers.
90 -- Qualifiers that can prefix the reserved word "project" in a project
92 -- Standard: standard project ...
93 -- Library: library project is ...
94 -- Dry: abstract project is
95 -- Aggregate: aggregate project is
96 -- Aggregate_Library: aggregate library project is ...
97 -- Configuration: configuration project is ...
99 subtype Aggregate_Project
is
100 Project_Qualifier
range Aggregate
.. Aggregate_Library
;
102 All_Packages
: constant String_List_Access
;
103 -- Default value of parameter Packages of procedures Parse, in Prj.Pars and
104 -- Prj.Part, indicating that all packages should be checked.
106 type Project_Tree_Data
;
107 type Project_Tree_Ref
is access all Project_Tree_Data
;
108 -- Reference to a project tree. Several project trees may exist in memory
111 No_Project_Tree
: constant Project_Tree_Ref
;
113 procedure Free
(Tree
: in out Project_Tree_Ref
);
114 -- Free memory associated with the tree
116 Config_Project_File_Extension
: String := ".cgpr";
117 Project_File_Extension
: String := ".gpr";
118 -- The standard config and user project file name extensions. They are not
119 -- constants, because Canonical_Case_File_Name is called on these variables
120 -- in the body of Prj.
122 function Empty_File
return File_Name_Type
;
123 function Empty_String
return Name_Id
;
124 -- Return the id for an empty string ""
126 type Path_Information
is record
127 Name
: Path_Name_Type
:= No_Path
;
128 Display_Name
: Path_Name_Type
:= No_Path
;
130 -- Directory names always end with a directory separator
132 No_Path_Information
: constant Path_Information
:= (No_Path
, No_Path
);
135 type Project_Id
is access all Project_Data
;
136 No_Project
: constant Project_Id
:= null;
137 -- Id of a Project File
139 type String_List_Id
is new Nat
;
140 Nil_String
: constant String_List_Id
:= 0;
141 type String_Element
is record
142 Value
: Name_Id
:= No_Name
;
144 Display_Value
: Name_Id
:= No_Name
;
145 Location
: Source_Ptr
:= No_Location
;
146 Flag
: Boolean := False;
147 Next
: String_List_Id
:= Nil_String
;
149 -- To hold values for string list variables and array elements.
150 -- Component Flag may be used for various purposes. For source
151 -- directories, it indicates if the directory contains Ada source(s).
153 package String_Element_Table
is new GNAT
.Dynamic_Tables
154 (Table_Component_Type
=> String_Element
,
155 Table_Index_Type
=> String_List_Id
,
156 Table_Low_Bound
=> 1,
157 Table_Initial
=> 200,
158 Table_Increment
=> 100);
159 -- The table for string elements in string lists
161 type Variable_Kind
is (Undefined
, List
, Single
);
162 -- Different kinds of variables
164 subtype Defined_Variable_Kind
is Variable_Kind
range List
.. Single
;
165 -- The defined kinds of variables
167 Ignored
: constant Variable_Kind
;
168 -- Used to indicate that a package declaration must be ignored
169 -- while processing the project tree (unknown package name).
171 type Variable_Value
(Kind
: Variable_Kind
:= Undefined
) is record
172 Project
: Project_Id
:= No_Project
;
173 Location
: Source_Ptr
:= No_Location
;
174 Default
: Boolean := False;
179 Values
: String_List_Id
:= Nil_String
;
181 Value
: Name_Id
:= No_Name
;
185 -- Values for variables and array elements. Default is True if the
186 -- current value is the default one for the variable.
188 Nil_Variable_Value
: constant Variable_Value
;
189 -- Value of a non existing variable or array element
191 type Variable_Id
is new Nat
;
192 No_Variable
: constant Variable_Id
:= 0;
193 type Variable
is record
194 Next
: Variable_Id
:= No_Variable
;
196 Value
: Variable_Value
;
198 -- To hold the list of variables in a project file and in packages
200 package Variable_Element_Table
is new GNAT
.Dynamic_Tables
201 (Table_Component_Type
=> Variable
,
202 Table_Index_Type
=> Variable_Id
,
203 Table_Low_Bound
=> 1,
204 Table_Initial
=> 200,
205 Table_Increment
=> 100);
206 -- The table of variable in list of variables
208 type Array_Element_Id
is new Nat
;
209 No_Array_Element
: constant Array_Element_Id
:= 0;
210 type Array_Element
is record
212 Restricted
: Boolean := False;
213 Src_Index
: Int
:= 0;
214 Index_Case_Sensitive
: Boolean := True;
215 Value
: Variable_Value
;
216 Next
: Array_Element_Id
:= No_Array_Element
;
218 -- Each Array_Element represents an array element and is linked (Next)
219 -- to the next array element, if any, in the array.
221 package Array_Element_Table
is new GNAT
.Dynamic_Tables
222 (Table_Component_Type
=> Array_Element
,
223 Table_Index_Type
=> Array_Element_Id
,
224 Table_Low_Bound
=> 1,
225 Table_Initial
=> 200,
226 Table_Increment
=> 100);
227 -- The table that contains all array elements
229 type Array_Id
is new Nat
;
230 No_Array
: constant Array_Id
:= 0;
231 type Array_Data
is record
232 Name
: Name_Id
:= No_Name
;
233 Location
: Source_Ptr
:= No_Location
;
234 Value
: Array_Element_Id
:= No_Array_Element
;
235 Next
: Array_Id
:= No_Array
;
237 -- Each Array_Data value represents an array.
238 -- Value is the id of the first element.
239 -- Next is the id of the next array in the project file or package.
241 package Array_Table
is new GNAT
.Dynamic_Tables
242 (Table_Component_Type
=> Array_Data
,
243 Table_Index_Type
=> Array_Id
,
244 Table_Low_Bound
=> 1,
245 Table_Initial
=> 200,
246 Table_Increment
=> 100);
247 -- The table that contains all arrays
249 type Package_Id
is new Nat
;
250 No_Package
: constant Package_Id
:= 0;
251 type Declarations
is record
252 Variables
: Variable_Id
:= No_Variable
;
253 Attributes
: Variable_Id
:= No_Variable
;
254 Arrays
: Array_Id
:= No_Array
;
255 Packages
: Package_Id
:= No_Package
;
257 -- Contains the declarations (variables, single and array attributes,
258 -- packages) for a project or a package in a project.
260 No_Declarations
: constant Declarations
:=
261 (Variables
=> No_Variable
,
262 Attributes
=> No_Variable
,
264 Packages
=> No_Package
);
265 -- Default value of Declarations: indicates that there is no declarations
267 type Package_Element
is record
268 Name
: Name_Id
:= No_Name
;
269 Decl
: Declarations
:= No_Declarations
;
270 Parent
: Package_Id
:= No_Package
;
271 Next
: Package_Id
:= No_Package
;
273 -- A package (includes declarations that may include other packages)
275 package Package_Table
is new GNAT
.Dynamic_Tables
276 (Table_Component_Type
=> Package_Element
,
277 Table_Index_Type
=> Package_Id
,
278 Table_Low_Bound
=> 1,
279 Table_Initial
=> 100,
280 Table_Increment
=> 100);
281 -- The table that contains all packages
284 type Language_Ptr
is access all Language_Data
;
285 -- Index of language data
287 No_Language_Index
: constant Language_Ptr
:= null;
288 -- Constant indicating that there is no language data
290 function Get_Language_From_Name
291 (Project
: Project_Id
;
292 Name
: String) return Language_Ptr
;
293 -- Get a language from a project. This might return null if no such
294 -- language exists in the project
296 Max_Header_Num
: constant := 6150;
297 type Header_Num
is range 0 .. Max_Header_Num
;
298 -- Size for hash table below. The upper bound is an arbitrary value, the
299 -- value here was chosen after testing to determine a good compromise
300 -- between speed of access and memory usage.
302 function Hash
(Name
: Name_Id
) return Header_Num
;
303 function Hash
(Name
: File_Name_Type
) return Header_Num
;
304 function Hash
(Name
: Path_Name_Type
) return Header_Num
;
305 function Hash
(Project
: Project_Id
) return Header_Num
;
306 -- Used for computing hash values for names put into hash tables
308 type Language_Kind
is (File_Based
, Unit_Based
);
309 -- Type for the kind of language. All languages are file based, except Ada
310 -- which is unit based.
312 -- Type of dependency to be checked
314 type Dependency_File_Kind
is
316 -- There is no dependency file, the source must always be recompiled
319 -- The dependency file is a Makefile fragment indicating all the files
320 -- the source depends on. If the object file or the dependency file is
321 -- more recent than any of these files, the source must be recompiled.
324 -- The dependency file is an ALI file and the source must be recompiled
325 -- if the object or ALI file is more recent than any of the sources
326 -- listed in the D lines.
329 -- The dependency file is an ALI file and the source must be recompiled
330 -- if the object or ALI file is more recent than any source in the full
333 Makefile_Dependency_Suffix
: constant String := ".d";
334 ALI_Dependency_Suffix
: constant String := ".ali";
335 Switches_Dependency_Suffix
: constant String := ".cswi";
337 Binder_Exchange_Suffix
: constant String := ".bexch";
338 -- Suffix for binder exchange files
340 Library_Exchange_Suffix
: constant String := ".lexch";
341 -- Suffix for library exchange files
343 type Name_List_Index
is new Nat
;
344 No_Name_List
: constant Name_List_Index
:= 0;
346 type Name_Node
is record
347 Name
: Name_Id
:= No_Name
;
348 Next
: Name_List_Index
:= No_Name_List
;
351 package Name_List_Table
is new GNAT
.Dynamic_Tables
352 (Table_Component_Type
=> Name_Node
,
353 Table_Index_Type
=> Name_List_Index
,
354 Table_Low_Bound
=> 1,
356 Table_Increment
=> 100);
357 -- The table for lists of names
360 (Table
: Name_List_Table
.Instance
;
361 List
: Name_List_Index
) return Natural;
362 -- Return the number of elements in specified list
364 type Number_List_Index
is new Nat
;
365 No_Number_List
: constant Number_List_Index
:= 0;
367 type Number_Node
is record
368 Number
: Natural := 0;
369 Next
: Number_List_Index
:= No_Number_List
;
372 package Number_List_Table
is new GNAT
.Dynamic_Tables
373 (Table_Component_Type
=> Number_Node
,
374 Table_Index_Type
=> Number_List_Index
,
375 Table_Low_Bound
=> 1,
377 Table_Increment
=> 100);
378 -- The table for lists of numbers
380 package Mapping_Files_Htable
is new Simple_HTable
381 (Header_Num
=> Header_Num
,
382 Element
=> Path_Name_Type
,
383 No_Element
=> No_Path
,
384 Key
=> Path_Name_Type
,
387 -- A hash table to store the mapping files that are not used
389 -- The following record ???
391 type Lang_Naming_Data
is record
392 Dot_Replacement
: File_Name_Type
:= No_File
;
393 -- The string to replace '.' in the source file name (for Ada)
395 Casing
: Casing_Type
:= All_Lower_Case
;
396 -- The casing of the source file name (for Ada)
398 Separate_Suffix
: File_Name_Type
:= No_File
;
399 -- String to append to unit name for source file name of an Ada subunit
401 Spec_Suffix
: File_Name_Type
:= No_File
;
402 -- The string to append to the unit name for the
403 -- source file name of a spec.
405 Body_Suffix
: File_Name_Type
:= No_File
;
406 -- The string to append to the unit name for the
407 -- source file name of a body.
410 No_Lang_Naming_Data
: constant Lang_Naming_Data
:=
411 (Dot_Replacement
=> No_File
,
412 Casing
=> All_Lower_Case
,
413 Separate_Suffix
=> No_File
,
414 Spec_Suffix
=> No_File
,
415 Body_Suffix
=> No_File
);
417 function Is_Standard_GNAT_Naming
(Naming
: Lang_Naming_Data
) return Boolean;
418 -- True if the naming scheme is GNAT's default naming scheme. This
419 -- is to take into account shortened names like "Ada." (a-), "System." (s-)
423 type Source_Id
is access all Source_Data
;
425 function Is_Compilable
(Source
: Source_Id
) return Boolean;
426 pragma Inline
(Is_Compilable
);
427 -- Return True if we know how to compile Source (i.e. if a compiler is
428 -- defined). This doesn't indicate whether the source should be compiled.
430 function Object_To_Global_Archive
(Source
: Source_Id
) return Boolean;
431 pragma Inline
(Object_To_Global_Archive
);
432 -- Return True if the object file should be put in the global archive.
433 -- This is for Ada, when only the closure of a main needs to be
436 function Other_Part
(Source
: Source_Id
) return Source_Id
;
437 pragma Inline
(Other_Part
);
438 -- Source ID for the other part, if any: for a spec, indicates its body;
439 -- for a body, indicates its spec.
441 No_Source
: constant Source_Id
:= null;
443 type Path_Syntax_Kind
is
447 -- Host specific syntax, for example on VMS (the default)
449 -- The following record describes the configuration of a language
451 type Language_Config
is record
452 Kind
: Language_Kind
:= File_Based
;
453 -- Kind of language. Most languages are file based. A few, such as Ada,
456 Naming_Data
: Lang_Naming_Data
;
457 -- The naming data for the languages (prefixes, etc.)
459 Include_Compatible_Languages
: Name_List_Index
:= No_Name_List
;
460 -- List of languages that are "include compatible" with this language. A
461 -- language B (for example "C") is "include compatible" with a language
462 -- A (for example "C++") if it is expected that sources of language A
463 -- may "include" header files from language B.
465 Compiler_Driver
: File_Name_Type
:= No_File
;
466 -- The name of the executable for the compiler of the language
468 Compiler_Driver_Path
: String_Access
:= null;
469 -- The path name of the executable for the compiler of the language
471 Compiler_Leading_Required_Switches
: Name_List_Index
:= No_Name_List
;
472 -- The list of initial switches that are required as a minimum to invoke
473 -- the compiler driver.
475 Compiler_Trailing_Required_Switches
: Name_List_Index
:= No_Name_List
;
476 -- The list of final switches that are required as a minimum to invoke
477 -- the compiler driver.
479 Multi_Unit_Switches
: Name_List_Index
:= No_Name_List
;
480 -- The switch(es) to indicate the index of a unit in a multi-source file
482 Multi_Unit_Object_Separator
: Character := ' ';
483 -- The string separating the base name of a source from the index of the
484 -- unit in a multi-source file, in the object file name.
486 Path_Syntax
: Path_Syntax_Kind
:= Host
;
487 -- Value may be Canonical (Unix style) or Host (host syntax, for example
488 -- on VMS for DEC C).
490 Source_File_Switches
: Name_List_Index
:= No_Name_List
;
491 -- Optional switches to be put before the source file. The source file
492 -- path name is appended to the last switch in the list.
493 -- Example: ("-i", "");
495 Object_File_Suffix
: Name_Id
:= No_Name
;
496 -- Optional alternate object file suffix
498 Object_File_Switches
: Name_List_Index
:= No_Name_List
;
499 -- Optional object file switches. When this is defined, the switches
500 -- are used to specify the object file. The object file name is appended
501 -- to the last switch in the list. Example: ("-o", "").
503 Object_Path_Switches
: Name_List_Index
:= No_Name_List
;
504 -- List of switches to specify to the compiler the path name of a
505 -- temporary file containing the list of object directories in the
508 Compilation_PIC_Option
: Name_List_Index
:= No_Name_List
;
509 -- The option(s) to compile a source in Position Independent Code for
510 -- shared libraries. Specified in the configuration. When not specified,
511 -- there is no need for such switch.
513 Object_Generated
: Boolean := True;
514 -- False in no object file is generated
516 Objects_Linked
: Boolean := True;
517 -- False if object files are not use to link executables and build
520 Runtime_Library_Dir
: Name_Id
:= No_Name
;
521 -- Path name of the runtime library directory, if any
523 Runtime_Source_Dir
: Name_Id
:= No_Name
;
524 -- Path name of the runtime source directory, if any
526 Mapping_File_Switches
: Name_List_Index
:= No_Name_List
;
527 -- The option(s) to provide a mapping file to the compiler. Specified in
528 -- the configuration. When value is No_Name_List, there is no mapping
531 Mapping_Spec_Suffix
: File_Name_Type
:= No_File
;
532 -- Placeholder representing the spec suffix in a mapping file
534 Mapping_Body_Suffix
: File_Name_Type
:= No_File
;
535 -- Placeholder representing the body suffix in a mapping file
537 Config_File_Switches
: Name_List_Index
:= No_Name_List
;
538 -- The option(s) to provide a config file to the compiler. Specified in
539 -- the configuration. If value is No_Name_List there is no config file.
541 Dependency_Kind
: Dependency_File_Kind
:= None
;
542 -- The kind of dependency to be checked: none, Makefile fragment or
543 -- ALI file (for Ada).
545 Dependency_Option
: Name_List_Index
:= No_Name_List
;
546 -- The option(s) to be used to create the dependency file. When value is
547 -- No_Name_List, there is not such option(s).
549 Compute_Dependency
: Name_List_Index
:= No_Name_List
;
550 -- Hold the value of attribute Dependency_Driver, if declared for the
553 Include_Option
: Name_List_Index
:= No_Name_List
;
554 -- Hold the value of attribute Include_Switches, if declared for the
557 Include_Path
: Name_Id
:= No_Name
;
558 -- Name of environment variable declared by attribute Include_Path for
561 Include_Path_File
: Name_Id
:= No_Name
;
562 -- Name of environment variable declared by attribute Include_Path_File
565 Objects_Path
: Name_Id
:= No_Name
;
566 -- Name of environment variable declared by attribute Objects_Path for
569 Objects_Path_File
: Name_Id
:= No_Name
;
570 -- Name of environment variable declared by attribute Objects_Path_File
573 Config_Body
: Name_Id
:= No_Name
;
574 -- The template for a pragma Source_File_Name(_Project) for a specific
575 -- file name of a body.
577 Config_Body_Index
: Name_Id
:= No_Name
;
578 -- The template for a pragma Source_File_Name(_Project) for a specific
579 -- file name of a body in a multi-source file.
581 Config_Body_Pattern
: Name_Id
:= No_Name
;
582 -- The template for a pragma Source_File_Name(_Project) for a naming
585 Config_Spec
: Name_Id
:= No_Name
;
586 -- The template for a pragma Source_File_Name(_Project) for a specific
587 -- file name of a spec.
589 Config_Spec_Index
: Name_Id
:= No_Name
;
590 -- The template for a pragma Source_File_Name(_Project) for a specific
591 -- file name of a spec in a multi-source file.
593 Config_Spec_Pattern
: Name_Id
:= No_Name
;
594 -- The template for a pragma Source_File_Name(_Project) for a naming
597 Config_File_Unique
: Boolean := False;
598 -- Indicate if the config file specified to the compiler needs to be
599 -- unique. If it is unique, then all config files are concatenated into
600 -- a temp config file.
602 Binder_Driver
: File_Name_Type
:= No_File
;
603 -- The name of the binder driver for the language, if any
605 Binder_Driver_Path
: Path_Name_Type
:= No_Path
;
606 -- The path name of the binder driver
608 Binder_Required_Switches
: Name_List_Index
:= No_Name_List
;
609 -- Hold the value of attribute Binder'Required_Switches for the language
611 Binder_Prefix
: Name_Id
:= No_Name
;
612 -- Hold the value of attribute Binder'Prefix for the language
614 Toolchain_Version
: Name_Id
:= No_Name
;
615 -- Hold the value of attribute Toolchain_Version for the language
617 Toolchain_Description
: Name_Id
:= No_Name
;
618 -- Hold the value of attribute Toolchain_Description for the language
620 Clean_Object_Artifacts
: Name_List_Index
:= No_Name_List
;
621 -- List of object artifact extensions to be deleted by gprclean
623 Clean_Source_Artifacts
: Name_List_Index
:= No_Name_List
;
624 -- List of source artifact extensions to be deleted by gprclean
628 No_Language_Config
: constant Language_Config
:=
630 Naming_Data
=> No_Lang_Naming_Data
,
631 Include_Compatible_Languages
=> No_Name_List
,
632 Compiler_Driver
=> No_File
,
633 Compiler_Driver_Path
=> null,
634 Compiler_Leading_Required_Switches
636 Compiler_Trailing_Required_Switches
638 Multi_Unit_Switches
=> No_Name_List
,
639 Multi_Unit_Object_Separator
=> ' ',
640 Path_Syntax
=> Canonical
,
641 Source_File_Switches
=> No_Name_List
,
642 Object_File_Suffix
=> No_Name
,
643 Object_File_Switches
=> No_Name_List
,
644 Object_Path_Switches
=> No_Name_List
,
645 Compilation_PIC_Option
=> No_Name_List
,
646 Object_Generated
=> True,
647 Objects_Linked
=> True,
648 Runtime_Library_Dir
=> No_Name
,
649 Runtime_Source_Dir
=> No_Name
,
650 Mapping_File_Switches
=> No_Name_List
,
651 Mapping_Spec_Suffix
=> No_File
,
652 Mapping_Body_Suffix
=> No_File
,
653 Config_File_Switches
=> No_Name_List
,
654 Dependency_Kind
=> None
,
655 Dependency_Option
=> No_Name_List
,
656 Compute_Dependency
=> No_Name_List
,
657 Include_Option
=> No_Name_List
,
658 Include_Path
=> No_Name
,
659 Include_Path_File
=> No_Name
,
660 Objects_Path
=> No_Name
,
661 Objects_Path_File
=> No_Name
,
662 Config_Body
=> No_Name
,
663 Config_Body_Index
=> No_Name
,
664 Config_Body_Pattern
=> No_Name
,
665 Config_Spec
=> No_Name
,
666 Config_Spec_Index
=> No_Name
,
667 Config_Spec_Pattern
=> No_Name
,
668 Config_File_Unique
=> False,
669 Binder_Driver
=> No_File
,
670 Binder_Driver_Path
=> No_Path
,
671 Binder_Required_Switches
=> No_Name_List
,
672 Binder_Prefix
=> No_Name
,
673 Toolchain_Version
=> No_Name
,
674 Toolchain_Description
=> No_Name
,
675 Clean_Object_Artifacts
=> No_Name_List
,
676 Clean_Source_Artifacts
=> No_Name_List
);
678 -- The following record ???
680 type Language_Data
is record
681 Name
: Name_Id
:= No_Name
;
682 Display_Name
: Name_Id
:= No_Name
;
683 Config
: Language_Config
:= No_Language_Config
;
684 First_Source
: Source_Id
:= No_Source
;
685 Mapping_Files
: Mapping_Files_Htable
.Instance
:=
686 Mapping_Files_Htable
.Nil
;
687 Next
: Language_Ptr
:= No_Language_Index
;
690 No_Language_Data
: constant Language_Data
:=
692 Display_Name
=> No_Name
,
693 Config
=> No_Language_Config
,
694 First_Source
=> No_Source
,
695 Mapping_Files
=> Mapping_Files_Htable
.Nil
,
696 Next
=> No_Language_Index
);
698 type Language_List_Element
;
699 type Language_List
is access all Language_List_Element
;
700 type Language_List_Element
is record
701 Language
: Language_Ptr
:= No_Language_Index
;
702 Next
: Language_List
;
705 type Source_Kind
is (Spec
, Impl
, Sep
);
706 subtype Spec_Or_Body
is Source_Kind
range Spec
.. Impl
;
708 -- The following declarations declare a structure used to store the Name
709 -- and File and Path names of a unit, with a reference to its GNAT Project
710 -- File(s). Some units might have neither Spec nor Impl when they were
711 -- created for a "separate".
713 type File_Names_Data
is array (Spec_Or_Body
) of Source_Id
;
715 type Unit_Data
is record
716 Name
: Name_Id
:= No_Name
;
717 File_Names
: File_Names_Data
;
720 type Unit_Index
is access all Unit_Data
;
722 No_Unit_Index
: constant Unit_Index
:= null;
723 -- Used to indicate a null entry for no unit
726 type Roots_Access
is access Source_Roots
;
727 type Source_Roots
is record
731 -- A list to store the roots associated with a main unit. These are the
732 -- files that need to linked along with the main (for instance a C file
733 -- corresponding to an Ada file). In general, these are dependencies that
734 -- cannot be computed automatically by the builder.
736 type Naming_Exception_Type
is (No
, Yes
, Inherited
);
738 -- Structure to define source data
740 type Source_Data
is record
741 Initialized
: Boolean := False;
742 -- Set to True when Source_Data is completely initialized
744 Project
: Project_Id
:= No_Project
;
745 -- Project of the source
747 Location
: Source_Ptr
:= No_Location
;
748 -- Location in the project file of the declaration of the source in
751 Source_Dir_Rank
: Natural := 0;
752 -- The rank of the source directory in list declared with attribute
753 -- Source_Dirs. Two source files with the same name cannot appears in
754 -- different directory with the same rank. That can happen when the
755 -- recursive notation <dir>/** is used in attribute Source_Dirs.
757 Language
: Language_Ptr
:= No_Language_Index
;
758 -- Index of the language. This is an index into
759 -- Project_Tree.Languages_Data.
761 In_Interfaces
: Boolean := True;
762 -- False when the source is not included in interfaces, when attribute
763 -- Interfaces is declared.
765 Declared_In_Interfaces
: Boolean := False;
766 -- True when source is declared in attribute Interfaces
768 Alternate_Languages
: Language_List
:= null;
769 -- List of languages a header file may also be, in addition of language
772 Kind
: Source_Kind
:= Spec
;
773 -- Kind of the source: spec, body or subunit
775 Unit
: Unit_Index
:= No_Unit_Index
;
776 -- Name of the unit, if language is unit based. This is only set for
777 -- those files that are part of the compilation set (for instance a
778 -- file in an extended project that is overridden will not have this
782 -- Index of the source in a multi unit source file (the same Source_Data
783 -- is duplicated several times when there are several units in the same
784 -- file). Index is 0 if there is either no unit or a single one, and
785 -- starts at 1 when there are multiple units
787 Compilable
: Yes_No_Unknown
:= Unknown
;
788 -- Updated at the first call to Is_Compilable. Yes if source file is
791 In_The_Queue
: Boolean := False;
792 -- True if the source has been put in the queue
794 Locally_Removed
: Boolean := False;
795 -- True if the source has been "excluded"
797 Suppressed
: Boolean := False;
798 -- True if the source is a locally removed direct source of the project.
799 -- These sources should not be put in the mapping file.
801 Replaced_By
: Source_Id
:= No_Source
;
802 -- Source in an extending project that replaces the current source
804 File
: File_Name_Type
:= No_File
;
805 -- Canonical file name of the source
807 Display_File
: File_Name_Type
:= No_File
;
808 -- File name of the source, for display purposes
810 Path
: Path_Information
:= No_Path_Information
;
811 -- Path name of the source
813 Source_TS
: Time_Stamp_Type
:= Empty_Time_Stamp
;
814 -- Time stamp of the source file
816 Object_Project
: Project_Id
:= No_Project
;
817 -- Project where the object file is. This might be different from
818 -- Project when using extending project files.
820 Object
: File_Name_Type
:= No_File
;
821 -- File name of the object file
823 Current_Object_Path
: Path_Name_Type
:= No_Path
;
824 -- Object path of an existing object file
826 Object_Path
: Path_Name_Type
:= No_Path
;
827 -- Object path of the real object file
829 Object_TS
: Time_Stamp_Type
:= Empty_Time_Stamp
;
830 -- Object file time stamp
832 Dep_Name
: File_Name_Type
:= No_File
;
833 -- Dependency file simple name
835 Current_Dep_Path
: Path_Name_Type
:= No_Path
;
836 -- Path name of an existing dependency file
838 Dep_Path
: Path_Name_Type
:= No_Path
;
839 -- Path name of the real dependency file
841 Dep_TS
: aliased Osint
.File_Attributes
:= Osint
.Unknown_Attributes
;
842 -- Dependency file time stamp
844 Switches
: File_Name_Type
:= No_File
;
845 -- File name of the switches file. For all languages, this is a file
846 -- that ends with the .cswi extension.
848 Switches_Path
: Path_Name_Type
:= No_Path
;
849 -- Path name of the switches file
851 Switches_TS
: Time_Stamp_Type
:= Empty_Time_Stamp
;
852 -- Switches file time stamp
854 Naming_Exception
: Naming_Exception_Type
:= No
;
855 -- True if the source has an exceptional name
857 Duplicate_Unit
: Boolean := False;
858 -- True when a duplicate unit has been reported for this source
860 Next_In_Lang
: Source_Id
:= No_Source
;
861 -- Link to another source of the same language in the same project
863 Next_With_File_Name
: Source_Id
:= No_Source
;
864 -- Link to another source with the same base file name
866 Roots
: Roots_Access
:= null;
867 -- The roots for a main unit
871 No_Source_Data
: constant Source_Data
:=
872 (Initialized
=> False,
873 Project
=> No_Project
,
874 Location
=> No_Location
,
875 Source_Dir_Rank
=> 0,
876 Language
=> No_Language_Index
,
877 In_Interfaces
=> True,
878 Declared_In_Interfaces
=> False,
879 Alternate_Languages
=> null,
881 Unit
=> No_Unit_Index
,
883 Locally_Removed
=> False,
885 Compilable
=> Unknown
,
886 In_The_Queue
=> False,
887 Replaced_By
=> No_Source
,
889 Display_File
=> No_File
,
890 Path
=> No_Path_Information
,
891 Source_TS
=> Empty_Time_Stamp
,
892 Object_Project
=> No_Project
,
894 Current_Object_Path
=> No_Path
,
895 Object_Path
=> No_Path
,
896 Object_TS
=> Empty_Time_Stamp
,
898 Current_Dep_Path
=> No_Path
,
900 Dep_TS
=> Osint
.Unknown_Attributes
,
902 Switches_Path
=> No_Path
,
903 Switches_TS
=> Empty_Time_Stamp
,
904 Naming_Exception
=> No
,
905 Duplicate_Unit
=> False,
906 Next_In_Lang
=> No_Source
,
907 Next_With_File_Name
=> No_Source
,
910 package Source_Files_Htable
is new Simple_HTable
911 (Header_Num
=> Header_Num
,
912 Element
=> Source_Id
,
913 No_Element
=> No_Source
,
914 Key
=> File_Name_Type
,
917 -- Mapping of source file names to source ids
919 package Source_Paths_Htable
is new Simple_HTable
920 (Header_Num
=> Header_Num
,
921 Element
=> Source_Id
,
922 No_Element
=> No_Source
,
923 Key
=> Path_Name_Type
,
926 -- Mapping of source paths to source ids
928 type Lib_Kind
is (Static
, Dynamic
, Relocatable
);
930 type Policy
is (Autonomous
, Compliant
, Controlled
, Restricted
, Direct
);
931 -- Type to specify the symbol policy, when symbol control is supported.
932 -- See full explanation about this type in package Symbols.
933 -- Autonomous: Create a symbol file without considering any reference
934 -- Compliant: Try to be as compatible as possible with an existing ref
935 -- Controlled: Fail if symbols are not the same as those in the reference
936 -- Restricted: Restrict the symbols to those in the symbol file
937 -- Direct: The symbol file is used as is
939 type Symbol_Record
is record
940 Symbol_File
: Path_Name_Type
:= No_Path
;
941 Reference
: Path_Name_Type
:= No_Path
;
942 Symbol_Policy
: Policy
:= Autonomous
;
944 -- Type to keep the symbol data to be used when building a shared library
946 No_Symbols
: constant Symbol_Record
:=
947 (Symbol_File
=> No_Path
,
948 Reference
=> No_Path
,
949 Symbol_Policy
=> Autonomous
);
950 -- The default value of the symbol data
952 function Image
(The_Casing
: Casing_Type
) return String;
953 -- Similar to 'Image (but avoid use of this attribute in compiler)
955 function Value
(Image
: String) return Casing_Type
;
956 -- Similar to 'Value (but avoid use of this attribute in compiler)
957 -- Raises Constraint_Error if not a Casing_Type image.
959 -- The following record contains data for a naming scheme
961 function Get_Object_Directory
962 (Project
: Project_Id
;
963 Including_Libraries
: Boolean;
964 Only_If_Ada
: Boolean := False) return Path_Name_Type
;
965 -- Return the object directory to use for the project. This depends on
966 -- whether we have a library project or a standard project. This function
967 -- might return No_Name when no directory applies.
968 -- If we have a library project file and Including_Libraries is True then
969 -- the library dir is returned instead of the object dir.
970 -- If Only_If_Ada is True, then No_Name will be returned when the project
971 -- doesn't Ada sources.
973 procedure Compute_All_Imported_Projects
974 (Root_Project
: Project_Id
;
975 Tree
: Project_Tree_Ref
);
976 -- For all projects in the tree, compute the list of the projects imported
977 -- directly or indirectly by project Root_Project. The result is stored in
978 -- Project.All_Imported_Projects for each project
980 function Ultimate_Extending_Project_Of
981 (Proj
: Project_Id
) return Project_Id
;
982 -- Returns the ultimate extending project of project Proj. If project Proj
983 -- is not extended, returns Proj.
985 type Project_List_Element
;
986 type Project_List
is access all Project_List_Element
;
987 type Project_List_Element
is record
988 Project
: Project_Id
:= No_Project
;
989 From_Encapsulated_Lib
: Boolean := False;
990 Next
: Project_List
:= null;
992 -- A list of projects
995 (List
: in out Project_List
;
996 Free_Project
: Boolean);
997 -- Free the list of projects, if Free_Project, each project is also freed
999 type Response_File_Format
is
1008 -- The format of the different response files
1010 type Project_Configuration
is record
1011 Target
: Name_Id
:= No_Name
;
1012 -- The target of the configuration, when specified
1014 Run_Path_Option
: Name_List_Index
:= No_Name_List
;
1015 -- The option to use when linking to specify the path where to look for
1018 Run_Path_Origin
: Name_Id
:= No_Name
;
1019 -- Specify the string (such as "$ORIGIN") to indicate paths relative to
1020 -- the directory of the executable in the run path option.
1022 Library_Install_Name_Option
: Name_Id
:= No_Name
;
1023 -- When this is not an empty list, this option, followed by the single
1024 -- name of the shared library file is used when linking a shared
1027 Separate_Run_Path_Options
: Boolean := False;
1028 -- True if each directory needs to be specified in a separate run path
1031 Executable_Suffix
: Name_Id
:= No_Name
;
1032 -- The suffix of executables, when specified in the configuration or in
1033 -- package Builder of the main project. When this is not specified, the
1034 -- executable suffix is the default for the platform.
1038 Linker
: Path_Name_Type
:= No_Path
;
1039 -- Path name of the linker driver. Specified in the configuration or in
1040 -- the package Builder of the main project.
1042 Map_File_Option
: Name_Id
:= No_Name
;
1043 -- Option to use when invoking the linker to build a map file
1045 Trailing_Linker_Required_Switches
: Name_List_Index
:= No_Name_List
;
1046 -- The minimum options for the linker driver. Specified in the
1049 Linker_Executable_Option
: Name_List_Index
:= No_Name_List
;
1050 -- The option(s) to indicate the name of the executable in the linker
1051 -- command. Specified in the configuration. When not specified, default
1052 -- to -o <executable name>.
1054 Linker_Lib_Dir_Option
: Name_Id
:= No_Name
;
1055 -- The option to specify where to find a library for linking. Specified
1056 -- in the configuration. When not specified, defaults to "-L".
1058 Linker_Lib_Name_Option
: Name_Id
:= No_Name
;
1059 -- The option to specify the name of a library for linking. Specified in
1060 -- the configuration. When not specified, defaults to "-l".
1062 Max_Command_Line_Length
: Natural := 0;
1063 -- When positive and when Resp_File_Format (see below) is not None,
1064 -- if the command line for the invocation of the linker would be greater
1065 -- than this value, a response file is used to invoke the linker.
1067 Resp_File_Format
: Response_File_Format
:= None
;
1068 -- The format of a response file, when linking with a response file is
1071 Resp_File_Options
: Name_List_Index
:= No_Name_List
;
1072 -- The switches, if any, that precede the path name of the response
1073 -- file in the invocation of the linker.
1077 Library_Builder
: Path_Name_Type
:= No_Path
;
1078 -- The executable to build library (specified in the configuration)
1080 Lib_Support
: Library_Support
:= None
;
1081 -- The level of library support. Specified in the configuration. Support
1082 -- is none, static libraries only or both static and shared libraries.
1084 Lib_Encapsulated_Supported
: Boolean := False;
1085 -- True when building fully standalone libraries supported on the target
1087 Archive_Builder
: Name_List_Index
:= No_Name_List
;
1088 -- The name of the executable to build archives, with the minimum
1089 -- switches. Specified in the configuration.
1091 Archive_Builder_Append_Option
: Name_List_Index
:= No_Name_List
;
1092 -- The options to append object files to an archive
1094 Archive_Indexer
: Name_List_Index
:= No_Name_List
;
1095 -- The name of the executable to index archives, with the minimum
1096 -- switches. Specified in the configuration.
1098 Archive_Suffix
: File_Name_Type
:= No_File
;
1099 -- The suffix of archives. Specified in the configuration. When not
1100 -- specified, defaults to ".a".
1102 Lib_Partial_Linker
: Name_List_Index
:= No_Name_List
;
1106 Shared_Lib_Driver
: File_Name_Type
:= No_File
;
1107 -- The driver to link shared libraries. Set with attribute Library_GCC.
1110 Shared_Lib_Prefix
: File_Name_Type
:= No_File
;
1111 -- Part of a shared library file name that precedes the name of the
1112 -- library. Specified in the configuration. When not specified, defaults
1115 Shared_Lib_Suffix
: File_Name_Type
:= No_File
;
1116 -- Suffix of shared libraries, after the library name in the shared
1117 -- library name. Specified in the configuration. When not specified,
1118 -- default to ".so".
1120 Shared_Lib_Min_Options
: Name_List_Index
:= No_Name_List
;
1121 -- The minimum options to use when building a shared library
1123 Lib_Version_Options
: Name_List_Index
:= No_Name_List
;
1124 -- The options to use to specify a library version
1126 Symbolic_Link_Supported
: Boolean := False;
1127 -- True if the platform supports symbolic link files
1129 Lib_Maj_Min_Id_Supported
: Boolean := False;
1130 -- True if platform supports library major and minor options, such as
1131 -- libname.so -> libname.so.2 -> libname.so.2.4
1133 Auto_Init_Supported
: Boolean := False;
1134 -- True if automatic initialisation is supported for shared stand-alone
1138 Default_Project_Config
: constant Project_Configuration
:=
1140 Run_Path_Option
=> No_Name_List
,
1141 Run_Path_Origin
=> No_Name
,
1142 Library_Install_Name_Option
=> No_Name
,
1143 Separate_Run_Path_Options
=> False,
1144 Executable_Suffix
=> No_Name
,
1146 Map_File_Option
=> No_Name
,
1147 Trailing_Linker_Required_Switches
=>
1149 Linker_Executable_Option
=> No_Name_List
,
1150 Linker_Lib_Dir_Option
=> No_Name
,
1151 Linker_Lib_Name_Option
=> No_Name
,
1152 Library_Builder
=> No_Path
,
1153 Max_Command_Line_Length
=> 0,
1154 Resp_File_Format
=> None
,
1155 Resp_File_Options
=> No_Name_List
,
1156 Lib_Support
=> None
,
1157 Lib_Encapsulated_Supported
=> False,
1158 Archive_Builder
=> No_Name_List
,
1159 Archive_Builder_Append_Option
=> No_Name_List
,
1160 Archive_Indexer
=> No_Name_List
,
1161 Archive_Suffix
=> No_File
,
1162 Lib_Partial_Linker
=> No_Name_List
,
1163 Shared_Lib_Driver
=> No_File
,
1164 Shared_Lib_Prefix
=> No_File
,
1165 Shared_Lib_Suffix
=> No_File
,
1166 Shared_Lib_Min_Options
=> No_Name_List
,
1167 Lib_Version_Options
=> No_Name_List
,
1168 Symbolic_Link_Supported
=> False,
1169 Lib_Maj_Min_Id_Supported
=> False,
1170 Auto_Init_Supported
=> False);
1172 -------------------------
1173 -- Aggregated projects --
1174 -------------------------
1176 type Aggregated_Project
;
1177 type Aggregated_Project_List
is access all Aggregated_Project
;
1178 type Aggregated_Project
is record
1179 Path
: Path_Name_Type
;
1180 Tree
: Project_Tree_Ref
;
1181 Project
: Project_Id
;
1182 Next
: Aggregated_Project_List
;
1185 procedure Free
(List
: in out Aggregated_Project_List
);
1186 -- Free the memory used for List
1188 procedure Add_Aggregated_Project
1189 (Project
: Project_Id
;
1190 Path
: Path_Name_Type
);
1191 -- Add a new aggregated project in Project.
1192 -- The aggregated project has not been processed yet. This procedure should
1193 -- the called while processing the aggregate project, and as a result
1194 -- Prj.Proc.Process will then automatically process the aggregated projects
1200 -- The following record describes a project file representation
1202 pragma Warnings
(Off
);
1206 -- The following clash with Standard is OK, and justified by the context
1207 -- which really wants to use the same set of qualifiers.
1212 pragma Warnings
(On
);
1214 type Project_Data
(Qualifier
: Project_Qualifier
:= Unspecified
) is record
1220 Name
: Name_Id
:= No_Name
;
1221 -- The name of the project
1223 Display_Name
: Name_Id
:= No_Name
;
1224 -- The name of the project with the spelling of its declaration
1226 Externally_Built
: Boolean := False;
1227 -- True if the project is externally built. In such case, the Project
1228 -- Manager will not modify anything in this project.
1230 Config
: Project_Configuration
;
1232 Path
: Path_Information
:= No_Path_Information
;
1233 -- The path name of the project file. This include base name of the
1236 Virtual
: Boolean := False;
1237 -- True for virtual extending projects
1239 Location
: Source_Ptr
:= No_Location
;
1240 -- The location in the project file source of the project name that
1241 -- immediately follows the reserved word "project".
1247 Languages
: Language_Ptr
:= No_Language_Index
;
1248 -- First index of the language data in the project.
1249 -- This is an index into the project_tree_data.languages_data.
1250 -- Traversing the list gives access to all the languages supported by
1257 Mains
: String_List_Id
:= Nil_String
;
1258 -- List of mains specified by attribute Main
1260 Extends
: Project_Id
:= No_Project
;
1261 -- The reference of the project file, if any, that this project file
1264 Extended_By
: Project_Id
:= No_Project
;
1265 -- The reference of the project file, if any, that extends this project
1268 Decl
: Declarations
:= No_Declarations
;
1269 -- The declarations (variables, attributes and packages) of this project
1272 Imported_Projects
: Project_List
:= null;
1273 -- The list of all directly imported projects, if any
1275 All_Imported_Projects
: Project_List
:= null;
1276 -- The list of all projects imported directly or indirectly, if any.
1277 -- This does not include the project itself.
1283 Directory
: Path_Information
:= No_Path_Information
;
1284 -- Path name of the directory where the project file resides
1286 Object_Directory
: Path_Information
:= No_Path_Information
;
1287 -- The path name of the object directory of this project file
1289 Exec_Directory
: Path_Information
:= No_Path_Information
;
1290 -- The path name of the exec directory of this project file. Default is
1291 -- equal to Object_Directory.
1293 Object_Path_File
: Path_Name_Type
:= No_Path
;
1294 -- Store the name of the temporary file that contains the list of object
1295 -- directories, when attribute Object_Path_Switches is declared.
1301 Library
: Boolean := False;
1302 -- True if this is a library project
1304 Library_Name
: Name_Id
:= No_Name
;
1305 -- If a library project, name of the library
1307 Library_Kind
: Lib_Kind
:= Static
;
1308 -- If a library project, kind of library
1310 Library_Dir
: Path_Information
:= No_Path_Information
;
1311 -- If a library project, path name of the directory where the library
1314 Library_TS
: Time_Stamp_Type
:= Empty_Time_Stamp
;
1315 -- The timestamp of a library file in a library project
1317 Library_Src_Dir
: Path_Information
:= No_Path_Information
;
1318 -- If a Stand-Alone Library project, path name of the directory where
1319 -- the sources of the interfaces of the library are copied. By default,
1320 -- if attribute Library_Src_Dir is not specified, sources of the
1321 -- interfaces are not copied anywhere.
1323 Library_ALI_Dir
: Path_Information
:= No_Path_Information
;
1324 -- In a library project, path name of the directory where the ALI files
1325 -- are copied. If attribute Library_ALI_Dir is not specified, ALI files
1326 -- are copied in the Library_Dir.
1328 Lib_Internal_Name
: Name_Id
:= No_Name
;
1329 -- If a library project, internal name store inside the library
1331 Standalone_Library
: Standalone
:= No
;
1332 -- Indicate that this is a Standalone Library Project File
1334 Lib_Interface_ALIs
: String_List_Id
:= Nil_String
;
1335 -- For Standalone Library Project Files, indicate the list of Interface
1338 Lib_Auto_Init
: Boolean := False;
1339 -- For non static Stand-Alone Library Project Files, indicate if
1340 -- the library initialisation should be automatic.
1342 Symbol_Data
: Symbol_Record
:= No_Symbols
;
1343 -- Symbol file name, reference symbol file name, symbol policy
1345 Need_To_Build_Lib
: Boolean := False;
1346 -- Indicates that the library of a Library Project needs to be built or
1352 -- The sources for all languages including Ada are accessible through
1353 -- the Source_Iterator type
1355 Interfaces_Defined
: Boolean := False;
1356 -- True if attribute Interfaces is declared for the project or any
1357 -- project it extends.
1359 Include_Path_File
: Path_Name_Type
:= No_Path
;
1360 -- The path name of the of the source search directory file.
1361 -- This is only used by gnatmake
1363 Source_Dirs
: String_List_Id
:= Nil_String
;
1364 -- The list of all the source directories
1366 Source_Dir_Ranks
: Number_List_Index
:= No_Number_List
;
1368 Ada_Include_Path
: String_Access
:= null;
1369 -- The cached value of source search path for this project file. Set by
1370 -- the first call to Prj.Env.Ada_Include_Path for the project. Do not
1371 -- use this field directly outside of the project manager, use
1372 -- Prj.Env.Ada_Include_Path instead.
1374 Has_Multi_Unit_Sources
: Boolean := False;
1375 -- Whether there is at least one source file containing multiple units
1381 Ada_Objects_Path
: String_Access
:= null;
1382 -- The cached value of ADA_OBJECTS_PATH for this project file. Do not
1383 -- use this field directly outside of the compiler, use
1384 -- Prj.Env.Ada_Objects_Path instead.
1386 Libgnarl_Needed
: Yes_No_Unknown
:= Unknown
;
1387 -- Set to True when libgnarl is needed to link
1389 Objects_Path
: String_Access
:= null;
1390 -- The cached value of the object dir path, used during the binding
1391 -- phase of gprbuild.
1393 Objects_Path_File_With_Libs
: Path_Name_Type
:= No_Path
;
1394 -- The cached value of the object path temp file (including library
1395 -- dirs) for this project file.
1397 Objects_Path_File_Without_Libs
: Path_Name_Type
:= No_Path
;
1398 -- The cached value of the object path temp file (excluding library
1399 -- dirs) for this project file.
1401 Config_File_Name
: Path_Name_Type
:= No_Path
;
1402 -- The path name of the configuration pragmas file, if any
1404 Config_File_Temp
: Boolean := False;
1405 -- An indication that the configuration pragmas file is a temporary file
1406 -- that must be deleted at the end.
1408 Config_Checked
: Boolean := False;
1409 -- A flag to avoid checking repetitively the configuration pragmas file
1411 Depth
: Natural := 0;
1412 -- The maximum depth of a project in the project graph. Depth of main
1415 Unkept_Comments
: Boolean := False;
1416 -- True if there are comments in the project sources that cannot be kept
1417 -- in the project tree.
1419 -----------------------------
1420 -- Qualifier-Specific data --
1421 -----------------------------
1423 -- The following fields are only valid for specific types of projects
1426 when Aggregate | Aggregate_Library
=>
1427 Aggregated_Projects
: Aggregated_Project_List
:= null;
1428 -- List of aggregated projects (which could themselves be
1429 -- aggregate projects).
1436 function Empty_Project
(Qualifier
: Project_Qualifier
) return Project_Data
;
1437 -- Return the representation of an empty project
1439 function Is_Extending
1440 (Extending
: Project_Id
;
1441 Extended
: Project_Id
) return Boolean;
1442 -- Return True if Extending is extending the Extended project
1445 (Extending
: Project_Id
;
1446 Extended
: Project_Id
) return Boolean renames Is_Extending
;
1448 function Has_Ada_Sources
(Data
: Project_Id
) return Boolean;
1449 -- Return True if the project has Ada sources
1451 Project_Error
: exception;
1452 -- Raised by some subprograms in Prj.Attr
1454 package Units_Htable
is new Simple_HTable
1455 (Header_Num
=> Header_Num
,
1456 Element
=> Unit_Index
,
1457 No_Element
=> No_Unit_Index
,
1461 -- Mapping of unit names to indexes in the Units table
1463 ---------------------
1464 -- Source_Iterator --
1465 ---------------------
1467 type Source_Iterator
is private;
1469 function For_Each_Source
1470 (In_Tree
: Project_Tree_Ref
;
1471 Project
: Project_Id
:= No_Project
;
1472 Language
: Name_Id
:= No_Name
;
1473 Encapsulated_Libs
: Boolean := True;
1474 Locally_Removed
: Boolean := True) return Source_Iterator
;
1475 -- Returns an iterator for all the sources of a project tree, or a specific
1476 -- project, or a specific language. Include sources from aggregated libs if
1477 -- Aggregated_Libs is True. If Locally_Removed is set to False the
1478 -- Locally_Removed files won't be reported.
1480 function Element
(Iter
: Source_Iterator
) return Source_Id
;
1481 -- Return the current source (or No_Source if there are no more sources)
1483 procedure Next
(Iter
: in out Source_Iterator
);
1484 -- Move on to the next source
1486 function Find_Source
1487 (In_Tree
: Project_Tree_Ref
;
1488 Project
: Project_Id
;
1489 In_Imported_Only
: Boolean := False;
1490 In_Extended_Only
: Boolean := False;
1491 Base_Name
: File_Name_Type
;
1492 Index
: Int
:= 0) return Source_Id
;
1493 -- Find the first source file with the given name.
1494 -- If In_Extended_Only is True, it will search in project and the project
1495 -- it extends, but not in the imported projects.
1496 -- Elsif In_Imported_Only is True, it will search in project and the
1497 -- projects it imports, but not in the others or in aggregated projects.
1498 -- Else it searches in the whole tree.
1499 -- If Index is specified, this only search for a source with that index.
1501 -----------------------
1502 -- Project_Tree_Data --
1503 -----------------------
1505 package Replaced_Source_HTable
is new Simple_HTable
1506 (Header_Num
=> Header_Num
,
1507 Element
=> File_Name_Type
,
1508 No_Element
=> No_File
,
1509 Key
=> File_Name_Type
,
1513 type Private_Project_Tree_Data
is private;
1514 -- Data for a project tree that is used only by the Project Manager
1516 type Shared_Project_Tree_Data
is record
1517 Name_Lists
: Name_List_Table
.Instance
;
1518 Number_Lists
: Number_List_Table
.Instance
;
1519 String_Elements
: String_Element_Table
.Instance
;
1520 Variable_Elements
: Variable_Element_Table
.Instance
;
1521 Array_Elements
: Array_Element_Table
.Instance
;
1522 Arrays
: Array_Table
.Instance
;
1523 Packages
: Package_Table
.Instance
;
1524 Private_Part
: Private_Project_Tree_Data
;
1526 type Shared_Project_Tree_Data_Access
is access all Shared_Project_Tree_Data
;
1527 -- The data that is shared among multiple trees, when these trees are
1528 -- loaded through the same aggregate project.
1529 -- To avoid ambiguities, limit the number of parameters to the
1530 -- subprograms (we would have to parse the "root project tree" since this
1531 -- is where the configuration file was loaded, in addition to the project's
1532 -- own tree) and make the comparison of projects easier, all trees store
1533 -- the lists in the same tables.
1535 type Project_Tree_Appdata
is tagged null record;
1536 type Project_Tree_Appdata_Access
is access all Project_Tree_Appdata
'Class;
1537 -- Application-specific data that can be associated with a project tree.
1538 -- We do not make the Project_Tree_Data itself tagged for several reasons:
1539 -- - it couldn't have a default value for its discriminant
1540 -- - it would require a "factory" to allocate such data, because trees
1541 -- are created automatically when parsing aggregate projects.
1543 procedure Free
(Tree
: in out Project_Tree_Appdata
);
1544 -- Should be overridden if your derive your own data
1546 type Project_Tree_Data
(Is_Root_Tree
: Boolean := True) is record
1547 -- The root tree is the one loaded by the user from the command line.
1548 -- Is_Root_Tree is only false for projects aggregated within a root
1549 -- aggregate project.
1551 Projects
: Project_List
;
1552 -- List of projects in this tree
1554 Replaced_Sources
: Replaced_Source_HTable
.Instance
;
1555 -- The list of sources that have been replaced by sources with
1556 -- different file names.
1558 Replaced_Source_Number
: Natural := 0;
1559 -- The number of entries in Replaced_Sources
1561 Units_HT
: Units_Htable
.Instance
;
1562 -- Unit name to Unit_Index (and from there to Source_Id)
1564 Source_Files_HT
: Source_Files_Htable
.Instance
;
1565 -- Base source file names to Source_Id list
1567 Source_Paths_HT
: Source_Paths_Htable
.Instance
;
1568 -- Full path to Source_Id
1569 -- ??? What is behavior for multi-unit source files, where there are
1570 -- several source_id per file ?
1572 Source_Info_File_Name
: String_Access
:= null;
1573 -- The name of the source info file, if specified by the builder
1575 Source_Info_File_Exists
: Boolean := False;
1576 -- True when a source info file has been successfully read
1578 Shared
: Shared_Project_Tree_Data_Access
;
1579 -- The shared data for this tree and all aggregated trees
1581 Appdata
: Project_Tree_Appdata_Access
;
1582 -- Application-specific data for this tree
1584 case Is_Root_Tree
is
1586 Shared_Data
: aliased Shared_Project_Tree_Data
;
1587 -- Do not access directly, only through Shared
1593 -- Data for a project tree
1595 function Debug_Name
(Tree
: Project_Tree_Ref
) return Name_Id
;
1596 -- If debug traces are activated, return an identitier for the project
1597 -- tree. This modifies Name_Buffer.
1599 procedure Expect
(The_Token
: Token_Type
; Token_Image
: String);
1600 -- Check that the current token is The_Token. If it is not, then output
1601 -- an error message.
1603 procedure Initialize
(Tree
: Project_Tree_Ref
);
1604 -- This procedure must be called before using any services from the Prj
1605 -- hierarchy. Namet.Initialize must be called before Prj.Initialize.
1607 procedure Reset
(Tree
: Project_Tree_Ref
);
1608 -- This procedure resets all the tables that are used when processing a
1609 -- project file tree. Initialize must be called before the call to Reset.
1611 package Project_Boolean_Htable
is new Simple_HTable
1612 (Header_Num
=> Header_Num
,
1614 No_Element
=> False,
1618 -- A table that associates a project to a boolean. This is used to detect
1619 -- whether a project was already processed for instance.
1622 with procedure Action
(Project
: Project_Id
; Tree
: Project_Tree_Ref
);
1623 procedure For_Project_And_Aggregated
1624 (Root_Project
: Project_Id
;
1625 Root_Tree
: Project_Tree_Ref
);
1626 -- Execute Action for Root_Project and all its aggregated projects
1630 type State
is limited private;
1631 with procedure Action
1632 (Project
: Project_Id
;
1633 Tree
: Project_Tree_Ref
;
1634 With_State
: in out State
);
1635 procedure For_Every_Project_Imported
1637 Tree
: Project_Tree_Ref
;
1638 With_State
: in out State
;
1639 Include_Aggregated
: Boolean := True;
1640 Imported_First
: Boolean := False);
1641 -- Call Action for each project imported directly or indirectly by project
1642 -- By, as well as extended projects.
1644 -- The order of processing depends on Imported_First:
1646 -- If False, Action is called according to the order of importation: if A
1647 -- imports B, directly or indirectly, Action will be called for A before
1648 -- it is called for B. If two projects import each other directly or
1649 -- indirectly (using at least one "limited with"), it is not specified
1650 -- for which of these two projects Action will be called first.
1652 -- The order is reversed if Imported_First is True
1654 -- With_State may be used by Action to choose a behavior or to report some
1657 -- If Include_Aggregated is True, then an aggregate project will recurse
1658 -- into the projects it aggregates. Otherwise, the latter are never
1661 -- In_Aggregate_Lib is True if the project is in an aggregate library
1663 -- The Tree argument passed to the callback is required in the case of
1664 -- aggregated projects, since they might not be using the same tree as 'By'
1666 type Project_Context
is record
1667 In_Aggregate_Lib
: Boolean;
1668 -- True if the project is part of an aggregate library
1670 From_Encapsulated_Lib
: Boolean;
1671 -- True if the project is imported from an encapsulated library
1675 type State
is limited private;
1676 with procedure Action
1677 (Project
: Project_Id
;
1678 Tree
: Project_Tree_Ref
;
1679 Context
: Project_Context
;
1680 With_State
: in out State
);
1681 procedure For_Every_Project_Imported_Context
1683 Tree
: Project_Tree_Ref
;
1684 With_State
: in out State
;
1685 Include_Aggregated
: Boolean := True;
1686 Imported_First
: Boolean := False);
1687 -- As for For_Every_Project_Imported but with an associated context
1690 with procedure Action
1691 (Project
: Project_Id
;
1692 Tree
: Project_Tree_Ref
;
1693 Context
: Project_Context
);
1694 procedure For_Project_And_Aggregated_Context
1695 (Root_Project
: Project_Id
;
1696 Root_Tree
: Project_Tree_Ref
);
1697 -- As for For_Project_And_Aggregated but with an associated context
1699 function Extend_Name
1700 (File
: File_Name_Type
;
1701 With_Suffix
: String) return File_Name_Type
;
1702 -- Replace the extension of File with With_Suffix
1704 function Object_Name
1705 (Source_File_Name
: File_Name_Type
;
1706 Object_File_Suffix
: Name_Id
:= No_Name
) return File_Name_Type
;
1707 -- Returns the object file name corresponding to a source file name
1709 function Object_Name
1710 (Source_File_Name
: File_Name_Type
;
1712 Index_Separator
: Character;
1713 Object_File_Suffix
: Name_Id
:= No_Name
) return File_Name_Type
;
1714 -- Returns the object file name corresponding to a unit in a multi-source
1717 function Dependency_Name
1718 (Source_File_Name
: File_Name_Type
;
1719 Dependency
: Dependency_File_Kind
) return File_Name_Type
;
1720 -- Returns the dependency file name corresponding to a source file name
1722 function Switches_Name
1723 (Source_File_Name
: File_Name_Type
) return File_Name_Type
;
1724 -- Returns the switches file name corresponding to a source file name
1726 procedure Set_Path_File_Var
(Name
: String; Value
: String);
1727 -- Call Setenv, after calling To_Host_File_Spec
1729 function Current_Source_Path_File_Of
1730 (Shared
: Shared_Project_Tree_Data_Access
) return Path_Name_Type
;
1731 -- Get the current include path file name
1733 procedure Set_Current_Source_Path_File_Of
1734 (Shared
: Shared_Project_Tree_Data_Access
;
1735 To
: Path_Name_Type
);
1736 -- Record the current include path file name
1738 function Current_Object_Path_File_Of
1739 (Shared
: Shared_Project_Tree_Data_Access
) return Path_Name_Type
;
1740 -- Get the current object path file name
1742 procedure Set_Current_Object_Path_File_Of
1743 (Shared
: Shared_Project_Tree_Data_Access
;
1744 To
: Path_Name_Type
);
1745 -- Record the current object path file name
1751 type Processing_Flags
is private;
1752 -- Flags used while parsing and processing a project tree to configure the
1753 -- behavior of the parser, and indicate how to report error messages. This
1754 -- structure does not allocate memory and never needs to be freed
1756 type Error_Warning
is (Silent
, Warning
, Error
);
1757 -- Severity of some situations, such as: no Ada sources in a project where
1758 -- Ada is one of the language.
1760 -- When the situation occurs, the behaviour depends on the setting:
1762 -- - Silent: no action
1763 -- - Warning: issue a warning, does not cause the tool to fail
1764 -- - Error: issue an error, causes the tool to fail
1766 type Error_Handler
is access procedure
1767 (Project
: Project_Id
;
1768 Is_Warning
: Boolean);
1769 -- This warns when an error was found when parsing a project. The error
1770 -- itself is handled through Prj.Err (and Prj.Err.Finalize should be called
1771 -- to actually print the error). This ensures that duplicate error messages
1772 -- are always correctly removed, that errors msgs are sorted, and that all
1773 -- tools will report the same error to the user.
1775 function Create_Flags
1776 (Report_Error
: Error_Handler
;
1777 When_No_Sources
: Error_Warning
;
1778 Require_Sources_Other_Lang
: Boolean := True;
1779 Allow_Duplicate_Basenames
: Boolean := True;
1780 Compiler_Driver_Mandatory
: Boolean := False;
1781 Error_On_Unknown_Language
: Boolean := True;
1782 Require_Obj_Dirs
: Error_Warning
:= Error
;
1783 Allow_Invalid_External
: Error_Warning
:= Error
;
1784 Missing_Source_Files
: Error_Warning
:= Error
;
1785 Ignore_Missing_With
: Boolean := False)
1786 return Processing_Flags
;
1787 -- Function used to create Processing_Flags structure
1789 -- If Allow_Duplicate_Basenames, then files with the same base names are
1790 -- authorized within a project for source-based languages (never for unit
1791 -- based languages).
1793 -- If Compiler_Driver_Mandatory is true, then a Compiler.Driver attribute
1794 -- for each language must be defined, or we will not look for its source
1797 -- When_No_Sources indicates what should be done when no sources of a
1798 -- language are found in a project where this language is declared.
1799 -- If Require_Sources_Other_Lang is true, then all languages must have at
1800 -- least one source file, or an error is reported via When_No_Sources. If
1801 -- it is false, this is only required for Ada (and only if it is a language
1802 -- of the project). When this parameter is set to False, we do not check
1803 -- that a proper naming scheme is defined for languages other than Ada.
1805 -- If Report_Error is null, use the standard error reporting mechanism
1806 -- (Errout). Otherwise, report errors using Report_Error.
1808 -- If Error_On_Unknown_Language is true, an error is displayed if some of
1809 -- the source files listed in the project do not match any naming scheme
1811 -- If Require_Obj_Dirs is true, then all object directories must exist
1812 -- (possibly after they have been created automatically if the appropriate
1813 -- switches were specified), or an error is raised.
1815 -- If Allow_Invalid_External is Silent, then no error is reported when an
1816 -- invalid value is used for an external variable (and it doesn't match its
1817 -- type). Instead, the first possible value is used.
1819 -- Missing_Source_Files indicates whether it is an error or a warning that
1820 -- a source file mentioned in the Source_Files attributes is not actually
1821 -- found in the source directories. This also impacts errors for missing
1822 -- source directories.
1824 -- If Ignore_Missing_With is True, then a "with" statement that cannot be
1825 -- resolved will simply be ignored. However, in such a case, the flag
1826 -- Incomplete_With in the project tree will be set to True.
1827 -- This is meant for use by tools so that they can properly set the
1828 -- project path in such a case:
1829 -- * no "gnatls" found (so no default project path)
1830 -- * user project sets Project.IDE'gnatls attribute to a cross gnatls
1831 -- * user project also includes a "with" that can only be resolved
1832 -- once we have found the gnatls
1834 Gprbuild_Flags
: constant Processing_Flags
;
1835 Gprclean_Flags
: constant Processing_Flags
;
1836 Gprexec_Flags
: constant Processing_Flags
;
1837 Gnatmake_Flags
: constant Processing_Flags
;
1838 -- Flags used by the various tools. They all display the error messages
1845 procedure Record_Temp_File
1846 (Shared
: Shared_Project_Tree_Data_Access
;
1847 Path
: Path_Name_Type
);
1848 -- Record the path of a newly created temporary file, so that it can be
1851 procedure Delete_All_Temp_Files
1852 (Shared
: Shared_Project_Tree_Data_Access
);
1853 -- Delete all recorded temporary files.
1854 -- Does nothing if Debug.Debug_Flag_N is set
1856 procedure Delete_Temp_Config_Files
(Project_Tree
: Project_Tree_Ref
);
1857 -- Delete all temporary config files. Does nothing if Debug.Debug_Flag_N is
1858 -- set or if Project_Tree is null. This initially came from gnatmake
1859 -- ??? Should this be combined with Delete_All_Temp_Files above
1861 procedure Delete_Temporary_File
1862 (Shared
: Shared_Project_Tree_Data_Access
:= null;
1863 Path
: Path_Name_Type
);
1864 -- Delete a temporary file from the disk. The file is also removed from the
1865 -- list of temporary files to delete at the end of the program, in case
1866 -- another program running on the same machine has recreated it. Does
1867 -- nothing if Debug.Debug_Flag_N is set
1869 Virtual_Prefix
: constant String := "v$";
1870 -- The prefix for virtual extending projects. Because of the '$', which is
1871 -- normally forbidden for project names, there cannot be any name clash.
1877 type Verbosity
is (Default
, Medium
, High
);
1878 pragma Ordered
(Verbosity
);
1879 -- Verbosity when parsing GNAT Project Files
1880 -- Default is default (very quiet, if no errors).
1881 -- Medium is more verbose.
1882 -- High is extremely verbose.
1884 Current_Verbosity
: Verbosity
:= Default
;
1885 -- The current value of the verbosity the project files are parsed with
1887 procedure Debug_Indent
;
1888 -- Inserts a series of blanks depending on the current indentation level
1890 procedure Debug_Output
(Str
: String);
1891 procedure Debug_Output
(Str
: String; Str2
: Name_Id
);
1892 -- If Current_Verbosity is not Default, outputs Str.
1893 -- This indents Str based on the current indentation level for traces
1894 -- Debug_Error is intended to be used to report an error in the traces.
1896 procedure Debug_Increase_Indent
1897 (Str
: String := ""; Str2
: Name_Id
:= No_Name
);
1898 procedure Debug_Decrease_Indent
(Str
: String := "");
1899 -- Increase or decrease the indentation level for debug traces. This
1900 -- indentation level only affects output done through Debug_Output.
1904 All_Packages
: constant String_List_Access
:= null;
1906 No_Project_Tree
: constant Project_Tree_Ref
:= null;
1908 Ignored
: constant Variable_Kind
:= Single
;
1910 Nil_Variable_Value
: constant Variable_Value
:=
1911 (Project
=> No_Project
,
1913 Location
=> No_Location
,
1916 type Source_Iterator
is record
1917 In_Tree
: Project_Tree_Ref
;
1919 Project
: Project_List
;
1920 All_Projects
: Boolean;
1921 -- Current project and whether we should move on to the next
1923 Language
: Language_Ptr
;
1924 -- Current language processed
1926 Language_Name
: Name_Id
;
1927 -- Only sources of this language will be returned (or all if No_Name)
1929 Current
: Source_Id
;
1931 Encapsulated_Libs
: Boolean;
1932 -- True if we want to include the sources from encapsulated libs
1934 Locally_Removed
: Boolean;
1937 procedure Add_To_Buffer
1939 To
: in out String_Access
;
1940 Last
: in out Natural);
1941 -- Append a String to the Buffer
1943 package Temp_Files_Table
is new GNAT
.Dynamic_Tables
1944 (Table_Component_Type
=> Path_Name_Type
,
1945 Table_Index_Type
=> Integer,
1946 Table_Low_Bound
=> 1,
1947 Table_Initial
=> 10,
1948 Table_Increment
=> 10);
1949 -- Table to store the path name of all the created temporary files, so that
1950 -- they can be deleted at the end, or when the program is interrupted.
1952 type Private_Project_Tree_Data
is record
1953 Temp_Files
: Temp_Files_Table
.Instance
;
1954 -- Temporary files created as part of running tools (pragma files,
1955 -- mapping files,...)
1957 Current_Source_Path_File
: Path_Name_Type
:= No_Path
;
1958 -- Current value of project source path file env var. Used to avoid
1959 -- setting the env var to the same value. When different from No_Path,
1960 -- this indicates that logical names (VMS) or environment variables were
1961 -- created and should be deassigned to avoid polluting the environment
1965 Current_Object_Path_File
: Path_Name_Type
:= No_Path
;
1966 -- Current value of project object path file env var. Used to avoid
1967 -- setting the env var to the same value.
1971 -- Type to represent the part of a project tree which is private to the
1974 type Processing_Flags
is record
1975 Require_Sources_Other_Lang
: Boolean;
1976 Report_Error
: Error_Handler
;
1977 When_No_Sources
: Error_Warning
;
1978 Allow_Duplicate_Basenames
: Boolean;
1979 Compiler_Driver_Mandatory
: Boolean;
1980 Error_On_Unknown_Language
: Boolean;
1981 Require_Obj_Dirs
: Error_Warning
;
1982 Allow_Invalid_External
: Error_Warning
;
1983 Missing_Source_Files
: Error_Warning
;
1984 Ignore_Missing_With
: Boolean;
1987 Gprbuild_Flags
: constant Processing_Flags
:=
1988 (Report_Error
=> null,
1989 When_No_Sources
=> Warning
,
1990 Require_Sources_Other_Lang
=> True,
1991 Allow_Duplicate_Basenames
=> False,
1992 Compiler_Driver_Mandatory
=> True,
1993 Error_On_Unknown_Language
=> True,
1994 Require_Obj_Dirs
=> Error
,
1995 Allow_Invalid_External
=> Error
,
1996 Missing_Source_Files
=> Error
,
1997 Ignore_Missing_With
=> False);
1999 Gprclean_Flags
: constant Processing_Flags
:=
2000 (Report_Error
=> null,
2001 When_No_Sources
=> Warning
,
2002 Require_Sources_Other_Lang
=> True,
2003 Allow_Duplicate_Basenames
=> False,
2004 Compiler_Driver_Mandatory
=> True,
2005 Error_On_Unknown_Language
=> True,
2006 Require_Obj_Dirs
=> Warning
,
2007 Allow_Invalid_External
=> Error
,
2008 Missing_Source_Files
=> Error
,
2009 Ignore_Missing_With
=> False);
2011 Gprexec_Flags
: constant Processing_Flags
:=
2012 (Report_Error
=> null,
2013 When_No_Sources
=> Silent
,
2014 Require_Sources_Other_Lang
=> False,
2015 Allow_Duplicate_Basenames
=> False,
2016 Compiler_Driver_Mandatory
=> False,
2017 Error_On_Unknown_Language
=> True,
2018 Require_Obj_Dirs
=> Silent
,
2019 Allow_Invalid_External
=> Error
,
2020 Missing_Source_Files
=> Silent
,
2021 Ignore_Missing_With
=> False);
2023 Gnatmake_Flags
: constant Processing_Flags
:=
2024 (Report_Error
=> null,
2025 When_No_Sources
=> Error
,
2026 Require_Sources_Other_Lang
=> False,
2027 Allow_Duplicate_Basenames
=> False,
2028 Compiler_Driver_Mandatory
=> False,
2029 Error_On_Unknown_Language
=> False,
2030 Require_Obj_Dirs
=> Error
,
2031 Allow_Invalid_External
=> Error
,
2032 Missing_Source_Files
=> Error
,
2033 Ignore_Missing_With
=> False);