Cross Compiling GStreamer in a chroot environment on Ubuntu Jaunty Based on http://gstreamer.freedesktop.org/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment #Prepare host to have required tools sudo apt-get install debootstrap #bootstrap chroot system GSTROOT=/home/j/gst-win32 sudo debootstrap jaunty $GSTROOT #Add shell chroot ID to avoid confusion sudo chroot $GSTROOT echo "gst-win32" > /etc/debian_chroot exit #installing required packages sudo chroot $GSTROOT #update /etc/apt/sources.list echo deb http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse > /etc/apt/sources.list echo deb http://archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe multiverse >> /etc/apt/sources.list echo deb http://archive.ubuntu.com/ubuntu/ jaunty-security main restricted universe multiverse >> /etc/apt/sources.list apt-get update #install packages required for cross compile apt-get install mingw32 pkg-config wget language-pack-en tzdata unzip libtool automake autoconf m4 gettext cvs flex bison git-core subversion make #make mingw default compiler in chroot cd /usr/bin mkdir tmp mv gcc ar ranlib as ld cc cpp tmp for i in gcc ar ranlib as ld cc cpp; do \ ln -s i586-mingw32msvc-$i $i; \ done ln -s i586-mingw32msvc-dlltool dlltool ln -s i586-mingw32msvc-dllwrap dllwrap #the chroot will install its all win32 code into /win32 #so lets first create that mkdir /win32 #getting some binaries mkdir /win32/downloads #glib cd /win32/downloads wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.20/glib_2.20.4-1_win32.zip wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.20/glib-dev_2.20.4-1_win32.zip cd /win32 unzip downloads/glib_2.20.4-1_win32.zip unzip downloads/glib-dev_2.20.4-1_win32.zip #icon cd /win32/downloads wget http://www.gimp.org/~tml/gimp/win32/libiconv-1.9.1.bin.woe32.zip cd /win32 unzip downloads/libiconv-1.9.1.bin.woe32.zip #Gettext cd /win32/downloads wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-dev-0.17-1.zip cd /win32 unzip downloads/gettext-runtime-0.17-1.zip unzip downloads/gettext-runtime-dev-0.17-1.zip #direct X cd /win32/downloads wget http://v2v.cc/~j/stuff/directx-headers-0.3.tar.gz cd /win32 tar xxvzf downloads/directx-headers-0.3.tar.gz #http://www.gtk.org/download-windows.html #pango cd /win32/downloads wget http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.24/pango_1.24.5-1_win32.zip wget http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.24/pango-dev_1.24.5-1_win32.zip cd /win32 unzip downloads/pango_1.24.5-1_win32.zip unzip downloads/pango-dev_1.24.5-1_win32.zip #cairo cd /win32/downloads wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.8.8-1_win32.zip wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo-dev_1.8.8-1_win32.zip cd /win32 unzip downloads/cairo_1.8.8-1_win32.zip unzip downloads/cairo-dev_1.8.8-1_win32.zip #fix location in pkgconfig files sed -i "s/c:\/devel\/target\/.*/\/win32/g" /win32/lib/pkgconfig/*.pc ##Building stuff from source #adjust environment to use /win32 for building and setting some corss compile flags export PKG_CONFIG_PATH="/win32/lib/pkgconfig" export CFLAGS='-mthreads -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -D_FILE_OFFSET_BITS=64 -I/win32/include -L/win32/lib' #liboil mkdir -p /win32/src cd /win32/src git clone git://anongit.freedesktop.org/git/liboil cd liboil ./autogen.sh --prefix=/win32 --host=i586-mingw32msvc && make && make install #libxml cd /win32/src wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz tar xzf libxml2-2.7.3.tar.gz cd libxml2-2.7.3 ./configure --prefix=/win32 --host=i586-mingw32msvc && make && make install #zlib cd /win32/downloads wget http://www.zlib.net/zlib123-dll.zip mkdir /tmp/zlib && cd /tmp/zlib unzip /win32/downloads/zlib123-dll.zip mv zlib1.dll /win32/bin mv include/* /win32/include/ mv lib/* /win32/lib/ rm -r /tmp/zlib #libpng cd /win32/downloads wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.2.38-1_win32.zip wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng-dev_1.2.38-1_win32.zip cd /win32 unzip downloads/libpng_1.2.38-1_win32.zip unzip downloads/libpng-dev_1.2.38-1_win32.zip #libogg cd /win32/src wget http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz tar xzf libogg-1.1.4.tar.gz cd libogg-1.1.4 ./configure --prefix=/win32 --host=i586-mingw32msvc && make && make install #libvorbis cd /win32/src wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.gz tar xzf libvorbis-1.2.3.tar.gz cd libvorbis-1.2.3 ./configure --prefix=/win32 --host=i586-mingw32msvc && make && make install #libshout cd /win32/src wget http://downloads.xiph.org/releases/libshout/libshout-2.2.2.tar.gz tar xzf libshout-2.2.2.tar.gz cd libshout-2.2.2 #remove all definitions from include/os.h #comment out sleep in examples/noblocking.c ./configure --prefix=/win32 --host=i586-mingw32msvc && make && make install #gstreamer #get latest version from git, for now only building gstramer and gst-plugins-base cd /win32/src for i in gstreamer gst-plugins-base gst-plugins-good; do git clone git://anongit.freedesktop.org/git/gstreamer/$i done #build apt-get install libglib2.0-dev rm -r /usr/lib/pkgconfig/*.pc cd /win32/src/gstreamer ./autogen.sh --prefix=/win32 --host=i586-mingw32msvc --disable-gtk-doc --disable-docbook make ERROR_CFLAGS="-Wall -Wdeclaration-after-statement -fno-strict-aliasing" make ERROR_CFLAGS="-Wall -Wdeclaration-after-statement -fno-strict-aliasing" install cd /win32/src/gst-plugins-base ./autogen.sh --prefix=/win32 --host=i586-mingw32msvc --disable-gtk-doc --disable-docbook make ERROR_CFLAGS="-Wall -Wdeclaration-after-statement -fno-strict-aliasing" make ERROR_CFLAGS="-Wall -Wdeclaration-after-statement -fno-strict-aliasing" install cd /win32/src/gst-plugins-good ./autogen.sh --prefix=/win32 --host=i586-mingw32msvc --disable-gtk-doc --disable-docbook make ERROR_CFLAGS="-Wall -Wdeclaration-after-statement -fno-strict-aliasing" make ERROR_CFLAGS="-Wall -Wdeclaration-after-statement -fno-strict-aliasing" install