split things up so this is not an unreadable mess
authorEric Andersen <andersen@codepoet.org>
Wed, 13 Dec 2006 11:49:19 +0000 (11:49 -0000)
committerEric Andersen <andersen@codepoet.org>
Wed, 13 Dec 2006 11:49:19 +0000 (11:49 -0000)
toolchain/kernel-headers/Config.in
toolchain/kernel-headers/kernel-headers-new.makefile [new file with mode: 0644]
toolchain/kernel-headers/kernel-headers-old.makefile [new file with mode: 0644]
toolchain/kernel-headers/kernel-headers.mk

index 535236836bf119cf2acd6de60c69abb65ca8c25b..033f963a31533867fe3eed42def78f5657e859c7 100644 (file)
@@ -38,9 +38,9 @@ choice
                depends !BR2_nios2
                bool "Linux 2.6.12 kernel headers"
 
-       config BR2_KERNEL_HEADERS_2_6_19
+       config BR2_KERNEL_HEADERS_2_6_19_1
                depends !BR2_nios2
-               bool "Linux 2.6.19 kernel headers"
+               bool "Linux 2.6.19.1 kernel headers"
 
 endchoice
 
@@ -53,4 +53,4 @@ config BR2_DEFAULT_KERNEL_HEADERS
        default "2.6.9"     if BR2_KERNEL_HEADERS_2_6_9
        default "2.6.11"    if BR2_KERNEL_HEADERS_2_6_11
        default "2.6.12"    if BR2_KERNEL_HEADERS_2_6_12
-       default "2.6.19"    if BR2_KERNEL_HEADERS_2_6_19
+       default "2.6.19.1"  if BR2_KERNEL_HEADERS_2_6_19_1
diff --git a/toolchain/kernel-headers/kernel-headers-new.makefile b/toolchain/kernel-headers/kernel-headers-new.makefile
new file mode 100644 (file)
index 0000000..546d95c
--- /dev/null
@@ -0,0 +1,39 @@
+#############################################################
+#
+# full kernel tarballs >= 2.6.19.1
+#
+#############################################################
+LINUX_HEADERS_IS_KERNEL=n
+
+ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.19.1")
+VERSION:=2
+PATCHLEVEL:=6
+SUBLEVEL:=19
+EXTRAVERSION:=1
+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)
+
+$(LINUX_HEADERS_UNPACK_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
+       rm -rf $(LINUX_HEADERS_DIR)
+       $(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
+       touch $(LINUX_HEADERS_UNPACK_DIR)/.unpacked
+
+$(LINUX_HEADERS_UNPACK_DIR)/.patched: $(LINUX_HEADERS_UNPACK_DIR)/.unpacked
+       toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) toolchain/kernel-headers \
+               linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
+       touch $(LINUX_HEADERS_UNPACK_DIR)/.patched
+
+$(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_UNPACK_DIR)/.patched
+       (cd $(LINUX_HEADERS_UNPACK_DIR) ; \
+        $(MAKE) ARCH=$(KERNEL_ARCH) INSTALL_HDR_PATH=$(LINUX_HEADERS_DIR) headers_install)
+       touch $(LINUX_HEADERS_DIR)/.configured
+
+endif
diff --git a/toolchain/kernel-headers/kernel-headers-old.makefile b/toolchain/kernel-headers/kernel-headers-old.makefile
new file mode 100644 (file)
index 0000000..8357e82
--- /dev/null
@@ -0,0 +1,190 @@
+#############################################################
+#
+# Setup the kernel headers.  I include a generic package of
+# kernel headers here, so you shouldn't need to include your
+# own.  Be aware these kernel headers _will_ get blown away
+# by a 'make clean' so don't put anything sacred in here...
+#
+#############################################################
+ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.4.25")
+VERSION:=2
+PATCHLEVEL:=4
+SUBLEVEL:=25
+LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
+LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.25.tar.bz2
+LINUX_HEADERS_CAT:=$(BZCAT)
+LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
+LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.25
+LINUX_HEADERS_IS_KERNEL=n
+endif
+
+ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.4.27")
+VERSION:=2
+PATCHLEVEL:=4
+SUBLEVEL:=27
+LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
+LINUX_HEADERS_CAT:=$(BZCAT)
+LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.27.tar.bz2
+LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
+LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.27
+LINUX_HEADERS_IS_KERNEL=n
+endif
+
+ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.4.29")
+VERSION:=2
+PATCHLEVEL:=4
+SUBLEVEL:=29
+LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
+LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.29.tar.bz2
+LINUX_HEADERS_CAT:=$(BZCAT)
+LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
+LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.29
+LINUX_HEADERS_IS_KERNEL=n
+endif
+
+ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.4.31")
+VERSION:=2
+PATCHLEVEL:=4
+SUBLEVEL:=31
+LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
+LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.31.tar.bz2
+LINUX_HEADERS_CAT:=$(BZCAT)
+LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
+LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.31
+LINUX_HEADERS_IS_KERNEL=n
+endif
+
+ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.9")
+VERSION:=2
+PATCHLEVEL:=6
+SUBLEVEL:=9
+LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
+LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.9.1.tar.bz2
+LINUX_HEADERS_CAT:=$(BZCAT)
+LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
+LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.9.1
+LINUX_HEADERS_IS_KERNEL=n
+endif
+
+ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.10")
+VERSION:=2
+PATCHLEVEL:=6
+SUBLEVEL:=10
+LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
+LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.10.0.tar.bz2
+LINUX_HEADERS_CAT:=$(BZCAT)
+LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
+LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.10.0
+LINUX_HEADERS_IS_KERNEL=n
+endif
+
+ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.11")
+VERSION:=2
+PATCHLEVEL:=6
+SUBLEVEL:=11
+LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
+LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.11.0.tar.bz2
+LINUX_HEADERS_CAT:=$(BZCAT)
+LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
+LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.11.0
+LINUX_HEADERS_IS_KERNEL=n
+endif
+
+ifeq ("$(DEFAULT_KERNEL_HEADERS)","2.6.12")
+VERSION:=2
+PATCHLEVEL:=6
+SUBLEVEL:=12
+LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
+LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.12.0.tar.bz2
+LINUX_HEADERS_CAT:=$(BZCAT)
+LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
+LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.12.0
+LINUX_HEADERS_IS_KERNEL=n
+endif
+
+
+# the old sanitized kernel-headers
+ifeq ($(LINUX_HEADERS_IS_KERNEL),n)
+
+$(LINUX_HEADERS_UNPACK_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
+       rm -rf $(LINUX_HEADERS_DIR)
+       $(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
+ifneq ($(LINUX_HEADERS_UNPACK_DIR),$(LINUX_HEADERS_DIR))
+       ln -fs $(LINUX_HEADERS_UNPACK_DIR) $(LINUX_HEADERS_DIR)
+endif
+       touch $(LINUX_HEADERS_UNPACK_DIR)/.unpacked
+
+$(LINUX_HEADERS_DIR)/.patched: $(LINUX_HEADERS_UNPACK_DIR)/.unpacked
+       toolchain/patch-kernel.sh $(LINUX_HEADERS_DIR) toolchain/kernel-headers \
+               linux-libc-headers-$(LINUX_HEADERS_VERSION)\*.patch
+ifeq ($(strip $(ARCH)),nios2)
+       toolchain/patch-kernel.sh $(LINUX_HEADERS_DIR) toolchain/kernel-headers \
+               linux-libc-headers-$(LINUX_HEADERS_VERSION)-nios2nommu.patch.conditional
+endif
+       touch $(LINUX_HEADERS_DIR)/.patched
+
+$(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_DIR)/.patched
+       rm -f $(LINUX_HEADERS_DIR)/include/asm
+       @if [ ! -f $(LINUX_HEADERS_DIR)/Makefile ] ; then \
+           /bin/echo -e "VERSION = $(VERSION)\nPATCHLEVEL = $(PATCHLEVEL)\n" > \
+                   $(LINUX_HEADERS_DIR)/Makefile; \
+           /bin/echo -e "SUBLEVEL = $(SUBLEVEL)\nEXTRAVERSION =\n" >> \
+                   $(LINUX_HEADERS_DIR)/Makefile; \
+           /bin/echo -e "KERNELRELEASE=\$$(VERSION).\$$(PATCHLEVEL).\$$(SUBLEVEL)\$$(EXTRAVERSION)" >> \
+                   $(LINUX_HEADERS_DIR)/Makefile; \
+       fi;
+       @if [ "$(ARCH)" = "powerpc" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-ppc$(NOMMU) asm;) \
+       elif [ "$(ARCH)" = "mips" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-mips$(NOMMU) asm;) \
+       elif [ "$(ARCH)" = "mipsel" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-mips$(NOMMU) asm;) \
+       elif [ "$(ARCH)" = "nios2" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-nios2nommu asm;) \
+       elif [ "$(ARCH)" = "arm" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-arm$(NOMMU) asm; \
+            cd asm; \
+            if [ ! -L proc ] ; then \
+            ln -fs proc-armv proc; \
+            ln -fs arch-ebsa285 arch; fi); \
+       elif [ "$(ARCH)" = "armeb" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-arm$(NOMMU) asm; \
+            cd asm; \
+            if [ ! -L proc ] ; then \
+            ln -fs proc-armv proc; \
+            ln -fs arch-ebsa285 arch; fi); \
+       elif [ "$(ARCH)" = "cris" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-cris asm;) \
+       elif [ "$(ARCH)" = "sh3" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
+            cd asm; \
+            ln -s cpu-sh3 cpu) \
+       elif [ "$(ARCH)" = "sh3eb" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
+            cd asm; \
+            ln -s cpu-sh3 cpu) \
+       elif [ "$(ARCH)" = "sh4" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
+            cd asm; \
+            ln -s cpu-sh4 cpu) \
+       elif [ "$(ARCH)" = "sh4eb" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
+            cd asm; \
+            ln -s cpu-sh4 cpu) \
+       elif [ "$(ARCH)" = "i386" -o "$(ARCH)" = "i486" -o "$(ARCH)" = "i586" -o "$(ARCH)" = "i686" ];then \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-i386$(NOMMU) asm;) \
+       else \
+           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-$(ARCH)$(NOMMU) asm;) \
+       fi
+       touch $(LINUX_HEADERS_DIR)/include/linux/autoconf.h;
+       touch $(LINUX_HEADERS_DIR)/.configured
+
+endif
index 54d57db8dd3e2a5652b6671ed2d63d80d8a21471..a2703b3dc6d74c75822af84e3a248ac5fdd19776 100644 (file)
@@ -12,219 +12,24 @@ LINUX_HEADERS_SITE:=127.0.0.1
 LINUX_HEADERS_SOURCE:=unspecified-kernel-headers
 LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-null
 
-ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.4.25")
-VERSION:=2
-PATCHLEVEL:=4
-SUBLEVEL:=25
-LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
-LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.25.tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.25
-endif
-
-ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.4.27")
-VERSION:=2
-PATCHLEVEL:=4
-SUBLEVEL:=27
-LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.27.tar.bz2
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.27
-endif
-
-ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.4.29")
-VERSION:=2
-PATCHLEVEL:=4
-SUBLEVEL:=29
-LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
-LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.29.tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.29
-endif
-
-ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.4.31")
-VERSION:=2
-PATCHLEVEL:=4
-SUBLEVEL:=31
-LINUX_HEADERS_SITE:=http://www.uclibc.org/downloads/toolchain
-LINUX_HEADERS_SOURCE:=linux-libc-headers-2.4.31.tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.4.31
-endif
-
-ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.9")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=9
-LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
-LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.9.1.tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.9.1
-endif
-
-ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.10")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=10
-LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
-LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.10.0.tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.10.0
-endif
-
-ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.11")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=11
-LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
-LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.11.0.tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.11.0
-endif
-
-ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.12")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=12
-LINUX_HEADERS_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
-LINUX_HEADERS_SOURCE:=linux-libc-headers-2.6.12.0.tar.bz2
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.12.0
-endif
-LINUX_HEADERS_IS_KERNEL=n
-
-ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.19")
-VERSION:=2
-PATCHLEVEL:=6
-SUBLEVEL:=19
-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
-LINUX_HEADERS_CAT:=$(BZCAT)
-LINUX_HEADERS_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-$(LINUX_HEADERS_VERSION)
-LINUX_HEADERS_IS_KERNEL=y
-endif
-
-LINUX_HEADERS_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-
-LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
-
-LINUX_HEADERS_DO_MOVE=n
-ifneq ($(LINUX_HEADERS_UNPACK_DIR),$(LINUX_HEADERS_DIR))
-LINUX_HEADERS_DO_MOVE=y
-endif
-ifeq ($(LINUX_HEADERS_IS_KERNEL),y)
-LINUX_HEADERS_DO_MOVE=n
-endif
-
-$(DL_DIR)/$(LINUX_HEADERS_SOURCE):
-       $(WGET) -P $(DL_DIR) $(LINUX_HEADERS_SITE)/$(LINUX_HEADERS_SOURCE)
-
-ifeq ($(LINUX_HEADERS_DO_MOVE),y)
-$(LINUX_HEADERS_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
-       rm -rf $(LINUX_HEADERS_DIR)
-       $(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
-       mv $(LINUX_HEADERS_UNPACK_DIR) $(LINUX_HEADERS_DIR)
-       touch $(LINUX_HEADERS_DIR)/.unpacked
-else
-$(LINUX_HEADERS_UNPACK_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
-       rm -rf $(LINUX_HEADERS_DIR)
-       $(LINUX_HEADERS_CAT) $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
-       touch $(LINUX_HEADERS_UNPACK_DIR)/.unpacked
-endif
-
-ifeq ($(LINUX_HEADERS_IS_KERNEL),y)
-# full kernel tarball >= 2.6.18
-
 KERNEL_ARCH:=$(shell $(SHELL) -c "echo \"$(ARCH)\" | sed -e \"s/-.*//\" \
        -e s/i.86/i386/ -e s/sun4u/sparc64/ \
        -e s/arm.*/arm/ -e s/sa110/arm/ \
        -e s/s390x/s390/ -e s/parisc64/parisc/ \
        -e s/ppc.*/powerpc/ -e s/mips.*/mips/")
 
-$(LINUX_HEADERS_UNPACK_DIR)/.patched: $(LINUX_HEADERS_UNPACK_DIR)/.unpacked
-       toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) toolchain/kernel-headers linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
-       touch $(LINUX_HEADERS_UNPACK_DIR)/.patched
-
-$(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_UNPACK_DIR)/.patched
-       (cd $(LINUX_HEADERS_UNPACK_DIR) ; \
-        $(MAKE) ARCH=$(KERNEL_ARCH) INSTALL_HDR_PATH=$(LINUX_HEADERS_DIR) headers_install)
-       touch $(LINUX_HEADERS_DIR)/.configured
-else
-# the sanitized kernel-headers
-$(LINUX_HEADERS_DIR)/.patched: $(LINUX_HEADERS_DIR)/.unpacked
-       toolchain/patch-kernel.sh $(LINUX_HEADERS_DIR) toolchain/kernel-headers linux-libc-headers-$(LINUX_HEADERS_VERSION)\*.patch
-ifeq ($(strip $(ARCH)),nios2)
-       toolchain/patch-kernel.sh $(LINUX_HEADERS_DIR) toolchain/kernel-headers linux-libc-headers-$(LINUX_HEADERS_VERSION)-nios2nommu.patch.conditional
-endif
-       touch $(LINUX_HEADERS_DIR)/.patched
 
-$(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_DIR)/.patched
-       rm -f $(LINUX_HEADERS_DIR)/include/asm
-       @if [ ! -f $(LINUX_HEADERS_DIR)/Makefile ] ; then \
-           /bin/echo -e "VERSION = $(VERSION)\nPATCHLEVEL = $(PATCHLEVEL)\n" > \
-                   $(LINUX_HEADERS_DIR)/Makefile; \
-           /bin/echo -e "SUBLEVEL = $(SUBLEVEL)\nEXTRAVERSION =\n" >> \
-                   $(LINUX_HEADERS_DIR)/Makefile; \
-           /bin/echo -e "KERNELRELEASE=\$$(VERSION).\$$(PATCHLEVEL).\$$(SUBLEVEL)\$$(EXTRAVERSION)" >> \
-                   $(LINUX_HEADERS_DIR)/Makefile; \
-       fi;
-       @if [ "$(ARCH)" = "powerpc" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-ppc$(NOMMU) asm;) \
-       elif [ "$(ARCH)" = "mips" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-mips$(NOMMU) asm;) \
-       elif [ "$(ARCH)" = "mipsel" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-mips$(NOMMU) asm;) \
-       elif [ "$(ARCH)" = "nios2" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-nios2nommu asm;) \
-       elif [ "$(ARCH)" = "arm" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-arm$(NOMMU) asm; \
-            cd asm; \
-            if [ ! -L proc ] ; then \
-            ln -fs proc-armv proc; \
-            ln -fs arch-ebsa285 arch; fi); \
-       elif [ "$(ARCH)" = "armeb" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-arm$(NOMMU) asm; \
-            cd asm; \
-            if [ ! -L proc ] ; then \
-            ln -fs proc-armv proc; \
-            ln -fs arch-ebsa285 arch; fi); \
-       elif [ "$(ARCH)" = "cris" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-cris asm;) \
-       elif [ "$(ARCH)" = "sh3" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
-            cd asm; \
-            ln -s cpu-sh3 cpu) \
-       elif [ "$(ARCH)" = "sh3eb" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
-            cd asm; \
-            ln -s cpu-sh3 cpu) \
-       elif [ "$(ARCH)" = "sh4" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
-            cd asm; \
-            ln -s cpu-sh4 cpu) \
-       elif [ "$(ARCH)" = "sh4eb" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-sh asm; \
-            cd asm; \
-            ln -s cpu-sh4 cpu) \
-       elif [ "$(ARCH)" = "i386" -o "$(ARCH)" = "i486" -o "$(ARCH)" = "i586" -o "$(ARCH)" = "i686" ];then \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-i386$(NOMMU) asm;) \
-       else \
-           (cd $(LINUX_HEADERS_DIR)/include; ln -fs asm-$(ARCH)$(NOMMU) asm;) \
-       fi
-       touch $(LINUX_HEADERS_DIR)/include/linux/autoconf.h;
-       touch $(LINUX_HEADERS_DIR)/.configured
-endif
+$(DL_DIR)/$(LINUX_HEADERS_SOURCE):
+       $(WGET) -P $(DL_DIR) $(LINUX_HEADERS_SITE)/$(LINUX_HEADERS_SOURCE)
 
-$(LINUX_KERNEL): $(LINUX_HEADERS_DIR)/.configured
+include toolchain/kernel-headers/kernel-headers-new.makefile
+include toolchain/kernel-headers/kernel-headers-old.makefile
 
 kernel-headers: $(LINUX_HEADERS_DIR)/.configured
 
 kernel-headers-source: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
 
 kernel-headers-clean: clean
-       rm -f $(LINUX_KERNEL)
        rm -rf $(LINUX_HEADERS_DIR)
 
 kernel-headers-dirclean: