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 May 28, 2000 at 7:37:23 PM

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
Line 
1@c
2@c
3@c  COPYRIGHT (c) 1988-1999.
4@c  On-Line Applications Research Corporation (OAR).
5@c  All rights reserved.
6@c
7@c  $Id$
8@c
9
10@chapter Building RTEMS
11
12@section Unpack the RTEMS Source
13
14Use the following command sequence to unpack the RTEMS source into the
15tools directory:
16
17@example
18cd tools
19tar xzf ../archive/@value{RTEMS-TAR}
20@end example
21
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
42@section Add <INSTALL_POINT>/bin to Executable PATH
43
44In order to compile RTEMS, you must have the cross compilation toolset
45in your search patch.  The following command appends the directory
46where the tools were installed prior to this point:
47
48@example
49export PATH=$PATH:<INSTALL_POINT>/bin
50@end example
51
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 )
67@{
68  return x + 1;
69@}
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.
88
89@section Generate RTEMS for a Specific Target and BSP
90
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
125@b{NOTE:}  The POSIX API must be enabled to use GNAT/RTEMS.
126
127@subsection Using the RTEMS configure Script Directly
128
129Make a build directory under tools and build the RTEMS product in this
130directory. The ../@value{RTEMS-UNTAR}/configure
131command has numerous command line
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
135in the file tools/@value{RTEMS-UNTAR}/README.configure.
136
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
141The following shows the command sequence required to configure,
142compile, and install RTEMS with the POSIX API, FreeBSD TCP/IP,
143and C++ support disabled.  RTEMS will be built to target
144the @code{BOARD_SUPPORT_PACKAGE} board.
145
146@example
147mkdir build-rtems
148cd build-rtems
149../@value{RTEMS-UNTAR}/configure --target=<TARGET_CONFIGURATION> \
150    --disable-posix --disable-tcpip --disable-cxx \
151    --enable-rtemsbsp=<BOARD_SUPPORT_PACKAGE>\
152    --prefix=<INSTALL_POINT>
153make all install
154@end example
155
156Where the list of currently supported of <TARGET_CONFIGURATION>'s and
157<BOARD_SUPPORT_PACKAGE>'s can be found in
158tools/@value{RTEMS-UNTAR}/README.configure.
159
160<INSTALL_POINT> is the installation point from the previous step
161"Modify the bit script" in the build of the tools.
162
163NOTE: The @code{make} utility used should be GNU make.
Note: See TracBrowser for help on using the repository browser.