Commit 0702af52 authored by yoogx's avatar yoogx

* Copy runtime in generated tree

        For issue #84
parent c7da6525
......@@ -1442,6 +1442,19 @@ package body Ocarina.Backends.Build_Utils is
Close (Fd);
Set_Standard_Output;
-- Copy the runtime directory
if Get_Current_Backend_Kind = PolyORB_HI_C then
Copy_Directory
(Get_Runtime_Path ("polyorb-hi-c"), "polyorb-hi-c");
else
if Get_Current_Backend_Kind = PolyORB_HI_Ada then
Copy_Directory
(Get_Runtime_Path ("polyorb-hi-ada"), "polyorb-hi-ada");
end if;
end if;
Leave_Directory;
end if;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-2017 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -219,6 +219,41 @@ package body Ocarina.Backends.Utils is
return Name_Find;
end Remove_Directory_Separator;
--------------------
-- Copy_Directory --
--------------------
procedure Copy_Directory (From : String; Dest : String) is
procedure Process_Entry (Directory_Entry : Directory_Entry_Type) is
begin
case Kind (Full_Name (Directory_Entry)) is
when Ordinary_File =>
Copy_File (Full_Name (Directory_Entry),
Dest & "/"
& Simple_Name (Simple_Name (Directory_Entry)));
when Directory =>
if Simple_Name (Simple_Name (Directory_Entry)) /= "" then
Copy_Directory
(Full_Name (Directory_Entry),
Compose (Dest, Simple_Name (Directory_Entry)));
end if;
when others => null;
end case;
end Process_Entry;
begin
if Kind (From) = Directory then
Create_Path (Dest);
else
raise Program_Error with "Invalid kind for " & From;
end if;
Search (From, "", Process => Process_Entry'Access);
end Copy_Directory;
----------------------------------
-- May_Be_Append_Handling_Entry --
----------------------------------
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-2017 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -68,6 +68,9 @@ package Ocarina.Backends.Utils is
-- If there is a directory separator at the end of the path, then
-- remove it and return the result. Else, return the same string.
procedure Copy_Directory (From : String; Dest : String);
-- Copy directory pointed by 'from' to 'dest'
----------
-- Misc --
----------
......
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