Typo
[linux_from_scratch_hints.git] / OLD / ada.txt
blob63b1c295d47bbd2a5a42b0bcb358100bff818bc1
1 TITLE:          Ada Compiler Hint
2 LFS VERSION:    All, (any Linux/UNIX system using gcc)
3 AUTHOR:         Chris Lingard   chris@stockwith.co.uk
5 SYNOPSIS:
7 For some time gcc has been available with an Ada compiler called gnat
9 The Ada compiler is unusual in that it is written in Ada.  All the
10 other languages that gcc supports have their compiler written in C.
12 >From gcc-3.1, Ada is included in the 'everything' tar ball
14 HINT:
16 First the dependencies/downloads required
17 tcsh:
18 tcsh-6.11.tar.bz2       from    tcsh.org
19 Just get the latest version.
21 gnat:
22 gnat-<version>-<hardware>.tar.bz2           from cs.nyu.edu/pub/gnat/<version>
25 /gnat-3.14p/gnat-3.14p-i686-pc-linux-gnu-bin.tar.bz2 currently, (for PCs)
27 There is a note in directory gnat about latest version, change directory
28 to this, it is currently 3.14p.
30 (Do not worry about the i686, this runs in AMD too)
31 If you are lucky enough to have a machine other than a PC; then get
32 the file for the appropriate hardware.
34 You need tcsh because the scripts to unpack the Ada compiler are csh scripts.
36 Build tcsh any way you want; then move tcsh to /bin
37 Then go to /bin and do
38 ln  -s tcsh  csh
39 This allows us to use scripts starting with #!/bin/csh
41 We now need to put the Ada compiler in a temporary location.  It will only
42 be used for the stage1 build of gcc.
44 Set up a temporary account on your machine.  Let us call this account Compiler
45 Log in as Compiler and unpack the gnat tar ball.  This expands into a
46 directory called gnat-3.14p-i686-pc-linux-gnu-bin, cd into this directory.
48 Run the script  ./doconfig
50 When offered a choice of locations to install gnat, take option 3
52   3) Install GCC C compiler and GNAT files in non-standard locations
53      that you will specify.
55 When asked for the location to install,  give the home directory of
56 this account
58     Specify the base directory you want to use for installation:
60 /home/Compiler
62 This will display what is to be installed, and where.
64 Now use  ./doinstall to install the compiler in this account
66 cd  to the home directory of Compiler and edit .bash_profile
68 Make sure that $HOME/bin and the location of gcc are in the PATH
70 Add the following
71 ADAC=$HOME/bin/gnatgcc
72 export ADAC
74 cd into bin, (the account's bin) and change the name of gcc to gnatgcc
75 mv gcc   gnatgcc
77 This completes the preparation.  Log out, and then log in again
79 Test that it is set up right:
80 $ADAC  -v  should be the gnatgcc in $HOME/bin, a static gcc-2.8
81 gcc -v should be your standard gcc, the normal compiler
83 Please note that this bootstrap compiler is not complete, but is just
84 enough to build the Ada in gcc.
86 Now unpack the source of gcc.  If you have downloaded the Ada source
87 separately it goes into srcdir/gcc/ada
89 Change directory to srcdir/gcc/ada and do
91 touch treeprs.ads [es]info.h nmake.ad[bs]
93 Now make a build directory somewhere and cd into it
95 Do your favourite srcdir/configure for gcc except that the following is used:
97  --enable-languages=c,c++,ada
99 You can just miss out the language directive and build all the options.
101 Put the configure output into a file and check that the Ada stuff has been
102 recognised
104 checking floating point format... IEEE (little-endian)
105 checking for gnatbind... gnatbind
106 checking for compiler driver that understands Ada... gcc
107 checking for mktemp... no
109 The build instructions are
111     make bootstrap
112     cd gcc
113     make gnatlib_and_tools
114     cd ..
116 This is also required if you are building a Chapter 5, static compiler.
118 You can now install the compiler and build huge Ada systems
120 Delete the account Compiler, it is no longer needed