------------------------------------------------------------------------------ -- -- -- PolyORB HI COMPONENTS -- -- -- -- P O L Y O R B _ H I -- -- -- -- P r o j e c t -- -- -- -- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2017 ESA & ISAE. -- -- -- -- PolyORB-HI is free software; you can redistribute it and/or modify under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. PolyORB-HI is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- . -- -- -- -- PolyORB-HI/Ada is maintained by the TASTE project -- -- (taste-users@lists.tuxfamily.org) -- -- -- ------------------------------------------------------------------------------ project PolyORB_HI is type Target_Type is ("NATIVE", "LEON_ORK", "LEON_GNAT", "ERC32", "MARTEOS", "GNAT_Runtime", "RTEMS"); Target : Target_Type := external ("TARGET", "NATIVE"); type Build_Type is ("Debug", "Release", "Analyzable"); Build : Build_Type := external ("BUILD", "Debug"); type Call_Graph_Control is ("Yes", "No"); CG_Control : Call_Graph_Control := external ("CGCTRL", "No"); for Languages use ("Ada"); for Source_Dirs use (); for Object_Dir use "."; for Exec_Dir use "."; -------------- -- Compiler -- -------------- Common_Options := ( "-gnatwa", -- All warnings are displayed -- The flags below are activated only in debug -- mode. In release mode, we do not want -- warnings to be errors. The flags below -- should not be the last flags given to -- Common_Options. --@WARNINGS_ARE_ERRORS@"-gnatfy", -- Style warnings --@WARNINGS_ARE_ERRORS@"-gnatwe", -- Warnings are errors "-gnatwG", -- Suppress warnings on unrecognized pragmas "-gnat12" -- Ada 2012 mode ); Debug_Options := ( "-g", -- Debug information "-O1", -- Optimisation level 1 "-gnata", -- pragma Debug and Assert activated "-gnato" -- Overflow checks enabled ); Output_CG := "-fcallgraph-info=su"; -- Generate call graph informations for GNATStack Release_Options := ( "-gnatp" -- Suppress all checks ); Analyze_Options := ( "-g", -- Debug information "-O1", -- Optimisation level 1 "-gnatp" -- Suppress all checks ); package Compiler is case Build is when "Debug" => -- Some Ada compilers do not support the call graph -- output useful for GNATStack. case CG_Control is when "Yes" => case Target is when "LEON_GNAT" => for Default_Switches ("Ada") use Common_Options & Debug_Options & Output_CG & "-fpreserve-control-flow"; when others => for Default_Switches ("Ada") use Common_Options & Debug_Options & Output_CG; end case; when "No" => case Target is when "LEON_GNAT" => for Default_Switches ("Ada") use Common_Options & Debug_Options & "-fpreserve-control-flow"; when others => for Default_Switches ("Ada") use Common_Options & Debug_Options; end case; end case; when "Release" => for Default_Switches ("Ada") use Common_Options & Release_Options; when "Analyzable" => for Default_Switches ("Ada") use Common_Options & Analyze_Options; end case; case Target is when "NATIVE" | "MARTEOS" => for Local_Configuration_Pragmas use "native.adc"; when "LEON_ORK" | "LEON_GNAT" | "ERC32" | "RTEMS" => for Local_Configuration_Pragmas use "hi-e.adc"; when "GNAT_Runtime" => for Local_Configuration_Pragmas use "gnat_runtime.adc"; end case; end Compiler; ------------- -- Builder -- ------------- package Builder is case Build is when "Debug" => for Default_Switches ("Ada") use ("-s", "-m", "-g"); when "Release" => -- In Release mode, we build all the program from scratch -- to suppress debug information and all checks even from -- the Ada and GNAT runtimes. for Default_Switches ("Ada") use ("-a", "-f", "-x"); when "Analyzable" => for Default_Switches ("Ada") use ("-a", "-f", "-x"); end case; end Builder; ------------ -- Binder -- ------------ package Binder is for Default_Switches ("ada") use ("-r", "-T0" -- Force time slice to 0, -- see A.3 of GNAT user Manual for more details ); end Binder; ------------ -- Linker -- ------------ package Linker is case Build is when "Debug" => case Target is when "GNAT_Runtime" => -- For GNAT runtimes, we clean up unused symbols. -- Unfortunately, this does not work for macOS -- because of clang linker. for Default_Switches ("ada") use ("-g", "-Wl,--gc-sections"); when others => for Default_Switches ("ada") use ("-g"); end case; when "Release" | "Analyzable" => null; end case; end Linker; ----------- -- Check -- ----------- package Check is for Default_Switches ("ada") use ("-rules", "-ALL", "+RGoto", "+RSlices", "+RDecl_Blocks", "+RDiscr_Rec", "+RContr_Types"); end Check; ----------- -- Prove -- ----------- package Prove is for Switches use ("--warnings=continue", -- Issue warnings and continue "--report=all" -- Report all results of proving VCs ); end Prove; end PolyORB_HI;