Difference between revisions of "Win32CompileMSYSNew"

From VideoLAN Wiki
Jump to navigation Jump to search
m (+{{Outdated}})
 
(142 intermediate revisions by 28 users not shown)
Line 1: Line 1:
== Introduction ==
+
{{Outdated}}
 +
= '''OUTDATED''' =
  
MSYS is a helper environment for MinGW, the compiler chain for Windows based on GCC. It is the fastest way to build VLC natively on Windows.
+
See [[Win32CompileMSYS]]
  
This howto was re-created by [[User:J-b|Jean-Baptiste Kempf]] and updated in June 2009, September 2009, December 2009 and March 2010
+
= Introduction  =
 +
== About ==
  
== Install MinGW ==
+
MSys is a helper environment for MinGW, the compiler chain for Windows based on GCC. It can build VLC natively on Windows.  Note that you should also [[Win32Compile|cross compile]] VLC from Linux, because it is faster, and feels easier.
  
Use the main installer 5.1.6 found at
+
VLC is a complex program with many dependencies, so minimal command-line experience is required. Also, don't be in a hurry (4 hours is a minimum for the whole process) and don't despair if it doesn't work first time.
http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe/download
 
  
Go through the wizard, selecting "Downloading and Install" and using the candidate release. Select gcc, g++ and MinGW make. It should download automatically:
+
== Acknowledgements ==
*mingwrt-3.17
 
*w32api-3.14
 
*binutils-2.18
 
*gcc-core-3.4.5
 
*gcc-g++-3.4.5
 
*mingw32-make-3.81
 
  
=== Update Mingw GCC to 4.4.0 ===
+
This howto was re-created by [[User:J-b|Jean-Baptiste Kempf]] and updated in June 2009, September 2009, December 2009 and March 2010.  
  
Use GCC 4.4.0, with
+
It was updated in June 2010 by Vicne with the help of J-b, gnosygnu and MichaelMc
http://sourceforge.net/projects/mingw/files/GCC%20Version%204/Current%20Release_%20gcc-4.4.0/gcc-full-4.4.0-mingw32-bin-2.tar.lzma/download
 
  
Extract it to C:\Mingw and make it replace the current files (you can use 7-zip to extract the files).
+
It was updated in July 2012 by gnosygnu. Note that there are several new notes in [[Win32CompileMSYSTroubleShooting]]. These reflect problems that were encountered on gnosygnu's setup (Windows XP SP3). Refer to this [http://forum.videolan.org/viewtopic.php?f=32&t=102843&sid=f58967215a83981dda030ff6efa3d493 forum thread] for more information.
  
* Use text editor to change MinGW\lib\gcc\mingw32\4.4.0\libstdc++.la file (line should be <code><nowiki>library_names=''</nowiki></code>) due to bug in latest MinGW.
+
= Windows tools needed  =
 +
== Text editor ==
  
It also needs
+
To edit unix-style text documents you need a suitable editor.  
http://sourceforge.net/projects/mingw/files/GCC%20Version%204/Current%20Release_%20gcc-4.4.0/gcc-core-4.4.0-mingw32-dll.tar.gz/download
 
to be installed otherwise there are warnings about a libgcc_s_dw2-1.dll missing when it comes to compiling the qt4 interface.
 
  
== Install MSYS ==
+
You can look at [http://sourceforge.net/projects/notepad2/ notepad2]. You can set File - Line endings - Default to "Unix (LF)", but it always saves opened files in the ending style they have.
 +
 
 +
Or you can look at [http://notepad-plus-plus.org/ notepad++].
 +
 
 +
== Unzip Utility (7-zip) ==
 +
 
 +
Many files to downloaded will have to be uncompressed. As most of them use Linux-originated formats (.tar.gz, .tar.bz2, .tar.lzma), you will need a versatile unzipping utility. A recent version of [http://www.7-zip.org/ 7-zip] is therefore strongly advised.
 +
 
 +
Please note that most archives contain directory structures. Unless otherwise stated, you have to merge the contents with the existing dirs
 +
 
 +
= GNU Windows Environment  =
 +
Before installing, ensure your Windows user name does not contain spaces (VLC will not build in a folder with spaces in it). If it does, please create another user on your system.
 +
 
 +
In the following text, we'll refer to this user name as "&lt;username&gt;". Replace it appropriately where needed of course.
 +
 
 +
== MinGW  ==
 +
=== TDM/MinGW Setup  ===
 +
 
 +
Use the installer found at http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.7.1-2.exe/download
 +
 
 +
Go through the wizard:
 +
* Select "Create"
 +
* Select 32bits
 +
* Install to C:\MinGW
 +
* Keep default settings
 +
 
 +
=== MinGW utils  ===
 +
 
 +
Install mingw-utils, for unix2dos: http://prdownloads.sourceforge.net/mingw/mingw-utils-0.3.tar.gz
 +
 
 +
Extract contents to c:\MinGW
 +
 
 +
== MSys  ==
 +
=== MSys Setup  ===
 +
 
 +
Use the installer found at http://sourceforge.net/project/downloading.php?group_id=2435&amp;filename=MSYS-1.0.11.exe
 +
 
 +
Go through the wizard and install to to default C:\Msys\1.0
 +
 
 +
In the command window that opens, answer questions as follows:
  
* Install 7-zip and Mozilla Firefox
 
* Install MSys 1.0.11-rc1 with the exe: http://sourceforge.net/project/downloading.php?group_id=2435&filename=MSYS-1.0.11.exe to default C:\Msys\1.0 folder
 
 
  Accept Post Install: [y]
 
  Accept Post Install: [y]
  MinGW Installed? [y]
+
  MinGW Installed?     [y]
 
  path to MinGW:      [c:/MinGW]
 
  path to MinGW:      [c:/MinGW]
* Install MSys Developer Tooltkit: http://downloads.sourceforge.net/mingw/msysDTK-1.0.1.exe
 
  
=== AutoTools in MSYS ===
+
=== MSys Developer Toolkit  ===
 +
 
 +
Use the installer found at http://downloads.sourceforge.net/mingw/msysDTK-1.0.1.exe
  
Update your autoconf, automake and libtool by downloading and installing them, keeping in mind that you need to extract the content to C:\Msys\1.0
+
Go through the wizard, keeping the default values.
* http://sourceforge.net/projects/mingw/files/MSYS%20autoconf/autoconf-2.63-1/autoconf-2.63-1-msys-1.0.11-bin.tar.lzma/download
 
* http://sourceforge.net/projects/mingw/files/MSYS%20automake/automake-1.11-1/automake-1.11-1-msys-1.0.11-bin.tar.lzma/download
 
* http://sourceforge.net/projects/mingw/files/MSYS%20libtool/libtool-2.2.7a-1/libtool-2.2.7a-1-msys-1.0.11-bin.tar.lzma/download
 
  
You can also compile them according to:
+
This will install old versions of autotools, perl, ssh, ftp and sftp.
* http://wiki.enlightenment.org/index.php/EFL_Windows_XP
 
* http://www.mingw.org/wiki/msys
 
  
=== Install libgcrypt in MSys ===
+
=== Git ===
 +
Install Git from http://code.google.com/p/msysgit/downloads/list?can=3
  
http://prdownloads.sourceforge.net/mingw/libcrypt-1.1_1-2-msys-1.0.11-dll-0.tar.lzma
+
Go through the wizard, keeping the default value, except the one speaking of line endings.
  
=== Install other tools in Mingw ===
+
=== Wget ===
 +
You will need Wget:
 +
http://sourceforge.net/projects/gnuwin32/files/wget/1.11.4-1/wget-1.11.4-1-setup.exe/download
  
Installing mingw-utils is recommended: http://prdownloads.sourceforge.net/mingw/mingw-utils-0.3.tar.gz, extract it to mingw/bin.
+
Extract it to c:\MinGW
  
Installation of wget too: http://prdownloads.sourceforge.net/mingw/wget-1.9.1-mingwPORT.tar.bz2
+
=== AutoTools and libcrypt  ===
  
Although this is a mingwPORT package it already has a precompiled wget on board.
+
Update autoconf, automake, libtool as well as libcrypt by downloading the following files and extracting them to C:\Msys\1.0:
Extract the .tar.bz2 file. It contains wget.exe in the bin subfolder, extract it to mingw/bin.
 
  
 +
*http://sourceforge.net/projects/mingw/files/MSYS/msysdev/autoconf/autoconf-2.68-1/autoconf-2.68-1-msys-1.0.17-bin.tar.lzma/download
 +
*http://sourceforge.net/projects/mingw/files/MSYS/msysdev/automake/automake-1.11.1-1/automake-1.11.1-1-msys-1.0.13-bin.tar.lzma/download
 +
*http://sourceforge.net/projects/mingw/files/MSYS/msysdev/libtool/libtool-2.4-1/libtool-2.4-1-msys-1.0.15-bin.tar.lzma/download
 +
*http://prdownloads.sourceforge.net/mingw/libcrypt-1.1_1-2-msys-1.0.11-dll-0.tar.lzma
 +
*http://sourceforge.net/projects/mingw/files/MSYS/Extension/perl/perl-5.8.8-1/perl-5.8.8-1-msys-1.0.17-bin.tar.lzma/download
 +
*http://sourceforge.net/projects/mingw/files/MSYS/Extension/m4/m4-1.4.14-1/m4-1.4.14-1-msys-1.0.13-bin.tar.lzma/download
  
 +
=== Glib and PKG-CONFIG  ===
  
=== PKG-CONFIG ===
+
Similarly, download the following files and extract them to C:\MSys\1.0:
  
pkg-config is a mess, this is not NEWS... And you cannot compile it from Windows because of a few bugs...
+
Note* Download the latest version inside this folders (Last tested to be OK is glib 2.28, non-dev version)):
  
Get Glib from GNOME: http://ftp.gnome.org/pub/GNOME/binaries/win32/glib/2.18/glib_2.18.2-1_win32.zip  
+
*http://ftp.gnome.org/pub/GNOME/binaries/win32/glib  
Unzip it to C:\Msys\1.0 .
+
*ftp://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.23-3_win32.zip
 +
*ftp://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-dev_0.23-3_win32.zip
 +
*http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
  
Get PKG-CONFIG from GNOME: ftp://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.23-3_win32.zip
+
'''Note''': I found that compiling 2.1.0 requires xgettext, msgmerge, msgfmt and so on. These in turn require libiconv. I'm not sure if that suffices as at this point I gave up.
and ftp://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-dev_0.23-3_win32.zip
 
Unzip them to C:\Msys\1.0 .
 
  
== Install Git and checkout VLC ==
+
=== Add pkg config path variable  ===
  
See [[Git_Windows]].
+
Add the following line to the *top* of C:\MSys\1.0\msys.bat:
  
You can also retrieve the source code from [http://www.videolan.org/vlc/download-sources.html VideoLAN Project: VLC media player source code]
+
set PKG_CONFIG_PATH=/win32/lib/pkgconfig
  
== Contribs ==
+
== Compile LUA tools  ==
  
Take the precompiled contribs from:
+
VLC uses the LUA scripting language (See [http://www.lua.org lua.org]). Unfortunately, no binaries are provided so you need to compile them.
http://people.videolan.org/~jb/Contribs/
 
  
Copy them in your ~
+
*Download the lua tools package from http://www.lua.org/ftp/lua-5.1.4.tar.gz
tar xvjf contrib-20090813-win32-bin-gcc-4.2.1-sjlj-runtime-3.15.2-only.tar.bz2 -C /
+
*Uncompress it in your home folder (C:\MSys\1.0\home\&lt;username&gt;)
rm -v /usr/win32/bin/moc /usr/win32/bin/uic /usr/win32/bin/rcc
+
*run MSys
 +
*type the following commands:
  
 +
cd /home/<username>/lua-5.1.4
 +
make mingw
 +
make install
  
== Bootstrap VLC ==
+
= VLC sources  =
 +
== Git ==
 +
Clone the git repo
 +
git clone git://git.videolan.org/vlc.git
 +
 
 +
= Get Precompiled contribs  =
 +
cd vlc/contrib
 +
mkdir win32 && cd win32
 +
../bootstrap --build=i586-mingw32msvc
 +
make prebuilt
 +
 
 +
'''Note''': it will say tar complains, just ignore them and watch tar die.
 +
I had to manually execute the rest of the prebuilt target, which consists of
 +
 
 +
mv i586-mingw32msvc ..
 +
cd ../i586-mingw32msvc
 +
change_prefix.sh
 +
 
 +
I also found that change_prefix.sh, which rewrites .pc files to deal with their chosen location, used the -i option which is not supported by MSYS-shipped sed. I rewrote the sed script to write changes $file.new then mv $file.new $file.
 +
 
 +
= Last change&nbsp;: whoami and hostname  =
 +
 
 +
Whoami is not available on Windows, and hostname doesn't support the -f option used by the build process. These utilities are used to show the name and computer of the person who compiled VLC in the 'About' box.
 +
 
 +
:''Note for the brave&nbsp;: the steps below are file changes so that compile works, but an alternative is to download and install GNU whoami and hostname functionality. This can be achieved by doing the following steps:
 +
# ''download coreutils from http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/coreutils, selecting any version (latter is normally better) then the file named like coreutils-5.97-2-msys-1.0.11-ext.tar.lzma (note '-ext' in file name) and extracting who.exe, whoami.exe, hostname.exe to C:/MSys/1.0/bin''
 +
# ''download libintl dll from http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/libiconv, selecting any version (latter is normally better) then the file named like libiconv-1.13.1-2-msys-1.0.13-dll-2.tar.lzma (note '-dll' in file name) and extracting dll in C:/MSys/1.0/bin''
 +
# ''download libiconv dll from http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/gettext, selecting any version (latter is normally better) then the file named like libintl-0.17-2-msys-dll-8.tar.lzma (note '-dll' in file name) and extracting dll in C:/MSys/1.0/bin''
 +
 
 +
== Whoami  ==
 +
 
 +
Create a new file containing the single line:
 +
 
 +
echo '&lt;username&gt;'
 +
 
 +
and save it as C:\MSys\1.0\bin\whoami (without any extension)
 +
 
 +
== Hostname  ==
 +
 
 +
Modify configure.ac so that it doesn't call 'hostname -f' as follows:
 +
 
 +
*open C:\MSys\1.0\home\&lt;username&gt;\vlc\configure.ac
 +
*goto search button:
 +
*change it as follows:
 +
 
 +
old: AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2&gt; /dev/null || hostname`", [host which ran configure])
 +
new: AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname`", [host which ran configure])
 +
 
 +
= Build VLC  =
 +
 
 +
The build is made exclusively from the command line, so if you closed the prompt at the LUA step, re-execute C:\MSys\1.0\msys.bat, then type the commands as mentioned
 +
 
 +
== Bootstrap ==
  
 
  cd vlc
 
  cd vlc
cp -v /usr/win32/share/aclocal/* m4/
 
 
  cp -v /usr/share/aclocal/* m4/
 
  cp -v /usr/share/aclocal/* m4/
  PATH=/usr/win32/bin:$PATH ./bootstrap
+
  bootstrap
It should warn about gettext... Just ignore.
+
== Configure  ==
 +
 
 +
sh extras/package/win32/configure.sh --host=i586-pc-mingw32msvc --disable-nls
  
 +
If you want any custom options, like "--disable-lua" or anything of that nature, you can append them.
  
== Configure ==
+
== Make (compile) ==
  
sh extras/package/win32/configure-msys.sh
+
Note&nbsp;: If your &lt;username&gt; starts with the "u" or "x" character, change C:\MSys\1.0\home\&lt;username&gt;\config.h and double all backslashes in VLC_COMPILED_BY constant.  
* If you downloaded a VLC source code tarball, retrieve ''configure-msys.sh'' and ''configure-common.sh'' from [[http://git.videolan.org/?p=vlc.git;a=summary vlc.git]] / extras / package / win32 /
 
* If Your user name starts from "u" or "x" characters, change config.h (double all backslashes in COMPILED_BY constant to avoid compilation errors) after configuring.
 
  
== Compile ==
+
Type the following command&nbsp;:
  
 
  PATH=/usr/win32/bin:$PATH make
 
  PATH=/usr/win32/bin:$PATH make
If you have Cygwin and others tools installed, try using a shorter PATH inside MSYS shell i.e.
 
$ echo $PATH
 
.:/usr/local/bin:/mingw/bin:/bin
 
  
==Creating self-contained packages==
+
If this step fails, try the following
 +
* Go back to "Precompiled contribs" section, and obtain the latest compiled contrib (under "Note for the brave")
 +
* In the configure script section (configure-msys.sh), open that file and add --disable-upnp
 +
 
 +
== Create self-contained packages ==
  
Once the compilation is done, build self-contained VLC packages with the following "make" commands:
+
Once the compilation is done, build self-contained VLC packages with one of the following "make" commands:  
  
 
  make package-win32-base
 
  make package-win32-base
  
(This will create a subdirectory named vlc-x.x.x with all the binaries "stripped" without any debugging symbols).
+
(This will create a subdirectory named vlc-x.x.x with all the binaries "stripped" without any debugging symbols).  
  
 
  make package-win32-zip
 
  make package-win32-zip
  
(Same as above but will package the directory in a zip file).
+
(Same as above but will package the directory in a zip file).  
  
 
  make package-win32
 
  make package-win32
Line 131: Line 222:
 
(Same as above but will also create an auto-installer package. You will need to have NSIS installed in its default location for this to work).
 
(Same as above but will also create an auto-installer package. You will need to have NSIS installed in its default location for this to work).
  
* If you have permissions problems running make package-*, chmod 777 -R the vlc folder.
+
make package-win32-base-debug
* If you have permissions problems running vlc.exe after packaging, rename or delete vlc.exe.manifest
+
 
 +
(This will create a subdirectory named vlc-x.x.x with all the binaries containing debug info usable by gdb).
 +
 
 +
Note that with the 1.2 branch these names have changed slightly. Run '
 +
grep ':' Makefile | grep package-win32
 +
to see what they are now.
 +
 
 +
= Troubleshooting =
 +
 
 +
See [[Win32CompileMSYSTroubleShooting]].
  
== Random bootstrap, configure, and make errors ==
+
= See also =
 +
*[[Win32CompileMSYSOld]] - deprecated documentation
  
There have been reports of random msys errors during bootstrap, configure, and make. They usually don't repeat themselves between runs. Rule out that your mingw-msys installation is at fault by building in windows safe mode. Even if this works, it may then be more practical to try a cross-compilation build.
+
[[Category:Building]]
 +
[[Category:Windows]]

Latest revision as of 20:24, 15 February 2019

This page is outdated and information might be incorrect.
Create an account to start editing, and then click here to update this article.

OUTDATED

See Win32CompileMSYS

Introduction

About

MSys is a helper environment for MinGW, the compiler chain for Windows based on GCC. It can build VLC natively on Windows. Note that you should also cross compile VLC from Linux, because it is faster, and feels easier.

VLC is a complex program with many dependencies, so minimal command-line experience is required. Also, don't be in a hurry (4 hours is a minimum for the whole process) and don't despair if it doesn't work first time.

Acknowledgements

This howto was re-created by Jean-Baptiste Kempf and updated in June 2009, September 2009, December 2009 and March 2010.

It was updated in June 2010 by Vicne with the help of J-b, gnosygnu and MichaelMc

It was updated in July 2012 by gnosygnu. Note that there are several new notes in Win32CompileMSYSTroubleShooting. These reflect problems that were encountered on gnosygnu's setup (Windows XP SP3). Refer to this forum thread for more information.

Windows tools needed

Text editor

To edit unix-style text documents you need a suitable editor.

You can look at notepad2. You can set File - Line endings - Default to "Unix (LF)", but it always saves opened files in the ending style they have.

Or you can look at notepad++.

Unzip Utility (7-zip)

Many files to downloaded will have to be uncompressed. As most of them use Linux-originated formats (.tar.gz, .tar.bz2, .tar.lzma), you will need a versatile unzipping utility. A recent version of 7-zip is therefore strongly advised.

Please note that most archives contain directory structures. Unless otherwise stated, you have to merge the contents with the existing dirs

GNU Windows Environment

Before installing, ensure your Windows user name does not contain spaces (VLC will not build in a folder with spaces in it). If it does, please create another user on your system.

In the following text, we'll refer to this user name as "<username>". Replace it appropriately where needed of course.

MinGW

TDM/MinGW Setup

Use the installer found at http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.7.1-2.exe/download

Go through the wizard:

  • Select "Create"
  • Select 32bits
  • Install to C:\MinGW
  • Keep default settings

MinGW utils

Install mingw-utils, for unix2dos: http://prdownloads.sourceforge.net/mingw/mingw-utils-0.3.tar.gz

Extract contents to c:\MinGW

MSys

MSys Setup

Use the installer found at http://sourceforge.net/project/downloading.php?group_id=2435&filename=MSYS-1.0.11.exe

Go through the wizard and install to to default C:\Msys\1.0

In the command window that opens, answer questions as follows:

Accept Post Install: [y]
MinGW Installed?     [y]
path to MinGW:       [c:/MinGW]

MSys Developer Toolkit

Use the installer found at http://downloads.sourceforge.net/mingw/msysDTK-1.0.1.exe

Go through the wizard, keeping the default values.

This will install old versions of autotools, perl, ssh, ftp and sftp.

Git

Install Git from http://code.google.com/p/msysgit/downloads/list?can=3

Go through the wizard, keeping the default value, except the one speaking of line endings.

Wget

You will need Wget: http://sourceforge.net/projects/gnuwin32/files/wget/1.11.4-1/wget-1.11.4-1-setup.exe/download

Extract it to c:\MinGW

AutoTools and libcrypt

Update autoconf, automake, libtool as well as libcrypt by downloading the following files and extracting them to C:\Msys\1.0:

Glib and PKG-CONFIG

Similarly, download the following files and extract them to C:\MSys\1.0:

Note* Download the latest version inside this folders (Last tested to be OK is glib 2.28, non-dev version)):

Note: I found that compiling 2.1.0 requires xgettext, msgmerge, msgfmt and so on. These in turn require libiconv. I'm not sure if that suffices as at this point I gave up.

Add pkg config path variable

Add the following line to the *top* of C:\MSys\1.0\msys.bat:

set PKG_CONFIG_PATH=/win32/lib/pkgconfig

Compile LUA tools

VLC uses the LUA scripting language (See lua.org). Unfortunately, no binaries are provided so you need to compile them.

cd /home/<username>/lua-5.1.4 
make mingw
make install

VLC sources

Git

Clone the git repo

git clone git://git.videolan.org/vlc.git

Get Precompiled contribs

cd vlc/contrib
mkdir win32 && cd win32
../bootstrap --build=i586-mingw32msvc
make prebuilt

Note: it will say tar complains, just ignore them and watch tar die. I had to manually execute the rest of the prebuilt target, which consists of

mv i586-mingw32msvc ..
cd ../i586-mingw32msvc
change_prefix.sh

I also found that change_prefix.sh, which rewrites .pc files to deal with their chosen location, used the -i option which is not supported by MSYS-shipped sed. I rewrote the sed script to write changes $file.new then mv $file.new $file.

Last change : whoami and hostname

Whoami is not available on Windows, and hostname doesn't support the -f option used by the build process. These utilities are used to show the name and computer of the person who compiled VLC in the 'About' box.

Note for the brave : the steps below are file changes so that compile works, but an alternative is to download and install GNU whoami and hostname functionality. This can be achieved by doing the following steps:
  1. download coreutils from http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/coreutils, selecting any version (latter is normally better) then the file named like coreutils-5.97-2-msys-1.0.11-ext.tar.lzma (note '-ext' in file name) and extracting who.exe, whoami.exe, hostname.exe to C:/MSys/1.0/bin
  2. download libintl dll from http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/libiconv, selecting any version (latter is normally better) then the file named like libiconv-1.13.1-2-msys-1.0.13-dll-2.tar.lzma (note '-dll' in file name) and extracting dll in C:/MSys/1.0/bin
  3. download libiconv dll from http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/gettext, selecting any version (latter is normally better) then the file named like libintl-0.17-2-msys-dll-8.tar.lzma (note '-dll' in file name) and extracting dll in C:/MSys/1.0/bin

Whoami

Create a new file containing the single line:

echo '<username>'

and save it as C:\MSys\1.0\bin\whoami (without any extension)

Hostname

Modify configure.ac so that it doesn't call 'hostname -f' as follows:

  • open C:\MSys\1.0\home\<username>\vlc\configure.ac
  • goto search button:
  • change it as follows:
old: AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2> /dev/null || hostname`", [host which ran configure])
new: AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname`", [host which ran configure])

Build VLC

The build is made exclusively from the command line, so if you closed the prompt at the LUA step, re-execute C:\MSys\1.0\msys.bat, then type the commands as mentioned

Bootstrap

cd vlc
cp -v /usr/share/aclocal/* m4/
bootstrap 

Configure

sh extras/package/win32/configure.sh --host=i586-pc-mingw32msvc --disable-nls

If you want any custom options, like "--disable-lua" or anything of that nature, you can append them.

Make (compile)

Note : If your <username> starts with the "u" or "x" character, change C:\MSys\1.0\home\<username>\config.h and double all backslashes in VLC_COMPILED_BY constant.

Type the following command :

PATH=/usr/win32/bin:$PATH make

If this step fails, try the following

  • Go back to "Precompiled contribs" section, and obtain the latest compiled contrib (under "Note for the brave")
  • In the configure script section (configure-msys.sh), open that file and add --disable-upnp

Create self-contained packages

Once the compilation is done, build self-contained VLC packages with one of the following "make" commands:

make package-win32-base

(This will create a subdirectory named vlc-x.x.x with all the binaries "stripped" without any debugging symbols).

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 will need to have NSIS installed in its default location for this to work).

make package-win32-base-debug

(This will create a subdirectory named vlc-x.x.x with all the binaries containing debug info usable by gdb).

Note that with the 1.2 branch these names have changed slightly. Run '

grep ':' Makefile | grep package-win32

to see what they are now.

Troubleshooting

See Win32CompileMSYSTroubleShooting.

See also