-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflorist.gpr
80 lines (65 loc) · 2.79 KB
/
florist.gpr
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
library project Florist is
for Library_Name use "florist";
for Languages use ("C", "Ada");
for Create_Missing_Dirs use "True";
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;
Target_OS := external ("TARGET_OS", "Linux");
So_Ext := "";
case Target_OS is
when "Darwin" =>
So_Ext := ".dylib";
when others =>
So_Ext := ".so";
end case;
Version := External ("florist_shared_object_version", "1");
for Library_Version use "lib" & Project'Library_Name & So_Ext & "." & 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 "static" =>
null;
end case;
type Build_Type is ("Debug", "Production");
Build : Build_Type := External ("Build", "Production");
package Compiler is
Adaflags := External_As_List ("ADAFLAGS", " ");
GNAT_Flags := ("-g", "-gnatpg", "-gnatU", "-gnatf") & Adaflags;
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 ("-g", "-gnatw.eH.YD", "-gnatyg", "-Wall",
"-gnata", "-gnatq", "-gnatQ", "-gnatVaep", "-gnato", "-gnatU",
"-fstack-check", "-gnatf", "-gnateA", "-gnateE", "-gnateF") & Adaflags;
for Default_Switches ("C") use ("-g")
& External_As_List ("CFLAGS", " ")
& External_As_List ("CPPFLAGS", " ");
when "Production" =>
for Default_Switches ("Ada") use ("-O2", "-gnatp", "-gnatU", "-gnatf") & Adaflags;
for Default_Switches ("C") use ("-O2")
& External_As_List ("CFLAGS", " ")
& External_As_List ("CPPFLAGS", " ");
end case;
end Compiler;
package Install is
for Install_Name use "florist";
for Artifacts ("share/doc/florist_rm") use ("obj/gnatdoc/*");
end Install;
end Florist;