50Chapter3 • Compilers and Assemblers
It is recommended to run the
configure
script in a directory other than the source code
directory so that the source code tree is completely separate from the place where you build the
compiler. For the sake of this example, I have created a directory
/gcc3/objdir
and I ran the
configure
script from that directory. As you already know, the source code tree is under the
/
gcc3/gcc-3.0.4
directory. You may need to add a prefix for GCC installation files. The pre-
fix shows the directory where GCC files will be finally installed. The default prefix is
/usr/
local
. This means that GCC binary files will be installed in
/usr/local/bin
directory.
For installation purposes, I have selected
/opt/gcc-3.0.4
directory as the prefix. In a typi-
cal development environment, you would do something similar to that. Just create a directory
under
/opt
and install all of your tools and applications under
/opt
. The following command
line will configure the GCC compilation process and will create many files under
/gcc3/
objdir
. These files will be used later on to build the compiler. When you start the
config-
ure
script, the following messages will start scrolling up.
[root@laptop objdir]# ../gcc-3.0.4/configure --prefix=/opt/
gcc-3.0.4
Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /gcc3/gcc-3.0.4 using "mt-frag"
Configuring libiberty...
creating cache ../config.cache
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for ar... ar
checking for ranlib... ranlib
checking for gcc... gcc
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for POSIXized ISC... no
checking for working const... yes
checking for inline... inline
checking for a BSD compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for sys/file.h... yes
checking for sys/param.h... yes
checking for limits.h... yes
checking for stdlib.h... yes
checking for string.h... yes
Most of the output is truncated from the configure script to save space. When the config-
ure script is completed, you will get back the command prompt. Now you may start building the
compiler.
N O T E There may be some other requirements when you are
building a non-native compiler.
Next Page >>
<< Previous Page
Back to the Table of Contents