DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦1d59e15c3⟧ Ada Source

    Length: 20480 (0x5000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Compilation_Extensions, seg_0211c0

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Calendar;
with Compilation_Interface;
with Extensions_Support;
with Log;
with Object_Class;
with Profile;
with Utilities;

package body Compilation_Extensions is

    package Ci     renames Compilation_Interface;
    package Du     renames Utilities.Directory_Utilities;
    package Es     renames Extensions_Support;
    package Naming renames Directory.Naming;
    package Rsu    renames Utilities.Rci_Switch_Utilities;
    package Ss     renames Simple_Status;
    package Tdi    renames Target_Dependent_Interface;

    Debugging : Boolean := False;


    function Qt (Str : String) return String is
    begin
        return " => """ & Str & """";
    end Qt;


    procedure Promote_Preprocess
                 (Host_Unit         :        Directory.Object;
                  Remote_Unit_Name  :        String;
                  Remote_Library    :        String;
                  Remote_Machine    :        String;
                  Remote_Directory  :        String;
                  Pre_Options       :        String;
                  Post_Options      :        String;
                  Options_Separator :        String;  
                  Remote_Connection :        Remote_Command_Interface.Context;
                  Is_Secondary      :        Boolean;
                  Status            : in out Simple_Status.Condition) is

        Prereqs : constant Ci.Unit_List :=
           Ci.Promotion_Prerequisites (The_Unit => Host_Unit,  
                                       Response => Profile.Nil);

        With_List : constant Ci.Unit_List :=
           Es.Discard_Units_From_Same_View (Prereqs, Host_Unit);
        -- This is a list of all units in other views that the current host
        -- unit depends upon.

        Unit_Obj         : Directory.Object;
        Current_View_Obj : Directory.Object :=
           Du.Get_View (Host_Unit, Profile.Get);

        Trace_On : constant Boolean := Rsu.Trace_On (Current_View_Obj);

    begin  
        if Trace_On then
            Log.Put_Line (Message =>
                             "#~~Promote_Preprocess (Host_Unit => " &
                                Naming.Unique_Full_Name (Host_Unit) &
                                ", Remote_Unit_Name" & Qt (Remote_Unit_Name) &
                                ", Remote_Library" & Qt (Remote_Library) &
                                ", Remote_Machine" & Qt (Remote_Machine) &
                                ", Remote_Directory" & Qt (Remote_Directory) &
                                ", Pre_Options" & Qt (Pre_Options) &
                                ", Post_Options" & Qt (Post_Options) &
                                ", Option_Separator" & Qt (Options_Separator) &  
                                ", Is_Secondary => " &
                                Boolean'Image (Is_Secondary) & ")",
                          Kind    => Profile.Debug_Msg);
        end if;

        if not Directory."=" (Directory.Get_Class (Host_Unit),
                              Object_Class.Ada) then
            -- Skip any non-Ada objects (like secondarys).  Actually we won't
            -- have been able to get their Promotion_Prerequisites above.
            return;
        end if;

        if Rsu.Is_Host_Only (Current_View_Obj) then
            -- No action if view is Host_Only.
            Ss.Create_Condition (Status, "", "", Ss.Normal);

            return;
        end if;

        --
        -- For each unit U that is in the compilation closure of the unit that
        -- is being compiled, enter a link to the corresponding remote unit
        -- into the current remote library.

        if Ss.Error (Prereqs.Condition) then
            Status := Prereqs.Condition;
            return;
        end if;

        if Trace_On then
            -- Print the names of the prerequisite units.
            for Index in Prereqs.Data'First .. Prereqs.Data'Last loop  
                Unit_Obj := Prereqs.Data (Index);

                Log.Put_Line ("#~~ Prereqs" & Integer'Image (Index) &
                              ": " & Naming.Unique_Full_Name (Unit_Obj),
                              Profile.Note_Msg);
            end loop;
        end if;

        if Ss.Error (With_List.Condition) then
            Status := With_List.Condition;
            return;
        end if;

        -- Set the unit's download time to be the current time.
        Es.Set_Download_Time (Host_Unit, Calendar.Clock);

        if With_List.Size /= 0 then
            -- Import each of the prerequisite units into Host_Unit's remote
            -- directory.
            Es.Import_Units (Imported_Units    => With_List,
                             Into_View         => Current_View_Obj,
                             Remote_Directory  => Remote_Directory,
                             Remote_Connection => Remote_Connection,
                             Status            => Status,
                             Trace_Command     => Trace_On);
        end if;

    exception
        when others =>
            Es.Unhandled_Exception (Status, "Promote_Preprocess");
    end Promote_Preprocess;


    procedure Promote_Postprocess
                 (Host_Unit         :        Directory.Object;
                  Remote_Unit_Name  :        String;
                  Remote_Library    :        String;
                  Remote_Machine    :        String;
                  Remote_Directory  :        String;
                  Pre_Options       :        String;
                  Post_Options      :        String;
                  Options_Separator :        String;  
                  Remote_Connection :        Remote_Command_Interface.Context;
                  Is_Secondary      :        Boolean;
                  Status            : in out Simple_Status.Condition) is
    begin
        if Debugging then
            Log.Put_Line (Message =>
                             "#~~Promote_Postprocess (Host_Unit => " &
                                Naming.Unique_Full_Name (Host_Unit) &
                                ", Remote_Unit_Name" & Qt (Remote_Unit_Name) &
                                ", Remote_Library" & Qt (Remote_Library) &
                                ", Remote_Machine" & Qt (Remote_Machine) &
                                ", Remote_Directory" & Qt (Remote_Directory) &
                                ", Pre_Options" & Qt (Pre_Options) &
                                ", Post_Options" & Qt (Post_Options) &
                                ", Option_Separator" & Qt (Options_Separator) &  
                                ", Is_Secondary => " &
                                Boolean'Image (Is_Secondary) & ")",
                          Kind    => Profile.Debug_Msg);
        end if;

        Simple_Status.Create_Condition (Status, "", "", Simple_Status.Normal);
    end Promote_Postprocess;


    procedure Demote_Preprocess (Host_Unit : Directory.Object;
                                 Remote_Unit_Name : String;
                                 Remote_Library : String;
                                 Remote_Machine : String;
                                 Remote_Directory : String;
                                 Status : in out Simple_Status.Condition) is
    begin  
        if Debugging then
            Log.Put_Line (Message =>
                             "#~~Demote_Preprocess (Host_Unit => " &
                                Naming.Unique_Full_Name (Host_Unit) &
                                ", Remote_Unit_Name" & Qt (Remote_Unit_Name) &
                                ", Remote_Library" & Qt (Remote_Library) &
                                ", Remote_Machine" & Qt (Remote_Machine) &
                                ", Remote_Directory" &
                                Qt (Remote_Directory) & ")",
                          Kind    => Profile.Debug_Msg);
        end if;

        Simple_Status.Create_Condition (Status, "", "", Simple_Status.Normal);
    end Demote_Preprocess;


    procedure Demote_Postprocess (Host_Unit : Directory.Object;
                                  Remote_Unit_Name : String;
                                  Remote_Library : String;
                                  Remote_Machine : String;
                                  Remote_Directory : String;
                                  Status : in out Simple_Status.Condition) is
    begin
        if Debugging then
            Log.Put_Line (Message =>
                             "#~~Demote_Postprocess (Host_Unit => " &
                                Naming.Unique_Full_Name (Host_Unit) &
                                ", Remote_Unit_Name" & Qt (Remote_Unit_Name) &
                                ", Remote_Library" & Qt (Remote_Library) &
                                ", Remote_Machine" & Qt (Remote_Machine) &
                                ", Remote_Directory" &
                                Qt (Remote_Directory) & ")",
                          Kind    => Profile.Debug_Msg);
        end if;

        Simple_Status.Create_Condition (Status, "", "", Simple_Status.Normal);
    end Demote_Postprocess;


    procedure Retrieve_Associated_Files_Preprocess
                 (Host_Unit              : Directory.Object;  
                  Remote_Unit_Name       : String;
                  Remote_Library         : String;
                  Remote_Machine         : String;
                  Remote_Directory       : String;
                  Remote_Connection      : Remote_Command_Interface.Context;
                  The_Retrieve_Condition :
                     Target_Dependent_Interface.Retrieve_Condition;
                  Phases                 : Target_Dependent_Interface.Phase_Map;
                  Status                 : in out Simple_Status.Condition) is
    begin
        if Debugging then
            Log.Put_Line
               (Message =>
                   "#~~Retrieve_Associated_Files_Preprocess (Host_Unit => " &
                      Naming.Unique_Full_Name (Host_Unit) &
                      ", Remote_Unit_Name" & Qt (Remote_Unit_Name) &
                      ", Remote_Library" & Qt (Remote_Library) &
                      ", Remote_Machine" & Qt (Remote_Machine) &
                      ", Remote_Directory" & Qt (Remote_Directory) &
                      ", The_Retrieve_Condition => " &
                      Tdi.Retrieve_Condition'Image (The_Retrieve_Condition) &
                      ", Phases => " &  
                      Boolean'Image (Phases (Tdi.Promote)) & ")",
                Kind    => Profile.Debug_Msg);
        end if;

        Simple_Status.Create_Condition (Status, "", "", Simple_Status.Normal);
    end Retrieve_Associated_Files_Preprocess;


    procedure Retrieve_Associated_Files_Postprocess
                 (Host_Unit              : Directory.Object;  
                  Remote_Unit_Name       : String;
                  Remote_Library         : String;
                  Remote_Machine         : String;
                  Remote_Directory       : String;  
                  Remote_Connection      : Remote_Command_Interface.Context;
                  The_Retrieve_Condition :
                     Target_Dependent_Interface.Retrieve_Condition;
                  Phases                 : Target_Dependent_Interface.Phase_Map;
                  Status                 : in out Simple_Status.Condition) is
    begin
        if Debugging then
            Log.Put_Line
               (Message =>
                   "#~~Retrieve_Associated_Files_Postprocess (Host_Unit => " &
                      Naming.Unique_Full_Name (Host_Unit) &
                      ", Remote_Unit_Name" & Qt (Remote_Unit_Name) &
                      ", Remote_Library" & Qt (Remote_Library) &
                      ", Remote_Machine" & Qt (Remote_Machine) &
                      ", Remote_Directory" & Qt (Remote_Directory) &
                      ", The_Retrieve_Condition => " &
                      Tdi.Retrieve_Condition'Image (The_Retrieve_Condition) &
                      ", Phases => " &  
                      Boolean'Image (Phases (Tdi.Promote)) & ")",
                Kind    => Profile.Debug_Msg);
        end if;

        Simple_Status.Create_Condition (Status, "", "", Simple_Status.Normal);
    end Retrieve_Associated_Files_Postprocess;


    function Build_Default_Target_Name
                (Host_Unit     : Directory.Object;
                 Suffix_Type   : Target_Dependent_Interface.Suffix_Type;
                 Serial_Number : Positive) return String is
    begin
        if Debugging then
            Log.Put_Line (Message =>
                             "#~~Build_Default_Target_Name (Host_Unit => " &
                                Naming.Unique_Full_Name (Host_Unit) &
                                ", Suffix_Type => " &
                                Tdi.Suffix_Type'Image (Suffix_Type) &
                                ", Serial_Number =>" &
                                Integer'Image (Serial_Number) & ")",
                          Kind    => Profile.Debug_Msg);
        end if;

        return "";
    end Build_Default_Target_Name;


    procedure Change_Remote_Context_Preprocess
                 (Remote_Directory  :        String;
                  Remote_Library    :        String;
                  Remote_Connection :        Remote_Command_Interface.Context;
                  Status            : in out Simple_Status.Condition) is

        Exists : Boolean := True;
    begin
        Log.Put_Line
           (Message => "#~~Change_Remote_Context_Preprocess (Remote_Directory" &
                          Qt (Remote_Directory) & ", Remote_Library" &
                          Qt (Remote_Library) & ")",
            Kind    => Profile.Debug_Msg);

        -- Make sure that the remote context exists.  This will use the
        -- "test -d" command, which will fail on the Lynx if
        -- Remote_Directory doesn't exist.  In the LynxOS shell (dlsh),
        -- the set-context command "cd" won't necessarily fail in that
        -- case, because it backs up through subdirectories (with the
        -- message "...trying . . . ") until it finds one that exists
        -- (which isn't at all what we want).
        Remote_Command_Interface.File_Exists
           (The_File          => Remote_Directory,
            Remote_Connection => Remote_Connection,
            Status            => Status,
            Exists            => Exists,
            Trace_Command     => Debugging);

        if not Ss.Error (Status) then
            if not Exists then
                Log.Put_Line (Message => "Can't set the remote context to """ &
                                            Remote_Directory &
                                            """. That directory doesn't exist",
                              Kind    => Profile.Error_Msg);
                Es.Set_Status ("Remote directory """ &
                               Remote_Directory & """ does not exist", Status);
            end if;
        end if;

    exception
        when others =>
            Es.Unhandled_Exception (Status, "Change_Remote_Context_Preprocess");
    end Change_Remote_Context_Preprocess;


    procedure Change_Remote_Context_Postprocess
                 (Remote_Directory  :        String;
                  Remote_Library    :        String;
                  Remote_Connection :        Remote_Command_Interface.Context;
                  Status            : in out Simple_Status.Condition) is
    begin
        if Debugging then
            Log.Put_Line
               (Message =>
                   "#~~Change_Remote_Context_Postprocess (Remote_Directory" &
                      Qt (Remote_Directory) & ", Remote_Library" &
                      Qt (Remote_Library) & ")",
                Kind    => Profile.Debug_Msg);
        end if;

        Simple_Status.Create_Condition (Status, "", "", Simple_Status.Normal);
    end Change_Remote_Context_Postprocess;

end Compilation_Extensions;

E3 Meta Data

    nblk1=13
    nid=0
    hdr6=26
        [0x00] rec0=22 rec1=00 rec2=01 rec3=030
        [0x01] rec0=00 rec1=00 rec2=13 rec3=02c
        [0x02] rec0=15 rec1=00 rec2=02 rec3=088
        [0x03] rec0=01 rec1=00 rec2=12 rec3=000
        [0x04] rec0=12 rec1=00 rec2=03 rec3=054
        [0x05] rec0=1b rec1=00 rec2=04 rec3=01a
        [0x06] rec0=17 rec1=00 rec2=05 rec3=05e
        [0x07] rec0=18 rec1=00 rec2=06 rec3=044
        [0x08] rec0=12 rec1=00 rec2=07 rec3=000
        [0x09] rec0=11 rec1=00 rec2=08 rec3=064
        [0x0a] rec0=15 rec1=00 rec2=09 rec3=026
        [0x0b] rec0=15 rec1=00 rec2=0a rec3=028
        [0x0c] rec0=15 rec1=00 rec2=0b rec3=038
        [0x0d] rec0=12 rec1=00 rec2=0c rec3=040
        [0x0e] rec0=15 rec1=00 rec2=0d rec3=088
        [0x0f] rec0=18 rec1=00 rec2=0e rec3=01a
        [0x10] rec0=13 rec1=00 rec2=0f rec3=07a
        [0x11] rec0=18 rec1=00 rec2=10 rec3=028
        [0x12] rec0=09 rec1=00 rec2=11 rec3=000
    tail 0x2151caf18838d6ae2c7f6 0x42a00088462065003