#
#############################################################
-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
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