Project:Ada

Aim of the project
The project maintains the compiler, builder, system library and IDE for ada.

The spark language, based on ada and aimed at safety and security, is also supported.

The reference sources are the one present in the libre.adacore.com site, maintained by AdaCore.

We also hope to integrate gnat-gcc with the standard toolchain packages starting with 6.x/7.x, with new arches added as new bootstraps become available (see the ada-overlay on github for the current packages/eclass).

Current packages
At present packages are part of the project.

Compilers are available for both x86 32 and 64 bits
 * dev-lang/gnat-gpl-2020 slotted 9.3.1
 * dev-lang/gnat-gpl-2021 slotted 10

Each dev-lang/gnat-gpl compiler conflict with the sys-devel/gcc on the same slot.

dev-lang/gnat-gpl share in fact most of the sources and the binaries with gcc.

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 mess with the bootstrap use flag, the Ada compiler will be built using the gnat-gpl-2014-*-linux-bin.tar.gz from libre.adacore.com.

When you disable the bootstrap use flag, the build compiler will be using the information set in the file etc/portage/make.conf

This will indicate the
 * the ADA compiler used to build the Ada compiler (if available)
 * the ADA compiler FLAGS, used 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 and that will be used to build the ada compiler. Is not used for anything else. If you do not specify the ADA variable, the system gcc compiler will be used instead, if capable.

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-8.3.1

It is possible to add to sys-devel/gcc the ada language capability.

These are the step you need to follow:
 * 1) enable the ada use flag for sys-devel/gcc
 * 2) select a gcc compiler that is already built with ada support (using gcc-config). dev-lang/gnat-gpl can be used for that
 * 3) emerge sys-devel/gcc
 * 4) select the new generated gcc compiler (gcc-config)

You should have now the ada compiler ready to use.

Note: always use an older compiler to build gcc: e.g. compiling gcc-11 using gcc-12 is not supported

Building the dev-ada packages
When building the ada related packages, you need to indicate which version of compilers to use by setting the ADA_TARGET variable in the file etc/portage/make.conf

The value used are
 * gnat_2020 to select dev-lang/gnat-gpl-2020
 * gnat_2021 to select dev-lang/gnat-gpl-2021
 * gcc_12_2_0 to select sys-devel/gcc-12.2.0

Switching to github release
Slowly we are switching to github release.

e.g. last release of dev-ada/gprbuild is from github and is versioned 22.0.0

To use these release you should mask the github switched package for all the annual based version:

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

i.e. enabling gnat_2021 and then rebuild all ada packages