2012-07-08 18:06:02 +00:00
|
|
|
Building MKVToolNix 5.7.0 on Windows
|
2010-03-06 13:40:50 +00:00
|
|
|
====================================
|
2003-05-09 06:27:26 +00:00
|
|
|
|
2012-03-29 19:10:49 +00:00
|
|
|
There is currently only one supported way to build MKVToolNix for
|
|
|
|
Windows: on Linux using a mingw cross compiler. It is known that you
|
|
|
|
can also build it on Windows itself with the mingw gcc compiler, but
|
|
|
|
that's not supported officially as I don't have such a setup myself.
|
2004-01-12 20:02:13 +00:00
|
|
|
|
2012-03-29 19:10:49 +00:00
|
|
|
Earlier versions could still be built with Microsoft's Visual Studio /
|
|
|
|
Visual C++ programs, and those steps were described here as
|
|
|
|
well. However, current MKVToolNix versions require many features of
|
|
|
|
the new C++11 standard that even the newest C++ compilers from
|
|
|
|
Microsoft simply don't support. Therefore the old project files that
|
|
|
|
enabled building with Visual Studio 8 or newer were removed.
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2012-03-29 19:10:49 +00:00
|
|
|
Section 1 -- Building with a mingw cross compiler
|
2010-03-06 13:40:50 +00:00
|
|
|
-------------------------------------------------
|
|
|
|
|
2012-03-29 19:10:49 +00:00
|
|
|
1.1. Preparations
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
You will need:
|
2010-03-06 13:40:50 +00:00
|
|
|
|
|
|
|
- a mingw cross compiler
|
2010-03-06 18:08:13 +00:00
|
|
|
- roughly 2 GB of free space available
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
Earlier versions of this document described in painful details how to
|
|
|
|
build each library. Luckily there's the "mingw-cross-env" project at
|
|
|
|
http://mingw-cross-env.nongnu.org/ that provides an easy-to-use way of
|
|
|
|
setting up everything we need.
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2012-05-31 11:39:43 +00:00
|
|
|
Unfortunately current versions of mingw-cross-env use a compiler
|
|
|
|
version that is known to cause issues upon runtime. Therefore the
|
|
|
|
author maintains his own fork that is known to work. In order to
|
|
|
|
retrieve that fork you need `git`. Then to the following:
|
|
|
|
|
|
|
|
git clone https://github.com/mbunkus/mxe $HOME/mingw-cross-env
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
The rest of this guide assumes that you've unpacked mingw-cross-env
|
|
|
|
into the directory $HOME/mingw-cross-env.
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2012-03-29 19:10:49 +00:00
|
|
|
1.2. Automatic build script
|
2010-03-06 13:40:50 +00:00
|
|
|
|
|
|
|
mkvtoolnix contains a script that can download, compile and install
|
2011-10-23 19:06:28 +00:00
|
|
|
all required libraries into the directory $HOME/mingw-cross-env.
|
2010-03-06 13:40:50 +00:00
|
|
|
|
|
|
|
If the script does not work or you want to do everything yourself
|
2012-05-21 15:54:58 +00:00
|
|
|
you'll find instructions for manual compilation in section 1.3.
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2012-03-29 19:10:49 +00:00
|
|
|
1.2.1. Script configuration
|
2010-03-06 13:40:50 +00:00
|
|
|
|
|
|
|
The script is called winbuild/setup_cross_compilation_env.sh. It
|
|
|
|
contains the following variables that can be adjusted to fit your
|
|
|
|
needs:
|
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
TARGET=i686-pc-mingw32
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
The target specification for the standard configure scripts.
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
INSTALL_DIR=$HOME/mingw-cross-env
|
2010-03-06 13:40:50 +00:00
|
|
|
|
|
|
|
Base installation directory
|
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
PARALLEL=
|
2010-03-06 18:08:13 +00:00
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
Number of processes to execute in parallel. Will be set to the number
|
|
|
|
of cores available if left empty.
|
2010-03-06 18:08:13 +00:00
|
|
|
|
2012-03-29 19:10:49 +00:00
|
|
|
1.2.2. Execution
|
2010-03-06 13:40:50 +00:00
|
|
|
|
|
|
|
From the mkvtoolnix source directory run:
|
|
|
|
|
|
|
|
./winbuild/setup_cross_compilation_env.sh
|
|
|
|
|
2010-03-07 17:56:35 +00:00
|
|
|
If everything works fine you'll end up with a configured mkvtoolnix
|
2011-10-23 19:06:28 +00:00
|
|
|
source tree. You just have to run 'drake' afterwards.
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2012-03-29 19:10:49 +00:00
|
|
|
1.3. Manual installation
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
First you will need the mingw-cross-env build scripts. Get them by
|
|
|
|
downloading them (see above) and unpacking them into
|
|
|
|
$HOME/mingw-cross-env.
|
|
|
|
|
|
|
|
Next, build the required libraries:
|
|
|
|
|
|
|
|
cd $HOME/mingw-cross-env
|
2012-04-07 22:20:04 +00:00
|
|
|
make gcc w32api mingwrt gettext boost bzip2 curl file flac libiconv \
|
2011-12-12 23:00:03 +00:00
|
|
|
lzo ogg pthreads vorbis wxwidgets zlib
|
2010-03-06 13:40:50 +00:00
|
|
|
|
2011-10-23 19:06:28 +00:00
|
|
|
Append the installation directory to your PATH variable:
|
|
|
|
|
2012-05-31 11:39:43 +00:00
|
|
|
export PATH=$PATH:$HOME/mingw-cross-env/usr/bin
|
|
|
|
hash -r
|
2011-10-23 19:06:28 +00:00
|
|
|
|
|
|
|
Finally, configure mkvtoolnix:
|
|
|
|
|
|
|
|
cd $HOME/path/to/mkvtoolnix-source
|
2010-03-06 13:40:50 +00:00
|
|
|
./configure \
|
2011-10-23 19:06:28 +00:00
|
|
|
--host=i686-pc-mingw32 \
|
|
|
|
--with-boost=$HOME/mingw-cross-env/usr/i686-pc-mingw32 \
|
2012-05-31 11:39:43 +00:00
|
|
|
--with-wx-config=$HOME/mingw-cross-env/usr/bin/i686-pc-mingw32-wx-config
|
2011-10-23 19:06:28 +00:00
|
|
|
|
|
|
|
If everything works then build it:
|
|
|
|
|
|
|
|
./drake
|
2010-03-06 13:40:50 +00:00
|
|
|
|
|
|
|
You're done.
|