diff options
author | Scott Rifenbark <scott.m.rifenbark@intel.com> | 2013-08-07 11:16:25 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-13 13:18:50 +0100 |
commit | 76f5d3f7bde218a48b6bd0788344ea26233a62a0 (patch) | |
tree | dc96516195cdbdd7522079470442afd1dfad738c /documentation | |
parent | 97ece259f70e8b4a64e00c97fa8f4eb584d84fb8 (diff) | |
download | poky-76f5d3f7bde218a48b6bd0788344ea26233a62a0.tar.gz |
dev-manual: updates to how to use externalsrc.bbclass
I made sure all the usage information for this class is in this
section and not in the ref-manual. Changes involved using
EXTERNALSRC and EXTERNALSRC_BUILD now to select the source
and build directories.
(From yocto-docs rev: f818d7013502d943517a99b84397e98f5f9dfd9a)
Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 5c556b26fb..5df89a94d7 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
@@ -3749,54 +3749,58 @@ | |||
3749 | <title>Building Software from an External Source</title> | 3749 | <title>Building Software from an External Source</title> |
3750 | 3750 | ||
3751 | <para> | 3751 | <para> |
3752 | By default, the OpenEmbedded build system does its work from within the | 3752 | By default, the OpenEmbedded build system uses the |
3753 | <link linkend='build-directory'>Build Directory</link>. | 3753 | <link linkend='build-directory'>Build Directory</link> to |
3754 | The build process involves fetching the source files, unpacking them, and then patching them | 3754 | build source code. |
3755 | if necessary before the build takes place. | 3755 | The build process involves fetching the source files, unpacking |
3756 | them, and then patching them if necessary before the build takes | ||
3757 | place. | ||
3756 | </para> | 3758 | </para> |
3757 | 3759 | ||
3758 | <para> | 3760 | <para> |
3759 | Situations exist where you might want to build software from source files that are external to | 3761 | Situations exist where you might want to build software from source |
3760 | and thus outside of the <link linkend='source-directory'>Source Directory</link>. | 3762 | files that are external to and thus outside of the |
3761 | For example, suppose you have a project that includes a new BSP with a heavily customized | 3763 | OpenEmbedded build system. |
3762 | kernel, a very minimal image, and some new user-space recipes. | 3764 | For example, suppose you have a project that includes a new BSP with |
3765 | a heavily customized kernel. | ||
3763 | And, you want to minimize exposing the build system to the | 3766 | And, you want to minimize exposing the build system to the |
3764 | development team so that they can focus on their project and maintain everyone's workflow | 3767 | development team so that they can focus on their project and |
3765 | as much as possible. | 3768 | maintain everyone's workflow as much as possible. |
3766 | In this case, you want a kernel source directory on the development machine where the | 3769 | In this case, you want a kernel source directory on the development |
3767 | development occurs. | 3770 | machine where the development occurs. |
3768 | You want the recipe's | 3771 | You want the recipe's |
3769 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | 3772 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> |
3770 | variable to point to the external directory and use it as is, not copy it. | 3773 | variable to point to the external directory and use it as is, not |
3774 | copy it. | ||
3771 | </para> | 3775 | </para> |
3772 | 3776 | ||
3773 | <para> | 3777 | <para> |
3774 | To build from software that comes from an external source, all you need to do is | 3778 | To build from software that comes from an external source, all you |
3775 | change your recipe so that it inherits the | 3779 | need to do is change your recipe so that it inherits |
3776 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-externalsrc'><filename>externalsrc.bbclass</filename></ulink> | 3780 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-externalsrc'><filename>externalsrc.bbclass</filename></ulink> |
3777 | class and then sets the | 3781 | and then sets the |
3778 | <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink> | 3782 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNALSRC'><filename>EXTERNALSRC</filename></ulink> |
3779 | variable to point to your external source code. | 3783 | variable to point to your external source code. |
3780 | Here are the statements to put in your recipe: | 3784 | Here are the statements to put in your |
3785 | <filename>local.conf</filename> file: | ||
3781 | <literallayout class='monospaced'> | 3786 | <literallayout class='monospaced'> |
3782 | inherit externalsrc | 3787 | INHERIT += "externalsrc" |
3783 | S = "/some/path/to/your/package/source" | 3788 | EXTERNALSRC_pn-myrecipe = "/some/path/to/your/source/tree" |
3784 | </literallayout> | 3789 | </literallayout> |
3785 | </para> | 3790 | </para> |
3786 | 3791 | ||
3787 | <para> | 3792 | <para> |
3788 | It is important to know that the <filename>externalsrc.bbclass</filename> assumes that the | 3793 | By default, <filename>externalsrc.bbclass</filename> builds |
3789 | source directory <filename>S</filename> and the Build Directory | 3794 | the source code in a directory separate from the external source |
3790 | <ulink url='&YOCTO_DOCS_REF_URL;#var-B'><filename>B</filename></ulink> | 3795 | directory as specified by |
3791 | are different even though these directories are the same by default. | 3796 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNALSRC'><filename>EXTERNALSRC</filename></ulink>. |
3792 | This assumption is important because it supports building different variants of the recipe | 3797 | If you need to have the source built in the same directory in |
3793 | by using the | 3798 | which it resides, or some other nominated directory, you can set |
3794 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></ulink> | 3799 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNALSRC_BUILD'><filename>EXTERNALSRC_BUILD</filename></ulink> |
3795 | variable. | 3800 | to point to that directory: |
3796 | You could allow the Build Directory to be the same as the source directory but you would | 3801 | <literallayout class='monospaced'> |
3797 | not be able to build more than one variant of the recipe. | 3802 | EXTERNALSRC_BUILD_pn-myrecipe = "/path/to/my/source/tree" |
3798 | Consequently, if you are building multiple variants of the recipe, you need to establish a | 3803 | </literallayout> |
3799 | Build Directory that is different than the Source Directory. | ||
3800 | </para> | 3804 | </para> |
3801 | </section> | 3805 | </section> |
3802 | 3806 | ||