Mono-4.4.0-IntegrationGuide.txt 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---------------------------------Compiling runtime-------------------------------------
  2. - Retrieve mono sources using git:
  3. - Make sure your git client has this set: "git config --global core.autocrlf input" as otherwise you'll have problems with line endings during later steps
  4. - Clone mono from https://github.com/mono/mono (make sure to perform a RECURSIVE clone as there are sub-modules in the /external folder)
  5. - Checkout mono-4.4.0-branch
  6. - Checkout commit # febc509ab9a7d07734f5b694037bc2becbc97851 (later ones might, but might not work)
  7. - Go to msvc/ folder to find mono.sln (Visual studio solution)
  8. - Open in VS2012 as is, or open in later VS and upgrade all projects to latest toolkit (v120 and v140 tested and working)
  9. - Expose "mono_class_bind_generic_parameters" to the public:
  10. - In object-internals.h change:
  11. MonoClass* mono_class_bind_generic_parameters (MonoClass *klass, int type_argc, MonoType **types, gboolean is_dynamic) MONO_INTERNAL;
  12. to:
  13. MONO_API MonoClass* mono_class_bind_generic_parameters (MonoClass *klass, int type_argc, MonoType **types, mono_bool is_dynamic);
  14. then move it to:
  15. object.h
  16. - In reflection.c modify:
  17. MonoClass* mono_class_bind_generic_parameters (MonoClass *klass, int type_argc, MonoType **types, gboolean is_dynamic)
  18. to:
  19. MonoClass* mono_class_bind_generic_parameters (MonoClass *klass, int type_argc, MonoType **types, mono_bool is_dynamic)
  20. - Add "mono_class_bind_generic_parameters" entry to mono/msvc/mono.def file
  21. - Generate missing header files:
  22. - First compile "genmdesc" project for desired configuration (debug/release, 32/64 bit)
  23. - Then run "runmdesc x64\bin\Debug\genmdesc x64" located in /msvc folder
  24. - Replace folder path to genmdesc you generated in the previous step
  25. - Replace x64 with Win32 for 32-bit builds
  26. - Compile mono project with desired configuration (debug/release, 32/64 bit, SGen builds were not tested). You will receive mono-2.0.dll and mono-2.0.lib as output.
  27. - Repeat the "genmdesc" step above for each configuration. Doing it once might be enough but be on the safe side.
  28. - Add mono-2.0.dll to (BansheeRootDir)/bin/(Platform)/(Configuration)
  29. - Add mono-2.0.lib to (BansheeRootDir)/Dependencies/lib/(Platform)/(Configuration)
  30. -----------------------------Compiling libraries & compiler-------------------------------------
  31. - Install Mono 4.2.3.4 (This is the latest binary release for Windows, you can use newer if there is one).
  32. - Add the "(InstallDir)\Mono\bin" to your PATH environment variable.
  33. - Install Cygwin 32-bit version using these command line parameters:
  34. setup-x86.exe -qnNdO -R "C:\cygwin" -s "http://cygwin.mirror.constant.com"
  35. -l "C:\cygwin\var\cache\setup" -P autoconf -P automake -P bison -P gcc-core -P gcc-g++ -P mingw64-i686-runtime
  36. -P mingw64-i686-binutils -P mingw64-i686-gcc-core -P mingw64-i686-gcc-g++ -P mingw64-i686-headers -P mingw64-i686-pthreads
  37. -P mingw64-i686-windows-default-manifest -P mingw64-i686-winpthreads -P w32api-headers -P w32api-runtime
  38. -P windows-default-manifest -P libtool -P make -P python -P gettext-devel -P gettext -P intltool -P libiconv
  39. -P pkg-config -P git -P wget -P curl
  40. - Go to your mono source directory (the one retrieved when compiling the runtime) in Cygwin and enter these commands in order:
  41. - "./autogen.sh --prefix="(OutputDir)" --with-preview=yes"" (Replace (OutputDir) with a folder where you want to output the binaries, e.g. "C:\MonoInstall")
  42. - "./configure --host=i686-w64-mingw32"
  43. - "make"
  44. - "make install"
  45. - Your built mono should now be output to (OutputDir) folder. (If it's not in that folder then check your Cygwin install folder under /usr/local)
  46. - Copy contents of (OutputDir)/include/mono/mono-2.0/mono to (BansheeRootDir)/Dependencies/Include/Mono
  47. - Make sure to modify "object.h" as you did above when building the binaries
  48. - Copy folder (OutputDir)/etc to (BansheeRootDir)/bin/Mono
  49. - Copy assembly folders (OutputDir)/lib/mono/4.0 and (OutputDir)/lib/mono/4.5 to (BansheeRootDir)/bin/Mono/lib/mono/4.0 and (BansheeRootDir)/bin/Mono/lib/mono/4.5, respectively
  50. - If you wish, you can clean up the assemblies within those folders are many might not be used. The minimum needed are "mscorlib.dll", "System.dll" and "System.Core.dll".
  51. - Copy the compiler (mcs.exe) from (OutputDir)/lib/mono/4.5 to (BansheeRootDir)/bin/Mono/compiler