2017-05-09 2 views
0

私は(根付いた)Androidデバイスで実行するために完全なモノをコンパイルしようとしています。これは、埋め込みLinuxからAndroidにアプリケーションを移植したいからです。ソフトウェアは、私がこれまで行ってきたどのような瞬間に、組み込みLinuxデバイス上で実行されます...私は本当にそれはそれの一部を書き換えることなくそのままソフトウェアを再利用したい...Androidとの完全なクロスコンパイルNDK

を-installed LinuxのDebianの

MONO tarアーカイブ-Downloaded http://developer.android.com/ndk/guides/index.html

のようにAndroidのSDK NDKを-installed(I既に試した異なるバージョン4.6、4.8および5.0)

-run次のコマンド

export CC=/home/alex/Android/mytoolchain/bin/arm-linux-androideabi-gcc 
export CXX=/home/alex/Android/mytoolchain/bin/arm-linux-androideabi-g++ 
export CPP=/home/alex/Android/mytoolchain/bin/arm-linux-androideabi-cpp 
export AR=/home/alex/Android/mytoolchain/bin/arm-linux-androideabi-ar 
export AS=/home/alex/Android/mytoolchain/bin/arm-linux-androideabi-as 
export ANDROID_STANDALONE_TOOLCHAIN=/home/alex/Android/mytoolchain 

./configure --prefix=/home/alex/Android/monobuild/ --with-sigaltstack=no --with-mcs-docs=no --disable-mcs-build --host=arm-linux-androideabi --target=arm-linux-androideabi --disable-nls --with-sysroot=/home/alex/Android/mytoolchain/sysroot/ --cache=/home/alex/Android/my.cache 

make 

--> 
CC libmonoruntimesgen_la-w32file-unix-glob.lo 
CC libmonoruntimesgen_la-w32error-unix.lo 

CC ../../support/libm/libmonoruntimesgen_la-complex.lo 
../../support/libm/complex.c:19:26: fatal error: math_private.h: No such file or Directory #include "math_private.h" 

compilation terminated. 
Makefile:4173: recipe for target '../../support/libm/libmonoruntimesgen_la-complex.lo' failed 
make[3]: *** [../../support/libm/libmonoruntimesgen_la-complex.lo] Error 1 
make[3]: Leaving directory '/home/alex/Android/mono-5.0.0/mono/metadata' 
Makefile:446: recipe for target 'all-recursive' failed 
make[2]: *** [all-recursive] Error 1 
make[2]: Leaving directory '/home/alex/Android/mono-5.0.0/mono' 
Makefile:522: recipe for target 'all-recursive' failed 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory '/home/alex/Android/mono-5.0.0' 
Makefile:451: recipe for target 'all' failed 
make: *** [all] Error 2 

私はAndroidについてたくさんのことを見ましたので、クロスコンパイルが可能でなければならないと思います。誰がエラーの詳細を知っている?

私はモノのディレクトリにNDKディレクトリからファイルmath_private.hをコピーすることができますが、それは後の段階で壊れる:

Making all in mini 
make[3]: Entering directory '/home/alex/Android/mono-4.8.1/mono/mini' 
make all-am 
make[4]: Entering directory '/home/alex/Android/mono-4.8.1/mono/mini' 
    CCLD  mono-sgen 
./.libs/libmonosgen-2.0.so: error: undefined reference to 'tkill' 
main.c:172: error: undefined reference to 'mono_dl_open' 
main.c:179: error: undefined reference to 'mono_loader_register_module' 
main.c:339: error: undefined reference to 'mono_build_date' 
collect2: error: ld returned 1 exit status 
Makefile:1468: recipe for target 'mono-sgen' failed 
make[4]: *** [mono-sgen] Error 1 
make[4]: Leaving directory '/home/alex/Android/mono-4.8.1/mono/mini' 
Makefile:1293: recipe for target 'all' failed 
make[3]: *** [all] Error 2 
make[3]: Leaving directory '/home/alex/Android/mono-4.8.1/mono/mini' 
Makefile:445: recipe for target 'all-recursive' failed 
make[2]: *** [all-recursive] Error 1 
make[2]: Leaving directory '/home/alex/Android/mono-4.8.1/mono' 
Makefile:525: recipe for target 'all-recursive' failed 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory '/home/alex/Android/mono-4.8.1' 
Makefile:454: recipe for target 'all' failed 
make: *** [all] Error 2 
+0

あなたが構築しているプロジェクトの 'math_private.h'は一部ですか?これはNDKの一部ではなく、Cライブラリのパブリックインターフェイスの一部ではないと思います。それがモノの一部であり、それが含まれていない場合、私はmakeファイルに何か問題があると考えます。ホストマシンに同じソースをビルドすることはできますか(クロスコンパイルではない)? –

+0

ファイルをNDKで見つけました:./Sdk/ndk-bundle/sources/android/support/src/msun/math_private.hしかし、ファイルをコピーするだけで正しいのか分かりません。とにかく、ファイルをコピーすると、後で別のエラーが発生します。 make [4]:ディレクトリ '/home/alex/Android/mono-4.8.1/mono/mini'を入力しています CCLD mono-sgen ./。 libs/libmonosgen2.0.so:error:未定義の 'tkill'への参照 main.c:172:エラー: 'mono_dl_open'への未定義参照 main.c:179:エラー:未定義の 'mono_loader_register_module'への参照 main.c :339:error:undefined reference to 'mono_build_date' – Alex111

+0

いいえ、そのファイルをコピーしていません。 –

答えて

0

自分自身にいくつかのトラブルを保存しstandalone toolchainを使用しています。あなたのためにNDKでautoconfを使用することの頭痛の世話をするでしょう。

+0

ありがとうございます - 私はすでにこれを試していますが、私の結果は既にスタンドアロンのツールチェーンで表示されています: make-standalone-toolchain .sh --arch = arm-linux-androideabi-4.9 --platform = android-23 --install-dir =/home/alex/Android/mytoolchain – Alex111

関連する問題