Question

Basic Question:

How can I get gcc to tell me where it searches for Ada includes?

Specific Problem:

I have just finished converting a C library's header files to Ada specs so that I can interface with the library using Ada. I now want to install the specs on my system. I also want to make the installation portable to some extent so that I can make install on any machine (and thus host the specs and Makefile on Github or similar). I'm just not sure where exactly to install the specs to.

Was it helpful?

Solution

gnat ls -v will give you the default search paths.

If you want to install your own Ada library, you should place a project file (.gpr) in the "Project Search Path", which will tell gnat where to find the ada and ali files and the library.

Normally, you will place the ada files in /usr/[local/]include/myadalib and the ali files in /usr/[local/]lib/myadalib and maybe link the .so file into /usr/[local/]lib, but you can put them anywhere you want. The important thing is to place the project file (myadalib.gpr) in the project search path.

You can even adjust the project search path by setting the ADA_PROJECT_PATH environment variable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top