Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Sauermann J.Realtime operating systems.Concepts and implementation of microkernels for embedded systems.1997.pdf
Скачиваний:
29
Добавлен:
23.08.2013
Размер:
1.32 Mб
Скачать

6. Development Environment

109

 

 

6.3Prerequisites

In order to create the development environment, the following items are required on the host machine:

A suitable native C compiler, preferably gcc

Sufficient support for native program development

A make program, preferably gmake

The term suitable refers to the requirements of the binutils and gcc packages which are stated in the README and INSTALL files provided with these packages. The INSTALL file for gcc says that “You cannot install GNU C by itself on MSDOS; it will not compile under any MSDOS compiler except itself”. In such cases, you will need a native gcc in binary form; see Section 6.3.2.

Depending on your actual host, there are mainly three scenarios which are described in the following sections.

6.3.1 Scenario 1: UNIX or Linux Host

With a UNIX or Linux host, you already have a suitable native C compiler which may or may not be gcc. You also have several other programs such as tar, sed, and sh installed as part of the normal UNIX installation.

You also have a make program installed, but it might not be the GNU make program. In this case, you should consider to install GNU make as well and use it for building the cross-environment. GNU make is by default installed as a program called make, which may conflict with an already existing make program. In the following, we assume that GNU make is installed as gmake rather than make.

To install GNU make, proceed as follows:

Get hold of a file called make-3.76.1.tar.gz and store it in a separate directory. You can get this file either from a CD-ROM, e.g. from a Linux distribution, or from the WWW: ftp://prep.ai.mit.edu/pub/gnu/make-3.76.1.tar.gz or ftp://ftp.funet.fi/pub/gnu/gnu/make-3.76.1.tar.gz

In the separate directory, unpack the file:

> tar -xvzf make-3.76.1.tar.gz

or

> zcat make-3.76.1.tar.gz | tar -xvf -

if your tar program does not

 

support the -z option

Change to the directory created by the tar program:

110

6.3 Prerequisites

 

 

>cd make-3.76.1

Read the files README and INSTALL for instructions particular for your host

Configure the package:

>./configure

Build the packet. This takes about 5 minutes:

>make

Install the packet. This may require root privileges, depending on where you want it to be installed. At this point, consider the name conflicts with the existing make program. Make sure that GNU make is installed as gmake:

>make install

6.3.2 Scenario 2: DOS Host

The simplest way for a DOS host is to fetch binary versions of gcc and gmake. Please refer to

ftp://prep.ai.mit.edu/pub/gnu/MicrosPorts/MSDOS.gcc

for links to sites providing such binaries.

The gcc and binutils packages provide special means for building the crossenvironment for DOS. The gmake is not strictly required, since it is not needed for building the cross-environment, and you will have to modify the Makefile for the embedded system anyway, since most UNIX commands are not available under DOS. You should fetch the gmake nevertheless, because this requires less changes for the target Makefile .

6.3.3 Scenario 3: Other Host or Scenarios 1 and 2 Failed

If none of the above scenarios discussed above succeeds, you can still survive:

Get hold of a machine satisfying one of the above scenarios. This machine is called the build machine.

On the build machine, install gmake (not required for scenario 2) and gcc as a native C compiler for the build machine.

On the build machine, build the cross-environment as described later on. Observe the README and INSTALL files particularly carefully. When configuring the packets, set the --build, --host and --target options accordingly.

6. Development Environment

111

 

 

Copy the cross-environment to your host.

After that, the build machine is no longer needed.