source: rtems/doc/started/buildrt.t @ 1732414

4.104.114.84.95
Last change on this file since 1732414 was 1732414, checked in by Joel Sherrill <joel.sherrill@…>, on 05/28/00 at 19:37:23

Added information on how to do this step if you installed tool
binaries rather than unpacking everything.

  • Property mode set to 100644
File size: 4.8 KB
RevLine 
[417fcc73]1@c
[6113b3a]2@c
[0660b4f8]3@c  COPYRIGHT (c) 1988-1999.
[417fcc73]4@c  On-Line Applications Research Corporation (OAR).
5@c  All rights reserved.
6@c
7@c  $Id$
8@c
9
[6113b3a]10@chapter Building RTEMS
[417fcc73]11
[57a736ff]12@section Unpack the RTEMS Source
[417fcc73]13
[6113b3a]14Use the following command sequence to unpack the RTEMS source into the
15tools directory:
[417fcc73]16
17@example
18cd tools
[ae2e9f2]19tar xzf ../archive/@value{RTEMS-TAR}
[417fcc73]20@end example
21
[1732414]22If you did not build and instal the tools from source, then you
23will need to unarchive the build scripts at this point.  In this
24case, you will have to execute the following additional command
25since you did not do it as part of building the tools.
26
27@example
28tar xzf ../archive/@value{BUILDTOOLS-TAR}
29@end example
30
31At this point, the following files and directories should
32exist in the current directory in order to build RTEMS:
33
34@itemize @bullet
35@item bit
36@item bit_rtems
37@item common.sh
38@item @value{RTEMS-UNTAR}
39@item user.cfg
40@end itemize
41
[57a736ff]42@section Add <INSTALL_POINT>/bin to Executable PATH
[417fcc73]43
[bdec2709]44In order to compile RTEMS, you must have the cross compilation toolset
45in your search patch.  The following command appends the directory
[1732414]46where the tools were installed prior to this point:
[417fcc73]47
48@example
[bdec2709]49export PATH=$PATH:<INSTALL_POINT>/bin
[417fcc73]50@end example
51
[c1c5ab9]52NOTE:  The above command is in Bourne shell (@code{sh}) syntax and
53should work with the Korn (@code{ksh}) and GNU Bourne Again Shell
54(@code{bash}).  It will not work with the C Shell (@code{csh}) or
55derivatives of the C Shell.
56
57@section Verifying the Operation of the Cross Toolset
58
59In order to insure that the cross-compiler is invoking the correct
60subprograms (like @code{as} and @code{ld}), one can test assemble
61a small program.  When in verbose more, @code{gcc} prints out information
62showing where it found the subprograms it invokes.  Place the following
63function in a file named @code{f.c}:
64
65@example
66int f( int x )
[6cede6e]67@{
[c1c5ab9]68  return x + 1;
[6cede6e]69@}
[c1c5ab9]70@end example
71
72Then assemble the file using a command similar to the following:
73
74@example
75m68k-rtems-gcc -v -S f.c
76@end example
77
78Where @code{m68k-rtems-gcc} should be changed to match the installed
79name of your cross compiler.  The result of this command will be
80a sequence of output showing where the cross-compiler searched for
81and found its subcomponents.  Verify that these paths correspond
82to your <INSTALL_POINT>.
83
84@b{NOTE:} One of the most common installation errors is for the
85cross-compiler not to be able to find the cross assembler and default
86to using the native @code{as}.  This can result in very confusing
87error messages.
[bdec2709]88
[57a736ff]89@section Generate RTEMS for a Specific Target and BSP
[417fcc73]90
[3fccbb34]91@subsection Using the bit_rtems Script
92
93The simplest way to build RTEMS is to use the @code{bit_rtems} script.
94This script interprets the settings in the @code{user.cfg} file to
95enable or disable the various RTEMS options.
96
97This script is invoked as follows:
98
99@example
100./bit_rtems CPU [BSP]
101@end example
102
103Where CPU is one of the RTEMS supported CPU families from the following
104list:
105
106@itemize @bullet
107@item hppa1.1
108@item i386
109@item i386-elf
110@item i386-go32
111@item i960
112@item m68k
113@item mips64orion
114@item powerpc
115@item sh
116@item sparc
117@end itemize
118
119BSP is a supported BSP for the selected CPU family.  The list of
120supported BSPs may be found in the file
121tools/@value{RTEMS-UNTAR}/README.configure
122in the RTEMS source tree.  If the BSP parameter is not specified,
123then all supported BSPs for the selected CPU family will be built.
124
[adee5979]125@b{NOTE:}  The POSIX API must be enabled to use GNAT/RTEMS.
126
[3fccbb34]127@subsection Using the RTEMS configure Script Directly
128
[6113b3a]129Make a build directory under tools and build the RTEMS product in this
[bdec2709]130directory. The ../@value{RTEMS-UNTAR}/configure
131command has numerous command line
[6113b3a]132arguments. These arguments are discussed in detail in documentation that
133comes with the RTEMS distribution. In the installation described in the
134section "Unpack the RTEMS source", these configuration options can be found
[3fccbb34]135in the file tools/@value{RTEMS-UNTAR}/README.configure.
[417fcc73]136
[adee5979]137The GNAT/RTEMS run-time implementation is based on the POSIX API.  Thus
138the RTEMS configuration for a GNAT/RTEMS environment MUST include the
139@code{--enable-posix} flag.
140
[bdec2709]141The following shows the command sequence required to configure,
[3fccbb34]142compile, and install RTEMS with the POSIX API, FreeBSD TCP/IP,
[bdec2709]143and C++ support disabled.  RTEMS will be built to target
144the @code{BOARD_SUPPORT_PACKAGE} board.
[417fcc73]145
146@example
[6113b3a]147mkdir build-rtems
148cd build-rtems
[bdec2709]149../@value{RTEMS-UNTAR}/configure --target=<TARGET_CONFIGURATION> \
[3fccbb34]150    --disable-posix --disable-tcpip --disable-cxx \
[bdec2709]151    --enable-rtemsbsp=<BOARD_SUPPORT_PACKAGE>\
152    --prefix=<INSTALL_POINT>
[0689ac5]153make all install
[417fcc73]154@end example
155
[57a736ff]156Where the list of currently supported of <TARGET_CONFIGURATION>'s and
[6113b3a]157<BOARD_SUPPORT_PACKAGE>'s can be found in
[bdec2709]158tools/@value{RTEMS-UNTAR}/README.configure.
[417fcc73]159
[6113b3a]160<INSTALL_POINT> is the installation point from the previous step
161"Modify the bit script" in the build of the tools.
[417fcc73]162
[0689ac5]163NOTE: The @code{make} utility used should be GNU make.
Note: See TracBrowser for help on using the repository browser.