2012年10月12日星期五

Arch Linux 中安装 Mono 2.11.4 备忘录

Arch Linux 中安装 Mono 2.11.4 备忘录

从源代码编译 Mono 2.11.4

基本步骤如下所示:

~$ cd reporepo$ wget http://download.mono-project.com/sources/mono/mono-2.11.4.tar.bz2repo$ tar xjf mono-2.11.4.tar.bz2repo$ cd mono-2.11.4mono-2.11.4$ ./configure --prefix=/opt/mono-2.11.4 ......        mcs source:    mcs   Engine:	GC:	       sgen and bundled Boehm GC with typed GC and parallel mark	TLS:           __thread	SIGALTSTACK:   yes	Engine:        Building and using the JIT	oprofile:      no	BigArrays:     no	DTrace:        no	LLVM Back End: no (dynamically loaded: no)   Libraries:	.NET 2.0/3.5:  yes	.NET 4.0:      yes	.NET 4.5:      yes	MonoDroid:     no	MonoTouch:     no	Mobile:        no	JNI support:   IKVM Native	libgdiplus:    assumed to be installed	zlib:          system zlibmono-2.11.4$ makemono-2.11.4$ sudo make install

验证安装结果

试运行一下:

~$ /opt/mono-2.11.4/bin/mono --versionMono JIT compiler version 2.11.4 (tarball 2012年 10月 12日 星期五 09:57:56 CST)Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com	TLS:           __thread	SIGSEGV:       altstack	Notifications: epoll	Architecture:  amd64	Disabled:      none	Misc:          softdebug 	LLVM:          supported, not enabled.	GC:            Included Boehm (with typed GC and Parallel Mark)~$ /opt/mono-2.11.4/bin/mcs --versionMono C# compiler version 2.11.4.0

检查一下 Arch Linux 自带的 Mono 2.10.8:

~$ mono --versionMono JIT compiler version 2.10.8 (tarball Sat Oct  6 23:22:30 UTC 2012)Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com	TLS:           __thread	SIGSEGV:       altstack	Notifications: epoll	Architecture:  amd64	Disabled:      none	Misc:          softdebug 	LLVM:          supported, not enabled.	GC:            Included Boehm (with typed GC and Parallel Mark)~$ mcs --versionMono C# compiler version 2.10.8.0

检验 .NET Framework 和 CLR 版本

如下所示:

ClrInfo$ /opt/mono-2.11.4/bin/mono ClrInfo40.exe      OS Version: Unix 3.5.6.1     CLR Version: 4.0.30319.17020  ( 2.11.4 (tarball 2012年 10月 12日 星期五 09:57:56 CST) )Default Encoding: System.Text.UTF8EncodingSystem.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.IO.Packaging.Package, WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35System.TimeZoneInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Available Frameworks:  Mono 1.0 Profile  Mono 2.0 ProfileClrInfo$ mono ClrInfo40.exe      OS Version: Unix 3.5.6.1     CLR Version: 4.0.30319.1  ( 2.10.8 (tarball Sat Oct  6 23:22:30 UTC 2012) )Default Encoding: System.Text.UTF8EncodingSystem.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.IO.Packaging.Package, WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35System.TimeZoneInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Available Frameworks:  Mono 1.0 Profile  Mono 2.0 ProfileClrInfo$ 

可见 Mono 2.11.4 已经支持 .NET Framework 4.5 和 CLR 4.5 了。

参考资料

  1. 在 Ubuntu 10.10 操作系统中安装 Mono 2.8.2
  2. .NET Framework CLR 版本检测

TAG: