[oe-commits] Tom Rini : lzma: Various cleanups and a bugfix

git version control git at git.openembedded.org
Wed Feb 23 21:08:09 UTC 2011


Module: openembedded.git
Branch: master
Commit: 6bb7f0a60617f50da54eaa03f25a14bfb19aad64
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=6bb7f0a60617f50da54eaa03f25a14bfb19aad64

Author: Tom Rini <tom_rini at mentor.com>
Date:   Wed Feb 23 12:51:24 2011 -0700

lzma: Various cleanups and a bugfix

We use the subdir parameter to SRC_URI so that we will unpack into
the normal S directory rather than WORKDIR (which avoids a race with
the append to unpack and removal of empty log files).  Next, we replace
the regex to override the compiler with a patch that really does it
where it's needed (C/LzmaUtil) and now we have a target liblzma.a
rather than host liblzma.a.  For CPP/7zip/Compress/LZMA_Alone we
just need to pass in correct values via CXX_C / CXX.  Given
the structure of the Makefile it's easiest to pass in the rest
of the flags as part of the compiler.

Signed-off-by: Tom Rini <tom_rini at mentor.com>

---

 recipes/lzma/lzma-4.65/makefile-cleanup.patch |   18 ++++++++++++++++++
 recipes/lzma/lzma.inc                         |   22 +++++++---------------
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/recipes/lzma/lzma-4.65/makefile-cleanup.patch b/recipes/lzma/lzma-4.65/makefile-cleanup.patch
new file mode 100644
index 0000000..ccca4d9
--- /dev/null
+++ b/recipes/lzma/lzma-4.65/makefile-cleanup.patch
@@ -0,0 +1,18 @@
+Index: lzma-4.65/C/LzmaUtil/makefile.gcc
+===================================================================
+--- lzma-4.65.orig/C/LzmaUtil/makefile.gcc
++++ lzma-4.65/C/LzmaUtil/makefile.gcc
+@@ -1,10 +1,10 @@
+ PROG = lzma
+-CC = gcc
++CC ?= gcc
+ LIB = liblzma.a
+ RM = rm -f
+ CFLAGS = -c -O2 -Wall
+-AR = ar
+-RANLIB = ranlib
++AR ?= ar
++RANLIB ?= ranlib
+ 
+ OBJS = \
+   Alloc.o \
diff --git a/recipes/lzma/lzma.inc b/recipes/lzma/lzma.inc
index c7e074c..c67619e 100644
--- a/recipes/lzma/lzma.inc
+++ b/recipes/lzma/lzma.inc
@@ -1,35 +1,27 @@
 DESCRIPTION = "LZMA is a general compression method. LZMA provides high compression ratio and very fast decompression."
 HOMEPAGE = "http://www.7-zip.org/"
 LICENSE = "LGPL"
-INC_PR = "r5"
+INC_PR = "r6"
 
-SRC_URI = "http://downloads.sourceforge.net/sevenzip/lzma${@bb.data.getVar('PV',d,1).replace('.','')}.tar.bz2 \
+SRC_URI = "http://downloads.sourceforge.net/sevenzip/lzma${@bb.data.getVar('PV',d,1).replace('.','')}.tar.bz2;subdir=${BPN}-${PV} \
            file://001-large_files.patch \
            file://002-lzmp.patch \
            file://003-compile_fixes.patch \
-           file://100-static_library.patch"
-
-S = "${WORKDIR}"
+           file://100-static_library.patch \
+           file://makefile-cleanup.patch"
 
 EXTRA_OEMAKE = "-f makefile.gcc"
 
-CFLAGS += "-c -I${S}"
-
 do_unpack_append() {
         # Replace MS-DOS line-endings with Unix style line-endings
         oe.process.run("find . -type f -print0 | xargs -0 sed 's/\r$//' -i",
                        cwd=d.getVar("S", True))
 }
 
-do_patch_append() {
-        # Hack to ensure we use our environment values
-        oe.process.run("find . -type f -name makefile.gcc -print0 | xargs -0 sed 's/^CXX =/CXX ?=/;s/^CXX_C =/CXX_C ?=/;s/CXX_C/CC/' -i",
-                       cwd=d.getVar("S", True))
-}
-
 do_compile() {
-        oe_runmake -C C/LzmaUtil
-        oe_runmake -C CPP/7zip/Compress/LZMA_Alone
+        oe_runmake CFLAGS='${CFLAGS} -c' -C C/LzmaUtil
+        oe_runmake CXX_C='${CC} ${CFLAGS}' CXX='${CXX} ${CXXFLAGS}' \
+		-C CPP/7zip/Compress/LZMA_Alone
 }
 
 do_install() {





More information about the Openembedded-commits mailing list