endif
LZMA_TARGET_BINARY:=bin/lzma
+# lzma binary for use on the host
+LZMA=$(TOOL_BUILD_DIR)/bin/lzma
+HOST_LZMA_BINARY=$(shell $(CONFIG_SHELL) package/lzma/lzmacheck.sh)
+HOST_LZMA_IF_ANY=$(shell $(CONFIG_SHELL) toolchain/dependencies/check-host-lzma.sh)
+
+
$(DL_DIR)/$(LZMA_SOURCE):
$(WGET) -P $(DL_DIR) $(LZMA_SITE)/$(LZMA_SOURCE)
$(SED) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/lib\',g" \
$(STAGING_DIR)/lib/liblzmadec.la
+.PHONY: lzma-host use-lzma-host-binary
+use-lzma-host-binary:
+ if [ ! -f "$(TOOL_BUILD_DIR)/bin/lzma" ] ; then \
+ [ -d $(TOOL_BUILD_DIR)/bin ] || mkdir $(TOOL_BUILD_DIR)/bin ; \
+ ln -sf "$(HOST_LZMA_IF_ANY)" "$(TOOL_BUILD_DIR)/bin/lzma" ; \
+ fi
+
+build-lzma-host-binary: $(LZMA_HOST_DIR)/src/lzma/lzma
+ -rm -f $(TOOL_BUILD_DIR)/bin/lzma
+ [ -d $(TOOL_BUILD_DIR)/bin ] || mkdir $(TOOL_BUILD_DIR)/bin
+ cp -pf $(LZMA_HOST_DIR)/src/lzma/lzma $(TOOL_BUILD_DIR)/bin/lzma
+
+host-lzma: $(HOST_LZMA_BINARY)
+
lzma-host: $(STAGING_DIR)/bin/lzma
lzma-host-clean:
lzma-host-dirclean:
rm -rf $(LZMA_HOST_DIR)
-/usr/local/bin/lzma: lzma_host
- sudo $(MAKE) DESTDIR=/usr/local -C $(LZMA_HOST_DIR) install
- sudo $(SED) "s,^libdir=.*,libdir=\'/usr/local/lib\',g" \
- /usr/local/lib/liblzmadec.la
-
lzma-host-install: /usr/local/bin/lzma
######################################################################
touch $@
$(LINUX26_KERNEL): $(LINUX26_DIR)/.depend_done
- $(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) $(LINUX26_FORMAT)
+ $(MAKE) $(LINUX26_MAKE_FLAGS) LZMA="$(LZMA)" \
+ -C $(LINUX26_DIR) $(LINUX26_FORMAT)
cp -dpf $(LINUX26_DIR)/$(LINUX26_BINLOC) $(LINUX26_KERNEL)
touch -c $@