File: common.gpr

package info (click to toggle)
opentoken 4.0b-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,812 kB
  • ctags: 57
  • sloc: ada: 12,643; makefile: 129; java: 37; sh: 6
file content (88 lines) | stat: -rw-r--r-- 2,621 bytes parent folder | download | duplicates (2)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
-- Common settings
project Common is

   for Source_Dirs use (); -- avoids spurious error about "no Ada sources"

   type Build_Type is ("Developer", "User");

   Build : Build_Type := External ("BUILD", "User");

   type Lib_Type is ("static", "dynamic");

   Libtype : Lib_Type := external ("LIBTYPE", "dynamic");

   package Compiler is
      -- Switches for gcc

      Style_Checks := "-gnaty3abcefhiklM120nprtx";

      --  -gnatVa causes some inline procedures to be non-inlineable;
      --  suppress that warning with -gnatwP.
      Debug_Switches :=
        --  Switches we always use
        ("-g",
         "-O0",
         "-gnat05",
         "-gnatfoqQ",
         "-gnatVa",
         "-gnatwaeLP",
         "-fstack-check");

      --  AdaCore recommends -O2 -gnatn instead of -O3; -O3 includes
      --  "potentially unsafe and disruptive optimizations". We include
      --  -fstack-check because it catches hard-to-find bugs, and the
      --  processors are so fast.
      Release_Switches :=
        ("-g",
         "-O2",
         "-gnat05",
         "-gnatfnoqQ",
         "-gnatwaeL",
         "-fstack-check");

      --  The project file syntax does not let us set a variable in a
      --  case statement. So we set the Default_Switches attribute to
      --  contain the version-dependent switches. This is then
      --  accessible in child project files via 'Default_Switches.

      case Build is
         when "Developer" =>
            -- -gnatyO requires patching the compiler runtime source
            -- It is not valid for GNAT 4.x and earlier
            for Default_Switches ("Ada") use ("-gnatyO");

         when "User" =>

      end case;

   end Compiler;

   --  In user project files, normally use this:
   --  package Compiler is
   --  for Default_Switches ("Ada") use
   --     Standard_Common.Compiler.Release_Switches &
   --     Standard_Common.Compiler.Style_Checks &
   --     Standard_Common.Compiler'Default_Switches ("Ada");
   --  end Compiler;

   package Builder is
      --  Switches for gnatmake
      for Default_Switches ("Ada") use ("-C");
   end Builder;

   --  In user project files, normally use this:
   --  package Builder is
   --     for Default_Switches ("Ada") use Standard_Common.Builder'Default_Switches ("Ada");
   --  end Builder;

   package Binder is
      --  Switches for gnatbind
      for Default_Switches ("Ada") use ("-E");
   end Binder;

   --  In user project files, normally use this:
   --  package Binder is
   --     for Default_Switches ("Ada") use Standard_Common.Binder'Default_Switches ("Ada");
   --  end Binder;

end Common;