2006-12-13 12:49:19 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# full kernel tarballs >= 2.6.19.1
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-09-12 06:06:54 +02:00
|
|
|
|
2007-09-25 15:32:08 +02:00
|
|
|
# parse linux version string
|
|
|
|
LNXVER:=$(subst ., , $(strip $(DEFAULT_KERNEL_HEADERS)))
|
|
|
|
VERSION:=$(word 1, $(LNXVER))
|
|
|
|
PATCHLEVEL:=$(word 2, $(LNXVER))
|
|
|
|
SUBLEVEL:=$(word 3, $(LNXVER))
|
|
|
|
EXTRAVERSION:=$(word 4, $(LNXVER))
|
2007-08-01 10:15:44 +02:00
|
|
|
LOCALVERSION:=
|
2007-09-25 15:32:08 +02:00
|
|
|
|
|
|
|
# should contain prepended dot
|
|
|
|
EXTRAVERSION:=$(if $(EXTRAVERSION),.$(EXTRAVERSION),)
|
|
|
|
|
2007-08-01 10:15:44 +02:00
|
|
|
LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
|
2008-03-11 19:54:17 +01:00
|
|
|
LINUX_HEADERS_SITE:=$(BR2_KERNEL_MIRROR)/linux/kernel/v2.6/
|
2007-08-01 10:15:44 +02:00
|
|
|
LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
|
|
|
|
LINUX_HEADERS_CAT:=$(BZCAT)
|
2009-09-23 01:30:00 +02:00
|
|
|
LINUX_HEADERS_UNPACK_DIR:=$(TOOLCHAIN_DIR)/linux-$(LINUX_HEADERS_VERSION)
|
|
|
|
LINUX_HEADERS_DIR:=$(TOOLCHAIN_DIR)/linux
|
2007-08-01 10:15:44 +02:00
|
|
|
|
2009-02-25 15:27:49 +01:00
|
|
|
ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.26.8")
|
|
|
|
LINUX_RT_VERSION:=rt16
|
2007-09-12 06:06:54 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
LINUX_HEADERS_DEPENDS:=
|
2006-12-13 12:49:19 +01:00
|
|
|
|
2007-09-12 06:06:54 +02:00
|
|
|
ifeq ($(BR2_KERNEL_HEADERS_RT),y)
|
|
|
|
LINUX_RT_SOURCE:=patch-$(LINUX_HEADERS_VERSION)-$(LINUX_RT_VERSION)
|
2009-02-25 15:27:49 +01:00
|
|
|
LINUX_RT_SITE:=$(BR2_KERNEL_MIRROR)/linux/kernel/projects/rt
|
2007-09-12 06:06:54 +02:00
|
|
|
LINUX_HEADERS_DEPENDS+=$(DL_DIR)/$(LINUX_RT_SOURCE)
|
|
|
|
$(DL_DIR)/$(LINUX_RT_SOURCE):
|
2009-01-16 13:07:53 +01:00
|
|
|
$(call DOWNLOAD,$(LINUX_RT_SITE),$(LINUX_RT_SOURCE))
|
2007-09-12 06:06:54 +02:00
|
|
|
endif
|
|
|
|
|
2008-10-02 16:24:45 +02:00
|
|
|
$(LINUX_HEADERS_UNPACK_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
|
2007-08-20 00:01:27 +02:00
|
|
|
@echo "*** Using kernel-headers generated from kernel source"
|
2006-12-13 12:49:19 +01:00
|
|
|
rm -rf $(LINUX_HEADERS_DIR)
|
2009-09-23 01:30:00 +02:00
|
|
|
[ -d $(TOOLCHAIN_DIR) ] || $(INSTALL) -d $(TOOLCHAIN_DIR)
|
|
|
|
$(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) -
|
2007-02-04 17:11:51 +01:00
|
|
|
touch $@
|
2006-12-13 12:49:19 +01:00
|
|
|
|
2007-09-12 06:06:54 +02:00
|
|
|
$(LINUX_HEADERS_UNPACK_DIR)/.patched: $(LINUX_HEADERS_UNPACK_DIR)/.unpacked $(LINUX_HEADERS_DEPENDS)
|
2006-12-13 12:49:19 +01:00
|
|
|
toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) toolchain/kernel-headers \
|
|
|
|
linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
|
2007-09-12 06:06:54 +02:00
|
|
|
ifeq ($(BR2_KERNEL_HEADERS_RT),y)
|
|
|
|
toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) $(DL_DIR) $(LINUX_RT_SOURCE)
|
|
|
|
endif
|
2009-02-25 15:28:35 +01:00
|
|
|
ifneq ($(KERNEL_HEADERS_PATCH_DIR),)
|
2007-08-20 00:01:27 +02:00
|
|
|
toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) $(KERNEL_HEADERS_PATCH_DIR) \
|
2009-02-25 15:28:35 +01:00
|
|
|
linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
|
2007-08-18 10:46:41 +02:00
|
|
|
endif
|
2007-03-21 11:55:31 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENSWAN),y)
|
|
|
|
toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) package/openswan \
|
|
|
|
linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
|
|
|
|
endif
|
2007-02-04 17:11:51 +01:00
|
|
|
touch $@
|
2006-12-13 12:49:19 +01:00
|
|
|
|
|
|
|
$(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_UNPACK_DIR)/.patched
|
2007-08-22 11:20:33 +02:00
|
|
|
(cd $(LINUX_HEADERS_UNPACK_DIR); \
|
|
|
|
$(MAKE) ARCH=$(KERNEL_ARCH) \
|
2008-10-02 16:24:45 +02:00
|
|
|
HOSTCC="$(HOSTCC)" HOSTCFLAGS="$(HOSTCFLAGS)" \
|
2007-08-22 11:20:33 +02:00
|
|
|
HOSTCXX="$(HOSTCXX)" \
|
|
|
|
INSTALL_HDR_PATH=$(LINUX_HEADERS_DIR) headers_install; \
|
2006-12-13 19:24:48 +01:00
|
|
|
)
|
2009-01-12 21:16:16 +01:00
|
|
|
ifeq ($(BR2_ARCH),"cris")
|
|
|
|
ln -s $(LINUX_HEADERS_DIR)/include/arch-v10/arch $(LINUX_HEADERS_DIR)/include/arch
|
|
|
|
cp -a $(LINUX_HEADERS_UNPACK_DIR)/include/linux/user.h $(LINUX_HEADERS_DIR)/include/linux
|
|
|
|
$(SED) "/^#include <asm\/page\.h>/d" $(LINUX_HEADERS_DIR)/include/asm/user.h
|
|
|
|
endif
|
2007-02-04 17:11:51 +01:00
|
|
|
touch $@
|