Building mono with android ndk standalone toolchain (android ndk r8e)

对着背影说爱祢 提交于 2019-12-22 07:40:09

问题


I'm attempting to build mono using the ndk standalone toolchain from the android ndk (version r8e), but I am unable to complete the build.

I setup my standalone environment like so:

export SYSROOT=/home/jeremybell/Desktop/android-ndk-r8e/platforms/android-14/arch-arm
/home/jeremybell/Desktop/android-ndk-r8e/build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=./android-14-toolchain

Next, I configure mono. I'm using something similar to the example shown here: http://permalink.gmane.org/gmane.comp.gnome.mono.patches/181374

Except for a few differences. First, I export each of the variables (AR, AS, CC, etc..) including SYSROOT (the configure script no longer takes a --sysroot=/path/to/sysroot option) prior to running configure. Second, I added --with-sgen=yes --disable-boehm

Here's my environment and my autogen.sh command:

export NDK=/home/jeremybell/Desktop/android-ndk-r8e
export SYSROOT=$NDK/platforms/android-14/arch-arm
export NDK_STANDALONE=/home/jeremybell/Desktop/monodevsrc/ndk_standalone
export PATH=$NDK_STANDALONE/bin:$PATH
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++
export AR=arm-linux-androideabi-ar
export AS=arm-linux-androideabi-as
export CPP=arm-linux-androideabi-cpp
export LD=arm-linux-androideabi-ld
export RANLIB=arm-linux-androideabi-ranlib
export STRIP=arm-linux-androideabi-strip
./autogen.sh --build=`./config.guess` --host=armv5-linux-androideabi --target=armv5-linux-androideabi --enable-nls=no --with-mcs-docs=no --enable-mcs-build=no --with-glib=embedded --with-monodroid=yes CFLAGS="-DARM_FPU_NONE=1" CXXFLAGS="-DARM_FPU_NONE=1"

Configure appears to run fine, but make fails while building mono_sgen-main.o:

  CC     libmini_static_la-tramp-arm.lo
  CC     libmini_static_la-mini-posix.lo
  CXXLD  libmini-static.la
  CC     mono_sgen-main.o
main.c:7:22: fatal error: buildver.h: No such file or directory
compilation terminated.
make[4]: *** [mono_sgen-main.o] Error 1
make[4]: Leaving directory `/home/jeremybell/Desktop/monodevsrc/mono/mono/mini'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/jeremybell/Desktop/monodevsrc/mono/mono/mini'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/jeremybell/Desktop/monodevsrc/mono/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jeremybell/Desktop/monodevsrc/mono'
make: *** [all] Error 2

The offending line:

#include <config.h>
#include "mini.h"
#ifndef HOST_WIN32
#ifdef HAVE_SGEN_GC
#include "buildver-sgen.h"
#else
#include "buildver.h"
#endif
#endif

So, it looks like HAVE_SGEN_GC is not defined, but should be? Have I missed a step somewhere?

Thanks!

Update: This build issue appears to have cropped up between branch mono-2-10-8 and master. I'm able to build fine with the mono-2-10-8 branch. Hopefully that helps.

来源:https://stackoverflow.com/questions/16450508/building-mono-with-android-ndk-standalone-toolchain-android-ndk-r8e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!