1 #############################################################
3 # full kernel tarballs >= 2.6.19.1
5 #############################################################
7 # parse linux version string
8 LNXVER:=$(subst ., , $(strip $(DEFAULT_KERNEL_HEADERS)))
9 VERSION:=$(word 1, $(LNXVER))
10 PATCHLEVEL:=$(word 2, $(LNXVER))
11 SUBLEVEL:=$(word 3, $(LNXVER))
12 EXTRAVERSION:=$(word 4, $(LNXVER))
15 # should contain prepended dot
16 EXTRAVERSION:=$(if $(EXTRAVERSION),.$(EXTRAVERSION),)
18 LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
19 LINUX_HEADERS_SITE:=$(BR2_KERNEL_MIRROR)/linux/kernel/v2.6/
20 LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
21 LINUX_HEADERS_CAT:=$(BZCAT)
22 LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
23 LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
25 ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.26.8")
26 LINUX_RT_VERSION:=rt16
29 LINUX_HEADERS_DEPENDS:=
31 ifeq ($(BR2_KERNEL_HEADERS_RT),y)
32 LINUX_RT_SOURCE:=patch-$(LINUX_HEADERS_VERSION)-$(LINUX_RT_VERSION)
33 LINUX_RT_SITE:=$(BR2_KERNEL_MIRROR)/linux/kernel/projects/rt
34 LINUX_HEADERS_DEPENDS+=$(DL_DIR)/$(LINUX_RT_SOURCE)
35 $(DL_DIR)/$(LINUX_RT_SOURCE):
36 $(call DOWNLOAD,$(LINUX_RT_SITE),$(LINUX_RT_SOURCE))
39 $(LINUX_HEADERS_UNPACK_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
40 @echo "*** Using kernel-headers generated from kernel source"
41 rm -rf $(LINUX_HEADERS_DIR)
42 [ -d $(TOOL_BUILD_DIR) ] || $(INSTALL) -d $(TOOL_BUILD_DIR)
43 $(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
46 $(LINUX_HEADERS_UNPACK_DIR)/.patched: $(LINUX_HEADERS_UNPACK_DIR)/.unpacked $(LINUX_HEADERS_DEPENDS)
47 toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) toolchain/kernel-headers \
48 linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
49 ifeq ($(BR2_KERNEL_HEADERS_RT),y)
50 toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) $(DL_DIR) $(LINUX_RT_SOURCE)
52 ifneq ($(KERNEL_HEADERS_PATCH_DIR),)
53 toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) $(KERNEL_HEADERS_PATCH_DIR) \
54 linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
56 ifeq ($(BR2_PACKAGE_OPENSWAN),y)
57 toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) package/openswan \
58 linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
62 $(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_UNPACK_DIR)/.patched
63 (cd $(LINUX_HEADERS_UNPACK_DIR); \
64 $(MAKE) ARCH=$(KERNEL_ARCH) \
65 HOSTCC="$(HOSTCC)" HOSTCFLAGS="$(HOSTCFLAGS)" \
66 HOSTCXX="$(HOSTCXX)" \
67 INSTALL_HDR_PATH=$(LINUX_HEADERS_DIR) headers_install; \
69 ifeq ($(BR2_ARCH),"cris")
70 ln -s $(LINUX_HEADERS_DIR)/include/arch-v10/arch $(LINUX_HEADERS_DIR)/include/arch
71 cp -a $(LINUX_HEADERS_UNPACK_DIR)/include/linux/user.h $(LINUX_HEADERS_DIR)/include/linux
72 $(SED) "/^#include <asm\/page\.h>/d" $(LINUX_HEADERS_DIR)/include/asm/user.h