Description: allow tests to build with build flags but outside the source tree
 ADAFLAGS come last and take precedence over the default (-O0).
 LDFLAGS comes before libraries that they affect (--as-needed).
 .
 Upstream only runs the tests inside the source tree and is not
 interested by this part.
Forwarded: not-needed
Author: Nicolas Boulenguez <nicolas@debian.org>

--- a/testgtk/testgtk.gpr
+++ b/testgtk/testgtk.gpr
@@ -21,7 +21,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with "../shared";
 with "../src/gtkada";
 with "opengl/testgtk_opengl";
 with "task_project/task_project";
@@ -37,10 +36,12 @@
    package Compiler is
       --  subprogram specs not required in testgtk
       for Switches ("Ada") use ("-g", "-O0", "-gnaty-s", "-gnatwJ")
-         & Shared.Adaflags;
+         & External_As_List ("ADAFLAGS", " ");
    end Compiler;
 
-   package Linker renames Shared.Linker;
+   package Linker is
+      for Leading_Switches ("Ada") use External_As_List("LDFLAGS", " ");
+   end Linker;
 
    package Install is
       for artifacts ("share/examples/gtkada/testgtk") use
