Project:Ada

Aim of the project
The project maintain the compiler, builder, system library and IDE for ada. The reference sources are the one present in the libre.adacore.com site, maintained by AdaCore.

Current packages
At present packages are part of the project.

gnat-gpl share in fact most of the sources and the binaries with gcc.
 * dev-lang/gnat-gpl-2016 conflict with the sys-devel/gcc-4.9.4 compiler.
 * dev-lang/gnat-gpl-2017 conflict with the sys-devel/gcc-6.3.0 compiler.

Configuration
You need to indicate the Those should be set in the file etc/portage/make.conf
 * the ADA compiler used to build Ada Ada packages
 * the ADA compiler FLAGS, again to build Ada packages
 * optionally the nostrip features (or splitdebug) to retains symbol in the gnat runtime (e.g. catch exception with debugger)

The ADA variable is the name of the gcc compiler that can compile ada files. If you do not specify the ADA variable, the system gcc compiler will be used instead, if capable.

Starting from 2017 version you should also set one of the two use flags: to build these two packages.
 * gnat_2016 to select dev-lang/gnat-gpl-2016
 * gnat_2017 to select dev-lang/gnat-gpl-2017

Only one of these two flags should be enabled, and preferably the setting should be done at global level on make.conf

The choice should be inline with the set of the ADA variable

Build instructions
To build the compiler unfortunately you need an ada/c/c++ compiler already available, to produce an ada/c/c++ compiler.

If you don't have an ada compiler available you must set the bootstrap use flags. In this case the compiler used will be gnat-gpl-2014-x86_64-linux-bin.tar.gz from libre.adacore.com.

Once installed you can use the compiler either
 * by selecting it with gcc-config. In this case you also change the default c/c++ compiler (and this is not supported to upgrade gentoo)
 * by postfixing any ada command with its own version: eg. gnatmake-4.9.4

Similar to the compiler, for gprbuild you need to set the "bootstrap" flag and unset the "shared" flag initially for the first build, then rebuild them in order to be able to use them as shared libs, like this:

as dev-ada/gprbuild needs dev-ada/xmlada and dev-ada/xmlada needs dev-ada/gprbuild; the bootstrap flag breaks the loop.

Compiler upgrade
When you want to use a new ada compiler you need to change the make.conf to reflect this choice

change the use flag setting, enabling gnat_2017 and disabling gnat_2016 and then rebuild all ada packages starting from dev-ada/gprbuild with the bootstrap use flags