RTEMS Logo

RTEMS 4.10.1 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.18.91 for the sparc-rtems4.10 target:

mkdir b-binutils
cd b-binutils
../binutils-2.18.91/configure --target=sparc-rtems4.10 \
  --prefix=/opt/rtems-4.10
make
make install

After binutils-2.18.91 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.18.91 or invoke the binutils-2.18.91 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=/opt/rtems-4.10/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.10-ar: command not found

Configuring and Building GCC and NEWLIB

Before building gcc-4.3.2 and newlib-1.16.0, binutils-2.18.91 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.3.2. Because of this, the newlib-1.16.0 directory source must be available inside the gcc-4.3.2 source tree. This is normally accomplished using a symbolic link as shown in this example:

cd gcc-4.3.2
ln -s ../newlib-1.16.0/newlib .

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

mkdir b-gcc
cd b-gcc
../gcc-4.3.2/configure --target=sparc-rtems4.10 \
   --with-gnu-as --with-gnu-ld --with-newlib --verbose \
   --enable-threads --enable-languages="c,c++" \
   --prefix=/opt/rtems-4.10
make all
make info
make install

After gcc-4.3.2 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.3.2 or invoke the gcc-4.3.2 configure command with the As you will need to frequently run various commands in the /opt/rtems-4.10/bin, you can update your ~/.bashrc to include this line. After doing that, don't forget to run

source ~/.bashrc

for the changes to take place.

--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.3.2 with only C, C++, and Ada support for the sparc-rtems4.10 target:

mkdir b-gcc
cd gcc-4.3.2/gcc/ada
touch treeprs.ads [es]info.h nmake.ad[bs]
cd ../../../b-gcc
../gcc-4.3.2/configure --target=sparc-rtems4.10 \
   --with-gnu-as --with-gnu-ld --with-newlib --verbose \
   --enable-threads --enable-languages="c,c++,ada" \
   --prefix=/opt/rtems-4.10
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.3.2 is built and installed the build directory b-gcc may be removed.


PREV UP NEXT Bookshelf Getting Started with RTEMS

Copyright © 1988-2008 OAR Corporation