linux-headers: fix circular dependency when HEADERS_AS_KERNEL is used
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 24 Feb 2016 14:04:09 +0000 (15:04 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 1 Mar 2016 08:43:37 +0000 (09:43 +0100)
commit18f3a22dcefe668a4522a936a0af59a2fa55f707
tree672875f9335f005ce406cfaeb63075390bd9372a
parent4ac9738be9d854235f1a61fc29792e1d86ff103b
linux-headers: fix circular dependency when HEADERS_AS_KERNEL is used

The linux-headers -> linux dependency causes a circular dependency, breaking
the source/legal-info/graph-depends/..  targets:

make graph-depends
Getting targets
Getting dependencies for ['toolchain-buildroot', 'toolchain', 'busybox',
'glibc', 'initscripts', 'linux-headers', 'skeleton', 'linux',
'host-fakeroot', 'host-makedevs', 'rootfs-cpio', 'rootfs-initramfs']
Getting dependencies for ['host-kmod', 'host-gcc-final',
'host-gcc-initial', 'host-gawk']
Getting dependencies for ['host-gmp', 'host-binutils', 'host-pkgconf',
'host-mpfr', 'host-mpc']
Getting dependencies for ['host-m4']

Recursion detected for  : toolchain
which is a dependency of: linux
which is a dependency of: linux-headers
which is a dependency of: glibc
which is a dependency of: host-gcc-final
which is a dependency of: toolchain-buildroot
which is a dependency of: toolchain
Makefile:721: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1

Fix it by instead duplicating in linux-headers the 10-20 lines of linux.mk
logic that infer the _SOURCE/_SITE/_VERSION from the BR2_LINUX_KERNEL_*
variables.

This does mean that we extract the kernel sources twice though.

[Peter: use same git/hg tarball as linux kernel to not clone twice, minor fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/linux-headers/linux-headers.mk