diff --git a/documentation/poky-ref-manual/ref-classes.xml b/documentation/poky-ref-manual/ref-classes.xml index 9238ba2406..09b3161fb7 100644 --- a/documentation/poky-ref-manual/ref-classes.xml +++ b/documentation/poky-ref-manual/ref-classes.xml @@ -519,6 +519,66 @@ +
+ Using External Source - <filename>externalsrc.bbclass</filename> + + + You can use this class to build software from source code that is external to the + Yocto Project build system. + In other words, your source code resides in an external tree outside of the Yocto Project. + Building software from an external source tree means that the normal fetch, unpack, and + patch process is not used. + + + + To use the class, you need to define the + S variable to point to the directory that contains the source files. + You also need to have your recipe inherit the externalsrc.bbclass class. + + + + This class expects the source code to support recipe builds that use the + B variable to point to the directory in + which the Yocto Project build system places the generated objects built from the recipes. + By default, the B directory is set to the following, which is separate from the + source directory (S): + + ${WORKDIR}/${BPN}-{PV}/ + + See the glossary entries for the + WORKDIR, + BPN, + PV, + S, and + B for more information. + + + + You can build object files in the external tree by setting the + B variable equal to "${S}". + However, this practice does not work well if you use the source for more than one variant + (i.e., "natives" such as quilt-native, + or "crosses" such as gcc-cross). + So, be sure there are no "native", "cross", or "multilib" variants of the recipe. + + + + If you do want to build different variants of a recipe, you can use the + BBCLASSEXTEND variable. + When you do, the B variable must support the + recipe's ability to build variants in different working directories. + Alternatively, you can make sure that separate recipes exist that each + use the BBCLASSEXTEND variable to build each variant. + The separate recipes can inherit a single target recipe. + + + + For information on how to use this class, see the + "Building + Software from an External Source" section in the Yocto Project Development Manual. + +
+
Other Classes