gpsd: pass sysroot param to scons and fix SConstruct to respect that

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Martin Jansa
2012-04-24 09:01:27 +02:00
parent cf49798890
commit 1c4eff918d
3 changed files with 71 additions and 1 deletions
@@ -0,0 +1,36 @@
From 7427bb23092b3e395d14e42cd3b64691082fe826 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Tue, 24 Apr 2012 10:58:26 +0200
Subject: [PATCH 1/4] SConstruct: respect sysroot setting when prepending
LIBPATH/RPATH
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
SConstruct | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/SConstruct b/SConstruct
index 22bc9f4..21b2205 100644
--- a/SConstruct
+++ b/SConstruct
@@ -269,9 +269,14 @@ def installdir(dir, add_destdir=True):
return wrapped
# Honor the specified installation prefix in link paths.
-env.Prepend(LIBPATH=[installdir('libdir')])
-if env["shared"]:
- env.Prepend(RPATH=[installdir('libdir')])
+if env['sysroot']:
+ env.Prepend(LIBPATH=[os.path.normpath("%s/%s/%s" % (env['sysroot'], env['prefix'], env['libdir']))])
+ if env["shared"]:
+ env.Prepend(RPATH=[os.path.normpath("%s/%s/%s" % (env['sysroot'], env['prefix'], env['libdir']))])
+else:
+ env.Prepend(LIBPATH=[installdir('libdir')])
+ if env["shared"]:
+ env.Prepend(RPATH=[installdir('libdir')])
# Give deheader a way to set compiler flags
if 'MORECFLAGS' in os.environ:
--
1.7.8.5
@@ -0,0 +1,29 @@
From 5266eb72cbc8193faa2345b8774b0f159e61c067 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Tue, 24 Apr 2012 11:52:35 +0200
Subject: [PATCH 2/4] SConstruct: respect sysroot also in SPLINTOPTS
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
SConstruct | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/SConstruct b/SConstruct
index 21b2205..0cf5799 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1224,7 +1224,10 @@ def Utility(target, source, action):
# Report splint warnings
# Note: test_bits.c is unsplintable because of the PRI64 macros.
-env['SPLINTOPTS'] = "-I/usr/include/libusb-1.0 +quiet"
+if env['sysroot']:
+ env['SPLINTOPTS'] = "-I%s/usr/include/libusb-1.0 +quiet" % env['sysroot']
+else:
+ env['SPLINTOPTS'] = "-I/usr/include/libusb-1.0 +quiet"
def Splint(target,sources, description, params):
return Utility(target,sources+generated_sources,[
--
1.7.8.5
+6 -1
View File
@@ -7,6 +7,8 @@ PROVIDES = "virtual/gpsd"
SRC_URI = "http://download.savannah.gnu.org/releases/${PN}/${P}.tar.gz \
file://0001-SConstruct-fix-DSO-build-for-ntpshm-garmin_monitor.patch \
file://0001-SConstruct-respect-sysroot-setting-when-prepending-L.patch \
file://0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch \
file://gpsd-default \
file://gpsd \
file://gpsd.socket \
@@ -28,16 +30,19 @@ export STAGING_INCDIR
export STAGING_LIBDIR
EXTRA_OESCONS = " \
sysroot=${STAGING_DIR_TARGET} \
libQgpsmm='false' \
debug='true' \
strip='false' \
systemd='true' \
"
# this cannot be used, because then chrpath is not found and only static lib is built
# target=${HOST_SYS}
do_compile_prepend() {
export LIBPATH="${STAGING_LIBDIR}"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
export BUILD_SYS="${BUILD_SYS}"
export HOST_SYS="${HOST_SYS}"
}