tools/coreutils: bootstrap to local gnulib source
[openwrt/openwrt.git] / tools / coreutils / Makefile
index f799e83c5b62e26ba052aec42ed80306aa2c67ab..233ab1585d75af954dd501348d890922628612a4 100644 (file)
@@ -20,15 +20,42 @@ 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/