Win32_Cross_Compiling_With_Mingw

Using the following scripts you can cross compile gstreamer on Linux host machine (tested on Ubuntu and Debian).

Contents

  1. Pre-requisites
    1. Install required packages
    2. Make 'bash' your default shell (optional - Ubuntu)
  2. Setup cross-compile root
  3. Build
  4. Miscellaneous

1. Pre-requisites

1.1. Install required packages

  1. Modify /etc/apt/source.list (if necessary):
    • Ubuntu hardy:

      # Binary
      deb hardy main restricted universe multiverse
      deb hardy-updates main restricted universe multiverse
      deb hardy-security main restricted universe multiverse
    • Debian etch:

      deb http://ftp.us.debian.org/debian etch main contrib non-free
      deb http://ftp.us.debian.org/debian etch-proposed-updates main contrib non-free
    root@linux# apt-get update    
  2. Install packages
    • Ubuntu hardy:

      root@linux# apt-get install mingw32 dpkg-dev pkg-config wget libglib2.0-dev unzip libtool automake autoconf m4 gettext cvs flex bison wine git-core subversion
    • Debian etch:

      root@linux# apt-get install mingw32 mingw32-binutils dpkg-dev pkg-config wget libglib2.0-dev bzip2 less unzip libtool automake autoconf m4 gettext cvs flex bison wine  git-core subversion

1.2. Make 'bash' your default shell (optional - Ubuntu)

On Ubuntu it might be necessary to force bash as default shell, else some configure scripts might fail (on Debian, bash is already the default shell). However, latest build script patches build infrastructure to arrange for bash where needed, so the following is optional:

root@linux# mv /bin/sh /bin/sh.orig
ln -s bash /bin/sh

2. Setup cross-compile root

  1. Create a directory where all cross compilation will take place:
    mnauw@linux> mkdir -p ~/src/win
  2. Obtain cross-env.sh and build_win32_sdk.sh scripts provided below, place them in the build directory and adjust settings in cross-env.sh as appropriate, e.g. according to the build root and the particular naming of the cross compiler in your distro.

3. Build

mnauw@linux> cd ~/src/win
bash ./build_win32_sdk.sh preqs deps gst

Arguments given above to the build script direct it to build all basic requirements (e.g. glib), as well as as some ext/ dependency libraries (e.g. lame) and finally various GStreamer releases. Other arguments allow building only a specific package. Details on this, as well as many other comments are provided in the scripts.

4. Miscellaneous

  1. David Schleef's scripts (local copy):
  2. Modified version of build_win32_sdk and config.site:
    • build_win32_sdk_tshalif (with some tweaks to force libtool to create shared DLLs)

    • An example forcing gstreamer's configure script to ignore host-installed 'libcdaudio-dev':
      echo ac_cv_path_CDAUDIO_CONFIG=no >> ~/src/gstreamer-mingw-cross/config.site
  3. Latest version of build scripts: