Getting a working build environment for Mono on an Intel Mac

Thanks a bunch to FireRabbit in #cocoa# on irc.gnome.org for helping me out with this. I thought that this information might help someone else out there so here goes.

I have been trying to build Mono out of the subversion repository for a while now, but I kept running into an error. I have been using fink to grab all of the dependencies that I need, so I made sure that I had the latest of everything. But the problem remained.

For reference, here is the error that I was getting.


checking for pkg-config... /sw/bin/pkg-config
./configure: line 22766: syntax error near unexpected token `BASE_DEPENDENCIES,'
./configure: line 22766: `PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)'

FireBird claimed to have run into the same problem, and just built his bulid environment from scratch. As in no fink. He stated several times that he is not a fink fan.

So, what follows are the steps that I took to get the environment up and running.

Before doing any of the following, make sure that /usr/local/bin is first on your path. The easiest way for me to tell you to do this is to add export PATH=/usr/local/bin:$PATH at the end of your .profile file. After doing this be sure to run source ~/.profile in any open shell windows.

  1. Installing automake
    • Get the latest version of automake.
    • Extract tarball and enter directory.
    • ./configure --prefix=/usr/local
    • make
    • sudo make install
  2. Installing libtool
    • Grab the stable release of libtool.
    • ./configure --prefix=/usr/local
    • make
    • sudo make install
  3. Installing intltool
    • Grab the latest version of intltool.
    • ./configure --prefix=/usr/local
    • make
    • sudo make install
  4. Installing pkg-config
    • Grab the latest version of pkg-config.
    • ./configure --prefix=/usr/local
    • make
    • sudo make install
  5. Installing gettext
    • Grab the latest version of gettext.
    • ./configure --prefix=/usr/local
    • make
    • sudo make install
  6. Installing glib
    • Grab at least version 2.4 of glib.
    • ./configure --prefix=/usr/local
    • make
    • sudo make install

So after I did all of that, I was unable to build mono from subversion. I am not sure what the problem is, but I was not able to fix it. So, instead, I grabbed the latest tarball for mono and it worked. So, my problem is now solved. I have a working mono installation, and I am happy. :)

I hopes this helps some other Intel Mac user out there. I am hoping that the next release of mono will include support for Intel Macs, but until it does, there is always make.

Tags:

Leave a Reply