-# XXX: the following is needed to build lzma-loader
-define Build/Install/post/lzma
- $(CP) \
- $(BUILD_DIR_TOOLCHAIN)/linux/include/asm-mips/asm.h \
- $(BUILD_DIR_TOOLCHAIN)/linux/include/asm-mips/regdef.h \
- $(TOOLCHAIN_DIR)/usr/include/asm/
+define Host/Prepare/post/mipsel
+ $(call Host/Prepare/lzma)
+endef
+
+define Host/Prepare
+ $(call Kernel/Prepare/Default)
+ ln -sf linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux
+ $(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile
+ yes '' | $(KMAKE) oldconfig
+ifeq ($(CONFIG_LINUX_2_6_33),y)
+ $(KMAKE) include/linux/version.h arch/$(LINUX_KARCH)/include/asm
+else
+ $(KMAKE) include/linux/version.h include/asm
+endif
+ if [ -d $(HOST_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm ]; then \
+ $(CP) \
+ $(HOST_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm/. \
+ $(HOST_BUILD_DIR)/include/asm-$(LINUX_KARCH)/; \
+ fi
+ $(call Host/Prepare/pre/$(ARCH))
+ $(call Host/Prepare/all)
+ $(call Host/Prepare/post/$(ARCH))