2013-01-08 16:11:59 +00:00
|
|
|
Cross compiling mpv to Windows is supported with MinGW-w64. This can be used to
|
|
|
|
produce both 32 bit and 64 bit executables. MinGW-w64 is available from
|
|
|
|
http://mingw-w64.sourceforge.net.
|
|
|
|
|
|
|
|
You have to run mpv's configure with these arguments:
|
|
|
|
./configure --enable-cross-compile --target=i686-w64-mingw32
|
|
|
|
|
|
|
|
Using MXE to setup a MinGW-w64 environment is recommended: http://mxe.cc
|
|
|
|
Currently, using an experimental branch of MXE is required:
|
|
|
|
https://github.com/tonytheodore/mxe.git
|
|
|
|
|
|
|
|
Warning: the original MinGW (http://www.mingw.org) is unsupported.
|
|
|
|
|
2013-07-30 14:07:42 +00:00
|
|
|
Note that MinGW environments included in Linux distributions are often broken,
|
2013-01-08 16:11:59 +00:00
|
|
|
outdated and useless, and usually don't use MinGW-w64.
|
|
|
|
|
|
|
|
Example with MXE
|
|
|
|
================
|
|
|
|
|
|
|
|
# Download MXE. Note that compiling the required packages requires about 1 GB
|
|
|
|
# or more! We are using an experimental repository, which supports MinGW-w64.
|
|
|
|
# The official MXE supports classic MinGW only, which doesn't work with mpv.
|
|
|
|
|
|
|
|
cd /opt
|
|
|
|
git clone https://github.com/tonytheodore/mxe.git mingw
|
|
|
|
cd mingw
|
|
|
|
|
2013-07-30 14:07:42 +00:00
|
|
|
# Edit the MXE target, so that MinGW-w64 for 32 bit targets is built.
|
2013-01-08 16:11:59 +00:00
|
|
|
|
|
|
|
echo "MXE_TARGETS := i686-w64-mingw32" > settings.mk
|
|
|
|
|
|
|
|
# Build required packages. The following provide a minimum required to build
|
|
|
|
# mpv. (Not all of the following packages are strictly required.)
|
|
|
|
|
|
|
|
make gcc
|
|
|
|
make ffmpeg
|
|
|
|
make libass
|
|
|
|
make jpeg
|
|
|
|
make pthreads
|
|
|
|
|
2013-07-30 14:07:42 +00:00
|
|
|
# Older MXE and MinGW-w64 snapshots don't provide up-to-date OpenGL headers.
|
2013-01-08 16:11:59 +00:00
|
|
|
|
|
|
|
wget http://www.opengl.org/registry/api/glext.h
|
|
|
|
mv glext.h usr/i686-w64-mingw32/include/GL/
|
|
|
|
|
|
|
|
# Build mpv. The target will be used to automatically select the name of the
|
|
|
|
# build tools involved (e.g. it will use i686-w64-mingw32-gcc).
|
|
|
|
|
|
|
|
git clone https://github.com/mpv-player/mpv.git
|
|
|
|
cd mpv
|
|
|
|
export PATH=/opt/mingw/usr/bin/:$PATH
|
|
|
|
./configure --enable-cross-compile --target=i686-w64-mingw32
|
|
|
|
make
|
|
|
|
|
|
|
|
# This should work. For some reason, the resulting .exe will depend on the DLL
|
|
|
|
# /opt/mingw/usr/i686-w64-mingw32/bin/libwinpthread-1.dll because pthreads-w32
|
|
|
|
# folks don't like static linking. How to enable static linking is left as
|
2013-06-16 20:11:30 +00:00
|
|
|
# exercise to the reader. Passsing --disable-pthreads to mpv's configure will
|
|
|
|
# get rid of the dependency, but may disable some features (such as the stream
|
|
|
|
# cache).
|