view DOCS/tech/crosscompile.txt @ 34115:3d7ee643b110

Port to Wine. This makes MPlayer and the GUI compile and run as a Wine executable, which is mainly to allow Windows code checking in a Linux environment. In Makefile: Generalize the windres call by specifying option "-o" for the output file. In gui/win32/interface.c: Use the same function to create a thread as Cygwin, and convert Windows style file names so that they are accessible in the Linux environment. In osdep/priority.c: Include windows.h. In configure: Add system "Wine" which shall be considered (mostly) a win32 system. Since winegcc by default compiles all files with the "-fpic" flag, remove it, and remove all MinGW compatibility WIN32 defines, because we're not compiling for real Windows. Define to not use Windows sockets (Wine uses different ones) and replace Windows' stricmp by strcasecmp. Ensure that yasm's object format isn't win32 and that HAVE_LINUX_DVD_STRUCT will be defined. In stream/tvi_dshow.c: Define MP_DEFINE_LOCAL_GUID, because Wine's DEFINE_GUID macro isn't compatible using "static" with it. In loader/com.h: Rename the IIDs to become local ones, because Wine's unknwn.h not only declares but defines them. In mplayer.c: Don't define a SIGSEGV signal handler, or the Wine executable will crash.
author ib
date Sat, 15 Oct 2011 13:20:52 +0000
parents
children 68d3b36b9dfc
line wrap: on
line source

Due to a lack of Windows developers, it is a good idea to allow Linux
developers to do at least some basic check of their code.
This HOWTO explains how to set up cross-compilation.


MinGW under Debian
==================

First, you need to install the "mingw32" package and get a MPlayer SVN
checkout.

Next, you need quite a lot of dependencies. Since this is for testing and
not actually use, the easiest way is to use this package:
http://natsuki.mplayerhq.hu/~reimar/mpl_mingw32.tar.bz2
NOTE that this is likely to be quite out-dated and might include packages
with security issues, so do not use it to build binaries for real use.

After extracting this package into the MPlayer source-tree,
you only need to run the included linux-mingw.sh to configure (it just runs
./configure --host-cc=cc --target=i686-mingw32msvc --cc=i586-mingw32msvc-cc
--windres=i586-mingw32msvc-windres --ranlib=i586-mingw32msvc-ranlib
--extra-cflags="-I$PWD/osdep/mingw32"
--extra-ldflags="-L$PWD/osdep/mingw32"
--with-freetype-config="$PWD/osdep/mingw32/ftconf") and then run make.

You should be able to run the generated binary with Wine, if you want to.

The steps as command-lines:

sudo apt-get install mingw32
svn co svn://svn.mplayerhq.hu/mplayer/trunk MPlayer-mingw
cd MPlayer-mingw
wget http://natsuki.mplayerhq.hu/~reimar/mpl_mingw32.tar.bz2
tar -xjf mpl_mingw32.tar.bz2
sh linux-mingw.sh
make


Wine
====

First, you need to install the "Wine" package and get a MPlayer SVN
checkout.

You don't need any dependencies other than those you already have for
your Linux build, because the Wine and Linux build will use them together.

Configure with

  ./configure --target=$(uname -m)-wine --cc=winegcc --windres=wrc

and add any options you normally use for your Linux build (such as
--enable-gui), then run make.