gpsd: pass sysroot param to scons and fix SConstruct to respect that
authorMartin Jansa <Martin.Jansa@gmail.com>
Tue, 24 Apr 2012 07:01:27 +0000 (09:01 +0200)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 16:20:27 +0000 (08:20 -0800)
(From meta-openembedded rev: 1c4eff918d6268cf211e77b8b0a22603f9d6c4f3)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-openembedded/meta-oe/recipes-navigation/gpsd/gpsd/0001-SConstruct-respect-sysroot-setting-when-prepending-L.patch [new file with mode: 0644]
meta-openembedded/meta-oe/recipes-navigation/gpsd/gpsd/0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch [new file with mode: 0644]
meta-openembedded/meta-oe/recipes-navigation/gpsd/gpsd_3.4.bb

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