1 | @c |
---|
2 | @c |
---|
3 | @c COPYRIGHT (c) 1988-1998. |
---|
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 | Make a build directory under tools and build the RTEMS product in this |
---|
72 | directory. The ../@value{RTEMS-UNTAR}/configure |
---|
73 | command has numerous command line |
---|
74 | arguments. These arguments are discussed in detail in documentation that |
---|
75 | comes with the RTEMS distribution. In the installation described in the |
---|
76 | section "Unpack the RTEMS source", these configuration options can be found |
---|
77 | in file tools/@value{RTEMS-UNTAR}/README.configure. |
---|
78 | |
---|
79 | The following shows the command sequence required to configure, |
---|
80 | compile, and install RTEMS with the POSIX API, KA9Q TCP/IP, |
---|
81 | and C++ support disabled. RTEMS will be built to target |
---|
82 | the @code{BOARD_SUPPORT_PACKAGE} board. |
---|
83 | |
---|
84 | @example |
---|
85 | mkdir build-rtems |
---|
86 | cd build-rtems |
---|
87 | ../@value{RTEMS-UNTAR}/configure --target=<TARGET_CONFIGURATION> \ |
---|
88 | --disable-posix --disable-ka9q --disable-cxx \ |
---|
89 | --enable-rtemsbsp=<BOARD_SUPPORT_PACKAGE>\ |
---|
90 | --prefix=<INSTALL_POINT> |
---|
91 | gmake all install |
---|
92 | @end example |
---|
93 | |
---|
94 | Where the list of currently supported of <TARGET_CONFIGURATION>'s and |
---|
95 | <BOARD_SUPPORT_PACKAGE>'s can be found in |
---|
96 | tools/@value{RTEMS-UNTAR}/README.configure. |
---|
97 | |
---|
98 | <INSTALL_POINT> is the installation point from the previous step |
---|
99 | "Modify the bit script" in the build of the tools. |
---|
100 | |
---|
101 | |
---|