The GPR files can be used to build the Ada runtime, usually via
libada.gpr as the entry point. This commits extends the GPR project
definitions to make them suitable for shared and static PIC runtime
builds.
When LIBRARY_KIND is "static-pic", the libraries gain a "_pic" suffix,
as expected by the build tools. When it's "dynamic", we configure the
Library_Version attribute in order to set the right SONAME on Unix, as
well as the expected symlinks.
Finally, libgnarl.gpr now depends on libgnat.gpr; the missing dependency
hasn't caused problems so far because static libraries don't resolve
missing symbols at build time, but it's necessary to build shared
libraries.
gcc/ada/ChangeLog:
* libgnarl/libgnarl.gpr: Add dependency on libgnat.gpr.
Set Library_Name and Library_Version depending on Library_Kind.
* libgnat/libgnat.gpr: Likewise.
with "libgnat_common";
+with "libgnat";
library project Libgnarl is
for Source_List_File use "libgnarl.lst";
for Object_Dir use "../obj-" & Libgnat_Common.Library_Kind;
- for Library_Name use "gnarl";
+ case Libgnat_Common.Library_Kind is
+ when "static-pic" =>
+ for Library_Name use "gnarl_pic";
+ when "dynamic" =>
+ for Library_Name use "gnarl";
+ for Library_Version use
+ "libgnarl-" & Libgnat_Common.Version & ".so";
+ when others =>
+ for Library_Name use "gnarl";
+ end case;
+
for Library_Dir use "../adalib";
for Library_Kind use Libgnat_Common.Library_Kind;
for Source_List_File use "libgnat.lst";
for Object_Dir use "../obj-" & Libgnat_Common.Library_Kind;
- for Library_Name use "gnat";
+ case Libgnat_Common.Library_Kind is
+ when "static-pic" =>
+ for Library_Name use "gnat_pic";
+ when "dynamic" =>
+ for Library_Name use "gnat";
+ for Library_Version use
+ "libgnat-" & Libgnat_Common.Version & ".so";
+ when others =>
+ for Library_Name use "gnat";
+ end case;
+
for Library_Dir use "../adalib";
for Library_Kind use Libgnat_Common.Library_Kind;