1------------------------------------------------------------------------------
2--                                                                          --
3--                     ASIS UTILITY LIBRARY COMPONENTS                      --
4--                                                                          --
5--                                 A S I S                                  --
6--                                                                          --
7--                    Copyright (C) 2004-2015, AdaCore                      --
8--                                                                          --
9-- Asis Utility Library (ASIS UL) is free software; you can redistribute it --
10-- and/or  modify  it  under  terms  of  the  GNU General Public License as --
11-- published by the Free Software Foundation; either version 2, or (at your --
12-- option)  any later version.  ASIS UL  is distributed in the hope that it --
13-- will  be  useful,  but  WITHOUT  ANY  WARRANTY; without even the implied --
14-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --
15-- GNU  General Public License for more details. You should have received a --
16-- copy of the  GNU General Public License  distributed with GNAT; see file --
17-- COPYING. If not, write to the Free Software Foundation, 59 Temple Place  --
18--  - Suite 330, Boston,                                                    --
19--                                                                          --
20-- ASIS UL is maintained by ACT Europe (http://www.act-europe.fr).          --
21--                                                                          --
22------------------------------------------------------------------------------
23
24abstract project Common is
25
26   for Source_Dirs use ();
27
28   type Bld_Type is ("prod", "debug", "prod_strict", "prod_no_checks");
29   Bld : Bld_Type := external ("BLD", "prod");
30
31   type Components is ("lib", "tools", "toolsdev");
32   --  The components to build:
33   --  "lib"      : asis library and asistant
34   --  "tools"    : all asis tools (also build asis library)
35   --  "toolsdev" : extra tools for the developers (also build asis library)
36
37   Comps : Components := external ("ASIS_COMPONENTS", "tools");
38
39   type OS_Type is ("default_Unix", "powerpc_aix", "pa_hpux");
40   OS : OS_Type := external ("ASISOPSYS", "default_Unix");
41
42   Ada_Strict_Switches :=
43     ("-gnatf",
44      "-gnatwae",
45      "-gnatw.g", -- gnat standard warnings
46      "-gnatw.u",
47      "-gnatyg");
48   Ada_Relaxed_Switches := ("-gnatf", "-gnatws");
49
50   Processors := External ("PROCESSORS", "1");
51
52   package Builder is
53      case Bld is
54         when "prod" =>
55            null;
56         when "prod_strict" =>
57            null;
58         when "debug" =>
59            for Default_Switches ("ada")
60              use Ada_Strict_Switches & ("-m", "-g", "-k");
61         when "prod_no_checks" =>
62            null;
63      end case;
64      for Default_Switches ("ada") use ("-j" & Processors);
65   end Builder;
66
67   package Compiler is
68
69      case Bld is
70         when "prod" =>
71            for Default_Switches ("ada") use Ada_Relaxed_Switches & ("-O2");
72         when "prod_strict" =>
73            for Default_Switches ("ada") use Ada_Strict_Switches & ("-O2");
74         when "debug" =>
75            for Default_Switches ("ada")
76              use Ada_Strict_Switches & ("-O0", "-g", "-gnata");
77         when "prod_no_checks" =>
78            for Default_Switches ("ada")
79              use Ada_Strict_Switches & ("-O2", "-gnatp");
80      end case;
81
82      case OS is
83         when "powerpc_aix" =>
84            for Default_Switches ("ada") use
85              Compiler'Default_Switches ("ada") & ("-mminimal-toc");
86         when "pa_hpux" =>
87            for Default_Switches ("ada") use
88              Compiler'Default_Switches ("ada") & ("-mdisable-indexing");
89         when others =>
90            null;
91      end case;
92   end Compiler;
93
94   package Binder is
95      for Default_Switches ("ada") use ("-static");
96   end Binder;
97
98   package Ide is
99      for Vcs_Kind use "Subversion";
100   end Ide;
101
102end Common;
103