serf: fix 'ccache' builds

'scons' cleans the environment which breaks ccache builds because
CCACHEDIR can point to an unexpected location:

| ccache arm-linux-gnueabi-gcc ... context.c
| ccache: failed to create .../serf/1.3.8-r0/.home/.ccache (No such file or directory)

Issue is described in

  http://www.scons.org/wiki/ImportingEnvironmentSettings

and because 'bitbake' cleans environment we can pass it completely
instead of trying to enumerate needed env.

With the 'env.patch' the FULLCC variable is not needed anymore (which
would break when CC is 'ccache arm-...-gcc' and host ccache is used)
because the correct $PATH is available during scons build:

| sh: .../sysroots/x86_64-oe-linux/usr/bin/arm-linux-gnueabi/ccache: No such file or directory
| scons: *** [context.o] Error 127

(From OE-Core rev: 36d94ed631f1a753482282fced7d3b7505d5e03d)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Enrico Scholz 2014-11-21 17:55:12 +01:00 committed by Richard Purdie
parent ec4781194c
commit 496a793d7b
2 changed files with 31 additions and 6 deletions

View File

@ -0,0 +1,28 @@
'scons' cleans the environment which breaks ccache builds because
CCACHEDIR can point to an unexpected location:
| ccache arm-linux-gnueabi-gcc ... context.c
| ccache: failed to create .../serf/1.3.6-r0/.home/.ccache (No such file or directory)
Issue is described in
http://www.scons.org/wiki/ImportingEnvironmentSettings
and because 'bitbake' cleans environment we can pass it completely
instead of trying to enumerate needed env.
Upstream-Status: Inappropriate
Index: serf-1.3.6/SConstruct
===================================================================
--- serf-1.3.6.orig/SConstruct
+++ serf-1.3.6/SConstruct
@@ -149,6 +149,7 @@ if sys.platform == 'win32':
env = Environment(variables=opts,
tools=('default', 'textfile',),
CPPPATH=['.', ],
+ ENV = os.environ,
)
env.Append(BUILDERS = {

View File

@ -1,7 +1,7 @@
SRC_URI = "http://serf.googlecode.com/svn/src_releases/serf-${PV}.tar.bz2 \
file://norpath.patch"
SRC_URI[md5sum] = "2e4efe57ff28cb3202a112e90f0c2889"
file://norpath.patch \
file://env.patch"
SRC_URI[sha256sum] = "e0500be065dbbce490449837bb2ab624e46d64fc0b090474d9acaa87c82b2590"
LICENSE = "Apache-2.0"
@ -9,12 +9,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
DEPENDS = "python-scons-native openssl apr apr-util util-linux expat"
FULLCC = "${STAGING_BINDIR_TOOLCHAIN}/${CC}"
FULLCC_class-native = "${CC}"
do_compile() {
${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} \
CC="${FULLCC}" \
CC="${CC}" \
APR=`which apr-1-config` APU=`which apu-1-config` \
CFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" \
OPENSSL="${STAGING_EXECPREFIXDIR}"