polyorb_hi.gpr.in 7.52 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
------------------------------------------------------------------------------
--                                                                          --
--                          PolyORB HI COMPONENTS                           --
--                                                                          --
--                           P O L Y O R B _ H I                            --
--                                                                          --
--                              P r o j e c t                               --
--                                                                          --
--               Copyright (C) 2007-2008, GET-Telecom Paris.                --
--                                                                          --
-- PolyORB HI is free software; you  can  redistribute  it and/or modify it --
-- under terms of the GNU General Public License as published by the Free   --
-- Software Foundation; either version 2, or (at your option) any later.    --
-- 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. See the GNU General --
-- Public License for more details. You should have received  a copy of the --
-- GNU General Public  License  distributed with PolyORB HI; see file       --
-- COPYING. If not, write  to the Free  Software Foundation, 51 Franklin    --
-- Street, Fifth Floor, Boston, MA 02111-1301, USA.                         --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable  to  be --
-- covered  by the  GNU  General  Public  License.  This exception does not --
-- however invalidate  any other reasons why  the executable file  might be --
-- covered by the  GNU Public License.                                      --
--                                                                          --
--                PolyORB HI is maintained by GET Telecom Paris             --
--                                                                          --
------------------------------------------------------------------------------

project PolyORB_HI is

   type Target_Type is ("NATIVE", "LEON_ORK", "LEON_GNAT", "ERC32", "MARTEOS");
   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.
61 62
                      --@WARNINGS_ARE_ERRORS@"-gnatfy", --  Style warnings
                      --@WARNINGS_ARE_ERRORS@"-gnatwe", --  Warnings are errors
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
                      "-gnat05"  --  Ada 2005 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
82
                       "-O1",       --  Optimisation level 1
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
                       "-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" =>
           for Local_Configuration_Pragmas use "hi-e.adc";
      end case;
   end Compiler;

   -------------
   -- Builder --
   -------------

   package Builder is
      for Global_Configuration_Pragmas use "gnat.adc";

      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
yoogx's avatar
yoogx committed
159 160 161
      for Default_Switches ("ada") use
        ("-r",
         "-T0" -- Force time slice to 0,
162 163
               -- see A.3 of GNAT user Manual for more details
        );
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
   end Binder;

   ------------
   -- Linker --
   ------------

   package Linker is
      case Build is
         when "Debug" =>
            for Default_Switches ("ada") use ("-g");
         when "Release" =>
            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;

yoogx's avatar
yoogx committed
189 190 191 192 193 194 195 196 197 198 199 200
   -----------
   -- Prove --
   -----------

   package Prove is
      for Switches use
          ("--mode=prove",        -- Prove subprogram contracts
                                  -- and absence of run-time errors
           "--report=statistics"  -- Report all results of proving VCs
           );
   end Prove;

201
end PolyORB_HI;