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 | |
---|
14 | Use the following command sequence to unpack the RTEMS source into the |
---|
15 | tools directory: |
---|
16 | |
---|
17 | @example |
---|
18 | cd tools |
---|
19 | tar xzf ../archive/@value{RTEMS-TAR} |
---|
20 | @end example |
---|
21 | |
---|
22 | @section Add <INSTALL_POINT>/bin to Executable PATH |
---|
23 | |
---|
24 | In order to compile RTEMS, you must have the cross compilation toolset |
---|
25 | in your search patch. The following command appends the directory |
---|
26 | where the tools were installed in the previous chapter: |
---|
27 | |
---|
28 | @example |
---|
29 | export PATH=$PATH:<INSTALL_POINT>/bin |
---|
30 | @end example |
---|
31 | |
---|
32 | NOTE: The above command is in Bourne shell (@code{sh}) syntax and |
---|
33 | should work with the Korn (@code{ksh}) and GNU Bourne Again Shell |
---|
34 | (@code{bash}). It will not work with the C Shell (@code{csh}) or |
---|
35 | derivatives of the C Shell. |
---|
36 | |
---|
37 | @section Verifying the Operation of the Cross Toolset |
---|
38 | |
---|
39 | In order to insure that the cross-compiler is invoking the correct |
---|
40 | subprograms (like @code{as} and @code{ld}), one can test assemble |
---|
41 | a small program. When in verbose more, @code{gcc} prints out information |
---|
42 | showing where it found the subprograms it invokes. Place the following |
---|
43 | function in a file named @code{f.c}: |
---|
44 | |
---|
45 | @example |
---|
46 | int f( int x ) |
---|
47 | @{ |
---|
48 | return x + 1; |
---|
49 | @} |
---|
50 | @end example |
---|
51 | |
---|
52 | Then assemble the file using a command similar to the following: |
---|
53 | |
---|
54 | @example |
---|
55 | m68k-rtems-gcc -v -S f.c |
---|
56 | @end example |
---|
57 | |
---|
58 | Where @code{m68k-rtems-gcc} should be changed to match the installed |
---|
59 | name of your cross compiler. The result of this command will be |
---|
60 | a sequence of output showing where the cross-compiler searched for |
---|
61 | and found its subcomponents. Verify that these paths correspond |
---|
62 | to your <INSTALL_POINT>. |
---|
63 | |
---|
64 | @b{NOTE:} One of the most common installation errors is for the |
---|
65 | cross-compiler not to be able to find the cross assembler and default |
---|
66 | to using the native @code{as}. This can result in very confusing |
---|
67 | error messages. |
---|
68 | |
---|
69 | @section Generate RTEMS for a Specific Target and BSP |
---|
70 | |
---|
71 | @subsection Using the bit_rtems Script |
---|
72 | |
---|
73 | The simplest way to build RTEMS is to use the @code{bit_rtems} script. |
---|
74 | This script interprets the settings in the @code{user.cfg} file to |
---|
75 | enable or disable the various RTEMS options. |
---|
76 | |
---|
77 | This script is invoked as follows: |
---|
78 | |
---|
79 | @example |
---|
80 | ./bit_rtems CPU [BSP] |
---|
81 | @end example |
---|
82 | |
---|
83 | Where CPU is one of the RTEMS supported CPU families from the following |
---|
84 | list: |
---|
85 | |
---|
86 | @itemize @bullet |
---|
87 | @item hppa1.1 |
---|
88 | @item i386 |
---|
89 | @item i386-elf |
---|
90 | @item i386-go32 |
---|
91 | @item i960 |
---|
92 | @item m68k |
---|
93 | @item mips64orion |
---|
94 | @item powerpc |
---|
95 | @item sh |
---|
96 | @item sparc |
---|
97 | @end itemize |
---|
98 | |
---|
99 | BSP is a supported BSP for the selected CPU family. The list of |
---|
100 | supported BSPs may be found in the file |
---|
101 | tools/@value{RTEMS-UNTAR}/README.configure |
---|
102 | in the RTEMS source tree. If the BSP parameter is not specified, |
---|
103 | then all supported BSPs for the selected CPU family will be built. |
---|
104 | |
---|
105 | @subsection Using the RTEMS configure Script Directly |
---|
106 | |
---|
107 | Make a build directory under tools and build the RTEMS product in this |
---|
108 | directory. The ../@value{RTEMS-UNTAR}/configure |
---|
109 | command has numerous command line |
---|
110 | arguments. These arguments are discussed in detail in documentation that |
---|
111 | comes with the RTEMS distribution. In the installation described in the |
---|
112 | section "Unpack the RTEMS source", these configuration options can be found |
---|
113 | in the file tools/@value{RTEMS-UNTAR}/README.configure. |
---|
114 | |
---|
115 | The following shows the command sequence required to configure, |
---|
116 | compile, and install RTEMS with the POSIX API, FreeBSD TCP/IP, |
---|
117 | and C++ support disabled. RTEMS will be built to target |
---|
118 | the @code{BOARD_SUPPORT_PACKAGE} board. |
---|
119 | |
---|
120 | @example |
---|
121 | mkdir build-rtems |
---|
122 | cd build-rtems |
---|
123 | ../@value{RTEMS-UNTAR}/configure --target=<TARGET_CONFIGURATION> \ |
---|
124 | --disable-posix --disable-tcpip --disable-cxx \ |
---|
125 | --enable-rtemsbsp=<BOARD_SUPPORT_PACKAGE>\ |
---|
126 | --prefix=<INSTALL_POINT> |
---|
127 | make all install |
---|
128 | @end example |
---|
129 | |
---|
130 | Where the list of currently supported of <TARGET_CONFIGURATION>'s and |
---|
131 | <BOARD_SUPPORT_PACKAGE>'s can be found in |
---|
132 | tools/@value{RTEMS-UNTAR}/README.configure. |
---|
133 | |
---|
134 | <INSTALL_POINT> is the installation point from the previous step |
---|
135 | "Modify the bit script" in the build of the tools. |
---|
136 | |
---|
137 | NOTE: The @code{make} utility used should be GNU make. |
---|