-# XXX: the following is needed to build final gcc on cris
-define Build/Install/post/cris
- mkdir -p $(TOOLCHAIN_DIR)/usr/include/asm/arch
- $(CP) \
- $(PKG_BUILD_DIR)/include/asm-cris/arch/ptrace.h \
- $(TOOLCHAIN_DIR)/usr/include/asm/arch/
+define Host/Prepare/post/mips
+ $(call Host/Prepare/lzma)
+endef
+
+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
+ $(KMAKE) include/linux/version.h include/asm
+ 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))