Sunday, July 11, 2010

Build mono-2.4.6 in Snow Leopard

Mono 2.4.6 configure scripts generates 32 bit build and requires 32 bit dependencies.

This is a problem in Snow Leopard which is all 64 bit. I had to use the following settings.


export CFLAGS="-I/Users/amitava/local/include -arch i386 -m32"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L/Users/amitava/local/lib"

Please note that we have to override the system defaults by the generated packages. So I append $prefix (/Users/amitava/local in my case) to the PATH environment variable

export PATH=$HOME/local/bin:$PATH

The following packages were needed
gettext-0.18.1.1
libiconv-1.13.1
glib-2.12.12

And to build mono
export PKG_CONFIG_PATH=/Users/amitava/local/lib/pkgconfig:$PKG_CONFIG_PATH
./configure --prefix=$HOME/local --with-tls=pthread

No comments: