source: rtems/doc/started/buildrt.t @ 6e8d424

4.104.114.84.95
Last change on this file since 6e8d424 was 6e8d424, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/27/03 at 16:14:26

2003-08-27 Ralf Corsepius <corsepiu@…>

  • buildc.t, buildrt.t, nt.t, sample.t, tversions.texi: Don't use VARIABLEs containing '-' in @set and @value (violates texi-syntax).
  • Property mode set to 100644
File size: 5.7 KB
Line 
1@c
2@c
3@c  COPYRIGHT (c) 1988-2002.
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 Obtain the RTEMS Source Code
13
14This section provides pointers to the RTEMS source code and
15Hello World example program.  These files should be
16placed in your @code{archive} directory. 
17
18@subheading @value{RTEMSVERSION}
19@example
20    FTP Site:    @value{RTEMSFTPSITE}
21    Directory:   @value{RTEMSFTPDIR}
22    File:        @value{RTEMSTAR}
23@ifset use-html
24@c    URL:         @uref{ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR}, Download RTEMS components}
25    URL:         ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR}
26@end ifset
27@end example
28
29@subheading RTEMS Hello World
30@example
31    FTP Site:    @value{RTEMSFTPSITE}
32    Directory:   @value{RTEMSFTPDIR}
33    File:        hello_world_c.tgz
34@ifset use-html
35@c    URL:         @uref{ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR}/hello_world_c.tgz, Download RTEMS Hello World}
36    URL:         ftp://@value{RTEMSFTPSITE}@value{RTEMSFTPDIR}/hello_world_c.tgz
37@end ifset
38@end example
39
40@c
41@c  Unarchive the RTEMS Source
42@c
43
44@section Unarchive the RTEMS Source
45
46Use the following command sequence to unpack the RTEMS source into the
47tools directory:
48
49@example
50cd tools
51tar xzf ../archive/@value{RTEMSTAR}
52@end example
53
54This creates the directory @value{RTEMSUNTAR}.
55
56
57@section Add <INSTALL_POINT>/bin to Executable PATH
58
59In order to compile RTEMS, you must have the cross compilation toolset
60in your search path.  The following command appends the directory
61where the tools were installed prior to this point:
62
63@example
64export PATH=$PATH:<INSTALL_POINT>/bin
65@end example
66
67NOTE:  The above command is in Bourne shell (@code{sh}) syntax and
68should work with the Korn (@code{ksh}) and GNU Bourne Again Shell
69(@code{bash}).  It will not work with the C Shell (@code{csh}) or
70derivatives of the C Shell.
71
72@section Verifying the Operation of the Cross Toolset
73
74In order to insure that the cross-compiler is invoking the correct
75subprograms (like @code{as} and @code{ld}), one can test assemble
76a small program.  When in verbose mode, @code{gcc} prints out information
77showing where it found the subprograms it invokes.  In a temporary
78working directory, place the following function in a file named @code{f.c}:
79
80@example
81int f( int x )
82@{
83  return x + 1;
84@}
85@end example
86
87Then assemble the file using a command similar to the following:
88
89@example
90m68k-rtems-gcc -v -S f.c
91@end example
92
93Where @code{m68k-rtems-gcc} should be changed to match the installed
94name of your cross compiler.  The result of this command will be
95a sequence of output showing where the cross-compiler searched for
96and found its subcomponents.  Verify that these paths correspond
97to your <INSTALL_POINT>.
98
99Look at the created file @code{f.s} and verify that it is in fact
100for your target processor.
101
102Then try to compile the file @code{f.c} directly to object code
103using a command like the following:
104
105@example
106m68k-rtems-gcc -v -c f.c
107@end example
108
109If this produces messages that indicate the assembly code is
110not valid, then it is likely that you have fallen victim to
111one of the problems described in
112@ref{Error Message Indicates Invalid Option to Assembler}
113Don't feel bad about this, one of the most common installation errors
114is for the cross-compiler not to be able to find the cross assembler
115and default to using the native @code{as}.  This can result in very confusing
116error messages.
117
118@section Building RTEMS for a Specific Target and BSP
119
120This section describes how to configure and build RTEMS
121so that it is specifically tailored for your BSP and the
122CPU model it uses.  There is currently only one supported
123method to compile and install RTEMS:
124
125@itemize @bullet
126@item direct invocation of @code{configure} and @code{make}
127@end itemize
128
129Direct invocation of @code{configure} and @code{make} provides more control
130and easier recovery from problems when building.
131
132This section describes how to build RTEMS.
133
134@subsection Using the RTEMS configure Script Directly
135
136Make a build directory under tools and build the RTEMS product in this
137directory. The ../@value{RTEMSUNTAR}/configure
138command has numerous command line
139arguments. These arguments are discussed in detail in documentation that
140comes with the RTEMS distribution. If you followed the procedure
141described in the section @ref{Unarchive the RTEMS Source}, these
142configuration options can be found in the file
143tools/@value{RTEMSUNTAR}/README.configure.
144
145@b{NOTE}: The GNAT/RTEMS run-time implementation is based on the POSIX
146API.  Thus the RTEMS configuration for a GNAT/RTEMS environment MUST
147include the @code{--enable-posix} flag.
148
149The following shows the command sequence required to configure,
150compile, and install RTEMS with the POSIX API, FreeBSD TCP/IP,
151and C++ support disabled.  RTEMS will be built to target
152the @code{BOARD_SUPPORT_PACKAGE} board.
153
154@example
155mkdir build-rtems
156cd build-rtems
157../@value{RTEMSUNTAR}/configure --target=<TARGET_CONFIGURATION> \
158    --disable-posix --disable-tcpip --disable-cxx \
159    --enable-rtemsbsp=<BOARD_SUPPORT_PACKAGE>\
160    --prefix=<INSTALL_POINT>
161make all install
162@end example
163
164Where the list of currently supported <TARGET_CONFIGURATION>'s and
165<BOARD_SUPPORT_PACKAGE>'s can be found in
166tools/@value{RTEMSUNTAR}/README.configure.
167
168<INSTALL_POINT> is typically the installation point for the
169tools and is @code{/opt/rtems} when using prebuilt toolset executables.
170
171BSP is a supported BSP for the selected CPU family.  The list of
172supported BSPs may be found in the file
173tools/@value{RTEMSUNTAR}/README.configure
174in the RTEMS source tree.  If the BSP parameter is not specified,
175then all supported BSPs for the selected CPU family will be built.
176
177@b{NOTE:}  The POSIX API must be enabled to use GNAT/RTEMS.
178
179@b{NOTE:} The @code{make} utility used should be GNU make.
180
Note: See TracBrowser for help on using the repository browser.