2012-01-20 47 views
4

我試圖建立與Android NDK獨立的編譯器工具鏈的東西,但我得到這個錯誤:「配置」與Android NDK獨立的工具鏈沒有

Updating bundled third-party dependencies... 

bash -c 'mkdir -p output/{debug,release,test}/{FCollada/{FCDocument,FMath,FUtils,FColladaTest/{FCTestAssetManagement,FCTestExportImport,FCTestXRef}},FColladaPlugins/FArchiveXML}' 
cp output/libFColladaSD.a ../lib/libFColladaSD.a 
cp output/libFColladaSR.a ../lib/libFColladaSR.a 

Building SpiderMonkey... 

SpiderMonkey build options: --disable-tests   
loading cache ./config.cache 
checking host system type... x86_64-unknown-linux-gnu 
checking target system type... x86_64-unknown-linux-gnu 
checking build system type... x86_64-unknown-linux-gnu 
checking for mawk... mawk 
checking for perl5... no 
checking for perl... /usr/bin/perl 
checking for gcc... gcc 
checking whether the C compiler (gcc ) works... yes 
checking whether the C compiler (gcc ) is a cross-compiler... no 
checking whether we are using GNU C... yes 
checking whether gcc accepts -g... yes 
checking for c++... arm-linux-androideabi-g++ 
checking whether the C++ compiler (arm-linux-androideabi-g++ ) works... no 
configure: error: installation or configuration problem: C++ compiler cannot create executables. 
ERROR: SpiderMonkey build failed 

這是config.log說什麼:http://pastebin.com/5AFZG4CX

ANDROID_NDK_ROOT設置如下:

[email protected]:~/android/0ad/build/workspaces$ echo $ANDROID_NDK_ROOT 
/home/afeder/android/android-ndk-r7-crystax-4 

可能是什麼原因,或者我該如何調試呢?謝謝。

+0

什麼'config.log'說?你可以上傳嗎? –

+0

這就是config.log所說的:http://pastebin.com/5AFZG4CX –

回答

10

對我來說,這看起來破:

checking host system type... x86_64-unknown-linux-gnu 
checking target system type... x86_64-unknown-linux-gnu 
checking build system type... x86_64-unknown-linux-gnu 

以下是我會成立了環境,我的Android NDK編譯:

export CROSS_COMPILE=arm-linux-androideabi 
export CC=${CROSS_COMPILE}-gcc 
export CXX=${CROSS_COMPILE}-g++ 

...其他binutils根據需要...

export NDK=/home/afeder/android/android-ndk-r7-crystax-4 
export SYSROOT=$NDK/platforms/android-8/arch-arm 
PATH=$PATH:$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin 

確保將--sysroot=$SYSROOT添加到CFLAGS,CPPFLAGS和/或CXXFLAGS

現在你需要告訴SpiderMonkey的configure你是交叉編譯:

./configure --build=x86_64-unknown-linux-gnu --host=arm-linux-androideabi --target=arm-linux-androideabi 
+0

'--sysroot = $ SYSROOT'也需要去預處理器標誌變量'CPPFLAGS'。請用upvote更新您的答案。 – Samveen

2

它看起來像它找不到arm-linux-androideabi-g++。嘗試在NDK文件夾中搜索並將目錄添加到您的PATH

我的在這裏:

ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ 
+0

這也是我的想法,但'arm-linux-androideabi-g ++'確實出現在我的'PATH'中,如果我只是運行'arm-linux-androideabi-g ++'離開命令行,它發現它已經足夠好了。 –

+0

你有一個ANDROID_NDK_ROOT環境變量集嗎? –

+0

是的,'ANDROID_NDK_ROOT'設置爲'/ home/afeder/android/android-ndk-r7-crystax-4'。 –

相關問題