[Mono-devel-list] How I built mono-0.25 on windows
David Joyner
djoyner at starband.net
Wed Jul 2 10:28:01 EDT 2003
The sticking point for building on windows is libgc.
Reference:
http://lists.ximian.com/archives/public/mono-devel-list/2003-March/000137.html
While the above refers to mono-0.20 I found it's
still a problem on mono-0.25. I also found that
this generous soul's solutions didn't work for
me. So.
I wish I was better with the gnu build tools, I'm
sure there is a better way -- nevertheless, this
worked for me.
After unpacking the source, and the prerequisite
zip files, I hacked mono/configure.in @ line 190
case "x$gc" in
xboehm|xbohem|xyes)
CPPFLAGS="-DWIN32_THREADS
-Id:/devel/gtk/2.0/include -Ld:/devel/gtk/2.0/lib"
AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
AC_CHECK_LIB(gc, GC_malloc,found_boehm="yes",,$libdl)
CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS"
...
All this does is remove -DGC_WIN32_THREADS from
CPPFLAGS, and then set it back again after doing
the header checks and the library check.
IMPORTANT:
Notice that the -I and -L flags above refer to
locations on my machine -- if you copy it it
won't work on your machine. Adjust the paths to
wherever you have unpacked libgc-dev.zip and
wherever you keep your runtime and devel prereqs.
This allows the AC_CHECK_HEADER macro to work
correctly since GC_WIN32_THREADS is not redefined.
Windows programmers remember to run aclocal &
autoconf after doing this, then run ./configure
--prefix=</path/to/new/mono>
Also, the build script mono-build-w32.sh has this
in it:
# Select the stable version anyway...
if [ ! -z "${AUTO_STABLE}" -o -e
/usr/autotool/stable ]; then
export
AUTO_STABLE=${AUTO_STABLE:-/usr/autotool/stable}
export AUTO_DEVEL=$AUTO_STABLE
echo $AUTO_STABLE
fi
which will make it impossible to configure libgc
because libgc/configure.in has this on the first
line:
AC_PREREQ(2.50)
You'll get the error
FATAL ERROR: Autoconf version 2.50 or higher is
required for this script
Unfortunately, this error doesn't stop configure
and you'll then get many errors later in the
build process.
The latest stable release of autotools for cygwin
according to their setup package is :
$ /usr/autotool/stable/bin/autoconf --version
Autoconf version 2.13
It appears that currently the devel release
$ /usr/autotool/devel/bin/autoconf --version
autoconf (GNU Autoconf) 2.57
Written by David J. MacKenzie and Akim Demaille.
must be used for configuring libgc. Commenting
out the selection of AUTO_STABLE does not work.
Since I don't know how to fix this correctly, I
had to do the work of the script manually (i.e.
PKG_CONFIG_PATH,LD_LIBRARY_PATH,CPPFLAGS,LDFLAGS) then run configure in the mono directory.
There are many snippets of documentation out
there relating to building on windows and some of
them are way out of date.
Is there any chance we could pull together and
come up with a maintainable solution?
I would love to hear comments no matter how
unflattering.
Thank you to the developers for the great work on
mono and all the related projects !
Dave Joyner
More information about the Mono-devel-list
mailing list