1 AUTHOR: Randy McMurchy <randy_at_linuxfromscratch_dot_org>
5 LICENSE: Creative Commons Attribution-NonCommercial-ShareAlike License
6 http://creativecommons.org/licenses/by-nc-sa/1.0/
8 SYNOPSIS: Installing the GCC Ada compiler while building LFS
10 DESCRIPTION: This hint will guide you through the installation of the GCC
11 Ada compiler while building an LFS system. Though these instructions target
12 the 3.4.x series of GCC, they should work with any LFS build.
18 1. The gcc-ada tarball for whatever version of GCC called for in LFS
19 (alternatively, download the complete tarball with all the compilers, if
20 you plan on installing more than just c, c++ and ada.
22 2. ftp://cs.nyu.edu/pub/gnat/3.15p/gnat-3.15p-i686-pc-redhat71-gnu-bin.tar.gz
23 (not required if your host system has an existing Ada compiler)
27 You must have a csh shell installed on the host system. Instructions for
28 installing the Tcsh package can be found at:
29 http://www.linuxfromscratch.org/blfs/view/svn/postlfs/tcsh.html
31 You won't need the csh shell if you already have an existing Ada compiler
41 2. Package Dependencies
42 csh shell installation
43 3. Installing the GNAT Ada compiler
44 4. Configuring the PATH variable
45 5. Chapter 5 GCC-Pass1 Modifications
46 6. Reconfiguring the PATH variable
47 7. Chapter 5 GCC-Pass2 Modifications
48 8. Chapter 6 GCC Modifications
55 The GCC installation instructions in Chapter 6 of the LFS book says this:
57 "Unpack both the gcc-core and the gcc-g++ tarballs - they will unpack into
58 the same directory. Likewise, extract the gcc-testsuite package. The full
59 GCC package contains additional compilers. Instructions for building these
61 http://www.linuxfromscratch.org/blfs/view/svn/general/gcc.html."
63 Though everything said is true, it is misleading. At this point of Chapter
64 6, you are in a chroot environment working with whatever is installed in the
65 /tools directory you created in Chapter 5.
67 In order to install the GCC Ada compiler, you must have an existing Ada
68 compiler available so GCC can boostrap its version of Ada. If your host has
69 an existing Ada compiler, you can omit some of this hint and simply use the
70 updated Chapter 5 and Chapter 6 GCC installation instructions. More on this
71 in the appropriate sections later in the hint.
73 ========================
74 2. PACKAGE DEPENDENCIES:
75 ========================
77 If you already have an existing Ada compiler on the host system, you won't
78 need to install the GNAT binary Ada compiler. You can skip to step 4 and
81 If you don't have an existing Ada compiler, you'll need to install the GNAT
82 binary version available from the URL shown in the "ATTACHMENTS" section at
83 the beginning of the hint.
85 The GNAT binary version installation requires a csh shell to run the
88 ----------------------
89 csh shell installation
90 ----------------------
92 If you don't have a csh shell available on the host system, follow the
93 instructions found at:
94 http://www.linuxfromscratch.org/blfs/view/svn/postlfs/tcsh.html
96 This must be done before starting your LFS build, or from another terminal
99 ====================================
100 3. INSTALLING THE GNAT ADA COMPILER:
101 ====================================
103 You'll need to install the GNAT Ada compiler before starting the Chapter 5
104 GCC-Pass1 instructions in the LFS book. This is right after the Binutils-Pass1
107 Here's the simple installation procedure for the GNAT Ada compiler:
109 1. Download the tarball:
111 ftp://cs.nyu.edu/pub/gnat/3.15p/gnat-3.15p-i686-pc-redhat71-gnu-bin.tar.gz
113 2. Issue the following commands to unpack the tarball and configure the
116 tar zxf gnat-3.15p-i686-pc-redhat71-gnu-bin.tar.gz
117 cd gnat-3.15p-i686-pc-linux-gnu-bin
120 (answer "3" at the first prompt asking what type of installation you desire,
121 and answer "/tools/gnat" when prompted for an installation path)
123 3. Issue the following command to install the GNAT compiler:
127 You should check and ensure that the /tools/gnat directory was created and
128 populated with files.
130 =================================
131 4. CONFIGURING THE PATH VARIABLE:
132 =================================
134 You'll need to modify the PATH variable so that the newly installed GNAT
135 compiler is used to bootstrap GCC. Issue the following commands:
138 export PATH=/tools/gnat/bin:$PATH
140 Ensure your PATH variable was changed properly:
144 And if you have the 'which' command installed on your host:
148 NOTE: if you're using an existing Ada compiler from your host, make the
149 appropriate substitutions above so this compiler is invoked by the 'gcc'
152 =====================================
153 5. CHAPTER 5 GCC-PASS1 MODIFICATIONS:
154 =====================================
156 There's three changes required to the Chapter 5 installation of GCC-Pass1.
158 1. You'll need to unpack the gcc-ada tarball along with the gcc-core tarball
159 so the GCC Ada sources are available. Alternatively, just unpack the combined
160 GCC tarball which contains all the compilers.
162 2. Modify the ./configure command to pass --enable-languages=c,ada
163 (Note the addition of ",ada")
165 3. After the "make bootstrap" step, issue the
166 following two commands:
169 make -C gcc gnattools
171 Except for the three changes shown above, follow the commands as outlined in
172 the Chapter 5 GCC-Pass1 instructions in LFS.
174 If desired, remove the /tools/gnat directory at the conclusion of the
175 Chapter 5 GCC-Pass1 instructions, as the GNAT compiler isn't required any
176 longer. All remaining GCC installations are done using the now existing GCC
179 ===================================
180 6. RECONFIGURING THE PATH VARIABLE:
181 ===================================
183 Now that you are done with GNAT compiler, put your PATH variable back like
184 it was using the following commands:
186 export PATH=$PATH_HOLD
189 Ensure your PATH variable was changed properly:
193 And if you have the 'which' command installed on your host:
198 =====================================
199 7. CHAPTER 5 GCC-PASS2 MODIFICATIONS:
200 =====================================
202 There's three changes required to the Chapter 5 installation of GCC-Pass2.
204 1. You'll need to unpack the gcc-ada tarball along with the gcc-core and
205 gcc-g++ tarballs so the GCC Ada sources are available. Alternatively, just
206 unpack the combined GCC tarball which contains all the compilers.
208 2. Modify the ./configure command to pass --enable-languages=c,c++,ada
209 (Note the addition of ",ada")
211 3. After the "make" step, issue the following two commands:
213 make -C gcc gnatlib-shared
214 make -C gcc gnattools
216 Except for the three changes shown above, follow the commands as outlined in
217 the Chapter 5 GCC-Pass1 instructions in LFS.
219 ===============================
220 8. CHAPTER 6 GCC MODIFICATIONS:
221 ===============================
223 There's four changes required to the Chapter 6 installation of GCC.
225 1. You'll need to unpack the gcc-ada tarball along with the gcc-core and
226 gcc-g++ tarballs so the GCC Ada sources are available. Alternatively, just
227 unpack the combined GCC tarball which contains all the compilers. At this
228 point also decide if you'd like to install additional (or all) compilers.
229 There's nothing keeping you from installing all of the compilers included
230 in the GCC source tarball. Do remember to also unpack the testsuite tarball.
232 2. Modify the ./configure command to pass --enable-languages=c,c++,ada
233 (Note the addition of ",ada")
235 ***** Alternatively, use --enable-languages=all, or add any other additional
236 ***** compilers on the --enable-languages= parameter.
238 3. After the "make" step, issue the following two commands:
240 make -C gcc gnatlib-shared
241 make -C gcc gnattools
243 4. After the "make install" step, issue the following two commands:
245 chown -v -R root:root /usr/lib/ada/adainclude
246 chown -v -R root:root /usr/lib/gcc/i686-pc-linux-gnu/3.4.3/adainclude
248 Except for the four changes shown above, follow the commands as outlined in
249 the Chapter 6 GCC instructions in LFS.
255 There's really not much to this hint. However, because the LFS book is
256 somewhat misleading in that at the point it mentions referring to BLFS to
257 install additional compilers, it's really too late to do it (for Ada anyway).
259 Following these easy instructions allows you to install the full suite of
260 GCC compilers during your LFS build, eliminating the time-consuming and
261 perhaps risky process of reinstalling c and c++ later on during your BLFS
266 Bruce Dubbs <bdubbs_at_linuxfromscratch_dot_org> for figuring out the
267 Ada build process with the new GCC-3.4.x series of compilers.
275 * Added instructions to change the ownership of the Ada interface header
276 include files to root
280 * Modified the Chapter 5 instructions to not use forced static build