Building gnat on CentOS 7

NightStrike nightstrike@gmail.com
Sun Aug 29 05:56:32 GMT 2021


When configuring gcc on centos 7 with --enable-languages=all,
eventually it tries to find if building Ada files is supported:

checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp
--ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
configure: WARNING: using in-tree isl, disabling version check
configure: WARNING: GNAT is required to build ada
configure: WARNING: --enable-host-shared required to build jit

That error message implies that it can't find gnat.  However, gnat is installed:

$ gnat
GNAT 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright 1996-2013, Free Software Foundation, Inc.
...etc.

What the configure test is actually doing is not running "gnat compile
conftest.adb".  It's running "gcc -c conftest.adb".  Doing that
manually fails:

$ echo "procedure conftest is begin null; end conftest;" > conftest.adb
$ gnat compile conftest.adb
gcc -c conftest.adb
$ gcc -c conftest.adb
gcc: error: conftest.adb: Ada compiler not installed on this system

Presumably, this is something that configure could handle better, I
would think.  I would also think that Redhat should package it better.
Until then, however, how do I get the system installed gcc to know
that gnat is available?


More information about the Gcc-help mailing list