Skip to content

Commit

Permalink
* For AADLv2 runtime files (e.g. drivers), one cannot force relative
Browse files Browse the repository at this point in the history
      path shortcut

    For #248
  • Loading branch information
yoogx committed Mar 2, 2020
1 parent 3b85ace commit 9628920
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/backends/ocarina-backends-build_utils.adb
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ package body Ocarina.Backends.Build_Utils is
-- Split the path made of Filename and Directory into Basename and
-- Dirname (with regular shell interpretations)
--
-- * If Relative_Path is true, we disregard Directory and assume
-- the base directory to be "../.." relative to the generated code
-- directory.
-- * If Relative_Path is true, and if Directory is not Ocarina
-- install directory (case of runtime library elements), then we
-- disregard Directory and assume the base directory to be "../.."
-- relative to the generated code directory.
--
-- * If Relative_Path is false, the full directory path is
-- resolved and is absolute to the user environment.

Expand Down Expand Up @@ -158,8 +160,20 @@ package body Ocarina.Backends.Build_Utils is
Dirname : out Name_Id;
Relative_Path : Boolean := False)
is
Temp_Dirname : Name_Id := No_Name;
AADL_Library_File : Boolean := False;
begin
if Relative_Path then
Temp_Dirname := Get_String_Name
(Normalize_Pathname (Get_Name_String (Directory)) & "/");
if Temp_Dirname = Default_Library_Path then
AADL_Library_File := True;
end if;
end if;

if Relative_Path and then not
AADL_Library_File
then
Set_Str_To_Name_Buffer ("../..");

elsif Directory = No_Name then
Expand Down

0 comments on commit 9628920

Please sign in to comment.