- Obj_Dir : Path_Name_Type;
- Extending : Project_Id;
- Extending2 : Project_Id;
- Packages : Package_Id;
- Element : Package_Element;
-
- procedure Process_Attributes (Attrs : Variable_Id);
-
- ------------------------
- -- Process_Attributes --
- ------------------------
-
- procedure Process_Attributes (Attrs : Variable_Id) is
- Attribute_Id : Variable_Id;
- Attribute : Variable;
- List : String_List_Id;
-
- begin
- -- Loop through attributes
-
- Attribute_Id := Attrs;
- while Attribute_Id /= No_Variable loop
- Attribute :=
- In_Tree.Variable_Elements.Table (Attribute_Id);
-
- if not Attribute.Value.Default then
- case Attribute.Name is
- when Snames.Name_Driver =>
-
- -- Attribute Linker'Driver: the default linker to use
-
- In_Tree.Config.Linker :=
- Path_Name_Type (Attribute.Value.Value);
-
- when Snames.Name_Required_Switches =>
-
- -- Attribute Linker'Required_Switches: the minimum
- -- options to use when invoking the linker
-
- Put (Into_List =>
- In_Tree.Config.Minimum_Linker_Options,
- From_List => Attribute.Value.Values,
- In_Tree => In_Tree);
-
- when Snames.Name_Executable_Suffix =>
-
- -- Attribute Executable_Suffix: the suffix of the
- -- executables.
-
- In_Tree.Config.Executable_Suffix :=
- Attribute.Value.Value;
-
- when Snames.Name_Library_Builder =>
-
- -- Attribute Library_Builder: the application to invoke
- -- to build libraries.
-
- In_Tree.Config.Library_Builder :=
- Path_Name_Type (Attribute.Value.Value);
-
- when Snames.Name_Archive_Builder =>
-
- -- Attribute Archive_Builder: the archive builder
- -- (usually "ar") and its minimum options (usually "cr").
-
- List := Attribute.Value.Values;
-
- if List = Nil_String then
- Error_Msg
- ("archive builder cannot be null",
- Attribute.Value.Location);
- end if;
-
- Put (Into_List => In_Tree.Config.Archive_Builder,
- From_List => List,
- In_Tree => In_Tree);
-
- when Snames.Name_Archive_Indexer =>
-
- -- Attribute Archive_Indexer: the optional archive
- -- indexer (usually "ranlib") with its minimum options
- -- (usually none).
-
- List := Attribute.Value.Values;
-
- if List = Nil_String then
- Error_Msg
- ("archive indexer cannot be null",
- Attribute.Value.Location);
- end if;
-
- Put (Into_List => In_Tree.Config.Archive_Indexer,
- From_List => List,
- In_Tree => In_Tree);
-
- when Snames.Name_Library_Partial_Linker =>
-
- -- Attribute Library_Partial_Linker: the optional linker
- -- driver with its minimum options, to partially link
- -- archives.
-
- List := Attribute.Value.Values;
-
- if List = Nil_String then
- Error_Msg
- ("partial linker cannot be null",
- Attribute.Value.Location);
- end if;
-
- Put (Into_List => In_Tree.Config.Lib_Partial_Linker,
- From_List => List,
- In_Tree => In_Tree);
-
- when Snames.Name_Archive_Suffix =>
- In_Tree.Config.Archive_Suffix :=
- File_Name_Type (Attribute.Value.Value);
-
- when Snames.Name_Linker_Executable_Option =>
-
- -- Attribute Linker_Executable_Option: optional options
- -- to specify an executable name. Defaults to "-o".
-
- List := Attribute.Value.Values;
-
- if List = Nil_String then
- Error_Msg
- ("linker executable option cannot be null",
- Attribute.Value.Location);
- end if;
-
- Put (Into_List =>
- In_Tree.Config.Linker_Executable_Option,
- From_List => List,
- In_Tree => In_Tree);
-
- when Snames.Name_Linker_Lib_Dir_Option =>
-
- -- Attribute Linker_Lib_Dir_Option: optional options
- -- to specify a library search directory. Defaults to
- -- "-L".
-
- Get_Name_String (Attribute.Value.Value);
-
- if Name_Len = 0 then
- Error_Msg
- ("linker library directory option cannot be empty",
- Attribute.Value.Location);
- end if;
-
- In_Tree.Config.Linker_Lib_Dir_Option :=
- Attribute.Value.Value;
-
- when Snames.Name_Linker_Lib_Name_Option =>
-
- -- Attribute Linker_Lib_Name_Option: optional options
- -- to specify the name of a library to be linked in.
- -- Defaults to "-l".
-
- Get_Name_String (Attribute.Value.Value);
-
- if Name_Len = 0 then
- Error_Msg
- ("linker library name option cannot be empty",
- Attribute.Value.Location);
- end if;
-
- In_Tree.Config.Linker_Lib_Name_Option :=
- Attribute.Value.Value;
-
- when Snames.Name_Run_Path_Option =>
-
- -- Attribute Run_Path_Option: optional options to
- -- specify a path for libraries.
-
- List := Attribute.Value.Values;
-
- if List /= Nil_String then
- Put (Into_List => In_Tree.Config.Run_Path_Option,
- From_List => List,
- In_Tree => In_Tree);
- end if;
-
- when Snames.Name_Library_Support =>
- declare
- pragma Unsuppress (All_Checks);
- begin
- In_Tree.Config.Lib_Support :=
- Library_Support'Value (Get_Name_String
- (Attribute.Value.Value));
- exception
- when Constraint_Error =>
- Error_Msg
- ("invalid value """ &
- Get_Name_String (Attribute.Value.Value) &
- """ for Library_Support",
- Attribute.Value.Location);
- end;
-
- when Snames.Name_Shared_Library_Prefix =>
- In_Tree.Config.Shared_Lib_Prefix :=
- File_Name_Type (Attribute.Value.Value);
-
- when Snames.Name_Shared_Library_Suffix =>
- In_Tree.Config.Shared_Lib_Suffix :=
- File_Name_Type (Attribute.Value.Value);
-
- when Snames.Name_Symbolic_Link_Supported =>
- declare
- pragma Unsuppress (All_Checks);
- begin
- In_Tree.Config.Symbolic_Link_Supported :=
- Boolean'Value (Get_Name_String
- (Attribute.Value.Value));
- exception
- when Constraint_Error =>
- Error_Msg
- ("invalid value """ &
- Get_Name_String (Attribute.Value.Value) &
- """ for Symbolic_Link_Supported",
- Attribute.Value.Location);
- end;
-
- when Snames.Name_Library_Major_Minor_Id_Supported =>
- declare
- pragma Unsuppress (All_Checks);
- begin
- In_Tree.Config.Lib_Maj_Min_Id_Supported :=
- Boolean'Value (Get_Name_String
- (Attribute.Value.Value));
- exception
- when Constraint_Error =>
- Error_Msg
- ("invalid value """ &
- Get_Name_String (Attribute.Value.Value) &
- """ for Library_Major_Minor_Id_Supported",
- Attribute.Value.Location);
- end;
-
- when Snames.Name_Library_Auto_Init_Supported =>
- declare
- pragma Unsuppress (All_Checks);
- begin
- In_Tree.Config.Auto_Init_Supported :=
- Boolean'Value (Get_Name_String
- (Attribute.Value.Value));
- exception
- when Constraint_Error =>
- Error_Msg
- ("invalid value """ &
- Get_Name_String (Attribute.Value.Value) &
- """ for Library_Auto_Init_Supported",
- Attribute.Value.Location);
- end;
-
- when Snames.Name_Shared_Library_Minimum_Switches =>
- List := Attribute.Value.Values;
-
- if List /= Nil_String then
- Put (Into_List =>
- In_Tree.Config.Shared_Lib_Min_Options,
- From_List => List,
- In_Tree => In_Tree);
- end if;
-
- when Snames.Name_Library_Version_Switches =>
- List := Attribute.Value.Values;
-
- if List /= Nil_String then
- Put (Into_List =>
- In_Tree.Config.Lib_Version_Options,
- From_List => List,
- In_Tree => In_Tree);
- end if;
-
- when others =>
- null;
- end case;
- end if;
-
- Attribute_Id := Attribute.Next;
- end loop;
- end Process_Attributes;
-