Skip to content

Commit 5f74513

Browse files
committed
support: allow override of ADAFLAGS, LDFLAGS, library Shared Object version
1 parent 7bbd9f3 commit 5f74513

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

langkit/support/langkit_support.gpr

+18
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ library project Langkit_Support is
1818
Library_Standalone : Library_Standalone_Type := external
1919
("LANGKIT_SUPPORT_STANDALONE", external ("STANDALONE", "standard"));
2020

21+
SO_Name := External ("LANGKIT_SUPPORT_SONAME", "");
22+
Ada_Flags := External_As_List ("ADAFLAGS", " ");
23+
Ld_Flags := External_As_List ("LDFLAGS", " ");
24+
2125
for Languages use ("Ada");
2226
for Source_Dirs use (".");
2327
for Object_Dir use "obj/" & Build_Mode;
@@ -82,6 +86,19 @@ library project Langkit_Support is
8286
for Library_Kind use Library_Kind_Param;
8387
for Library_Dir use "lib/" & Library_Kind_Param & "/" & Build_Mode;
8488

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+
85102
Common_Ada_Cargs := ("-gnatwa", "-gnatyg", "-fPIC");
86103

87104
package Compiler is
@@ -102,6 +119,7 @@ library project Langkit_Support is
102119
for Default_Switches ("Ada") use
103120
("-Og", "-ggdb", "-g3", "-fno-omit-frame-pointer");
104121
end case;
122+
for Default_Switches ("Ada") use Default_Switches ("Ada") & Adaflags;
105123
end Compiler;
106124

107125
end Langkit_Support;

0 commit comments

Comments
 (0)