2006-08-29 18:40:38 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# lzma
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-07-11 16:06:06 +02:00
|
|
|
LZMA_VERSION:=4.32.0beta3
|
|
|
|
LZMA_SOURCE:=lzma-$(LZMA_VERSION).tar.gz
|
2006-11-17 16:43:51 +01:00
|
|
|
LZMA_CAT:=$(ZCAT)
|
2006-08-29 18:40:38 +02:00
|
|
|
LZMA_SITE:=http://tukaani.org/lzma/
|
2007-07-11 16:06:06 +02:00
|
|
|
LZMA_HOST_DIR:=$(TOOL_BUILD_DIR)/lzma-$(LZMA_VERSION)
|
|
|
|
LZMA_TARGET_DIR:=$(BUILD_DIR)/lzma-$(LZMA_VERSION)
|
2006-08-29 18:40:38 +02:00
|
|
|
LZMA_CFLAGS:=$(TARGET_CFLAGS)
|
|
|
|
ifeq ($(BR2_LARGEFILE),y)
|
|
|
|
LZMA_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
|
|
|
endif
|
2007-02-04 17:34:56 +01:00
|
|
|
LZMA_TARGET_BINARY:=bin/lzma
|
2006-08-29 18:40:38 +02:00
|
|
|
|
2007-08-21 17:33:33 +02:00
|
|
|
# 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)
|
|
|
|
|
|
|
|
|
2006-08-29 18:40:38 +02:00
|
|
|
$(DL_DIR)/$(LZMA_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(LZMA_SITE)/$(LZMA_SOURCE)
|
|
|
|
|
2006-11-04 20:15:56 +01:00
|
|
|
######################################################################
|
|
|
|
#
|
|
|
|
# lzma host
|
|
|
|
#
|
|
|
|
######################################################################
|
|
|
|
|
2007-07-31 18:13:00 +02:00
|
|
|
$(LZMA_HOST_DIR)/.unpacked: $(DL_DIR)/$(LZMA_SOURCE)
|
2006-11-17 16:43:51 +01:00
|
|
|
$(LZMA_CAT) $(DL_DIR)/$(LZMA_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
|
2006-11-04 20:15:56 +01:00
|
|
|
toolchain/patch-kernel.sh $(LZMA_HOST_DIR) package/lzma/ lzma\*.patch
|
2007-07-31 18:13:00 +02:00
|
|
|
touch $@
|
2006-11-04 20:15:56 +01:00
|
|
|
|
2007-07-31 18:13:00 +02:00
|
|
|
$(LZMA_HOST_DIR)/.configured: $(LZMA_HOST_DIR)/.unpacked
|
2007-08-22 11:56:41 +02:00
|
|
|
(cd $(LZMA_HOST_DIR); rm -f config.cache;\
|
2006-11-04 20:15:56 +01:00
|
|
|
CC="$(HOSTCC)" \
|
2006-11-20 17:09:43 +01:00
|
|
|
CXX="$(HOSTCXX)" \
|
2006-11-04 20:15:56 +01:00
|
|
|
./configure \
|
|
|
|
--prefix=/ \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2007-07-31 18:13:00 +02:00
|
|
|
touch $@
|
2006-11-04 20:15:56 +01:00
|
|
|
|
|
|
|
$(LZMA_HOST_DIR)/src/lzma/lzma: $(LZMA_HOST_DIR)/.configured
|
|
|
|
$(MAKE) -C $(LZMA_HOST_DIR) all
|
|
|
|
touch -c $@
|
|
|
|
|
|
|
|
$(STAGING_DIR)/bin/lzma: $(LZMA_HOST_DIR)/src/lzma/lzma
|
|
|
|
$(MAKE) DESTDIR=$(STAGING_DIR) -C $(LZMA_HOST_DIR) install
|
2007-08-13 01:28:48 +02:00
|
|
|
$(SED) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/lib\',g" \
|
|
|
|
$(STAGING_DIR)/lib/liblzmadec.la
|
2006-08-29 18:40:38 +02:00
|
|
|
|
2007-08-21 17:33:33 +02:00
|
|
|
.PHONY: lzma-host use-lzma-host-binary
|
|
|
|
use-lzma-host-binary:
|
2007-08-22 11:56:41 +02:00
|
|
|
if [ ! -f "$(TOOL_BUILD_DIR)/bin/lzma" ]; then \
|
2007-08-31 16:27:07 +02:00
|
|
|
[ -d $(TOOL_BUILD_DIR)/bin ] || mkdir -p $(TOOL_BUILD_DIR)/bin; \
|
2007-08-22 11:56:41 +02:00
|
|
|
ln -sf "$(HOST_LZMA_IF_ANY)" "$(TOOL_BUILD_DIR)/bin/lzma"; \
|
2007-08-21 17:33:33 +02:00
|
|
|
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)
|
|
|
|
|
2007-07-31 18:13:00 +02:00
|
|
|
lzma-host: $(STAGING_DIR)/bin/lzma
|
2007-08-16 20:17:39 +02:00
|
|
|
|
2007-07-31 18:13:00 +02:00
|
|
|
lzma-host-clean:
|
|
|
|
rm -f $(STAGING_DIR)/bin/lzma
|
|
|
|
-$(MAKE) -C $(LZMA_HOST_DIR) clean
|
|
|
|
lzma-host-dirclean:
|
|
|
|
rm -rf $(LZMA_HOST_DIR)
|
2007-08-16 20:17:39 +02:00
|
|
|
|
2007-08-20 19:21:16 +02:00
|
|
|
lzma-host-install: /usr/local/bin/lzma
|
2007-08-16 20:17:39 +02:00
|
|
|
|
2006-11-04 20:15:56 +01:00
|
|
|
######################################################################
|
|
|
|
#
|
|
|
|
# lzma target
|
|
|
|
#
|
|
|
|
######################################################################
|
|
|
|
|
2007-07-31 18:13:00 +02:00
|
|
|
$(LZMA_TARGET_DIR)/.unpacked: $(DL_DIR)/$(LZMA_SOURCE)
|
2006-11-17 16:43:51 +01:00
|
|
|
$(LZMA_CAT) $(DL_DIR)/$(LZMA_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2006-11-04 20:15:56 +01:00
|
|
|
toolchain/patch-kernel.sh $(LZMA_TARGET_DIR) package/lzma/ lzma\*.patch
|
2007-07-31 18:13:00 +02:00
|
|
|
touch $@
|
2006-11-04 20:15:56 +01:00
|
|
|
|
2007-07-31 18:13:00 +02:00
|
|
|
$(LZMA_TARGET_DIR)/.configured: $(LZMA_TARGET_DIR)/.unpacked
|
2007-08-22 11:56:41 +02:00
|
|
|
(cd $(LZMA_TARGET_DIR); rm -f config.cache;\
|
2006-08-29 18:40:38 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-06-27 14:01:27 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2006-08-29 18:40:38 +02:00
|
|
|
CFLAGS="$(TARGET_CFLAGS) $(LZMA_CFLAGS)" \
|
|
|
|
ac_cv_func_malloc_0_nonnull=yes \
|
|
|
|
./configure \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--prefix=/usr \
|
2006-11-04 20:15:56 +01:00
|
|
|
--exec-prefix=$(TARGET_DIR)/usr/bin \
|
|
|
|
--libdir=$(TARGET_DIR)/lib \
|
|
|
|
--includedir=$(TARGET_DIR)/include \
|
2006-08-29 18:40:38 +02:00
|
|
|
--disable-debug \
|
|
|
|
$(DISABLE_NLS) \
|
2006-12-21 11:36:40 +01:00
|
|
|
$(DISABLE_LARGEFILE) \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2007-07-31 18:13:00 +02:00
|
|
|
touch $@
|
2006-08-29 18:40:38 +02:00
|
|
|
|
2006-11-04 20:15:56 +01:00
|
|
|
$(LZMA_TARGET_DIR)/src/lzma/lzma: $(LZMA_TARGET_DIR)/.configured
|
|
|
|
$(MAKE) -C $(LZMA_TARGET_DIR) all
|
2006-08-29 18:40:38 +02:00
|
|
|
touch -c $@
|
|
|
|
|
2007-02-04 17:34:56 +01:00
|
|
|
$(TARGET_DIR)/$(LZMA_TARGET_BINARY): $(LZMA_TARGET_DIR)/src/lzma/lzma
|
|
|
|
cp -dpf $(LZMA_TARGET_DIR)/src/lzma/lzma $@
|
2007-08-21 03:53:57 +02:00
|
|
|
-$(STRIP) $(STRIP_STRIP_UNNEEDED) $@
|
2007-02-04 17:34:56 +01:00
|
|
|
touch -c $@
|
2006-08-29 18:40:38 +02:00
|
|
|
|
2007-02-04 17:34:56 +01:00
|
|
|
#lzma-headers: $(TARGET_DIR)/$(LZMA_TARGET_BINARY)
|
2006-08-29 18:40:38 +02:00
|
|
|
|
2007-02-04 17:34:56 +01:00
|
|
|
lzma-target: uclibc $(TARGET_DIR)/$(LZMA_TARGET_BINARY)
|
2006-08-29 18:40:38 +02:00
|
|
|
|
|
|
|
lzma-source: $(DL_DIR)/$(LZMA_SOURCE)
|
|
|
|
|
|
|
|
lzma-clean:
|
2006-11-04 20:15:56 +01:00
|
|
|
rm -f $(TARGET_DIR)/usr/bin/lzma
|
|
|
|
-$(MAKE) -C $(LZMA_TARGET_DIR) clean
|
2006-08-29 18:40:38 +02:00
|
|
|
|
|
|
|
lzma-dirclean:
|
|
|
|
rm -rf $(LZMA_DIR)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-11-04 20:15:56 +01:00
|
|
|
ifeq ($(strip $(BR2_PACKAGE_LZMA_HOST)),y)
|
|
|
|
TARGETS+=lzma-host
|
2007-07-31 18:13:00 +02:00
|
|
|
HOST_SOURCE+=lzma-source
|
2006-11-04 20:15:56 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_LZMA_TARGET)),y)
|
|
|
|
TARGETS+=lzma-target
|
2006-08-29 18:40:38 +02:00
|
|
|
endif
|
2006-11-04 20:15:56 +01:00
|
|
|
|
2006-08-29 18:40:38 +02:00
|
|
|
#ifeq ($(strip $(BR2_PACKAGE_LZMA_TARGET_HEADERS)),y)
|
|
|
|
#TARGETS+=lzma-headers
|
|
|
|
#endif
|