我从 Internet 上下载了一些包含自动工具功能的 C++ 源代码项目。所以,我想为我有编译器的arm设备交叉编译它;但是,我不知道如何在 autotools 参数上指示 arm 编译器,我尝试使用 CC=pathOfArmCompiler 在配置选项上设置我的编译器的路径,但它不起作用。
你有什么建议吗?我正在阅读更改 configure.ac 存档,但我不确定这是否是更好的解决方案。
提前致谢,
问候
编辑:
我尝试过使用以下配置的 Jack Kelly 建议
configure CC=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CXX=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++ CFLAGS="-m32" LDFLAGS="-m32"--host=arm-mv5sft-linux-gnueabi --with-sysroot=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi/
我得到这个错误
Command-line environment variables:
LDFLAGS="-m32" LDFLAGS="-m32" CC="/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc" CXX="/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++"
sh -c /home/t/ibrdtn/ibrdtn-tools-0.8.0/configure ++ --host=arm-mv5sft-linux-gnueabi --with-sysroot=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi/
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: ++
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-mv5sft-linux-gnueabi-strip... no
checking for arm-mv5sft-linux-gnueabi-strip... no
checking for strip... strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
Invalid configuration `++': machine `++' not recognized
configure: error: /bin/bash ./config.sub ++ failed
configure: error: /bin/bash ./config.sub ++ failed
checking build system type...
Configuration failed with error
编辑 2:重新安装 Eclipse 后,以前的错误消失了。但是现在有了这个配置
./configure --build=i686-linux --host=arm-mv5sft-linux-gnueabi
--target=arm-mv5sft-linux-gnueabi
CC=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc
CXX=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++
--with-gnu-ld--with-sysroot=/h/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi
CFLAGS="-m32" LDFLAGS="-m32" --prefix=/ibrdtn-svn/dtnCross/
检查配置输出我得到了这个
checking for arm-mv5sft-linux-gnueabi-g++... no
checking for arm-mv5sft-linux-gnueabi-c++... no
checking for arm-mv5sft-linux-gnueabi-gpp... no
checking for arm-mv5sft-linux-gnueabi-aCC... no
checking for arm-mv5sft-linux-gnueabi-CC... no
checking for arm-mv5sft-linux-gnueabi-cxx... no
checking for arm-mv5sft-linux-gnueabi-cc++... no
checking for arm-mv5sft-linux-gnueabi-cl.exe... no
checking for arm-mv5sft-linux-gnueabi-FCC... no
checking for arm-mv5sft-linux-gnueabi-KCC... no
checking for arm-mv5sft-linux-gnueabi-RCC... no
checking for arm-mv5sft-linux-gnueabi-xlC_r... no
checking for arm-mv5sft-linux-gnueabi-xlC... no
...
make[3]: Entering directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon/net'
CXX tcpclient.lo
CXX tcpserver.lo
CXX tcpstream.lo
CXX udpsocket.lo
CXX MulticastSocket.lo
CXX UnicastSocket.lo
CXX stopandwait.lo
CXX vsocket.lo
CXX vinterface.lo
CXX vaddress.lo
CXX LinkManager.lo
In file included from LinkManager.cpp:16:
../../ibrcommon/net/NetLinkManager.h:19:29: error: netlink/netlink.h: No such file or directory
../../ibrcommon/net/NetLinkManager.h:20:26: error: netlink/attr.h: No such file or directory
make[3]: *** [LinkManager.lo] Error 1
make[3]: Leaving directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon/net'
make[2]: Leaving directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon'
make[2]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon'
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
**** Build Finished ****
所以我认为编译器没有正确咳嗽,你知道可能的原因吗?
提前致谢,