[Fuego] [PATCH 2/4] Fuego:qemu tools: add SDKROOT and bring back export_tools

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Wed Nov 2 06:27:17 UTC 2016


The export_tools function is useful to keep the xx-tools.sh
files shorter. Add definition of SDKROOT.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
 userdata/conf/tools.sh                    | 15 +++++++++++++++
 userdata/toolchains/qemu-armv7hf-tools.sh | 14 ++++----------
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/userdata/conf/tools.sh b/userdata/conf/tools.sh
index 52a6b2e..bfd100e 100755
--- a/userdata/conf/tools.sh
+++ b/userdata/conf/tools.sh
@@ -21,6 +21,21 @@
 # DESCRIPTION
 # This script defines (or calls env. setup script) build variables for ${PLATFORM}
 
+function export_tools () {
+    export AS=${PREFIX}-as
+    export CC=${PREFIX}-gcc
+    export CXX=${PREFIX}-g++
+    export AR=${PREFIX}-ar
+    export RANLIB=${PREFIX}-ranlib
+    export CPP=${PREFIX}-cpp
+    export CXXCPP=${PREFIX}-cpp
+    export LD=${PREFIX}-ld
+    export LDFLAGS="--sysroot ${SDKROOT} -lm"
+    export CROSS_COMPILE=${PREFIX}-
+    export HOST=${PREFIX}
+    export CONFIGURE_FLAGS="--target=${PREFIX} --host=${PREFIX} --build=`uname -m`-unknown-linux-gnu"
+}
+
 # scan the toolchains directory for a matching $PLATFORM-tools.sh file
 if [ -f "/userdata/toolchains/${PLATFORM}-tools.sh" ];
 then
diff --git a/userdata/toolchains/qemu-armv7hf-tools.sh b/userdata/toolchains/qemu-armv7hf-tools.sh
index 00384a8..f291bb3 100644
--- a/userdata/toolchains/qemu-armv7hf-tools.sh
+++ b/userdata/toolchains/qemu-armv7hf-tools.sh
@@ -7,17 +7,11 @@
 # 
 # this script is sourced by /userdata/conf/tools.sh
 
-export PREFIX=arm-linux-gnueabihf
-export CC=${PREFIX}-gcc
-export CXX=${PREFIX}-g++
-export CONFIGURE_FLAGS="--target=${PREFIX} --host=arm-linux-gnueabihf --build=x86_64-linux"
-export AS=${PREFIX}-as
-export LD=${PREFIX}-ld
-export AR=${PREFIX}-ar
-export RANLIB=${PREFIX}-ranlib
 export ARCH=arm
-export CROSS_COMPILE=${PREFIX}-
-HOST=arm-linux
+
+export SDKROOT=/
+export PREFIX=arm-linux-gnueabihf
+export_tools
 
 # save original path, to get to non-toolchain version of python
 ORIG_PATH=$PATH
-- 
2.7.4




More information about the Fuego mailing list