# Making AUnit available to gprbuild

**URL:** <https://forum.ada-lang.io/t/making-aunit-available-to-gprbuild/1879>\
**Category:** General\
**Tags:** ada, gnat, aunit\
**Created:** [March 11, 2025, 10:08am UTC](https://forum.ada-lang.io/t/making-aunit-available-to-gprbuild/1879 "2025-03-11T10:08:07Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![fatso83](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/fatso83/32/624_2.png) [@fatso83](https://forum.ada-lang.io/u/fatso83)\
**Post date:** [March 11, 2025, 1:35pm UTC](https://forum.ada-lang.io/t/making-aunit-available-to-gprbuild/1879/3 "2025-03-11T13:35:58Z")

</div>

That was it! Adjusting the install path for aunit when installing made it available.

**Related question**  
Is it it possible to adjust the globally searched paths using some environment variable or some setting that GPRBuild will use? The suggested `GPR_PROJECT_PATH` did not seem to take effect, or it was perhaps used incorrectly.

Thanks!

# Details

## Showing the default project search directories

```ada
aunit/examples/simple_test on  master [!?]
✦ ❯ gprbuild -vm
GPRBUILD 24.0.0 (2024-08-01) (x86_64-pc-linux-gnu)
Copyright (C) 2004-2024, AdaCore
using project file harness.gpr
 33 lines: No errors
TMPDIR = "/tmp/GPR.49115"
gprconfig --batch -o /tmp/GPR.49115/GNAT-TEMP-000001.TMP --target=x86_64-linux --fallback-targets --config=ada,,,,
Checking configuration /tmp/GPR.49115/GNAT-TEMP-000001.TMP
Setting the default project search directories
   Adding directory "/opt/gnat-x86_64-linux-14.2.0-1/x86_64-linux/share/gpr"
   Adding directory "/opt/gnat-x86_64-linux-14.2.0-1/x86_64-linux/lib/gnat"
   Adding directory "/opt/gnat-x86_64-linux-14.2.0-1/share/gpr"
   Adding directory "/opt/gnat-x86_64-linux-14.2.0-1/lib/gnat"

```

This shows that the sub directories of the gprbuild install was not being searched.

## Adjusting the install path for AUnit

```ada
 make install INSTALL=/opt/gnat-x86_64-linux-14.2.0-1

```

Now I could revert the change from using absolute directory paths to using global shared libraries, such as `with "aunit";`

```diff
✦ ❯ git diff
diff --git a/examples/simple_test/harness.gpr b/examples/simple_test/harness.gpr
index f445b8d..a12f6fd 100644
--- a/examples/simple_test/harness.gpr
+++ b/examples/simple_test/harness.gpr
@@ -1,4 +1,10 @@
-with "aunit";
+-- Requires Aunit to be globally available
+-- See https://forum.ada-lang.io/t/making-aunit-available-to-gprbuild/1879/2
+ with "aunit";
+-- If AUnit has not been made available, it will need to be included by path
+--with "../../lib/gnat/aunit.gpr";
+--with "/opt/gprbuild-x86_64-linux-24.0.0-2/share/gpr/aunit.gpr";
+
 with "tested_lib/testlib";

 project Harness is

```

---

_[View the full topic](https://forum.ada-lang.io/t/making-aunit-available-to-gprbuild/1879)._
