diff options
Diffstat (limited to 'documentation/adt-manual/adt-command.xml')
-rw-r--r-- | documentation/adt-manual/adt-command.xml | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/documentation/adt-manual/adt-command.xml b/documentation/adt-manual/adt-command.xml index c6609193d1..e5b2cdb420 100644 --- a/documentation/adt-manual/adt-command.xml +++ b/documentation/adt-manual/adt-command.xml | |||
@@ -6,22 +6,22 @@ | |||
6 | <title>Using the Command Line</title> | 6 | <title>Using the Command Line</title> |
7 | 7 | ||
8 | <para> | 8 | <para> |
9 | Recall that earlier the manual discussed how to use an existing toolchain | 9 | Recall that earlier the manual discussed how to use an existing toolchain |
10 | tarball that had been installed into <filename>/opt/poky</filename>, | 10 | tarball that had been installed into <filename>/opt/poky</filename>, |
11 | which is outside of the | 11 | which is outside of the |
12 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | 12 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> |
13 | (see the section "<link linkend='using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball)</link>". | 13 | (see the section "<link linkend='using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball)</link>". |
14 | And, that sourcing your architecture-specific environment setup script | 14 | And, that sourcing your architecture-specific environment setup script |
15 | initializes a suitable cross-toolchain development environment. | 15 | initializes a suitable cross-toolchain development environment. |
16 | During the setup, locations for the compiler, QEMU scripts, QEMU binary, | 16 | During the setup, locations for the compiler, QEMU scripts, QEMU binary, |
17 | a special version of <filename>pkgconfig</filename> and other useful | 17 | a special version of <filename>pkgconfig</filename> and other useful |
18 | utilities are added to the <filename>PATH</filename> variable. | 18 | utilities are added to the <filename>PATH</filename> variable. |
19 | Variables to assist <filename>pkgconfig</filename> and <filename>autotools</filename> | 19 | Variables to assist <filename>pkgconfig</filename> and <filename>autotools</filename> |
20 | are also defined so that, | 20 | are also defined so that, |
21 | for example, <filename>configure.sh</filename> can find pre-generated | 21 | for example, <filename>configure.sh</filename> can find pre-generated |
22 | test results for tests that need target hardware on which to run. | 22 | test results for tests that need target hardware on which to run. |
23 | These conditions allow you to easily use the toolchain outside of the | 23 | These conditions allow you to easily use the toolchain outside of the |
24 | OpenEmbedded build environment on both autotools-based projects and | 24 | OpenEmbedded build environment on both autotools-based projects and |
25 | Makefile-based projects. | 25 | Makefile-based projects. |
26 | </para> | 26 | </para> |
27 | 27 | ||
@@ -29,9 +29,9 @@ | |||
29 | <title>Autotools-Based Projects</title> | 29 | <title>Autotools-Based Projects</title> |
30 | 30 | ||
31 | <para> | 31 | <para> |
32 | Once you have a suitable cross-toolchain installed, it is very easy to | 32 | Once you have a suitable cross-toolchain installed, it is very easy to |
33 | develop a project outside of the OpenEmbedded build system. | 33 | develop a project outside of the OpenEmbedded build system. |
34 | This section presents a simple "Helloworld" example that shows how | 34 | This section presents a simple "Helloworld" example that shows how |
35 | to set up, compile, and run the project. | 35 | to set up, compile, and run the project. |
36 | </para> | 36 | </para> |
37 | 37 | ||
@@ -42,7 +42,7 @@ | |||
42 | Follow these steps to create a simple autotools-based project: | 42 | Follow these steps to create a simple autotools-based project: |
43 | <orderedlist> | 43 | <orderedlist> |
44 | <listitem><para><emphasis>Create your directory:</emphasis> | 44 | <listitem><para><emphasis>Create your directory:</emphasis> |
45 | Create a clean directory for your project and then make | 45 | Create a clean directory for your project and then make |
46 | that directory your working location: | 46 | that directory your working location: |
47 | <literallayout class='monospaced'> | 47 | <literallayout class='monospaced'> |
48 | $ mkdir $HOME/helloworld | 48 | $ mkdir $HOME/helloworld |
@@ -78,25 +78,25 @@ | |||
78 | AC_OUTPUT(Makefile) | 78 | AC_OUTPUT(Makefile) |
79 | </literallayout></para></listitem> | 79 | </literallayout></para></listitem> |
80 | </itemizedlist></para></listitem> | 80 | </itemizedlist></para></listitem> |
81 | <listitem><para><emphasis>Source the cross-toolchain | 81 | <listitem><para><emphasis>Source the cross-toolchain |
82 | environment setup file:</emphasis> | 82 | environment setup file:</emphasis> |
83 | Installation of the cross-toolchain creates a cross-toolchain | 83 | Installation of the cross-toolchain creates a cross-toolchain |
84 | environment setup script in <filename>/opt/poky/<release></filename>. | 84 | environment setup script in <filename>/opt/poky/<release></filename>. |
85 | Before you can use the tools to develop your project, you must | 85 | Before you can use the tools to develop your project, you must |
86 | source this setup script. | 86 | source this setup script. |
87 | The script begins with the string "environment-setup" and contains | 87 | The script begins with the string "environment-setup" and contains |
88 | the machine architecture, which is followed by the string | 88 | the machine architecture, which is followed by the string |
89 | "poky-linux". | 89 | "poky-linux". |
90 | Here is an example for an environment setup using the | 90 | Here is an example for an environment setup using the |
91 | 32-bit Intel x86 Architecture and using the | 91 | 32-bit Intel x86 Architecture and using the |
92 | &DISTRO_NAME; Yocto Project release: | 92 | &DISTRO_NAME; Yocto Project release: |
93 | <literallayout class='monospaced'> | 93 | <literallayout class='monospaced'> |
94 | $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux | 94 | $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux |
95 | </literallayout></para></listitem> | 95 | </literallayout></para></listitem> |
96 | <listitem><para><emphasis>Generate the local <filename>aclocal.m4</filename> | 96 | <listitem><para><emphasis>Generate the local <filename>aclocal.m4</filename> |
97 | files and create the configure script:</emphasis> | 97 | files and create the configure script:</emphasis> |
98 | The following GNU Autotools generate the local | 98 | The following GNU Autotools generate the local |
99 | <filename>aclocal.m4</filename> files and create the | 99 | <filename>aclocal.m4</filename> files and create the |
100 | configure script: | 100 | configure script: |
101 | <literallayout class='monospaced'> | 101 | <literallayout class='monospaced'> |
102 | $ aclocal | 102 | $ aclocal |
@@ -104,8 +104,8 @@ | |||
104 | </literallayout></para></listitem> | 104 | </literallayout></para></listitem> |
105 | <listitem><para><emphasis>Generate files needed by GNU | 105 | <listitem><para><emphasis>Generate files needed by GNU |
106 | coding standards:</emphasis> | 106 | coding standards:</emphasis> |
107 | GNU coding standards require certain files in order for the | 107 | GNU coding standards require certain files in order for the |
108 | project to be compliant. | 108 | project to be compliant. |
109 | This command creates those files: | 109 | This command creates those files: |
110 | <literallayout class='monospaced'> | 110 | <literallayout class='monospaced'> |
111 | $ touch NEWS README AUTHORS ChangeLog | 111 | $ touch NEWS README AUTHORS ChangeLog |
@@ -122,7 +122,7 @@ | |||
122 | $ ./configure ${CONFIGURE_FLAGS} | 122 | $ ./configure ${CONFIGURE_FLAGS} |
123 | </literallayout></para></listitem> | 123 | </literallayout></para></listitem> |
124 | <listitem><para><emphasis>Make and install the project:</emphasis> | 124 | <listitem><para><emphasis>Make and install the project:</emphasis> |
125 | These two commands generate and install the project into the | 125 | These two commands generate and install the project into the |
126 | destination directory: | 126 | destination directory: |
127 | <literallayout class='monospaced'> | 127 | <literallayout class='monospaced'> |
128 | $ make | 128 | $ make |
@@ -130,16 +130,16 @@ | |||
130 | </literallayout></para></listitem> | 130 | </literallayout></para></listitem> |
131 | <listitem><para><emphasis>Verify the installation:</emphasis> | 131 | <listitem><para><emphasis>Verify the installation:</emphasis> |
132 | This command is a simple way to verify the installation | 132 | This command is a simple way to verify the installation |
133 | of your project. | 133 | of your project. |
134 | Running the command prints the architecture on which | 134 | Running the command prints the architecture on which |
135 | the binary file can run. | 135 | the binary file can run. |
136 | This architecture should be the same architecture that | 136 | This architecture should be the same architecture that |
137 | the installed cross-toolchain supports. | 137 | the installed cross-toolchain supports. |
138 | <literallayout class='monospaced'> | 138 | <literallayout class='monospaced'> |
139 | $ file ./tmp/usr/local/bin/hello | 139 | $ file ./tmp/usr/local/bin/hello |
140 | </literallayout></para></listitem> | 140 | </literallayout></para></listitem> |
141 | <listitem><para><emphasis>Execute your project:</emphasis> | 141 | <listitem><para><emphasis>Execute your project:</emphasis> |
142 | To execute the project in the shell, simply enter the name. | 142 | To execute the project in the shell, simply enter the name. |
143 | You could also copy the binary to the actual target hardware | 143 | You could also copy the binary to the actual target hardware |
144 | and run the project there as well: | 144 | and run the project there as well: |
145 | <literallayout class='monospaced'> | 145 | <literallayout class='monospaced'> |
@@ -155,14 +155,14 @@ | |||
155 | <title>Passing Host Options</title> | 155 | <title>Passing Host Options</title> |
156 | 156 | ||
157 | <para> | 157 | <para> |
158 | For an Autotools-based project, you can use the cross-toolchain by just | 158 | For an Autotools-based project, you can use the cross-toolchain by just |
159 | passing the appropriate host option to <filename>configure.sh</filename>. | 159 | passing the appropriate host option to <filename>configure.sh</filename>. |
160 | The host option you use is derived from the name of the environment setup | 160 | The host option you use is derived from the name of the environment setup |
161 | script in <filename>/opt/poky</filename> resulting from installation of the | 161 | script in <filename>/opt/poky</filename> resulting from installation of the |
162 | cross-toolchain tarball. | 162 | cross-toolchain tarball. |
163 | For example, the host option for an ARM-based target that uses the GNU EABI | 163 | For example, the host option for an ARM-based target that uses the GNU EABI |
164 | is <filename>armv5te-poky-linux-gnueabi</filename>. | 164 | is <filename>armv5te-poky-linux-gnueabi</filename>. |
165 | You will notice that the name of the script is | 165 | You will notice that the name of the script is |
166 | <filename>environment-setup-armv5te-poky-linux-gnueabi</filename>. | 166 | <filename>environment-setup-armv5te-poky-linux-gnueabi</filename>. |
167 | Thus, the following command works: | 167 | Thus, the following command works: |
168 | <literallayout class='monospaced'> | 168 | <literallayout class='monospaced'> |
@@ -172,12 +172,12 @@ | |||
172 | </para> | 172 | </para> |
173 | 173 | ||
174 | <para> | 174 | <para> |
175 | This single command updates your project and rebuilds it using the appropriate | 175 | This single command updates your project and rebuilds it using the appropriate |
176 | cross-toolchain tools. | 176 | cross-toolchain tools. |
177 | <note> | 177 | <note> |
178 | If <filename>configure</filename> script results in problems recognizing the | 178 | If <filename>configure</filename> script results in problems recognizing the |
179 | <filename>--with-libtool-sysroot=<sysroot-dir></filename> option, | 179 | <filename>--with-libtool-sysroot=<sysroot-dir></filename> option, |
180 | regenerate the script to enable the support by doing the following and then | 180 | regenerate the script to enable the support by doing the following and then |
181 | re-running the script: | 181 | re-running the script: |
182 | <literallayout class='monospaced'> | 182 | <literallayout class='monospaced'> |
183 | $ libtoolize --automake | 183 | $ libtoolize --automake |
@@ -187,17 +187,17 @@ | |||
187 | $ autoheader | 187 | $ autoheader |
188 | $ automake -a | 188 | $ automake -a |
189 | </literallayout> | 189 | </literallayout> |
190 | </note> | 190 | </note> |
191 | </para> | 191 | </para> |
192 | </section> | 192 | </section> |
193 | </section> | 193 | </section> |
194 | 194 | ||
195 | <section id='makefile-based-projects'> | 195 | <section id='makefile-based-projects'> |
196 | <title>Makefile-Based Projects</title> | 196 | <title>Makefile-Based Projects</title> |
197 | 197 | ||
198 | <para> | 198 | <para> |
199 | For a Makefile-based project, you use the cross-toolchain by making sure | 199 | For a Makefile-based project, you use the cross-toolchain by making sure |
200 | the tools are used. | 200 | the tools are used. |
201 | You can do this as follows: | 201 | You can do this as follows: |
202 | <literallayout class='monospaced'> | 202 | <literallayout class='monospaced'> |
203 | CC=arm-poky-linux-gnueabi-gcc | 203 | CC=arm-poky-linux-gnueabi-gcc |