source: rtems/doc/started/buildrt.t @ 45c8fb6

4.115
Last change on this file since 45c8fb6 was df631170, checked in by Joel Sherrill <joel.sherrill@…>, on 12/14/10 at 16:51:17

2010-12-14 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac, common/cpright.texi, common/rtems.texi.in, cpu_supplement/.cvsignore, started/Makefile.am, started/binaries.t, started/buildc.t, started/buildrt.t, started/intro.t, started/nextstep.t, started/nt.t, started/require.t, started/sample.t, started/started.texi, started/version.texi: Major update which includes removal of references to specific tool versions and patches.
  • started/tversions.texi.in: Removed.
  • Property mode set to 100644
File size: 6.5 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-2010.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Building RTEMS
10
11@section Obtain the RTEMS Source Code
12
13This section provides pointers to the RTEMS source code and example
14programs.  These files should be placed in your @code{archive} directory.
15The set of tarballs which comprise an RTEMS release is placed in a
16directory whose name if the release on the ftp site.  The RTEMS ftp site
17is accessible via both the ftp and http protocols at the following URLs:
18 
19@itemize @bullet
20@item @uref{http://www.rtems.org/ftp/pub/rtems,http://www.rtems.org/ftp/pub/rtems}
21@item @uref{ftp://www.rtems.org/pub/rtems,ftp://www.rtems.org/pub/rtems}
22@end itemize
23
24Associated with each RTEMS Release is a set of example programs.
25Prior to the 4.10 Release Series, these examples were in a "Class
26Examples" and an "Examples" collection.  Beginning with the 4.10 Release
27Series, these examples collections were merged and other examples added.
28This new collection is called "Examples V2".  It is contained in the file
29@code{examples-v2-<VERSION>.tar.bz2>} within the RTEMS release directory.
30
31@c
32@c  Unarchive the RTEMS Source
33@c
34
35@section Unarchive the RTEMS Source
36
37Use the following command sequence to unpack the RTEMS source into the
38tools directory:
39
40@example
41cd tools
42tar xjf ../archive/rtems-@value{RTEMSAPI}.<VERSION>.tar.bz2
43@end example
44
45This creates the directory rtems-@value{RTEMSAPI}.<VERSION>
46
47@section Add <INSTALL_POINT>/bin to Executable PATH
48
49In order to compile RTEMS, you must have the cross compilation toolset
50in your search path.  It is important to have the RTEMS toolset first
51in your path to ensure that you are using the intended version of all
52tools.  The following command prepends the directory where
53the tools were installed in a previous step.  If you are using
54binaries provided by the RTEMS Project, the <INSTALL_POINT> will be
55@code{/opt/rtems-@value{RTEMSAPI}}
56
57@example
58export PATH=<INSTALL_POINT>/bin:$@{PATH@}
59@end example
60
61@b{NOTE:}  The above command is in Bourne shell (@code{sh}) syntax and should
62work with the Korn (@code{ksh}) and GNU Bourne Again Shell (@code{bash}).
63It will not work with the C Shell (@code{csh}) or derivatives of the
64C Shell.
65
66@section Verifying the Operation of the Cross Toolset
67
68In order to insure that the cross-compiler is invoking the correct
69subprograms (like @code{as} and @code{ld}), one can test assemble
70a small program.  When in verbose mode, @code{gcc} prints out information
71showing where it found the subprograms it invokes.  In a temporary
72working directory, place the following function in a file named @code{f.c}:
73
74@example
75int f( int x )
76@{
77  return x + 1;
78@}
79@end example
80
81Then assemble the file using a command similar to the following:
82
83@example
84m68k-rtems@value{RTEMSAPI}-gcc -v -S f.c
85@end example
86
87Where @code{m68k} should be changed to match the target architecture
88of your cross compiler.  The result of this command will be a sequence
89of output showing where the cross-compiler searched for and found
90its subcomponents.  Verify that these paths correspond to your
91<INSTALL_POINT>.
92
93Look at the created file @code{f.s} and verify that it is in fact
94for your target processor.
95
96Then try to compile the file @code{f.c} directly to object code
97using a command like the following:
98
99@example
100m68k-rtems@code{RTEMSAPI}-gcc -v -c f.c
101@end example
102
103If this produces messages that indicate the assembly code is not valid,
104then it is likely that you have fallen victim to one of the problems
105described in @ref{Error Message Indicates Invalid Option to Assembler}
106Please do not feel bad about this and do not give up, one of the most
107common installation errors is for the cross-compiler not to be able
108to find the cross assembler and default to using the native @code{as}.
109This can result in very confusing error messages.
110
111@section Building RTEMS for a Specific Target and BSP
112
113This section describes how to configure and build RTEMS
114so that it is specifically tailored for your BSP and the
115CPU model it uses.  There is currently only one supported
116method to compile and install RTEMS:
117
118@itemize @bullet
119@item direct invocation of @code{configure} and @code{make}
120@end itemize
121
122Direct invocation of @code{configure} and @code{make} provides more control
123and easier recovery from problems when building.
124
125This section describes how to build 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 @code{../rtems-@value{RTEMSAPI}.<VERSION>/configure}
131command has numerous command line arguments. These arguments are
132discussed in detail in documentation that comes with the RTEMS
133distribution. A full list of these arguments can be obtained by running
134@code{../rtems-@value{RTEMSAPI}.<VERSION>/configure --help} If you
135followed the procedure described in the section @ref{Unarchive the
136RTEMS Source}, these configuration options can be found in the file
137tools/rtems-@value{RTEMSAPI}.<VERSION>/README.configure.
138
139@b{NOTE}: The GNAT/RTEMS run-time implementation is based on the POSIX
140API and the GNAT/RTEMS run-time cannot be compiled with networking
141disabled. Your application does not have to use networking but it must
142be enabled.  Thus the RTEMS configuration for a GNAT/RTEMS environment
143MUST include the @code{--enable-posix --enable-networking} flag.
144
145The following shows the command sequence required to configure,
146compile, and install RTEMS with the POSIX API, FreeBSD TCP/IP,
147and C++ support disabled.  RTEMS will be built to target
148the @code{BOARD_SUPPORT_PACKAGE} board.
149
150@example
151mkdir build-rtems
152cd build-rtems
153../rtems-@value{RTEMSAPI}.VERSION/configure --target=<TARGET_CONFIGURATION> \
154    --disable-posix --disable-networking --disable-cxx \
155    --enable-rtemsbsp=<BSP>\
156    --prefix=<INSTALL_POINT>
157make all install
158@end example
159
160<TARGET> is of the form <CPU>-rtems@value{RTEMSAPI} and the list of
161currently supported <TARGET> configuration's and <BSP>'s can be found in
162@code{tools/RTEMS-@value{RTEMSAPI}.<VERSION>/README.configure}.
163
164<INSTALL_POINT> is typically the installation point for the tools and
165defaults to @code{/opt/rtems-@value{RTEMSAPI}}.
166
167BSP is a supported BSP for the selected CPU family.
168The list of supported BSPs may be found in the file
169@code{tools/rtems-@value{RTEMSAPI}.<VERSION>/README.configure} in the
170RTEMS source tree.  If the BSP parameter is not specified, then all
171supported BSPs for the selected CPU family will be built.
172
173@b{NOTE:} The POSIX API and networking must be enabled to use GNAT/RTEMS.
174
175@b{NOTE:} The @code{make} utility used should be GNU make.
Note: See TracBrowser for help on using the repository browser.