- add handling of lzma for the host (unconditionally for now)
- remove non-working attempt to install an lzma to the host via sudo
This commit is contained in:
parent
1afb8226cb
commit
e99518277a
|
@ -15,6 +15,12 @@ LZMA_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
||||||
endif
|
endif
|
||||||
LZMA_TARGET_BINARY:=bin/lzma
|
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):
|
$(DL_DIR)/$(LZMA_SOURCE):
|
||||||
$(WGET) -P $(DL_DIR) $(LZMA_SITE)/$(LZMA_SOURCE)
|
$(WGET) -P $(DL_DIR) $(LZMA_SITE)/$(LZMA_SOURCE)
|
||||||
|
|
||||||
|
@ -47,6 +53,20 @@ $(STAGING_DIR)/bin/lzma: $(LZMA_HOST_DIR)/src/lzma/lzma
|
||||||
$(SED) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/lib\',g" \
|
$(SED) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/lib\',g" \
|
||||||
$(STAGING_DIR)/lib/liblzmadec.la
|
$(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: $(STAGING_DIR)/bin/lzma
|
||||||
|
|
||||||
lzma-host-clean:
|
lzma-host-clean:
|
||||||
|
@ -55,11 +75,6 @@ lzma-host-clean:
|
||||||
lzma-host-dirclean:
|
lzma-host-dirclean:
|
||||||
rm -rf $(LZMA_HOST_DIR)
|
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
|
lzma-host-install: /usr/local/bin/lzma
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
9
package/lzma/lzmacheck.sh
Executable file
9
package/lzma/lzmacheck.sh
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
bin=$(toolchain/dependencies/check-host-lzma.sh)
|
||||||
|
if [ "x$bin" = "x" ] ; then
|
||||||
|
echo build-lzma-host-binary
|
||||||
|
else
|
||||||
|
echo use-lzma-host-binary
|
||||||
|
fi
|
||||||
|
|
|
@ -143,7 +143,8 @@ $(LINUX26_DIR)/.depend_done: $(LINUX26_DIR)/.configured
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
$(LINUX26_KERNEL): $(LINUX26_DIR)/.depend_done
|
$(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)
|
cp -dpf $(LINUX26_DIR)/$(LINUX26_BINLOC) $(LINUX26_KERNEL)
|
||||||
touch -c $@
|
touch -c $@
|
||||||
|
|
||||||
|
|
13
toolchain/dependencies/check-host-lzma.sh
Executable file
13
toolchain/dependencies/check-host-lzma.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ok=""
|
||||||
|
|
||||||
|
for bin in /usr/bin/lzma $LZMA
|
||||||
|
do
|
||||||
|
# TODO: add check for proper functionality here..
|
||||||
|
$bin --version > /dev/null 2>&1 && ok="$bin"
|
||||||
|
if test "x$ok" != "x" ; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "$ok"
|
|
@ -5,7 +5,7 @@
|
||||||
#
|
#
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
dependencies: host-sed
|
dependencies: host-sed host-lzma
|
||||||
@HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
|
@HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
|
||||||
HOST_SED_DIR="$(HOST_SED_DIR)" \
|
HOST_SED_DIR="$(HOST_SED_DIR)" \
|
||||||
$(TOPDIR)/toolchain/dependencies/dependencies.sh
|
$(TOPDIR)/toolchain/dependencies/dependencies.sh
|
||||||
|
|
Loading…
Reference in a new issue