6

我正在尝试从 GitHub 的 Mono 存储库的压缩包中编译 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

我已经尝试通过 do 来安装 monolitemake get-monolite-latest并且已经尝试安装 2.x 版本然后编译。这些解决方案都没有奏效。我对 3.0.2 版本的兴趣在于新的 Razor 模板引擎和 MVC 4 框架,但是,如果无法为 CentOS 6 编译/安装或二进制包,我会很感激具有以前版本的存储库。

4

1 回答 1

10

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

如果您在从 tarball 编译时遇到与这些目录中丢失文件相关的任何错误,那么我的猜测是用于创建此 tarball 的任何脚本都已损坏并且不包含任何这些依赖项。

如果您直接从 github 获取源代码,那么您需要git submodule init运行git submodule update.

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

但是,git 会在每个主模块的提交中记录每个子模块的具体修订。因此,如果您在 mono 和 use 中签出某些特定的提交git submodule update,您将获得与提交的作者在提交时使用的每个模块完全相同的版本。

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

于 2012-12-13T15:04:55.550 回答