@@ -18,6 +18,10 @@ library project Langkit_Support is
18
18
Library_Standalone : Library_Standalone_Type := external
19
19
("LANGKIT_SUPPORT_STANDALONE", external ("STANDALONE", "standard"));
20
20
21
+ SO_Name := External ("LANGKIT_SUPPORT_SONAME", "");
22
+ Ada_Flags := External_As_List ("ADAFLAGS", " ");
23
+ Ld_Flags := External_As_List ("LDFLAGS", " ");
24
+
21
25
for Languages use ("Ada");
22
26
for Source_Dirs use (".");
23
27
for Object_Dir use "obj/" & Build_Mode;
@@ -82,25 +86,39 @@ library project Langkit_Support is
82
86
for Library_Kind use Library_Kind_Param;
83
87
for Library_Dir use "lib/" & Library_Kind_Param & "/" & Build_Mode;
84
88
89
+ case Library_Kind_Param is
90
+ when "relocatable" =>
91
+ case SO_Name is
92
+ when "" =>
93
+ null;
94
+ when others =>
95
+ for Library_Version use SO_Name;
96
+ end case;
97
+ for Leading_Library_Options use Ld_Flags;
98
+ when "static" | "static-pic" =>
99
+ null;
100
+ end case;
101
+
85
102
Common_Ada_Cargs := ("-gnatwa", "-gnatyg", "-fPIC");
86
103
87
104
package Compiler is
88
105
case Build_Mode is
89
106
when "dev" =>
90
107
for Default_Switches ("Ada") use
91
- Common_Ada_Cargs & ("-g", "-O0", "-gnatwe", "-gnata");
108
+ Common_Ada_Cargs & ("-g", "-O0", "-gnatwe", "-gnata")
109
+ & Ada_Flags;
92
110
93
111
when "prod" =>
94
112
-- Debug information is useful even with optimization for
95
113
-- profiling, for instance.
96
114
for Default_Switches ("Ada") use
97
- Common_Ada_Cargs & ("-g", "-Ofast");
115
+ Common_Ada_Cargs & ("-g", "-Ofast") & Ada_Flags ;
98
116
99
117
when "prof" =>
100
118
-- Ensure that we have a relatively fast build but with all
101
119
-- possible stack info & debug info, for profiling.
102
120
for Default_Switches ("Ada") use
103
- ("-Og", "-ggdb", "-g3", "-fno-omit-frame-pointer");
121
+ ("-Og", "-ggdb", "-g3", "-fno-omit-frame-pointer") & Adaflags ;
104
122
end case;
105
123
end Compiler;
106
124
0 commit comments