File: common.gpr

package info (click to toggle)
asis 2019-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 13,848 kB
  • sloc: ada: 156,772; makefile: 296; sh: 81; xml: 48; csh: 10
file content (118 lines) | stat: -rw-r--r-- 4,421 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
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
------------------------------------------------------------------------------
--                                                                          --
--                     ASIS UTILITY LIBRARY COMPONENTS                      --
--                                                                          --
--                                 A S I S                                  --
--                                                                          --
--                    Copyright (C) 2004-2016, AdaCore                      --
--                                                                          --
-- Asis Utility Library (ASIS UL) 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 version.  ASIS UL  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 GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 59 Temple Place  --
--  - Suite 330, Boston,                                                    --
--                                                                          --
-- ASIS UL is maintained by ACT Europe (http://www.act-europe.fr).          --
--                                                                          --
------------------------------------------------------------------------------

abstract project Common is

   for Source_Dirs use ();

   type Bld_Type is ("prod", "debug");
   Bld : Bld_Type := external ("BLD", "prod");

   type Components is ("lib", "tools", "toolsdev");
   --  The components to build:
   --  "lib"      : asis library and asistant
   --  "tools"    : all asis tools (also build asis library)
   --  "toolsdev" : extra tools for the developers (also build asis library)

   Comps : Components := external ("ASIS_COMPONENTS", "tools");

   type Use_GNSA is ("no", "yes");
   GNSA : Use_GNSA := external ("GNSA", "no");

   type OS_Type is ("default_Unix", "powerpc_aix", "pa_hpux");
   OS : OS_Type := external ("OPSYS", "default_Unix");

   Ada_Strict_Switches :=
     ("-gnatf",
      "-gnatwae",
      "-gnatw.g", -- gnat standard warnings
      "-gnatw.u",
      "-gnatyg"); -- gnat style checks
   Ada_Relaxed_Switches :=
     ("-gnatf",
      "-gnatws");

   Adaflags := External_As_List ("ADAFLAGS", " ");
   Ldflags := External_As_List ("LDFLAGS", " ");

   Processors := External ("PROCESSORS", "1");

   Asis_Soversion := External ("soversion", "");
   --  "" means that we require static linking.

   package Builder is
      case Bld is
         when "debug" =>
            for Default_Switches ("ada")
              use Ada_Strict_Switches & ("-m", "-g", "-k");
         when "prod" =>
            null;
      end case;

      for Default_Switches ("ada")
        use Builder'Default_Switches ("ada") & ("-j" & Processors);
   end Builder;

   package Compiler is

      case Bld is
         when "prod" =>
            for Default_Switches ("ada") use Ada_Relaxed_Switches & ("-O2");
         when "debug" =>
            for Default_Switches ("ada")
              use Ada_Strict_Switches &
                ("-O0",
                 "-gnata",
                 "-g");
      end case;

      case OS is
         when "powerpc_aix" =>
            for Default_Switches ("ada") use
              Compiler'Default_Switches ("ada") & ("-mminimal-toc");
         when "pa_hpux" =>
            for Default_Switches ("ada") use
              Compiler'Default_Switches ("ada") & ("-mdisable-indexing");
         when others =>
            null;
      end case;

      --  Put ADAFLAGS last so that they take priority.
      for Default_Switches ("Ada") use Compiler'Default_switches ("Ada")
        & Adaflags;
   end Compiler;

   package Linker is
      --  Put LDFLAGS first so that they affect libraries.
      for Leading_Switches ("Ada") use Ldflags;
   end Linker;

   package Binder is
      for Default_Switches ("ada") use ("-static");
   end Binder;

   package Ide is
      for Vcs_Kind use "Subversion";
   end Ide;

end Common;