Commit 09d30d8f authored by yoogx's avatar yoogx

* Add USER_ENV property, used to pass specific env. variable

          as part of the build process

          For issue openaadl/ocarina#110
parent 81cb8465
...@@ -66,6 +66,11 @@ property set Deployment is ...@@ -66,6 +66,11 @@ property set Deployment is
applies to (device); applies to (device);
-- List execution platforms supported by a particular driver -- List execution platforms supported by a particular driver
USER_ENV: aadlstring applies to (processor);
-- Additional configuration parameters passed as environment
-- variables as part of the build phase. These env. variables are
-- passed in the generated makefiles.
Runtime : type enumeration Runtime : type enumeration
(PolyORB_HI_C, (PolyORB_HI_C,
PolyORB_HI_Ada, PolyORB_HI_Ada,
......
...@@ -1585,6 +1585,19 @@ package body Ocarina.Backends.Build_Utils is ...@@ -1585,6 +1585,19 @@ package body Ocarina.Backends.Build_Utils is
M.Use_Scade, M.Use_Scade,
M.Scade_Directory); M.Scade_Directory);
-- Add user-defined environment variable
declare
Env : constant Name_Id := Get_USER_ENV
(Get_Bound_Processor (E));
begin
if Env /= No_Name then
Write_Str ("export ");
Write_Name (Env);
Write_Eol;
end if;
end;
-- Add rule to compile the C files, if any -- Add rule to compile the C files, if any
Write_Eol; Write_Eol;
......
...@@ -189,8 +189,9 @@ package body Ocarina.Backends.Properties is ...@@ -189,8 +189,9 @@ package body Ocarina.Backends.Properties is
------------------------------------ ------------------------------------
Ada_Runtime : Name_Id; Ada_Runtime : Name_Id;
User_CFLAGS : Name_Id; USER_CFLAGS : Name_Id;
User_LDFLAGS : Name_Id; USER_LDFLAGS : Name_Id;
USER_ENV : Name_Id;
Location : Name_Id; Location : Name_Id;
Execution_Platform : Name_Id; Execution_Platform : Name_Id;
Scheduler_Quantum : Name_Id; Scheduler_Quantum : Name_Id;
...@@ -2508,6 +2509,17 @@ package body Ocarina.Backends.Properties is ...@@ -2508,6 +2509,17 @@ package body Ocarina.Backends.Properties is
return Get_String_Property (P, USER_LDFLAGS); return Get_String_Property (P, USER_LDFLAGS);
end Get_USER_LDFLAGS; end Get_USER_LDFLAGS;
------------------
-- Get_USER_ENV --
------------------
function Get_USER_ENV (P : Node_Id) return Name_Id is
pragma Assert
(AINU.Is_Processor (P) or else AINU.Is_Virtual_Processor (P));
begin
return Get_String_Property (P, USER_ENV);
end Get_USER_ENV;
----------------------- -----------------------
-- Get_Transport_API -- -- Get_Transport_API --
----------------------- -----------------------
...@@ -2910,6 +2922,7 @@ package body Ocarina.Backends.Properties is ...@@ -2910,6 +2922,7 @@ package body Ocarina.Backends.Properties is
Ada_Runtime := Get_String_Name ("deployment::ada_runtime"); Ada_Runtime := Get_String_Name ("deployment::ada_runtime");
USER_CFLAGS := Get_String_Name ("deployment::user_cflags"); USER_CFLAGS := Get_String_Name ("deployment::user_cflags");
USER_LDFLAGS := Get_String_Name ("deployment::user_ldflags"); USER_LDFLAGS := Get_String_Name ("deployment::user_ldflags");
USER_ENV := Get_String_Name ("deployment::user_env");
Location := Get_String_Name ("deployment::location"); Location := Get_String_Name ("deployment::location");
Execution_Platform := Get_String_Name ("deployment::execution_platform"); Execution_Platform := Get_String_Name ("deployment::execution_platform");
Scheduler_Quantum := Get_String_Name ("scheduler_quantum"); Scheduler_Quantum := Get_String_Name ("scheduler_quantum");
......
...@@ -579,7 +579,10 @@ package Ocarina.Backends.Properties is ...@@ -579,7 +579,10 @@ package Ocarina.Backends.Properties is
function Get_USER_CFLAGS (P : Node_Id) return Name_Id; function Get_USER_CFLAGS (P : Node_Id) return Name_Id;
function Get_USER_LDFLAGS (P : Node_Id) return Name_Id; function Get_USER_LDFLAGS (P : Node_Id) return Name_Id;
-- Return USER_CFLAGS and USER_LDFLGAS property for processor P -- Return USER_CFLAGS and USER_LDFLAGS property for processor P
function Get_USER_ENV (P : Node_Id) return Name_Id;
-- Return USER_ENV property
function Get_Location (P : Node_Id) return Name_Id; function Get_Location (P : Node_Id) return Name_Id;
-- Return the location of the processor or device P. No_Name is -- Return the location of the processor or device P. No_Name is
......
...@@ -95,6 +95,9 @@ property set Deployment is ...@@ -95,6 +95,9 @@ property set Deployment is
Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform
applies to (device); applies to (device);
USER_ENV : aadlstring
applies to (processor);
Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK); Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK);
Supported_Runtime : Deployment::Runtime Supported_Runtime : Deployment::Runtime
...@@ -410,7 +413,8 @@ end POK; ...@@ -410,7 +413,8 @@ end POK;
package Base_Types package Base_Types
public with data_model; public
with data_model;
data Boolean data Boolean
properties properties
...@@ -968,7 +972,8 @@ end Replication_Properties; ...@@ -968,7 +972,8 @@ end Replication_Properties;
package RMAAadl package RMAAadl
public with Deployment; public
with Deployment;
subprogram Hello_Spg_1 subprogram Hello_Spg_1
properties properties
......
...@@ -95,6 +95,9 @@ property set Deployment is ...@@ -95,6 +95,9 @@ property set Deployment is
Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform
applies to (device); applies to (device);
USER_ENV : aadlstring
applies to (processor);
Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK); Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK);
Supported_Runtime : Deployment::Runtime Supported_Runtime : Deployment::Runtime
...@@ -410,7 +413,8 @@ end POK; ...@@ -410,7 +413,8 @@ end POK;
package Base_Types package Base_Types
public with data_model; public
with data_model;
data Boolean data Boolean
properties properties
...@@ -968,7 +972,8 @@ end Replication_Properties; ...@@ -968,7 +972,8 @@ end Replication_Properties;
package RMAAadl package RMAAadl
public with Deployment; public
with Deployment;
subprogram Hello_Spg_1 subprogram Hello_Spg_1
properties properties
......
...@@ -95,6 +95,9 @@ property set Deployment is ...@@ -95,6 +95,9 @@ property set Deployment is
Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform
applies to (device); applies to (device);
USER_ENV : aadlstring
applies to (processor);
Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK); Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK);
Supported_Runtime : Deployment::Runtime Supported_Runtime : Deployment::Runtime
...@@ -410,7 +413,8 @@ end POK; ...@@ -410,7 +413,8 @@ end POK;
package Base_Types package Base_Types
public with data_model; public
with data_model;
data Boolean data Boolean
properties properties
...@@ -968,7 +972,8 @@ end Replication_Properties; ...@@ -968,7 +972,8 @@ end Replication_Properties;
package RMAAadl package RMAAadl
public with Deployment; public
with Deployment;
subprogram Hello_Spg_1 subprogram Hello_Spg_1
properties properties
......
...@@ -95,6 +95,9 @@ property set Deployment is ...@@ -95,6 +95,9 @@ property set Deployment is
Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform
applies to (device); applies to (device);
USER_ENV : aadlstring
applies to (processor);
Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK); Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK);
Supported_Runtime : Deployment::Runtime Supported_Runtime : Deployment::Runtime
...@@ -410,7 +413,8 @@ end POK; ...@@ -410,7 +413,8 @@ end POK;
package Base_Types package Base_Types
public with data_model; public
with data_model;
data Boolean data Boolean
properties properties
...@@ -968,7 +972,8 @@ end Replication_Properties; ...@@ -968,7 +972,8 @@ end Replication_Properties;
package RMAAadl package RMAAadl
public with Deployment; public
with Deployment;
subprogram Hello_Spg_1 subprogram Hello_Spg_1
properties properties
......
...@@ -95,6 +95,9 @@ property set Deployment is ...@@ -95,6 +95,9 @@ property set Deployment is
Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform
applies to (device); applies to (device);
USER_ENV : aadlstring
applies to (processor);
Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK); Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK);
Supported_Runtime : Deployment::Runtime Supported_Runtime : Deployment::Runtime
...@@ -410,7 +413,8 @@ end POK; ...@@ -410,7 +413,8 @@ end POK;
package Base_Types package Base_Types
public with data_model; public
with data_model;
data Boolean data Boolean
properties properties
...@@ -968,7 +972,8 @@ end Replication_Properties; ...@@ -968,7 +972,8 @@ end Replication_Properties;
package RMAAadl package RMAAadl
public with Deployment; public
with Deployment;
subprogram Hello_Spg_1 subprogram Hello_Spg_1
properties properties
......
...@@ -91,6 +91,9 @@ property set Deployment is ...@@ -91,6 +91,9 @@ property set Deployment is
Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform Supported_Execution_Platform : list of Deployment::Allowed_Execution_Platform
applies to (device); applies to (device);
USER_ENV : aadlstring
applies to (processor);
Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK); Runtime : type enumeration (PolyORB_HI_C, PolyORB_HI_Ada, POK);
Supported_Runtime : Deployment::Runtime Supported_Runtime : Deployment::Runtime
...@@ -406,7 +409,8 @@ end POK; ...@@ -406,7 +409,8 @@ end POK;
package Base_Types package Base_Types
public with data_model; public
with data_model;
data Boolean data Boolean
properties properties
...@@ -964,7 +968,8 @@ end Replication_Properties; ...@@ -964,7 +968,8 @@ end Replication_Properties;
package PartitionedSystemExample package PartitionedSystemExample
public with ARINC653; public
with ARINC653;
data integer data integer
end integer; end integer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment