diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-27 19:20:19 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-27 19:20:19 +0000 |
commit | 488133ac66acbad4fbb7177438c6a651c3de8a07 (patch) | |
tree | f502522737a39b8803377a20fa7f25073cbd16d1 /gcc/ada/prj.ads | |
parent | 5ed3bd072fbadb6e5dbac35a56dd35e94827b04d (diff) | |
download | gcc-488133ac66acbad4fbb7177438c6a651c3de8a07.tar.gz |
2008-05-27 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r136046
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@136051 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj.ads')
-rw-r--r-- | gcc/ada/prj.ads | 401 |
1 files changed, 206 insertions, 195 deletions
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index c547eb66397..5d8caa79cd3 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -150,6 +150,13 @@ package Prj is function Empty_String return Name_Id; -- Return the id for an empty string "" + type Path_Information is record + Name : Path_Name_Type := No_Path; + Display_Name : Path_Name_Type := No_Path; + end record; + + No_Path_Information : constant Path_Information := (No_Path, No_Path); + type Project_Id is new Nat; No_Project : constant Project_Id := 0; -- Id of a Project File @@ -672,11 +679,8 @@ package Prj is Display_File : File_Name_Type := No_File; -- File name of the source, for display purposes - Path : Path_Name_Type := No_Path; - -- Canonical path name of the source - - Display_Path : Path_Name_Type := No_Path; - -- Path name of the source, for display purposes + Path : Path_Information := No_Path_Information; + -- Path name of the source Source_TS : Time_Stamp_Type := Empty_Time_Stamp; -- Time stamp of the source file @@ -756,8 +760,7 @@ package Prj is Replaced_By => No_Source, File => No_File, Display_File => No_File, - Path => No_Path, - Display_Path => No_Path, + Path => No_Path_Information, Source_TS => Empty_Time_Stamp, Object_Project => No_Project, Object_Exists => True, @@ -1125,100 +1128,106 @@ package Prj is -- The table that contains the lists of project files type Project_Configuration is record - Run_Path_Option : Name_List_Index := No_Name_List; - -- The option to use when linking to specify the path where to look - -- for libraries. + Run_Path_Option : Name_List_Index := No_Name_List; + -- The option to use when linking to specify the path where to look for + -- libraries. + + Executable_Suffix : Name_Id := No_Name; + -- The suffix of executables, when specified in the configuration or in + -- package Builder of the main project. When this is not specified, the + -- executable suffix is the default for the platform. - Executable_Suffix : Name_Id := No_Name; - -- The suffix of executables, when specified in the configuration - -- or in package Builder of the main project. When this is not - -- specified, the executable suffix is the default for the platform. + -- Linking - -- Linking + Linker : Path_Name_Type := No_Path; + -- Path name of the linker driver. Specified in the configuration or in + -- the package Builder of the main project. - Linker : Path_Name_Type := No_Path; - -- Path name of the linker driver. Specified in the configuration - -- or in the package Builder of the main project. + Map_File_Option : Name_Id := No_Name; + -- Option to use when invoking the linker to build a map file - Minimum_Linker_Options : Name_List_Index := No_Name_List; - -- The minimum options for the linker driver. Specified in the - -- configuration. + Minimum_Linker_Options : Name_List_Index := No_Name_List; + -- The minimum options for the linker driver. Specified in the + -- configuration. - Linker_Executable_Option : Name_List_Index := No_Name_List; - -- The option(s) to indicate the name of the executable in the - -- linker command. Specified in the configuration. When not - -- specified, default to -o <executable name>. + Linker_Executable_Option : Name_List_Index := No_Name_List; + -- The option(s) to indicate the name of the executable in the linker + -- command. Specified in the configuration. When not specified, default + -- to -o <executable name>. - Linker_Lib_Dir_Option : Name_Id := No_Name; - -- The option to specify where to find a library for linking. - -- Specified in the configuration. When not specified, defaults to - -- "-L". + Linker_Lib_Dir_Option : Name_Id := No_Name; + -- The option to specify where to find a library for linking. Specified + -- in the configuration. When not specified, defaults to "-L". - Linker_Lib_Name_Option : Name_Id := No_Name; - -- The option to specify the name of a library for linking. Specified - -- in the configuration. When not specified, defaults to "-l". + Linker_Lib_Name_Option : Name_Id := No_Name; + -- The option to specify the name of a library for linking. Specified in + -- the configuration. When not specified, defaults to "-l". - -- Libraries + -- Libraries - Library_Builder : Path_Name_Type := No_Path; - -- The executable to build library (specified in the configuration) + Library_Builder : Path_Name_Type := No_Path; + -- The executable to build library (specified in the configuration) - Lib_Support : Library_Support := None; - -- The level of library support. Specified in the configuration. - -- Support is none, static libraries only or both static and shared - -- libraries. + Lib_Support : Library_Support := None; + -- The level of library support. Specified in the configuration. Support + -- is none, static libraries only or both static and shared libraries. - -- Archives + Archive_Builder : Name_List_Index := No_Name_List; + -- The name of the executable to build archives, with the minimum + -- switches. Specified in the configuration. - Archive_Builder : Name_List_Index := No_Name_List; - -- The name of the executable to build archives, with the minimum - -- switches. Specified in the configuration. + Archive_Builder_Append_Option : Name_List_Index := No_Name_List; + -- The options to append object files to an archive - Archive_Builder_Append_Option : Name_List_Index := No_Name_List; - -- The options to append object files to an archive + Archive_Indexer : Name_List_Index := No_Name_List; + -- The name of the executable to index archives, with the minimum + -- switches. Specified in the configuration. - Archive_Indexer : Name_List_Index := No_Name_List; - -- The name of the executable to index archives, with the minimum - -- switches. Specified in the configuration. + Archive_Suffix : File_Name_Type := No_File; + -- The suffix of archives. Specified in the configuration. When not + -- specified, defaults to ".a". - Archive_Suffix : File_Name_Type := No_File; - -- The suffix of archives. Specified in the configuration. When not - -- specified, defaults to ".a". + Lib_Partial_Linker : Name_List_Index := No_Name_List; - Lib_Partial_Linker : Name_List_Index := No_Name_List; + -- Shared libraries - -- Shared libraries + Shared_Lib_Driver : File_Name_Type := No_File; + -- The driver to link shared libraries. Set with attribute Library_GCC. + -- Default to gcc. - Shared_Lib_Prefix : File_Name_Type := No_File; - -- Part of a shared library file name that precedes the name of the - -- library. Specified in the configuration. When not specified, - -- defaults to "lib". + Shared_Lib_Prefix : File_Name_Type := No_File; + -- Part of a shared library file name that precedes the name of the + -- library. Specified in the configuration. When not specified, defaults + -- to "lib". - Shared_Lib_Suffix : File_Name_Type := No_File; - -- Suffix of shared libraries, after the library name in the shared - -- library name. Specified in the configuration. When not specified, - -- default to ".so". + Shared_Lib_Suffix : File_Name_Type := No_File; + -- Suffix of shared libraries, after the library name in the shared + -- library name. Specified in the configuration. When not specified, + -- default to ".so". - Shared_Lib_Min_Options : Name_List_Index := No_Name_List; - -- Comment ??? + Shared_Lib_Min_Options : Name_List_Index := No_Name_List; + -- The minimum options to use when building a shared library - Lib_Version_Options : Name_List_Index := No_Name_List; - -- Comment ??? + Lib_Version_Options : Name_List_Index := No_Name_List; + -- The options to use to specify a library version - Symbolic_Link_Supported : Boolean := False; - -- Comment ??? + Symbolic_Link_Supported : Boolean := False; + -- True if the platform supports symbolic link files - Lib_Maj_Min_Id_Supported : Boolean := False; - -- Comment ??? + Lib_Maj_Min_Id_Supported : Boolean := False; + -- True if platform supports library major and minor options, such as + -- libname.so -> libname.so.2 -> libname.so.2.4 - Auto_Init_Supported : Boolean := False; - -- Comment ??? + Auto_Init_Supported : Boolean := False; + -- True if automatic initialisation is supported for shared stand-alone + -- libraries. end record; Default_Project_Config : constant Project_Configuration := (Run_Path_Option => No_Name_List, Executable_Suffix => No_Name, Linker => No_Path, + Map_File_Option => No_Name, Minimum_Linker_Options => No_Name_List, Linker_Executable_Option => No_Name_List, Linker_Lib_Dir_Option => No_Name, @@ -1230,6 +1239,7 @@ package Prj is Archive_Indexer => No_Name_List, Archive_Suffix => No_File, Lib_Partial_Linker => No_Name_List, + Shared_Lib_Driver => No_File, Shared_Lib_Prefix => No_File, Shared_Lib_Suffix => No_File, Shared_Lib_Min_Options => No_Name_List, @@ -1245,6 +1255,17 @@ package Prj is -- separator. type Project_Data is record + + ------------- + -- General -- + ------------- + + Name : Name_Id := No_Name; + -- The name of the project + + Display_Name : Name_Id := No_Name; + -- The name of the project with the spelling of its declaration + Qualifier : Project_Qualifier := Unspecified; -- The eventual qualifier for this project @@ -1252,90 +1273,115 @@ package Prj is -- True if the project is externally built. In such case, the Project -- Manager will not modify anything in this project. + Config : Project_Configuration; + + Path : Path_Information := No_Path_Information; + -- The path name of the project file + + Virtual : Boolean := False; + -- True for virtual extending projects + + Location : Source_Ptr := No_Location; + -- The location in the project file source of the reserved word project + + Naming : Naming_Data := Standard_Naming_Data; + -- The naming scheme of this project file + + --------------- + -- Languages -- + --------------- + Languages : Name_List_Index := No_Name_List; -- The list of languages of the sources of this project - Config : Project_Configuration; + Include_Language : Language_Index := No_Language_Index; + + First_Language_Processing : Language_Index := No_Language_Index; + -- First index of the language data in the project + + Unit_Based_Language_Name : Name_Id := No_Name; + Unit_Based_Language_Index : Language_Index := No_Language_Index; + -- The name and index, if any, of the unit-based language of some + -- sources of the project. There may be only one unit-based language + -- in one project. + + -------------- + -- Projects -- + -------------- First_Referred_By : Project_Id := No_Project; -- The project, if any, that was the first to be known as importing or -- extending this project - Name : Name_Id := No_Name; - -- The name of the project + Mains : String_List_Id := Nil_String; + -- List of mains specified by attribute Main - Display_Name : Name_Id := No_Name; - -- The name of the project with the spelling of its declaration + Extends : Project_Id := No_Project; + -- The reference of the project file, if any, that this project file + -- extends. - Path_Name : Path_Name_Type := No_Path; - -- The path name of the project file + Extended_By : Project_Id := No_Project; + -- The reference of the project file, if any, that extends this project + -- file. - Display_Path_Name : Path_Name_Type := No_Path; - -- The path name used for display purposes. May be different from - -- Path_Name for platforms where the file names are case-insensitive. + Decl : Declarations := No_Declarations; + -- The declarations (variables, attributes and packages) of this project + -- file. - Virtual : Boolean := False; - -- True for virtual extending projects + Imported_Projects : Project_List := Empty_Project_List; + -- The list of all directly imported projects, if any - Location : Source_Ptr := No_Location; - -- The location in the project file source of the reserved word project + All_Imported_Projects : Project_List := Empty_Project_List; + -- The list of all projects imported directly or indirectly, if any - Mains : String_List_Id := Nil_String; - -- List of mains specified by attribute Main + ----------------- + -- Directories -- + ----------------- - Directory : Path_Name_Type := No_Path; + Directory : Path_Information := No_Path_Information; -- Path name of the directory where the project file resides - Display_Directory : Path_Name_Type := No_Path; - -- The path name of the project directory, for display purposes. May be - -- different from Directory for platforms where the file names are - -- case-insensitive. - Dir_Path : String_Access; - -- Same as Directory, but as an access to String + -- Same as Directory.Name, but as an access to String + + Object_Directory : Path_Information := No_Path_Information; + -- The path name of the object directory of this project file + + Exec_Directory : Path_Information := No_Path_Information; + -- The path name of the exec directory of this project file. Default is + -- equal to Object_Directory. + + ------------- + -- Library -- + ------------- + + Library : Boolean := False; + -- True if this is a library project + + Library_Name : Name_Id := No_Name; + -- If a library project, name of the library + + Library_Kind : Lib_Kind := Static; + -- If a library project, kind of library - Library_Dir : Path_Name_Type := No_Path; + Library_Dir : Path_Information := No_Path_Information; -- If a library project, path name of the directory where the library -- resides. - Display_Library_Dir : Path_Name_Type := No_Path; - -- The path name of the library directory, for display purposes. May be - -- different from Library_Dir for platforms where the file names are - -- case-insensitive. - Library_TS : Time_Stamp_Type := Empty_Time_Stamp; -- The timestamp of a library file in a library project - Library_Src_Dir : Path_Name_Type := No_Path; + Library_Src_Dir : Path_Information := No_Path_Information; -- If a Stand-Alone Library project, path name of the directory where -- the sources of the interfaces of the library are copied. By default, -- if attribute Library_Src_Dir is not specified, sources of the -- interfaces are not copied anywhere. - Display_Library_Src_Dir : Path_Name_Type := No_Path; - -- The path name of the library source directory, for display purposes. - -- May be different from Library_Src_Dir for platforms where the file - -- names are case-insensitive. - - Library_ALI_Dir : Path_Name_Type := No_Path; + Library_ALI_Dir : Path_Information := No_Path_Information; -- In a library project, path name of the directory where the ALI files -- are copied. If attribute Library_ALI_Dir is not specified, ALI files -- are copied in the Library_Dir. - Display_Library_ALI_Dir : Path_Name_Type := No_Path; - -- The path name of the library ALI directory, for display purposes. May - -- be different from Library_ALI_Dir for platforms where the file names - -- are case-insensitive. - - Library : Boolean := False; - -- True if this is a library project - - Library_Name : Name_Id := No_Name; - -- If a library project, name of the library - - Library_Kind : Lib_Kind := Static; - -- If a library project, kind of library - Lib_Internal_Name : Name_Id := No_Name; -- If a library project, internal name store inside the library @@ -1350,12 +1396,17 @@ package Prj is -- For non static Stand-Alone Library Project Files, indicate if -- the library initialisation should be automatic. - Libgnarl_Needed : Yes_No_Unknown := Unknown; - -- Set to True when libgnarl is needed to link - Symbol_Data : Symbol_Record := No_Symbols; -- Symbol file name, reference symbol file name, symbol policy + Need_To_Build_Lib : Boolean := False; + -- Indicates that the library of a Library Project needs to be built or + -- rebuilt. + + ------------- + -- Sources -- + ------------- + Ada_Sources : String_List_Id := Nil_String; -- The list of all the Ada source file names (gnatmake only) @@ -1370,19 +1421,15 @@ package Prj is -- True if attribute Interfaces is declared for the project or any -- project it extends. - Unit_Based_Language_Name : Name_Id := No_Name; - Unit_Based_Language_Index : Language_Index := No_Language_Index; - -- The name and index, if any, of the unit-based language of some - -- sources of the project. There may be only one unit-based language - -- in one project. - Imported_Directories_Switches : Argument_List_Access := null; -- List of the source search switches (-I<source dir>) to be used when -- compiling. Include_Path : String_Access := null; - -- Value of the environment variable to indicate the source search path, - -- instead of a list of switches (Imported_Directories_Switches). + -- The search source path for the project. Used as the value for an + -- environment variable, specified by attribute Include_Path + -- (<language>). The names of the environment variables are in component + -- Include_Path of the records Language_Config. Include_Path_File : Path_Name_Type := No_Path; -- The path name of the of the source search directory file @@ -1390,8 +1437,6 @@ package Prj is Include_Data_Set : Boolean := False; -- Set True when Imported_Directories_Switches or Include_Path are set - Include_Language : Language_Index := No_Language_Index; - Source_Dirs : String_List_Id := Nil_String; -- The list of all the source directories @@ -1400,57 +1445,38 @@ package Prj is -- the ordering of the source subdirs depend on the OS. If True, -- duplicate file names in the same project file are allowed. - Object_Directory : Path_Name_Type := No_Path; - -- The path name of the object directory of this project file - - Display_Object_Dir : Path_Name_Type := No_Path; - -- The path name of the object directory, for display purposes. May be - -- different from Object_Directory for platforms where the file names - -- are case-insensitive. - - Exec_Directory : Path_Name_Type := No_Path; - -- The path name of the exec directory of this project file. Default is - -- equal to Object_Directory. - - Display_Exec_Dir : Path_Name_Type := No_Path; - -- The path name of the exec directory, for display purposes. May be - -- different from Exec_Directory for platforms where the file names are - -- case-insensitive. - - Extends : Project_Id := No_Project; - -- The reference of the project file, if any, that this project file - -- extends. - - Extended_By : Project_Id := No_Project; - -- The reference of the project file, if any, that extends this project - -- file. + Ada_Include_Path : String_Access := null; + -- The cached value of source search path for this project file. Set by + -- the first call to Prj.Env.Ada_Include_Path for the project. Do not + -- use this field directly outside of the project manager, use + -- Prj.Env.Ada_Include_Path instead. - Naming : Naming_Data := Standard_Naming_Data; - -- The naming scheme of this project file + ------------- + -- Linking -- + ------------- - First_Language_Processing : Language_Index := No_Language_Index; - -- First index of the language data in the project + Linker_Name : File_Name_Type := No_File; + -- Value of attribute Language_Processing'Linker in the project file - Decl : Declarations := No_Declarations; - -- The declarations (variables, attributes and packages) of this project - -- file. + Linker_Path : Path_Name_Type := No_Path; + -- Path of linker when attribute Language_Processing'Linker is specified - Imported_Projects : Project_List := Empty_Project_List; - -- The list of all directly imported projects, if any + Minimum_Linker_Options : Name_List_Index := No_Name_List; + -- List of options specified in attribute + -- Language_Processing'Minimum_Linker_Options. - All_Imported_Projects : Project_List := Empty_Project_List; - -- The list of all projects imported directly or indirectly, if any - - Ada_Include_Path : String_Access := null; - -- The cached value of ADA_INCLUDE_PATH for this project file. Do not - -- use this field directly outside of the compiler, use - -- Prj.Env.Ada_Include_Path instead. + ------------------- + -- Miscellaneous -- + ------------------- Ada_Objects_Path : String_Access := null; -- The cached value of ADA_OBJECTS_PATH for this project file. Do not -- use this field directly outside of the compiler, use -- Prj.Env.Ada_Objects_Path instead. + Libgnarl_Needed : Yes_No_Unknown := Unknown; + -- Set to True when libgnarl is needed to link + Objects_Path : String_Access := null; -- The cached value of the object dir path, used during the binding -- phase of gprbuild. @@ -1470,16 +1496,6 @@ package Prj is -- An indication that the configuration pragmas file is a temporary file -- that must be deleted at the end. - Linker_Name : File_Name_Type := No_File; - -- Value of attribute Language_Processing'Linker in the project file - - Linker_Path : Path_Name_Type := No_Path; - -- Path of linker when attribute Language_Processing'Linker is specified - - Minimum_Linker_Options : Name_List_Index := No_Name_List; - -- List of options specified in attribute - -- Language_Processing'Minimum_Linker_Options. - Config_Checked : Boolean := False; -- A flag to avoid checking repetitively the configuration pragmas file @@ -1491,10 +1507,6 @@ package Prj is -- A flag to mark a project as "visited" to avoid processing the same -- project several time. - Need_To_Build_Lib : Boolean := False; - -- Indicates that the library of a Library Project needs to be built or - -- rebuilt. - Depth : Natural := 0; -- The maximum depth of a project in the project graph. Depth of main -- project is 0. @@ -1568,13 +1580,12 @@ package Prj is type Spec_Or_Body is (Specification, Body_Part); type File_Name_Data is record - Name : File_Name_Type := No_File; - Index : Int := 0; - Display_Name : File_Name_Type := No_File; - Path : Path_Name_Type := No_Path; - Display_Path : Path_Name_Type := No_Path; - Project : Project_Id := No_Project; - Needs_Pragma : Boolean := False; + Name : File_Name_Type := No_File; + Index : Int := 0; + Display_Name : File_Name_Type := No_File; + Path : Path_Information := No_Path_Information; + Project : Project_Id := No_Project; + Needs_Pragma : Boolean := False; end record; -- File and Path name of a spec or body |