Difference between revisions of "Win32Compile"
(paths) |
|||
Line 96: | Line 96: | ||
== Packaging VLC == | == Packaging VLC == | ||
− | Once the compilation is done, | + | Once the compilation is done, you can build self-contained VLC packages with the following <code>make</code> rules: |
{| class="wikitable" | {| class="wikitable" | ||
Line 103: | Line 103: | ||
! Description | ! Description | ||
|- | |- | ||
− | | <code>make package- | + | | <code>make package-win-common</code> |
− | | Creates a subdirectory named <code>vlc-x.x.x</code> with all the binaries | + | | Creates a subdirectory named <code>vlc-x.x.x</code> with all the binaries. You can run VLC directly from this directory. |
|- | |- | ||
− | | <code>make package-win32-7zip</code> | + | | <code>make package-win-strip</code> (might be package-win32-strip) |
+ | | Same as above but will create 'stripped' binaries (that is, smallest size, unusable with a debugger). | ||
+ | |- | ||
+ | | <code>make package-win32-7zip</code> | ||
| Same as above but will package the directory in a 7z file. | | Same as above but will package the directory in a 7z file. | ||
|- | |- | ||
− | | <code>make package-win32-zip</code> | + | | <code>make package-win32-zip</code> |
| Same as above but will package the directory in a zip file. | | Same as above but will package the directory in a zip file. | ||
|- | |- | ||
− | | <code>make package-win32</code> | + | | <code>make package-win32</code> |
| Same as above but will also create an auto-installer package. You must have NSIS installed in its default location for this to work. | | Same as above but will also create an auto-installer package. You must have NSIS installed in its default location for this to work. | ||
|} | |} |
Revision as of 20:00, 18 December 2011
How to compile VLC media player for Windows.
Contents
Building Methods
If you want to build VLC from source, you have several choices:
Method | Documentation | Notes |
---|---|---|
Cross-compile with Mingw on Linux | This page | Preferred method (uses cross compilation). On Windows, you should do it in a virtual machine. |
Native compilation with MSYS+MINGW | Win32CompileMSYSNew | Native compilation method. MSYS is a minimal build environment to compile Unixish projects under Microsoft Windows. |
Native compilation with cygwin | Win32CompileCygwinNew | Build using cygwin as your compile environment. Error prone, and slow. |
Obtaining the toolchain
Each build method requires its own toolchain:
- Debian/Ubuntu users can
apt-get install gcc-mingw32 mingw32-binutils
. - Gentoo users can
emerge crossdev && crossdev mingw32
- ArchLinux users can
pacman -S mingw32-gcc
- Fedora users should read Win32CompileFedora13
- Other Linux systems may attempt http://www.mingw.org/wiki/LinuxCrossMinGW
- Native-compile with MSYS+MINGW, should read the documentation
- Native-compile with Cygwin, should read the documentation
Get the source code
$ git clone git://git.videolan.org/vlc.git
Prepare 3rd party libraries
Before compiling VLC, you need lots of other libraries. Here is how to get them:
$ mkdir -p contrib/win32 $ cd contrib/win32 $ ../bootstrap --host=i586-mingw32msvc $ make prebuilt
Linux 64bits
If you are on linux 64bits, you MUST remove some files:
$ rm -f ../i586-mingw32msvc/bin/moc ../i586-mingw32msvc/bin/uic ../i586-mingw32msvc/bin/rcc
And install your qt4-tools.
Fix your contrib path
If your Mingw prefix is not i586-mingw32msvc (you are NOT on Debian or Ubuntu), create a symlink to contribs:
$ ln -sf ../i586-mingw32msvc ../i486-mingw32
Go Back
Go back to the VLC source directory:
$ cd -
Configuring the build
Bootstrap
First, prepare the tree:
$ ./bootstrap
Configure
Then, you can to configure the build with the ./configure
script.
Create a subfolder:
$ mkdir win32 && cd win32
Use the standard configure:
$ ../extras/package/win32/configure.sh --host=i586-mingw32msvc
NB: use YOUR Xcompiling prefix here, like i486-mingw32
You can also, just run configure manually:
$ ../configure --with-contrib=/usr/win32 --host=i586-mingw32msvc
See '../configure --help'
for more information.
Building VLC
Once configured, to build VLC, just run:
$ make
Packaging VLC
Once the compilation is done, you can build self-contained VLC packages with the following make
rules:
Command | Description |
---|---|
make package-win-common
|
Creates a subdirectory named vlc-x.x.x with all the binaries. You can run VLC directly from this directory.
|
make package-win-strip (might be package-win32-strip)
|
Same as above but will create 'stripped' binaries (that is, smallest size, unusable with a debugger). |
make package-win32-7zip
|
Same as above but will package the directory in a 7z file. |
make package-win32-zip
|
Same as above but will package the directory in a zip file. |
make package-win32
|
Same as above but will also create an auto-installer package. You must have NSIS installed in its default location for this to work. |
Well done—you're ready to use VLC!