RTEMS Logo

RTEMS 4.8.0 On-Line Library


Using configure and make

PREV UP NEXT Bookshelf Getting Started with RTEMS

4.1.4.2: Using configure and make

NOTE: The procedures described in the following sections must be completed before this step:

This section describes the process of building binutils, gcc, and newlib manually using configure and make directly.

Configuring and Building BINUTILS

The following example illustrates the invocation of configure and make to build and install binutils-2.17 for the sparc-rtems4.8 target:

mkdir b-binutils
cd b-binutils
../binutils-2.17/configure --target=sparc-rtems4.8 \
  --prefix=/tmp/rtemsdocs-4.8.0
make all
make info
make install

After binutils-2.17 is built and installed the build directory b-binutils may be removed.

For more information on the invocation of configure, please refer to the documentation for binutils-2.17 or invoke the binutils-2.17 configure command with the --help option.

NOTE: The shell PATH variable needs to be updated to include the path the binutils user executables have been installed in. The directory containing the executables is the prefix used above with `bin' post-fixed.

export PATH=/tmp/rtemsdocs-4.8.0/bin:${PATH}

Failure to have the binutils in the path will cause the GCC and NEWLIB build to fail with an error message similar to:

sparc-rtems4.8-ar: command not found

Configuring and Building GCC and NEWLIB

Before building gcc-4.1.1 and newlib-1.15.0, binutils-2.17 must be installed and the directory containing those executables must be in your PATH.

The C Library is built as a subordinate component of gcc-4.1.1. Because of this, the newlib-1.15.0 directory source must be available inside the gcc-4.1.1 source tree. This is normally accomplished using a symbolic link as shown in this example:

cd gcc-4.1.1
ln -s ../newlib-1.15.0/newlib .

The following example illustrates the invocation of configure and make to build and install gcc-4.1.1 with only C and C++ support for the sparc-rtems4.8 target:

mkdir b-gcc
cd b-gcc
../gcc-4.1.1/configure --target=sparc-rtems4.8 \
   --with-gnu-as --with-gnu-ld --with-newlib --verbose \
   --enable-threads --enable-languages="c,c++" \
   --prefix=/tmp/rtemsdocs-4.8.0
make all
make info
make install

After gcc-4.1.1 is built and installed the build directory b-gcc may be removed.

For more information on the invocation of configure, please refer to the documentation for gcc-4.1.1 or invoke the gcc-4.1.1 configure command with the --help option.

Building GCC with Ada Support

If you want a GCC toolset that includes support for Ada (e.g. GNAT), there are some additional requirements on the host environment and additional build steps to perform. It is critical that you use the same version of GCC/GNAT as the native compiler. GNAT must be compiled with an Ada compiler and when building a GNAT cross-compiler, it should be the same version of GNAT itself.

The build procedure is the same until the configure step. A GCC toolset with GNAT enabled requires that ada be included in the set of enabled languages. The following example illustrates the invocation of configure and make to build and install gcc-4.1.1 with only C, C++, and Ada support for the sparc-rtems4.8 target:

mkdir b-gcc
cd gcc-4.1.1/gcc/ada
touch treeprs.ads [es]info.h nmake.ad[bs]
cd ../../../b-gcc
../gcc-4.1.1/configure --target=sparc-rtems4.8 \
   --with-gnu-as --with-gnu-ld --with-newlib --verbose \
   --enable-threads --enable-languages="c,c++,ada" \
   --prefix=/tmp/rtemsdocs-4.8.0
make all
make info
make -C gcc cross-gnattools
make -C gcc ada.all.cross
make -C gcc GNATLIBCFLAGS="USER_SELECTED_CPU_CFLAGS" gnatlib
make install

After gcc-4.1.1 is built and installed the build directory b-gcc may be removed.


PREV UP NEXT Bookshelf Getting Started with RTEMS

Copyright © 1988-2007OAR Corporation