summaryrefslogtreecommitdiffstats
path: root/toolchain/kernel-headers/kernel-headers-new.makefile
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2007-09-25 13:32:08 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2007-09-25 13:32:08 +0000
commit0eb89c45bc38f89cdac062a1180302a2d4e29eac (patch)
tree76b44363ad808f751273924c39df69b5cc0ae671 /toolchain/kernel-headers/kernel-headers-new.makefile
parent193d987287acac51c97ef3679a90f64fcb560abe (diff)
downloadbuildroot-novena-0eb89c45bc38f89cdac062a1180302a2d4e29eac.tar.gz
buildroot-novena-0eb89c45bc38f89cdac062a1180302a2d4e29eac.zip
Generalized kernel headers handling for new-style kernels
Diffstat (limited to 'toolchain/kernel-headers/kernel-headers-new.makefile')
-rw-r--r--toolchain/kernel-headers/kernel-headers-new.makefile87
1 files changed, 12 insertions, 75 deletions
diff --git a/toolchain/kernel-headers/kernel-headers-new.makefile b/toolchain/kernel-headers/kernel-headers-new.makefile
index 712ad088e..4ff8e6045 100644
--- a/toolchain/kernel-headers/kernel-headers-new.makefile
+++ b/toolchain/kernel-headers/kernel-headers-new.makefile
@@ -4,12 +4,19 @@
#
#############################################################
-ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.22.7")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=22
-EXTRAVERSION:=.7
+# new-style kernels?
+ifeq ($(LINUX_HEADERS_VERSION),)
+# 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))
LOCALVERSION:=
+
+# should contain prepended dot
+EXTRAVERSION:=$(if $(EXTRAVERSION),.$(EXTRAVERSION),)
+
LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
@@ -20,83 +27,13 @@ LINUX_HEADERS_IS_KERNEL=y
endif
ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.22.1")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=22
-EXTRAVERSION:=.1
-LOCALVERSION:=
-LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
-LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
-LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
-LINUX_HEADERS_IS_KERNEL=y
LINUX_RT_VERSION:=rt9
endif
-ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.21.7")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=21
-EXTRAVERSION:=.7
-LOCALVERSION:=
-LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
-LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
-LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
-LINUX_HEADERS_IS_KERNEL=y
-endif
-
ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.21.5")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=21
-EXTRAVERSION:=.5
-LOCALVERSION:=
-LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
-LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
-LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
-LINUX_HEADERS_IS_KERNEL=y
LINUX_RT_VERSION:=rt20
endif
-ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.20.19")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=20
-EXTRAVERSION:=.19
-LOCALVERSION:=
-LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
-LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
-LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
-LINUX_HEADERS_IS_KERNEL=y
-endif
-
-ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.20.4")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=20
-EXTRAVERSION:=.4
-LOCALVERSION:=
-LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-LINUX_HEADERS_SITE:=http://www.kernel.org/pub/linux/kernel/v2.6/
-LINUX_HEADERS_SOURCE:=linux-$(LINUX_HEADERS_VERSION).tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
-LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
-LINUX_HEADERS_IS_KERNEL=y
-endif
-
-
ifeq ($(LINUX_HEADERS_IS_KERNEL),y)
# Need to redefine KERNEL_HEADERS_PATCH_DIR if you want
# board specific kernel headers