By default, the OpenEmbedded build system uses the Build Directory to build source code. The build process involves fetching the source files, unpacking them, and then patching them if necessary before the build takes place.
Situations exist where you might want to build software from source
files that are external to and thus outside of the
OpenEmbedded build system.
For example, suppose you have a project that includes a new BSP with
a heavily customized kernel.
And, you want to minimize exposing the build system to the
development team so that they can focus on their project and
maintain everyone's workflow as much as possible.
In this case, you want a kernel source directory on the development
machine where the development occurs.
You want the recipe's
SRC_URI
variable to point to the external directory and use it as is, not
copy it.
To build from software that comes from an external source, all you
need to do is inherit
externalsrc.bbclass
and then set the
EXTERNALSRC
variable to point to your external source code.
Here are the statements to put in your
local.conf
file:
INHERIT += "externalsrc" EXTERNALSRC_pn-myrecipe = "/some/path/to/your/source/tree"
By default, externalsrc.bbclass
builds
the source code in a directory separate from the external source
directory as specified by
EXTERNALSRC
.
If you need to have the source built in the same directory in
which it resides, or some other nominated directory, you can set
EXTERNALSRC_BUILD
to point to that directory:
EXTERNALSRC_BUILD_pn-myrecipe = "/path/to/my/source/tree"