1 #############################################################
5 #############################################################
6 LZMA_VERSION_STRING
:=$(subst ",,$(BR2_PACKAGE_LZMA_VERSION))
8 ifneq ($(BR2_PACKAGE_LZMA_VERSION_git
),)
9 LZMA_SITE
:=git
://ctrl.tukaani.org
/lzma-utils.git
10 LZMA_SOURCE
:=lzma-utils.
tar.gz
12 LZMA_SRCDIR
:=$(TOOL_BUILD_DIR
)/lzma-utils
13 LZMA_HOST_DIR
:=$(TOOL_BUILD_DIR
)/lzma-utils-host
14 LZMA_TARGET_DIR
:=$(BUILD_DIR
)/lzma-utils
15 LZMA_CONFIGURE_ARGS
:=--enable-small
18 LZMA_SOURCE
:=lzma-
$(LZMA_VERSION
).
tar.gz
20 LZMA_SITE
:=http
://tukaani.org
/lzma
/
21 LZMA_SRCDIR
:=$(TOOL_BUILD_DIR
)/lzma-
$(LZMA_VERSION
)
22 LZMA_HOST_DIR
:=$(TOOL_BUILD_DIR
)/lzma-
$(LZMA_VERSION
)-host
23 LZMA_TARGET_DIR
:=$(BUILD_DIR
)/lzma-
$(LZMA_VERSION
)
26 LZMA_CFLAGS
:=$(TARGET_CFLAGS
)
27 ifeq ($(BR2_LARGEFILE
),y
)
28 LZMA_CFLAGS
+=-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS
=64
30 LZMA_TARGET_BINARY
:=bin
/lzma
32 # lzma binary for use on the host
33 LZMA
=$(TOOL_BUILD_DIR
)/bin
/lzma
34 HOST_LZMA_BINARY
=$(shell $(CONFIG_SHELL
) package
/lzma
/lzmacheck.sh
)
35 HOST_LZMA_IF_ANY
=$(shell $(CONFIG_SHELL
) toolchain
/dependencies
/check-host-lzma.sh
)
38 $(DL_DIR
)/$(LZMA_SOURCE
):
39 ifeq ($(BR2_PACKAGE_LZMA_VERSION_git
),)
40 $(WGET
) -P
$(DL_DIR
) $(LZMA_SITE
)/$(LZMA_SOURCE
)
42 test -d
$(DL_DIR
)/lzma-utils
/.git || \
43 $(GIT
) clone
$(LZMA_SITE
) $(DL_DIR
)/lzma-utils
44 #(cd $(DL_DIR)/lzma-utils && ./autogen.sh)
45 (cd
$(DL_DIR
) && tar -czf
$@ lzma-utils
)
48 ######################################################################
52 ######################################################################
54 $(LZMA_SRCDIR
)/.unpacked
: $(DL_DIR
)/$(LZMA_SOURCE
)
55 $(LZMA_CAT
) $(DL_DIR
)/$(LZMA_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
56 toolchain
/patch-kernel.sh
$(LZMA_SRCDIR
) package
/lzma
/ lzma\
*.patch
57 ifeq ($(BR2_USE_UPDATES
),y
)
58 (test -d
$(LZMA_SRCDIR
)/.git
&& cd
$(@D
) && $(GIT
) pull
&& .
/autogen.sh
)
60 $(CONFIG_UPDATE
) $(@D
)
63 $(LZMA_HOST_DIR
)/.configured
: $(LZMA_SRCDIR
)/.unpacked
65 (cd
$(LZMA_HOST_DIR
); rm -f config.cache
;\
68 $(LZMA_SRCDIR
)/configure \
73 $(LZMA_HOST_DIR
)/src
/lzma
/lzma
: $(LZMA_HOST_DIR
)/.configured
74 $(MAKE
) -C
$(LZMA_HOST_DIR
) all
77 $(STAGING_DIR
)/bin
/lzma
: $(LZMA_HOST_DIR
)/src
/lzma
/lzma
78 $(MAKE
) DESTDIR
=$(STAGING_DIR
) -C
$(LZMA_HOST_DIR
) install
79 $(SED
) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/lib\',g" \
80 $(STAGING_DIR
)/lib
/liblzmadec.la
82 .PHONY
: host-lzma use-lzma-host-binary build-lzma-host-binary
84 $(Q
)if
[ ! -f
"$(TOOL_BUILD_DIR)/bin/lzma" ]; then \
85 [ -d
$(TOOL_BUILD_DIR
)/bin
] || mkdir
-p
$(TOOL_BUILD_DIR
)/bin
; \
86 ln
-sf
"$(HOST_LZMA_IF_ANY)" "$(TOOL_BUILD_DIR)/bin/lzma"; \
89 build-lzma-host-binary
: $(LZMA_HOST_DIR
)/src
/lzma
/lzma
90 -rm -f
$(TOOL_BUILD_DIR
)/bin
/lzma
91 $(INSTALL
) -D
-m
0755 $(LZMA_HOST_DIR
)/src
/lzma
/lzma
$(TOOL_BUILD_DIR
)/bin
/lzma
93 host-lzma
: $(HOST_LZMA_BINARY
)
95 lzma-host
: $(STAGING_DIR
)/bin
/lzma
98 rm -f
$(STAGING_DIR
)/bin
/lzma
99 -$(MAKE
) -C
$(LZMA_HOST_DIR
) clean
101 rm -rf
$(LZMA_HOST_DIR
)
103 lzma-host-install
: /usr
/local
/bin
/lzma
105 ######################################################################
109 ######################################################################
111 #$(LZMA_TARGET_DIR)/.unpacked: $(DL_DIR)/$(LZMA_SOURCE)
112 # $(LZMA_CAT) $(DL_DIR)/$(LZMA_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
113 # toolchain/patch-kernel.sh $(LZMA_TARGET_DIR) package/lzma/ lzma\*.patch
116 $(LZMA_TARGET_DIR
)/.configured
: THIS_SRCDIR
=$(LZMA_SRCDIR
)
117 $(LZMA_TARGET_DIR
)/.configured
: $(LZMA_SRCDIR
)/.unpacked
119 (cd
$(LZMA_TARGET_DIR
); rm -f config.cache
;\
120 $(TARGET_CONFIGURE_OPTS
) \
121 $(TARGET_CONFIGURE_ARGS
) \
122 CFLAGS
="$(TARGET_CFLAGS) $(LZMA_CFLAGS)" \
123 ac_cv_func_malloc_0_nonnull
=yes \
124 $(LZMA_SRCDIR
)/configure \
125 --target
=$(GNU_TARGET_NAME
) \
126 --host
=$(GNU_TARGET_NAME
) \
127 --build
=$(GNU_HOST_NAME
) \
129 --exec-prefix
=$(TARGET_DIR
)/usr
/bin \
130 --libdir=$(TARGET_DIR
)/lib \
131 --includedir=$(TARGET_DIR
)/include \
134 $(DISABLE_LARGEFILE
) \
135 $(LZMA_CONFIGURE_ARGS
) \
139 $(LZMA_TARGET_DIR
)/src
/lzma
/lzma
: $(LZMA_TARGET_DIR
)/.configured
140 $(MAKE
) -C
$(LZMA_TARGET_DIR
) all
143 $(TARGET_DIR
)/$(LZMA_TARGET_BINARY
): $(LZMA_TARGET_DIR
)/src
/lzma
/lzma
144 $(INSTALL
) -D
-m
0755 $(LZMA_TARGET_DIR
)/src
/lzma
/lzma
$@
145 -$(STRIPCMD
) $(STRIP_STRIP_UNNEEDED
) $@
148 #lzma-headers: $(TARGET_DIR)/$(LZMA_TARGET_BINARY)
150 lzma-target
: $(TARGET_DIR
)/$(LZMA_TARGET_BINARY
)
152 lzma-source
: $(DL_DIR
)/$(LZMA_SOURCE
)
155 -$(MAKE
) -C
$(LZMA_TARGET_DIR
) clean
156 rm -f
$(TARGET_DIR
)/usr
/bin
/lzma
161 #############################################################
163 # Toplevel Makefile options
165 #############################################################
166 ifeq ($(BR2_PACKAGE_LZMA_HOST
),y
)
168 HOST_SOURCE
+=lzma-source
171 ifeq ($(BR2_PACKAGE_LZMA_TARGET
),y
)
175 #ifeq ($(BR2_PACKAGE_LZMA_TARGET_HEADERS),y)
176 #TARGETS+=lzma-headers