BuildingGStreamerInMinGWMsys

Back to contents

Install prerequisites

Install libxml2

Go to ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/

Download latest libxml2 source package:

libxml2-2.6.30.tar.bz2

Unpack it to c:\src

Modify c:\src\libxml-2.6.30\configure:

Find a line:

    if test "${ac_cv_header_pthread_h+set}" = set; then

and delete all lines starting at that line and stopping before this line:

    case $host_os in

This is necessary to disable pthread detection, because libxml2 2.6.x (hopefully, the next major version will have this fixed) does have a few broken #ifdefs for threading support. So it's either hacking configure or hacking the source. The choice is obvious in this case.

Build and install libxml2

LDFLAGS="-Wl,-no-undefined" ./configure --prefix=/mingw
make
make install

Build gstreamer

To get GStreamer:

cd /c/src
git clone git://anongit.freedesktop.org/gstreamer/gstreamer

To configure GStreamer:

cd gstreamer
CXXFLAGS="-fno-common" CFLAGS="-fno-common" LDFLAGS="-Wl,-no-undefined" ./autogen.sh --disable-gtk-doc --enable-silent-rules --disable-poisoning --with-libintl-prefix=/mingw --with-libiconv-prefix=/mingw

You need to specify -fno-common gcc option whenever you're building something with gcc 4.x on Windows, else you may get buggy binaries (and you won't know they're buggy until you stumble across one of the bugs). As far as I remember, it's a Windows-only gcc bug that is not yet fixed.

FIXME: is it fixed yet? I don't really remember how it manifests. Maybe pseudo-relocation-v2 fixes it?

Also, you need to pass -Wl,-no-undefined flag to the linker whenever you're building shared libraries (dll's), it will make linker to show a big fat warning when it is unable to link you a dll. If you don't do that, linker will just print a small one-lined warning and continue the building process.

To build GStreamer:

make
make install

If you want to see exact commands invoked by make, use V=1 argument:

make V=1

If you don't want to mix installed files with everything in /mingw, use DESTDIR variable:

make install DESTDIR=/somewhere/other/than/root

This will install everything in /somewhere/other/than/root/mingw