Compile Mono SVN Head on Windows

  1. Download and install a recent Mono from http://mono-project.com/Downloads. Install it in C:\mono (instead of C:\Program Files\Mono) in order to avoid problems with whitespace in path during build). This mono will be used to compile mono from source. It will also provide a set of other native libraries required for the build.
  2. Install Cygwin (I would recommend in C:\cygwin to same problems mentioned above) with the following packages in addition to the default ones:
  3. autoconf
    automake
    bison
    gcc-mingw
    gcc-mingw-g++
    libtool
    pkg-config
    subversion
    make
    
  4. Downgrade make because version 3.81 installed by Cygwin introduces a bug which causes the mono build to fail. Replace C:\cygwin\bin\make.exe with the one from here: make 3.80
  5. Prepare the build environment by setting the paths so that all the dependancy libs and scripts will be used from the official setup.
  6. export MONO_LOCATION=/cygdrive/c/mono
    export PATH=${PATH}:${MONO_LOCATION}/bin
    export ACLOCAL_FLAGS="-I ${MONO_LOCATION}/share/aclocal"
    export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${MONO_LOCATION}/lib/pkgconfig
    mkdir -p /mono/svn
    mkdir /mono/build
    
  7. Checkout Mono’s source from svn and compile.
  8. cd /mono/svn
    svn co svn://anonsvn.mono-project.com/source/trunk/mono
    svn co svn://anonsvn.mono-project.com/source/trunk/mcs
    cd mono
    ./autogen.sh --prefix=/mono/build
    make
    make install
  9. Copy the freshly compiled files from C:\cygwin\mono\build to C:\mono and replace all existing. DONE!

Related Posts:

  1. Coursework results
  2. “Why Mono Is Currently An Unacceptable Risk”
  3. Sleep – No, thanks
  • _Alan_

    Woo, after 2 long hard days of trying and failing, i finally managed to compile mono for windows on windows. Only worked when i did exactly as he did, with the exact same paths. Cygwin is a monster :(

  • http://Whatsite? _Alan_

    Woo, after 2 long hard days of trying and failing, i finally managed to compile mono for windows on windows. Only worked when i did exactly as he did, with the exact same paths. Cygwin is a monster :(

  • http://kitchen-things.net geanowu

    Very interesting, thnx :)

  • http://www.mogs.com/ffxi-gil ffxi gil

    Ah, about the first post, it didn’t tell me the post had gone through, it just took me back to the original post when I submitted, so I figured it just didn’t like me. Ah well, now it’s blogged :)
    As for the version thing, I’m talking about the xulbrowser and mono.mozilla code in the mono svn, not the xulrunner (yes, the names are a mess… :p). The problems you had with not being able to input the text are related to my code and are fixed in mono svn head.

  • http://stifu.free.fr/ Stifu

    This little article has been useful to me. Thanks to you, I could submit my first Mono patch today. :)

    However, I'm running into a problem… I closely followed your steps on 2 computers. It worked on one, but not on the other. After the autogen step (at the end of which I'm told: “Now type 'make' to compile”), the “make” command does nothing at all, it displays nothing and instantly lets you type another command. “make clean”, “make –help” and so on behave the same. I even redownloaded make 3.80 just in case, and same result. Any idea?

    By the way, the link to make 3.80 above doesn't work anymore, so here's a working one for anyone interested: http://www.go-mono.com/archive/helper/make-3.80…

  • Ivan N. Zlatev

    I have no idea what the problem might be. Try make –verbose or something.

    Thanks for pointing out that the link is broken. I have no uploaded the file onto my blog and linked it directly just to make sure it doesn't go 404 again.

  • Stifu

    Verbose made no difference. For the record, I checked out Cygwin 1.70 beta, and it worked the same as the stable version except it actually outputs an error:

    /usr/bin/make.exe: error while loading shared libraries: cygint1-2.dll: cannot open shared object file: No such file or directory

  • Stifu

    Verbose made no difference. For the record, I checked out Cygwin 1.70 beta, and it worked the same as the stable version except it actually outputs an error:

    /usr/bin/make.exe: error while loading shared libraries: cygintl-2.dll: cannot open shared object file: No such file or directory
    I can indeed see I have cygintl-3 and 8, but not 2… I'll grab that DLL and see if it works!

    Edit: yep, looks like the libintl2 package was left out from cygwin… I might have clicked it by mistake during the install or something.

    Now for another error… 'libgthread-2.0.la' not a valid libtool archive. Great. But I'll manage.

  • Stifu

    Verbose made no difference. For the record, I checked out Cygwin 1.70 beta, and it worked the same as the stable version except it actually outputs an error:

    /usr/bin/make.exe: error while loading shared libraries: cygintl-2.dll: cannot open shared object file: No such file or directory
    I can indeed see I have cygintl-3 and 8, but not 2… I'll grab that DLL and see if it works!

    Edit: yep, looks like the libintl2 package was left out from cygwin… I might have clicked it by mistake during the install or something.

    Now for another error… 'libgthread-2.0.la' not a valid libtool archive. Great. But I'll manage.

  • Fff

    buy rift platinum at http://www.riftplatinum.us
    riftgamestores.com offers cheapest Rift Platinum to all the players! Here is the best place for the Rift players to buy your RIFT Gold. We just offer the lowest price and the best service when you buy RIFT gold here. We are 24/7 online, if you have any questions with buying RIFT Platinum, you can contact us anytime and we will try our best to solve your problems. We are also the professional supplier of all kinds of RIFT Powel Leveling which can meet all your needs. Buy Cheap rift Platinum and fast and safe Rift Power Leveling here, enjoy the Cheapest price, the Fastest delivery and our Best service!
    buy diable 3 http://www.diablo3goldsale.us
    buy dragon nest gold at http://www.saledragonnestgold.com and http://www.selldragonnestgold.com