-$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked
- $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR)/Rules.mak
- $(CP) ./files/config.$(ARCH) $(UCLIBC_DIR)/.config
- $(SED) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
- $(UCLIBC_DIR)/.config
-ifeq ($(CONFIG_LARGEFILE),y)
- $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(UCLIBC_DIR)/.config
-else
- $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(UCLIBC_DIR)/.config
-endif
- $(SED) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR)/.config
-ifeq ($(CONFIG_SOFT_FLOAT),y)
- $(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(UCLIBC_DIR)/.config
-endif
- mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/include
- mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/lib
- mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/lib
- $(MAKE1) -C $(UCLIBC_DIR) \
- PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
+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/" \