@ifset USING
@node G++ and GCC
-@chapter Compile C, C++, Objective-C, Fortran, Java or CHILL
+@chapter Compile C, C++, Objective-C, Ada, CHILL, Fortran, or Java
@cindex Objective-C
@cindex Fortran
@cindex Java
@cindex CHILL
-Several versions of the compiler (C, C++, Objective-C, Fortran, Java
-and CHILL) are integrated; this is why we use the name
+@cindex Ada
+Several versions of the compiler (C, C++, Objective-C, Ada, CHILL,
+Fortran, and Java) are integrated; this is why we use the name
``GNU Compiler Collection''. GCC can compile programs written in any of these
-languages. The Fortran, CHILL, and Java compilers are described in
+languages. The Ada, CHILL, Fortran, and Java compilers are described in
separate manuals.
@cindex GCC
it ``GCC'' no matter what the language context; however, the term
``G++'' is more useful when the emphasis is on compiling C++ programs.
+@cindex Ada
+@cindex GNAT
+Similarly, when we talk about Ada compilation, we usually call the
+compiler ``GNAT'', for the same reasons.
+
We use the name ``GCC'' to refer to the compilation system as a
whole, and more specifically to the language-independent part of the
compiler. For example, we refer to the optimization options as
affecting the behavior of ``GCC'' or sometimes just ``the compiler''.
-Front ends for other languages, such as Ada 95 and Pascal exist but
+Front ends for other languages, such as Mercury and Pascal exist but
have not yet been integrated into GCC@. These front ends, like that for C++,
are built in subdirectories of GCC and link to it. The result is an
integrated compiler that can compile programs written in C, C++,
is an older example. @uref{http://www.gnustep.org} includes useful
information as well.
+@xref{Top, GNAT Reference Manual, About This Guide, gnat_rm,
+GNAT Reference Manual}, for information on standard
+conformance and compatibility of the Ada compiler.
+
+@xref{References,,Language Definition References, chill, GNU Chill},
+for details of the CHILL standard.
+
@xref{Language,,The GNU Fortran Language, g77, Using and Porting GNU
Fortran}, for details of the Fortran language supported by GCC@.
@xref{Compatibility,,Compatibility with the Java Platform, gcj, GNU gcj},
for details of compatibility between @code{gcj} and the Java Platform.
-@xref{References,,Language Definition References, chill, GNU Chill},
-for details of the CHILL standard.
-
@include invoke.texi
@include install-old.texi
grep language= */config-lang.in
@end example
Currently, you can use any of the following:
-@code{c}, @code{c++}, @code{f77}, @code{java} and @code{objc}.
+@code{ada}, @code{c}, @code{c++}, @code{f77}, @code{java}, @code{objc}.
@code{CHILL} is not currently maintained, and will almost
-certainly fail to compile.@*
+certainly fail to compile. Building the Ada compiler has special
+requirements, see below.@*
If you do not pass this flag, all languages available in the @file{gcc}
sub-tree will be configured. Re-defining @code{LANGUAGES} when calling
@samp{make bootstrap} @strong{does not} work anymore, as those
runtime libraries.
We @strong{highly} recommend that GCC be built using GNU make;
-other versions may work, then again they might not.
+other versions may work, then again they might not.
+GNU make is required for compiling GNAT, the Ada compiler.
(For example, many broken versions of make will fail if you use the
recommended setup where @var{objdir} is different from @var{srcdir}.
you like. In most cases, it won't help to use a number bigger than
the number of processors in your machine.
+@section Building the Ada compiler
+
+In order to build GNAT, the Ada compiler, you need a working GNAT
+compiler, since the Ada front end is written in Ada (with some
+GNAT-specific extensions), and GNU make.
+
+However, you do not need a full installation of GNAT, just the GNAT
+binary @file{gnat1}, a copy of @file{gnatbind}, and a compiler driver
+which can deal with Ada input (by invoking the @file{gnat1} binary).
+You can specify this compiler driver by setting the @env{ADAC}
+environment variable at the configure step. @command{configure} can
+detect the driver automatically if it has got a common name such as
+@command{gcc} or @command{gnatgcc}. Of course, you still need a working
+C compiler (the compiler driver can be different or not).
+
+Additional build tools (such as @command{gnatmake}) or a working GNAT
+run-time library installation are usually @emph{not} required. However,
+if you want to boostrap the compiler using a minimal version of GNAT,
+you have to issue the following commands before invoking @samp{make
+boostrap} (this assumes that you start with an unmodified and consistent
+source distribution):
+
+@example
+ cd @var{srcdir}/gcc/ada
+ touch treeprs.ads [es]info.h nmake.ad[bs]
+@end example
+
+At the moment, the GNAT library and several tools for GNAT are not built
+by @samp{make bootstrap}. You have to invoke
+@samp{make gnatlib_and_tools} in the @file{@var{objdir}/gcc}
+subdirectory before proceeding with the next steps.
+
+For example, you can build a native Ada compiler by issuing the
+following commands (assuming @command{make} is GNU make):
+
+@example
+ cd @var{objdir}
+ @var{srcdir}/configure --enable-languages=c,ada
+ cd @var{srcdir}/gcc/ada
+ touch treeprs.ads [es]info.h nmake.ad[bs]
+ cd @var{objdir}
+ make bootstrap
+ cd gcc
+ make gnatlib_and_tools
+ cd ..
+@end example
+
+Currently, when compiling the Ada front end, you cannot use the parallel
+build feature described in the previous section.
+
@html
<hr>
<p>
@c @var{file}.zip
@c @var{file}.jar
+@item @var{file}.ads
+Ada source code file which contains a library unit declaration (a
+declaration of a package, subprogram, or generic, or a generic
+instantiation), or a library unit renaming declaration (a package,
+generic, or subprogram renaming declaration). Such files are also
+called @dfn{specs}.
+
+@itemx @var{file}.adb
+Ada source code file containing a library unit body (a subprogram or
+package body). Such files are also called @dfn{bodies}.
+
@c GCC also knows about some suffixes for languages not yet included:
-@c Ada:
-@c @var{file}.ads
-@c @var{file}.adb
-@c @var{file}.ada
@c Pascal:
@c @var{file}.p
@c @var{file}.pas
c++ c++-cpp-output
objective-c objc-cpp-output
assembler assembler-with-cpp
+ada
+chill
f77 f77-cpp-input ratfor
-java chill
+java
@end example
@c Also f77-version, for internal use only.