File: florist.gpr

package info (click to toggle)
libflorist 2017-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,212 kB
  • sloc: ada: 11,902; ansic: 7,195; makefile: 137; sh: 18
file content (60 lines) | stat: -rw-r--r-- 2,122 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
library project Florist is

   for Library_Name use "florist";
   for Languages use ("C", "Ada");

   type Boolean is ("False", "True");
   Threads : Boolean := external ("THREADS", "True");

   Common_Source_Dirs := ("libsrc", "gensrc", "confsrc");
   Threads_Source_Dirs := ("libsrc/threads", "gensrc/threads");
   case Threads is
      when "False" =>
          for Source_Dirs use Common_Source_Dirs;
      when "True" =>
          for Source_Dirs use Common_Source_Dirs & Threads_Source_Dirs;
   end case;

   Version := External ("SOVERSION", "1");
   for Library_version use "libflorist.so." & Version;

   type Library_Type_Type is ("relocatable", "static");
   Library_Type : Library_Type_Type := external ("LIBRARY_TYPE", "static");
   for Library_Kind use Library_Type;

   for Object_Dir  use "obj/" & Library_Type;
   for Library_Dir use "lib/" & Library_Type;

   case Library_Type is
      when "relocatable" =>
         for Leading_Library_Options use External_As_List ("LDFLAGS", " ");
         for Library_Options use External_As_List ("LIBS", " ");
      when others =>
         null;
   end case;

   type Build_Type is ("Debug", "Production");
   Build : Build_Type := External ("Build", "Production");
   package Compiler is
      --  Select -O2 in the absence of user settings.
      Adaflags := ("-O2") & External_As_List ("ADAFLAGS", " ");

      --  Let -gnatg override user settings.
      GNAT_Flags := ("-gnatp") & Adaflags & ("-gnatg");
      for Switches ("posix-signals.adb") use GNAT_Flags;
      for Switches ("posix-implementation.adb") use GNAT_Flags;
      for Switches ("posix-supplement_to_ada_io.adb") use GNAT_Flags;
      for Switches ("posix-unsafe_process_primitives.adb") use GNAT_Flags;

      case Build is
         when "Debug" =>
            for Default_Switches ("Ada") use ("-gnatwae", "-gnatyg") & Adaflags;
         when "Production" =>
            for Default_Switches ("Ada") use ("-gnatp") & Adaflags;
      end case;

      for Default_Switches ("C") use External_As_List ("CFLAGS", " ")
        & External_As_List ("CPPFLAGS", " ");
   end Compiler;

end Florist;