Bootstrapping GLIB with MinGW

Reason:

There is a circular dependency between GLIB and the pkg_config packages. In order to overcome the lack of the dependencies you must do a bootstrap method. This requires some basic knowledge of how to overcome the requirement of pkg_config within the GLIB configure process by telling the configure script where to find some things that pkg_config would have given it.

Alternatives:

One can also use the pkg-config alternatives listed under Build Utilities on the Community_Supplied_Links page.

Requirements:

  • Using mingw-get install
    • gcc
    • g++
    • libiconv
    • zlib
    • libz
    • msys
    • msys-perl
    • msys-m4
  • Install python-2.7 and point your PATH to the installation directory e.g. /c/python as well as /c/python/DLLs.
  • Download the source, build and install libffi
    • cd /path/to/libffi/source
    • mkdir bld
    • cd bld
    • ../configure --prefix=/mingw
    • make && make install

Building GLIB without PKG_CONFIG:

  • cd /path/to/glib/source
  • mkdir bld
  • cd bld
  • export LIBFFI_CFLAGS='-I /mingw/lib/libffi-VERSION/include'
    • VERSION is to be replaced with whatever version you built above.
    • For me VERSION is 3.0.10.
  • export LIBFFI_LIBS=-lffi
  • export lt_cv_deplibs_check_method="pass_all"
  • export CFLAGS=”O0 -g -pipe -Wall -march=i486 -mms-bitfields -mthreads”
  • export CPPFLAGS=”-DG_ATOMIC_OP_USE_GCC_BUILTINS=1”
  • export LDFLAGS=”-Wl,--enable-auto-image-base”
  • ../configure --prefix=/mingw --with-pcre=internal --disable-static --disable-gtk-doc --enable-silent-rules
  • lengthy amount of time later
  • make
  • lengthy amount of time later
  • make install

Hopefully

If all goes well you should now be able to build pkg_config and install it. Then come back to GLIB and rebuild it.

  • cd /path/to/glib/source/bld
  • make clean
  • ../configure --prefix=/mingw
  • make
  • make install

Site Status

Site maintenance completed May 25th, 2012 at 12:38 UTC