[yocto] native recipe and sysroot-destdir troubles
Richard Purdie
richard.purdie at linuxfoundation.org
Sun Apr 15 04:26:44 PDT 2012
On Fri, 2012-04-13 at 17:17 -0400, Philip Tricca wrote:
> Worked out a solution to this issue. For the sake of brevity it can be
> found here:
>
> http://twobit.us/blog/2012/04/openembedded-yocto-native-hello-world/
So just to follow up here too for the list archives:
This “craziness” does have a rational explanation. “native” targets are
meant to run on the system they’re built on and run in the location
they’re installed to. This means they install to a destination of “/”
and PREFIX is inside the native sysroot directory.
We install them to a DESTDIR to allow us to manipulate them before they
then get moved to a final DESTDIR of “/”.
Most Makefiles handle this correctly by doing:
DESTDIR ?= “”
prefix ?= “/usrr”
bindir ?= “$(prefix)/bin”
and then, importantly, install in the form:
install -d $(DESTDIR)$(bindir)
so both prefix and DESTDIR are used. Whilst this is a convention, its a
widely adopted and followed one. As you’ve found, you can call into a
custom makefile and set the variables manually if the makefile doesn’t
follow the convention.
Cheers,
Richard
More information about the yocto
mailing list