在尝试在CentOS 6.2上编译Mono 3.0.2时出现错误。

6
我正在尝试从GitHub的Mono存储库中的tarball编译Mono 3.0.2。 但是当我进入mcs文件夹时,编译失败:
if test -w /root/mono/mcs; then :; else chmod -R +w /root/mono/mcs; fi
    cd /root/mono/mcs && make --no-print-directory -s NO_DIR_CHECK=1 PROFILES=' net_2_0            net_3_5 net_4_0 net_4_5  ' CC='gcc' all-profiles
    Bootstrap compiler: Mono C# compiler version 3.0.3.0
    Makefile:43: warning: overriding commands for target 'csproj-local'
../build/executable.make:149: warning: ignoring old commands for target 'csproj-local'
    Makefile:43: warning: overriding commands for target 'csproj-local'
../build/executable.make:149: warning: ignoring old commands for target 'csproj-local'
    make[7]: *** No rule to make target '../../external/ikvm/reflect/*.cs', needed by '../class/lib/basic/basic.exe'.  Stop.
    make[6]: *** [do-all] Error 2
    make[5]: *** [all-recursive] Error 1
    make[4]: *** [profile-do--basic--all] Error 2
    make[3]: *** [profiles-do--all] Error 2
    make[2]: *** [all-local] Error 2
    make[2]: Leaving directory '/root/mono/runtime'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/root/mono'
    make: *** [all] Error 2

我已经尝试通过 make get-monolite-latest 命令来安装 monolite,并尝试安装 2.x 版本并进行编译。但是这些解决方案都没有成功。

我对 3.0.2 版本的兴趣在于新的 Razor 模板引擎和 MVC 4 框架,但是如果在 CentOS 6 上无法编译/安装或二进制包,则希望提供以前版本的软件源。

1个回答

10

external/子目录包含使用所谓的git子模块的外部依赖项。

如果从tarball编译时出现与这些目录中任何文件缺失相关的错误,则我猜测用于创建此tarball的任何脚本都是错误的,并且不包括任何这些依赖项。

如果直接从github获取源代码,则需要运行git submodule initgit submodule update

理论上,您可以通过查看.gitmodules文件从github下载每个子模块。

但是,git在每个主模块提交的每个子模块中记录了特定的修订版本。因此,如果您检出mono中的某个特定提交并使用git submodule update,您将得到作者在进行该提交时使用的这些模块的确切相同版本。

如果要从源代码编译,则建议使用git来获取源代码。它将自动为您获取每个依赖项的正确版本,并使您更容易以后更新到新版本和/或进行本地更改。


谢谢,对我来说也适用于最新版本(3.1.2)。 - Ben Baron
作为参考,GitHub存储库的发布选项卡上的mono-4.3.2.467 tarball是其中一个已损坏的版本。 >.< - Benjamin Nolan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接