在Ubuntu上为RaspberryPI交叉编译allJoyn

时间:2016-05-25 01:54:47

标签: cross-compiling alljoyn

我正在尝试在Ubuntu 16.04上为RaspberryPI2交叉编译AllJoyn。我按照Linux Cross-Compiling一节中提到的https://wiki.allseenalliance.org/develop/building_and_running步骤进行了操作。

当我尝试使用命令编译AllJoyn时 scons OS=openwrt CPU=openwrt BINDINGS=cpp,c,java WS=off BT=off ICE=off SERVICE="about,notification,controlpannel,config,onboarding,sample_apps" 我收到以下错误

    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.

我修改了build_core / conf / openwrt下的SConscript文件,以便在检查编译器之前打印env变量。

为了验证我的编译器不是过时的编译器,我尝试了

  1. 创建了一个名为" test.cc"的文件。其中有一行int main(void) { return 0; }
  2. 使用命令/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
  3. 编译文件
  4. 文件编译没有任何错误
  5. arm-linux-gnueabihf-g ++的版本是4.9.3
  6. 以下是我在运行scons命令之前设置的环境变量的值

    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
    

    我无法在Ubuntu 16.04计算机上交叉编译AllJoyn for RaspberryPI2。任何正确方向的指针都将非常受欢迎。提前谢谢。

1 个答案:

答案 0 :(得分:0)