[Mono-list] Instructions for installing from CVS on Linux

Scott Bronson bronson@rinspin.com
28 Sep 2002 13:54:54 -0700


Your instructions only work if you already have Mono installed.  Here's
how I installed mono from scratch in my home directory.  Thanks to
Andrew Birkett for the info on how to bootstrap the .dlls.


1) cd to the directory in which you'd like to download and build mono.

   % cd /home/bronson/mono


2) Grab Mono from CVS

2.1) Create a script (named gomono) to automate pulling from CVS. This
script will work whether you're checking out for the first time, or
you've already checked out the sources and just updating them.

  % cat > gomono <<EOL
  #!/bin/sh

  export CVSROOT=:pserver:anonymous@anoncvs.go-mono.com:/mono
  cvs login
  cvs -z3 co mcs mono gtk-sharp
  EOL

QUESTION: is there any way to get the CVS server to return a list of
available modules?  How do I know what's available to check out?


2.2) Check the sources out from cvs

  % source gomono
  (hit return when it asks for a password)


3)  Build mono

I don't like using mono-build.sh.  It's too complex and offers no
insight into how this stuff works.  I'd rather do it manually.

  % cd mono   (now CWD is /home/bronson/mono/mono)
  % ./autogen.sh --prefix=/home/bronson/mono
  % make
  % make install


4) Set up your environment

Make sure $PATH includes /home/bronson/mono/bin and $LD_LIBRARY_PATH
includes /home/bronson/mono/lib.  Personally, I put the following in my
~/.bashrc:

if [ -d ~/mono/bin ] ; then
    LD_LIBRARY_PATH="/home/bronson/mono/lib:${LD_LIBRARY_PATH}"
    PATH="/home/bronson/mono/bin:${PATH}"
fi

NOTE: You cannot specify ~/mono/bin here!  Otherwise, it will complain
"mono not found" and "mcs not found" when you try to build mcs later.  I
haven't figured out why this is yet.  Anyone know?


5) Copy pre-built DLLs (because we can't build the dlls in MCS until we
have a working set of DLLs installed)

  % cd ..    (now CWD is /home/bronson/mono)
  - download the latest monocharge from
http://www.gnome-db.org/~gonzalo/mono/

  % tar zxvf monocharge-20020927.tar.gz
  % cp monocharge-20020927/lib/*.dll /home/bronson/mono/lib/
  % cp monocharge-20020927/bin/*.exe /home/bronson/mono/bin/


6) Build and install MCS

  % cd mcs
  % make -f makefile.gnu
  % make -f makefile.gnu install prefix=/home/bronson/mono


You're done!

Any time you want to update to the latest CVS, just redo steps 2.2, 3,
and 6.



7) Here's a simple way of verifying that your install works.

7.1) create helloworld.cs (doesn't matter where, /tmp is fine)

  class HelloWorld
  {
          static void Main()
          {
                  System.Console.WriteLine("Hello World.");
          }
  }


7.2) Run the following commands

  % mcs helloworld.cs
  % mono helloworld.exe


"Hello World." should be printed to stdout.

To run using the interpreter instead of the JIT, replace "mono" with
"mint" in the second command above.



I look forward to when the build bug is fixed and I can use "~/mono"
instead of "/home/bronson/mono" everywhere.

    - Scott