diff --git a/lib/gnat/aunit.gpr b/lib/gnat/aunit.gpr index 7bb2a67..f11a8b1 100644 --- a/lib/gnat/aunit.gpr +++ b/lib/gnat/aunit.gpr @@ -24,6 +24,8 @@ project AUnit is for Library_Kind use "dynamic"; for Library_Version use "lib" & project'Library_name & ".so." & AUnit_Shared.Soversion; + -- Put options like --as-needed before the libraries. + for Leading_Library_Options use AUnit_Shared.Ldflags; end case; for Library_Dir use "../aunit/" @@ -51,6 +53,9 @@ project AUnit is for Default_Switches ("ada") use ("-O2", "-gnatp", "-gnatn", "-gnatwa.X"); end case; + -- Allow user flags to override default flags. + for Default_Switches ("ada") use Compiler'Default_Switches ("ada") + & AUnit_Shared.Adaflags; for Switches ("aunit.adb") use Compiler'Default_Switches ("ada") & ("-fno-strict-aliasing"); diff --git a/lib/gnat/aunit_shared.gpr b/lib/gnat/aunit_shared.gpr index d3ee1ff..1e1fddb 100644 --- a/lib/gnat/aunit_shared.gpr +++ b/lib/gnat/aunit_shared.gpr @@ -18,6 +18,9 @@ project AUnit_Shared is -- A non-empty soversion requires a shared library. Soversion := External ("aunit_SOVERSION", ""); + Adaflags := External_As_List ("ADAFLAGS", " "); + Ldflags := External_As_List ("LDFLAGS", " "); + for Source_Dirs use (); type Exception_Type is ("fullexception", "certexception", "zfpexception");