tools/coreutils: bootstrap to local gnulib source
[openwrt/openwrt.git] / tools / coreutils / Makefile
index 87c9102fa6219c6ba2d334c3289b0e354e7b4614..233ab1585d75af954dd501348d890922628612a4 100644 (file)
@@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coreutils
 PKG_CPE_ID:=cpe:/a:gnu:coreutils
-PKG_VERSION:=8.32
+PKG_VERSION:=9.3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/coreutils
-PKG_HASH:=4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa
+PKG_HASH:=adbcfcfe899235b71e8768dcf07cd532520b7f54f9a8064843f8d199a904bbaa
 
 HOST_BUILD_PARALLEL := 1
 
@@ -20,19 +20,51 @@ BUILD_PROGRAMS = date readlink touch ln chown ginstall
 
 include $(INCLUDE_DIR)/host-build.mk
 
+export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
+
 BUILD_BINS = $(patsubst %,src/%,$(BUILD_PROGRAMS))
 
 HOST_CONFIGURE_ARGS += \
         --enable-install-program=$(subst $(space),$(comma),$(strip $(BUILD_PROGRAMS)))
 
 HOST_MAKE_FLAGS += \
+       $(AM_TOOL_PATHS_FAKE) \
        PROGRAMS="$(BUILD_BINS)" \
        LIBRARIES= MANS= SUBDIRS=.
 
+define Host/Bootstrap
+       ( \
+               cd $(HOST_BUILD_DIR); \
+               $(AM_TOOL_PATHS_FAKE) \
+               ./bootstrap \
+                       --bootstrap-sync \
+                       --force \
+                       --no-git \
+                       --skip-po \
+                       --gnulib-srcdir=$(GNULIB_SRCDIR) \
+       )
+endef
+
+define Host/Prepare
+       $(call Host/Prepare/Default)
+       $(if $(QUILT),,$(call Host/Bootstrap))
+endef
+
+define Host/Configure
+       $(if $(QUILT),$(call Host/Bootstrap))
+       -$(CP) $(HOST_BUILD_DIR)/lib/time.in.h~ $(HOST_BUILD_DIR)/lib/time.in.h # @GNULIB_TIME@ not defined
+       $(call Host/Configure/Default)
+endef
+
 define Host/Install
        $(INSTALL_DIR) $(1)/bin
        $(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/%,$(BUILD_BINS)) $(1)/bin/
        ln -sf ginstall $(1)/bin/install
 endef
 
+define Host/Uninstall
+       rm -f $(STAGING_DIR_HOST)/bin/install
+       -$(call Host/Compile/Default,uninstall)
+endef
+
 $(eval $(call HostBuild))