I am trying to cross-compile AllJoyn on Ubuntu 16.04 for RaspberryPI2. I followed steps mentioned https://wiki.allseenalliance.org/develop/building_and_running under section Linux Cross-Compiling.
When I try to compile AllJoyn using command
scons OS=openwrt CPU=openwrt BINDINGS=cpp,c,java WS=off BT=off ICE=off SERVICE="about,notification,controlpannel,config,onboarding,sample_apps"
I get following error
scons: Reading SConscript files ...
Checking c++ compiler support for -std=c++11 flag... Printing env dump...
{ 'CPATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/include',
'HOME': '/home/jha',
'LIBRARY_PATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib:/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/libexec',
'PATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin',
'STAGING_DIR': '/home/jha/rpi/linux/usr'}
no
Checking c++ compiler support for -std=c++0x flag... Printing env dump...
{ 'CPATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/include',
'HOME': '/home/jha',
'LIBRARY_PATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib:/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/libexec',
'PATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin',
'STAGING_DIR': '/home/jha/rpi/linux/usr'}
no
*** Compiler too old to build AllJoyn. Aborting.
I modified the SConscript file under build_core/conf/openwrt to print env variables right before checking the compiler.
To verify that my compiler is not an outdated compiler, I tried following
- Created a file named "test.cc" with one line in it
int main(void) { return 0; }
- Compiled the file using command
/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -std=c++11 -o ../test ../test.cc
- File compiles without any error
- Version of arm-linux-gnueabihf-g++ is 4.9.3
Following are values of environment variables I set, before running the scons command
HOST_HOME="/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf"
TARGET_PREFIX="arm-linux-gnueabihf-"
export TARGET_PATH="${HOST_HOME}/bin"
export TARGET_CC="${TARGET_PREFIX}gcc"
export TARGET_CPPFLAGS=""
export TARGET_CFLAGS="-I${HOST_HOME}/arm-linux-gnueabihf/sysroot/usr/include"
export CXXFLAGS="-std=c++11"
export TARGET_CXX="${TARGET_PREFIX}g++"
export TARGET_LINK=$TARGET_CC
export TARGET_LINKFLAGS="-L${HOST_HOME}/arm-linux-gnueabihf/sysroot/usr/lib -L${HOST_HOME}/arm-linux-gnueabihf/sysroot/usr/libexec"
export TARGET_LDFLAGS=$TARGET_LINKFLAGS
export TARGET_AR="${TARGET_PREFIX}ar"
export TARGET_RANLIB="${TARGET_PREFIX}ranlib"
export STAGING_DIR="/home/jha/rpi/linux/usr"
export CROSS_PREFIX=$TARGET_PREFIX
export CROSS_PATH=$TARGET_PATH
export CROSS_CFLAGS="$TARGET_CFLAGS -march=armv7 "
export CROSS_LINKFLAGS=$TARGET_LINKFLAGS
export CROSS_COMPILE=$TARGET_PREFIX
I am not able to cross-compile AllJoyn for RaspberryPI2 on an Ubuntu 16.04 machine. Any pointers in right direction will be much appreciated. Thank you in advance.