Patchwork [meta-oe,06/16] gpsd: pass sysroot param to scons and fix SConstruct to respect that

login
register
mail settings
Submitter Martin Jansa
Date April 30, 2012, 6:33 a.m.
Message ID <1c4eff918d6268cf211e77b8b0a22603f9d6c4f3.1335767139.git.Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/26611/
State Accepted
Commit 1c4eff918d6268cf211e77b8b0a22603f9d6c4f3
Headers show

Comments

Martin Jansa - April 30, 2012, 6:33 a.m.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 ...respect-sysroot-setting-when-prepending-L.patch |   36 ++++++++++++++++++++
 ...struct-respect-sysroot-also-in-SPLINTOPTS.patch |   29 ++++++++++++++++
 meta-oe/recipes-navigation/gpsd/gpsd_3.4.bb        |    7 +++-
 3 files changed, 71 insertions(+), 1 deletions(-)
 create mode 100644 meta-oe/recipes-navigation/gpsd/gpsd/0001-SConstruct-respect-sysroot-setting-when-prepending-L.patch
 create mode 100644 meta-oe/recipes-navigation/gpsd/gpsd/0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch

Patch

diff --git a/meta-oe/recipes-navigation/gpsd/gpsd/0001-SConstruct-respect-sysroot-setting-when-prepending-L.patch b/meta-oe/recipes-navigation/gpsd/gpsd/0001-SConstruct-respect-sysroot-setting-when-prepending-L.patch
new file mode 100644
index 0000000..6b720a5
--- /dev/null
+++ b/meta-oe/recipes-navigation/gpsd/gpsd/0001-SConstruct-respect-sysroot-setting-when-prepending-L.patch
@@ -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
+
diff --git a/meta-oe/recipes-navigation/gpsd/gpsd/0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch b/meta-oe/recipes-navigation/gpsd/gpsd/0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch
new file mode 100644
index 0000000..55ef704
--- /dev/null
+++ b/meta-oe/recipes-navigation/gpsd/gpsd/0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch
@@ -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
+
diff --git a/meta-oe/recipes-navigation/gpsd/gpsd_3.4.bb b/meta-oe/recipes-navigation/gpsd/gpsd_3.4.bb
index bb79368..7502f9a 100644
--- a/meta-oe/recipes-navigation/gpsd/gpsd_3.4.bb
+++ b/meta-oe/recipes-navigation/gpsd/gpsd_3.4.bb
@@ -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}"
 }