[Mono-devel-list] HOWTO - Build mono, mcs, and gtk-sharp on w indows

Urs Muff umuff at QUARK.com
Sun Feb 29 01:08:55 EST 2004

what's the difference of that and mono/web/mono-build-w32.sh?  shouldn't
that be the same?

but since last monday the window build has been broken anyway and nobody
seems to give a shit about it.

- Urs

-----Original Message-----
From: mono-devel-list-admin at lists.ximian.com
To: Josh Gerdes; gtk-sharp-list-request at lists.ximian.com;
mono-devel-list at lists.ximian.com
Sent: 2/28/2004 10:19 AM
Subject: RE: [Mono-devel-list] HOWTO - Build mono, mcs, and gtk-sharp on

Could someone add this as a web page on www.go-mono.com
<http://www.go-mono.com>  somewhere please?

-----Original Message-----
From: mono-devel-list-admin at lists.ximian.com
[mailto:mono-devel-list-admin at lists.ximian.com]On Behalf Of Josh Gerdes
Sent: Friday, February 27, 2004 3:07 PM
To: gtk-sharp-list-request at lists.ximian.com;
mono-devel-list at lists.ximian.com
Subject: [Mono-devel-list] HOWTO - Build mono, mcs, and gtk-sharp on


Building mono, mcs, and gtk-sharp from CVS for windows

by Josh Gerdes



I decided to write this guide to help those like myself who would like
to be able to build mono, mcs, and gtk-sharp on a windows platform.  I
have gathered information from various sources and I would like to thank
the following for their posts and information:


Giovanni Zito

Bernie Solomon

Daniel Morgan



Setting up the Environment and Dependencies



1) Install the .NET SDK V1.1 from msdn.microsoft.com/downloads. I've put
this step here simply because previous instructions states to install
it. I'm don't know if and why this step is required. By the way, if you
have Microsoft Visual Studio .NET 2003 installed on your system then you
can skip this step.


2) Install the latest cygwin setup (about 30MB). Start choosing the
default installation if you are not sure what packages you need. You'll
can always get the other missing packages later, if mono configure
script will require them. Be sure to get libiconv (not just libiconv2!).
I installed everything just to be safe.


3) Download and install the gtk+ dependencies to /usr/local:





Note: The Runtime installer will delete the destination installation
directory before installing so it must be installed first.  This is
optional if you do not want to compile gtk-sharp.


4) Download and install the following dependencies packages and extract
to /usr/local:











5) Open a cygwin prompt and edit your profile "~/.bashrc" by adding the


#Environment Variables for Mono

export PATH="/usr/local/bin:/usr/local/lib:$PATH"

export ACLOCAL_FLAGS="-I /usr/share/aclocal"

export CPPFLAGS="$CPPFLAGS -I /usr/local/include"

export LDFLAGS="$LDFLAGS -L /usr/local/lib"

export CC="gcc -mno-cygwin"

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

export LD_LIBRARY_PATH="/usr/local/lib"

export MONO_PATH="/usr/local/lib:$MONO_PATH"

export MONO_CFG_PATH="/usr/local/etc:$MONO_CFG_PATH"


#Environment variables for Mono CVS access

export CVSROOT=:pserver:anonymous at anoncvs.go-mono.com:/mono

export CVS_RSH=ssh


#Environment variables for .NET if not already in your Windows PATH


export PATH="$PATH:/cygdrive/c/Program Files/Microsoft.NET/SDK/v1.1/Bin"


6) Create the following script, name it icu-config and copy it to





case $1



    echo "-I$ICU_ROOT/include"



    echo "-L$ICU_ROOT/lib -licuuc -licuin"



    grep '\<U_ICU_VERSION\>' $ICU_ROOT/include/unicode/uversion.h | sed
-e 's/.*"\(.*\)".*/\1/'




7) Change the script permissions by running "chmod u+x


8) Restart your cygwin environment



Downloading latest CVS



1) Create a directory to store the source files in your home directory
("mkdir ~/src")


2) Go to the newly created directory ("cd src") 


3) Login to CVS by running "cvs login" you will be asked for a password
which can be left blank


4) Download the source 


            To get the source for the first time run the following:


                        cvs -z3 co mcs mono gtk-sharp


            After that you can just update the source by running the


                        cvs -z3 update -dP mcs mono gtk-sharp



Building mono



You are now ready to buld mono by running the following commands:


$ cd ~src/mono

$ ./configure --with-gc=boehm CPPFLAGS=-I/usr/local/include

$ make

$ make install


Note: at the time of creating these instructions the CVS had some issues
so I used mono 0.30.1 source instead



Building mcs



You are now ready to buld mcs by running the following commands:


$ cd ~/src/mcs

$ make

$ make install



Building gtk-sharp



1) Download and install the libglade lib package to /usr/local/:




2) Download the libglade bin package and copy libglade-2.0-0.dll to




3) Edit /usr/local/lib/pkgconfig/libglade-2.0.pc and set the prefix


4) Download and rename libxml2.dll to libxml-2.0.dll and copy to




5) Create the following script, name it libxml-2.0.pc and copy it to






Name: Libxml2

Description: a XML parser

Version: 2.4.12

Libs: -L${libdir} -llibxml-2.0


6) Edit makefile.win32 located in your gtk-sharp (~/src/gtk-sharp) and
change the following path to point to the correct Microsoft .NET
Framework (I had v1.1 installed so it had the incorrect path initially).


CSC=$(ROOT)/microsoft.net/framework/v1.1.4322/csc.exe /d:WIN32


7) You are now ready to buld gtk-sharp by running the following


$ cd ~/src/gtk-sharp

$ make -f makefile.win32


8) Copy the newly created dlls to /usr/local/lib:











Congratulations!  You should now have compiled mono, mcs, and gtk-sharp
successfully and have a working version of all of them located in
/usr/local.  Please note that these projects are constantly changing and
might not always build and these instructions most likely will need to
eventually be updated.  At least there is a starting point now.

More information about the Mono-devel-list mailing list