diff --git a/lib/gnat/aunit.gpr b/lib/gnat/aunit.gpr index d07f63d..4e2b136 100644 --- a/lib/gnat/aunit.gpr +++ b/lib/gnat/aunit.gpr @@ -18,11 +18,21 @@ project AUnit is for Library_Dir use AUnit_Shared.Library_Dir; Obj_Dir := external ("AUNIT_OBJDIR", "../aunit-obj/" - & AUnit_Shared.Target & "-" & AUnit_Shared.Runtime); + & AUnit_Shared.Target & "-" & AUnit_Shared.Runtime + & "-" & AUnit_Shared.Library_Kind); for Object_Dir use Obj_Dir; for Library_Name use "aunit"; - for Library_Kind use "static"; + for Library_Kind use AUnit_Shared.Library_Kind; + for Library_Version use + external ("AUNIT_LIBRARY_VERSION", "libaunit.so.0.0"); + + case AUnit_Shared.Library_Kind is + when "dynamic" | "relocatable" => + -- Put options like --as-needed before the libraries. + for Leading_Library_Options use external_As_List ("LDFLAGS", " "); + when others => + end case; -------------- -- Compiler -- @@ -40,6 +50,10 @@ project AUnit is ("-O2", "-gnatp", "-gnatn", "-gnatwa.X"); end case; + -- Allow user flags to override default flags. + for Default_Switches ("ada") use + Compiler'Default_Switches ("ada") & external_As_List ("ADAFLAGS", " "); + for Switches ("aunit.adb") use Compiler'Default_Switches ("ada") & ("-fno-strict-aliasing"); end Compiler; diff --git a/lib/gnat/aunit_shared.gpr b/lib/gnat/aunit_shared.gpr index 43f6f40..1fe5506 100644 --- a/lib/gnat/aunit_shared.gpr +++ b/lib/gnat/aunit_shared.gpr @@ -14,7 +14,9 @@ project AUnit_Shared is Runtime : Runtime_Type := external ("AUNIT_RUNTIME", "full"); - Library_Dir := external ("AUNIT_LIBDIR", "../aunit/" & Target & "-" & Runtime); + Library_Kind := external ("AUNIT_LIBRARY_KIND", "static"); + Library_Dir := external ("AUNIT_LIBDIR", "../aunit/" & Target & "-" & Runtime + & "-" & Library_Kind); for Source_Dirs use ();