1 #############################################################
5 #############################################################
7 LZMA_SOURCE
:=lzma-
$(LZMA_VERSION
).
tar.gz
9 LZMA_SITE
:=http
://tukaani.org
/lzma
/
10 LZMA_HOST_DIR
:=$(TOOL_BUILD_DIR
)/lzma-
$(LZMA_VERSION
)
11 LZMA_TARGET_DIR
:=$(BUILD_DIR
)/lzma-
$(LZMA_VERSION
)
12 LZMA_CFLAGS
:=$(TARGET_CFLAGS
)
13 ifeq ($(BR2_LARGEFILE
),y
)
14 LZMA_CFLAGS
+=-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS
=64
16 LZMA_TARGET_BINARY
:=bin
/lzma
18 # lzma binary for use on the host
19 LZMA
=$(TOOL_BUILD_DIR
)/bin
/lzma
20 HOST_LZMA_BINARY
=$(shell $(CONFIG_SHELL
) package
/lzma
/lzmacheck.sh
)
21 HOST_LZMA_IF_ANY
=$(shell $(CONFIG_SHELL
) toolchain
/dependencies
/check-host-lzma.sh
)
24 $(DL_DIR
)/$(LZMA_SOURCE
):
25 $(WGET
) -P
$(DL_DIR
) $(LZMA_SITE
)/$(LZMA_SOURCE
)
27 ######################################################################
31 ######################################################################
33 $(LZMA_HOST_DIR
)/.unpacked
: $(DL_DIR
)/$(LZMA_SOURCE
)
34 $(LZMA_CAT
) $(DL_DIR
)/$(LZMA_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
35 toolchain
/patch-kernel.sh
$(LZMA_HOST_DIR
) package
/lzma
/ lzma\
*.patch
38 $(LZMA_HOST_DIR
)/.configured
: $(LZMA_HOST_DIR
)/.unpacked
39 (cd
$(LZMA_HOST_DIR
); rm -f config.cache
;\
47 $(LZMA_HOST_DIR
)/src
/lzma
/lzma
: $(LZMA_HOST_DIR
)/.configured
48 $(MAKE
) -C
$(LZMA_HOST_DIR
) all
51 $(STAGING_DIR
)/bin
/lzma
: $(LZMA_HOST_DIR
)/src
/lzma
/lzma
52 $(MAKE
) DESTDIR
=$(STAGING_DIR
) -C
$(LZMA_HOST_DIR
) install
53 $(SED
) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/lib\',g" \
54 $(STAGING_DIR
)/lib
/liblzmadec.la
56 .PHONY
: lzma-host use-lzma-host-binary
58 if
[ ! -f
"$(TOOL_BUILD_DIR)/bin/lzma" ]; then \
59 [ -d
$(TOOL_BUILD_DIR
)/bin
] || mkdir
-p
$(TOOL_BUILD_DIR
)/bin
; \
60 ln
-sf
"$(HOST_LZMA_IF_ANY)" "$(TOOL_BUILD_DIR)/bin/lzma"; \
63 build-lzma-host-binary
: $(LZMA_HOST_DIR
)/src
/lzma
/lzma
64 -rm -f
$(TOOL_BUILD_DIR
)/bin
/lzma
65 $(INSTALL
) -D
-m
0755 $(LZMA_HOST_DIR
)/src
/lzma
/lzma
$(TOOL_BUILD_DIR
)/bin
/lzma
67 host-lzma
: $(HOST_LZMA_BINARY
)
69 lzma-host
: $(STAGING_DIR
)/bin
/lzma
72 rm -f
$(STAGING_DIR
)/bin
/lzma
73 -$(MAKE
) -C
$(LZMA_HOST_DIR
) clean
75 rm -rf
$(LZMA_HOST_DIR
)
77 lzma-host-install
: /usr
/local
/bin
/lzma
79 ######################################################################
83 ######################################################################
85 $(LZMA_TARGET_DIR
)/.unpacked
: $(DL_DIR
)/$(LZMA_SOURCE
)
86 $(LZMA_CAT
) $(DL_DIR
)/$(LZMA_SOURCE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
87 toolchain
/patch-kernel.sh
$(LZMA_TARGET_DIR
) package
/lzma
/ lzma\
*.patch
90 $(LZMA_TARGET_DIR
)/.configured
: $(LZMA_TARGET_DIR
)/.unpacked
91 (cd
$(LZMA_TARGET_DIR
); rm -f config.cache
;\
92 $(TARGET_CONFIGURE_OPTS
) \
93 $(TARGET_CONFIGURE_ARGS
) \
94 CFLAGS
="$(TARGET_CFLAGS) $(LZMA_CFLAGS)" \
95 ac_cv_func_malloc_0_nonnull
=yes \
97 --target
=$(GNU_TARGET_NAME
) \
98 --host
=$(GNU_TARGET_NAME
) \
99 --build
=$(GNU_HOST_NAME
) \
101 --exec-prefix
=$(TARGET_DIR
)/usr
/bin \
102 --libdir=$(TARGET_DIR
)/lib \
103 --includedir=$(TARGET_DIR
)/include \
106 $(DISABLE_LARGEFILE
) \
110 $(LZMA_TARGET_DIR
)/src
/lzma
/lzma
: $(LZMA_TARGET_DIR
)/.configured
111 $(MAKE
) -C
$(LZMA_TARGET_DIR
) all
114 $(TARGET_DIR
)/$(LZMA_TARGET_BINARY
): $(LZMA_TARGET_DIR
)/src
/lzma
/lzma
115 $(INSTALL
) -D
-m
0755 $(LZMA_TARGET_DIR
)/src
/lzma
/lzma
$@
116 -$(STRIPCMD
) $(STRIP_STRIP_UNNEEDED
) $@
119 #lzma-headers: $(TARGET_DIR)/$(LZMA_TARGET_BINARY)
121 lzma-target
: uclibc
$(TARGET_DIR
)/$(LZMA_TARGET_BINARY
)
123 lzma-source
: $(DL_DIR
)/$(LZMA_SOURCE
)
126 -$(MAKE
) -C
$(LZMA_TARGET_DIR
) clean
127 rm -f
$(TARGET_DIR
)/usr
/bin
/lzma
132 #############################################################
134 # Toplevel Makefile options
136 #############################################################
137 ifeq ($(BR2_PACKAGE_LZMA_HOST
),y
)
139 HOST_SOURCE
+=lzma-source
142 ifeq ($(BR2_PACKAGE_LZMA_TARGET
),y
)
146 #ifeq ($(BR2_PACKAGE_LZMA_TARGET_HEADERS),y)
147 #TARGETS+=lzma-headers