-define Build/Prepare
- $(call Build/Prepare/Default)
- $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(PKG_BUILD_DIR)/Rules.mak
- if [ -e config/$(ARCH).$(BOARD) ]; then \
- $(CP) config/$(ARCH).$(BOARD) $(PKG_BUILD_DIR)/.config; \
- else \
- $(CP) config/$(ARCH) $(PKG_BUILD_DIR)/.config; \
- fi
- $(SED) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
- $(PKG_BUILD_DIR)/.config
-ifeq ($(CONFIG_LARGEFILE),y)
- $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(PKG_BUILD_DIR)/.config
-else
- $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(PKG_BUILD_DIR)/.config
-endif
- $(SED) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(PKG_BUILD_DIR)/.config
-ifeq ($(CONFIG_SOFT_FLOAT),y)
- $(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(PKG_BUILD_DIR)/.config
-endif
- mkdir -p $(TOOLCHAIN_BUILD_DIR)/uClibc_dev/usr/include
- mkdir -p $(TOOLCHAIN_BUILD_DIR)/uClibc_dev/usr/lib
- mkdir -p $(TOOLCHAIN_BUILD_DIR)/uClibc_dev/lib
- PATH=$(TARGET_PATH) $(MAKE) -C $(PKG_BUILD_DIR) \
- PREFIX=$(TOOLCHAIN_BUILD_DIR)/uClibc_dev/ \
+
+define Host/SetToolchainInfo
+ $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
+ $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk
+ $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
+ $(SED) 's,^\(LIBC_PATCHVER\)=.*,\1=$(PKG_EXTRAVERSION),' $(TOOLCHAIN_DIR)/info.mk
+endef
+
+define Host/Prepare/Snapshot
+ $(PKG_UNPACK)
+ rm -Rf $(HOST_BUILD_DIR)
+ ln -snf $(BUILD_DIR_TOOLCHAIN)/uClibc $(HOST_BUILD_DIR)
+ $(Host/Patch)
+ $(if $(QUILT),touch $(HOST_BUILD_DIR)/.quilt_used)
+endef
+
+define Host/Prepare/V_0_9_28
+ $(SED) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(BUILD_DIR_TOOLCHAIN)/linux\",g' \
+ $(HOST_BUILD_DIR)/.config
+ ifeq ($(CONFIG_SOFT_FLOAT),y)
+ $(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(HOST_BUILD_DIR)/.config
+ endif
+ ifeq ($(CONFIG_C99_MATH),y)
+ $(SED) 's,.*DO_C99_MATH.*,DO_C99_MATH=y,g' $(HOST_BUILD_DIR)/.config
+ endif
+endef
+
+define Host/Prepare
+ $(call Host/SetToolchainInfo)
+ @echo prepare uClibc version $(PKG_VERSION)$(PKG_EXTRAVERSION)
+ ifeq ($(PKG_VERSION_SNAPSHOT),y)
+ $(call Host/Prepare/Snapshot)
+ else
+ $(call Host/Prepare/Default)
+ ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
+ endif
+ $(CP) ./$(CONFIG_DIR)/$(ARCH)$(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD)) $(HOST_BUILD_DIR)/.config
+ ifeq ($(PKG_VERSION),0.9.28)
+ $(call Host/Prepare/V_0_9_28)
+ endif
+ $(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include\",g' \
+ -e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \
+ -e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \
+ -e 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=$(if $(CONFIG_LARGEFILE),y,n),g' \
+ -e 's,^.*CONFIG_ARM_EABI.*,CONFIG_ARM_EABI=$(if $(CONFIG_EABI_SUPPORT),y,n),g' \
+ -e 's,^.*CONFIG_ARM_OABI.*,CONFIG_ARM_OABI=$(if $(CONFIG_EABI_SUPPORT),n,y),g' \
+ -e 's,^.*UCLIBC_HAS_SHADOW.*,UCLIBC_HAS_SHADOW=$(if $(CONFIG_SHADOW_PASSWORDS),y,n),g' \
+ $(HOST_BUILD_DIR)/.config
+ $(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS"
+ PATH=$(TARGET_PATH) $(MAKE) -C $(HOST_BUILD_DIR) \
+ PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \