使用linux交叉编译mono

mono是一个跨平台的C#解决方案。

mono官方免费提供了linux,windows,mac 平台的mono sdk,但是对于安卓和iphone平台是收费项目。

最近在研究将mono作为虚幻脚本,对于安卓和iphone平台必须自己编译mono运行时。

参照http://www.mono-project.com/docs/compiling-mono/windows/,可以顺利编译出linux版本和windows版本。

 

参考:http://www.mono-project.com/docs/about-mono/supported-platforms/arm/编译arm平台。

测试了几天,终于编译通过。主要卡在了配置上面。

简单记录一下编译过程:

1.    在linux系统上,安装scratchbox

下载并安装scratchbox

1.  > cd /tmp/
2.  > wget http://www.scratchbox.org/download/files/sbox-releases/1.0/tarball/scratchbox-core-1.0.27-i386.tar.gz
3.  > wget http://www.scratchbox.org/download/files/sbox-releases/1.0/tarball/scratchbox-libs-1.0.27-i386.tar.gz
4.  > wget http://www.scratchbox.org/download/files/sbox-releases/1.0/tarball/scratchbox-toolchain-cs2009q3-eglibc2.10-armv7-soft-1.0.19-6-i386.tar.gz
5.  > tar -xzf scratchbox-core-1.0.27-i386.tar.gz -C /
6.  > tar -xzf scratchbox-libs-1.0.27-i386.tar.gz -C /
7.  > tar -xzf scratchbox-toolchain-cs2009q3-eglibc2.10-armv7-soft-1.0.19-6-i386.tar.gz -C /
8.  > /scratchbox/run_me_first.sh

'run_me_first.sh' asks you some questions, just use defaults. After this we need to add user for Scratchbox. User must be some user that you have in your system. Do NOT add root user! e.g.:

 
> /scratchbox/sbin/sbox_adduser vmankine

Scratcbox installation document [3] chapter number two helps you in installing the packages if you want to use for example .deb packages.

9.      

 

 

2.    配置scratchbox环境

具体可以参照: http://www.scratchbox.org/documentation/user/scratchbox-1.0/html/installdoc.html

 

3.    编译

这里只编译mono运行时,至于mcs库是通用的,在其他平台编译就可以了:

在scratchbox中的home目录,下载并解压mono源码。

tar –xf mono-4.0.3.20.tar.bz2

 

进入源码目录编译:

./configure --host=arm-linux --enable-minimal=profiler,logging --with-tls=--with-tls=__thread --with-monotouch=no --without-mcs-docs --with-sigaltstack=no --disable-mcs-build --enable-nls=no

make

make install `pwd`/temptree

完成。注意这里的配置选项与官方提供的不同。测试了官方的配置选项并不能编译通过。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值