01.09.2014 Views

The Linux Development Platform Configuring, Using, and ... - Classes

The Linux Development Platform Configuring, Using, and ... - Classes

The Linux Development Platform Configuring, Using, and ... - Classes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CH03.fm Page 50 Monday, October 7, 2002 8:33 PM<br />

50 Chapter 3 • Compilers <strong>and</strong> Assemblers<br />

N O T E <strong>The</strong>re may be some other requirements when you are<br />

building a non-native compiler.<br />

It is recommended to run the configure script in a directory other than the source code<br />

directory so that the source code tree is completely separate from the place where you build the<br />

compiler. For the sake of this example, I have created a directory /gcc3/objdir <strong>and</strong> I ran the<br />

configure script from that directory. As you already know, the source code tree is under the /<br />

gcc3/gcc-3.0.4 directory. You may need to add a prefix for GCC installation files. <strong>The</strong> prefix<br />

shows the directory where GCC files will be finally installed. <strong>The</strong> default prefix is /usr/<br />

local. This means that GCC binary files will be installed in /usr/local/bin directory.<br />

For installation purposes, I have selected /opt/gcc-3.0.4 directory as the prefix. In a typical<br />

development environment, you would do something similar to that. Just create a directory<br />

under /opt <strong>and</strong> install all of your tools <strong>and</strong> applications under /opt. <strong>The</strong> following comm<strong>and</strong><br />

line will configure the GCC compilation process <strong>and</strong> will create many files under /gcc3/<br />

objdir. <strong>The</strong>se files will be used later on to build the compiler. When you start the configure<br />

script, the following messages will start scrolling up.<br />

[root@laptop objdir]# ../gcc-3.0.4/configure --prefix=/opt/<br />

gcc-3.0.4<br />

<strong>Configuring</strong> for a i686-pc-linux-gnu host.<br />

Created "Makefile" in /gcc3/gcc-3.0.4 using "mt-frag"<br />

<strong>Configuring</strong> libiberty...<br />

creating cache ../config.cache<br />

checking host system type... i686-pc-linux-gnu<br />

checking build system type... i686-pc-linux-gnu<br />

checking for ar... ar<br />

checking for ranlib... ranlib<br />

checking for gcc... gcc<br />

checking whether we are using GNU C... yes<br />

checking whether gcc accepts -g... yes<br />

checking for POSIXized ISC... no<br />

checking for working const... yes<br />

checking for inline... inline<br />

checking for a BSD compatible install... /usr/bin/install -c<br />

checking how to run the C preprocessor... gcc -E<br />

checking for sys/file.h... yes<br />

checking for sys/param.h... yes<br />

checking for limits.h... yes<br />

checking for stdlib.h... yes<br />

checking for string.h... yes<br />

Most of the output is truncated from the configure script to save space. When the configure<br />

script is completed, you will get back the comm<strong>and</strong> prompt. Now you may start building the<br />

compiler.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!