Project:Ada

From Gentoo Wiki
Jump to: navigation, search
Gentoo Resources for Ada
Description This project provides support for Ada compilers and libraries in Portage. At present a gnat compiler is provided: gnat-gpl by AdaCore.
Email ada@gentoo.org
Lead(s) none
No lead election date set
Members
Subprojects
(and inherited members)
(none)
Parent Project Gentoo Programming Language Support Project
Project listing

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

  • dev-lang/gnat-gpl
  • dev-ada/asis
  • dev-ada/gprbuild
  • dev-ada/gnatcoll
  • dev-ada/gnatmem
  • dev-ada/gnat_util
  • dev-ada/gtkada
  • dev-ada/xmlada
  • dev-ada/gps-bin
  • dev-ada/aws

packages are part of the project.

  • 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.30 compiler.

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

Configuration

You need to indicate the

  • 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)

Those should be set in the file etc/portage/make.conf

FILE /etc/portage/make.confADA setting
ADA=x86_64-pc-linux-gnu-gcc-4.9.4
ADAFLAGS=${CFLAGS}
FEATURES="nostrip"

The ADA variable is the basename 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.

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.

root # USE=bootstrap emerge dev-lang/gnat-gpl

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:

root # USE="bootstrap -shared" emerge dev-ada/gprbuild
root # emerge dev-ada/gprbuild

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

FILE /etc/portage/make.confADA setting
ADA=x86_64-pc-linux-gnu-gcc-6.3.0

and then rebuild all ada packages starting from dev-ada/gprbuild with the bootstrap use flags