How to compile GLib on Snow Leopard

These are just a few notes on how to compile GLib on Snow Leopard.

Download GLib and its dependencies

  $ wget http://ftp.gnome.org/pub/GNOME/sources/glib/2.33/glib-2.33.6.tar.xz
  $ wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.27.tar.gz
  $ wget ftp://ftp.gnu.org/gnu/gettext/gettext-0.18.1.1.tar.gz
 

Compiling

gettext

  ./configure
  make
  sudo make install
 

GLib

  ./configure LIBFFI_CFLAGS=-I/usr/include/ffi LIBFFI_LIBS=-lffi
  make
  sudo make install
 

Pkgconfig

  ./configure GLIB_CFLAGS="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include" GLIB_LIBS="-lglib-2.0 -lgio-2.0"
  make
  sudo make install