]> Git Repo - buildroot-mgba.git/blob - docs/manual/using-buildroot-toolchain.txt
package/environment-setup: add configure alias
[buildroot-mgba.git] / docs / manual / using-buildroot-toolchain.txt
1 // -*- mode:doc; -*-
2 // vim: set syntax=asciidoc:
3
4 ==== Using the generated toolchain outside Buildroot
5
6 You may want to compile, for your target, your own programs or other
7 software that are not packaged in Buildroot. In order to do this you
8 can use the toolchain that was generated by Buildroot.
9
10 The toolchain generated by Buildroot is located by default in
11 +output/host/+. The simplest way to use it is to add
12 +output/host/bin/+ to your PATH environment variable and then to
13 use +ARCH-linux-gcc+, +ARCH-linux-objdump+, +ARCH-linux-ld+, etc.
14
15 Alternatively, Buildroot can also export the toolchain and the development
16 files of all selected packages, as an SDK, by running the command
17 +make sdk+. This generates a tarball of the content of the host directory
18 +output/host/+, named +<TARGET-TUPLE>_sdk-buildroot.tar.gz+ (which can be
19 overriden by setting the environment variable +BR2_SDK_PREFIX+) and
20 located in the output directory +output/images/+.
21
22 This tarball can then be distributed to application developers, when
23 they want to develop their applications that are not (yet) packaged as
24 a Buildroot package.
25
26 Upon extracting the SDK tarball, the user must run the script
27 +relocate-sdk.sh+ (located at the top directory of the SDK), to make
28 sure all paths are updated with the new location.
29
30 Alternatively, if you just want to prepare the SDK without generating
31 the tarball (e.g. because you will just be moving the +host+ directory,
32 or will be generating the tarball on your own), Buildroot also allows
33 you to just prepare the SDK with +make prepare-sdk+ without actually
34 generating a tarball.
35
36 For your convenience, by selecting the option
37 +BR2_PACKAGE_HOST_ENVIRONMENT_SETUP+, you can get a
38 +setup-environment+ script installed in +output/host/+ and therefore
39 in your SDK.  This script can be sourced with
40 +. your/sdk/path/environment-setup+ to export a number of environment
41 variables that will help cross-compile your projects using the
42 Buildroot SDK: the +PATH+ will contain the SDK binaries, standard
43 _autotools_ variables will be defined with the appropriate values, and
44 +CONFIGURE_FLAGS+ will contain basic +./configure+ options to
45 cross-compile _autotools_ projects. It also provides some useful
46 commands. Note however that once this script is sourced, the
47 environment is setup only for cross-compilation, and no longer for
48 native compilation.
This page took 0.030232 seconds and 4 git commands to generate.