Difference between revisions of "Win32CompileMSYSNew"
(I think this is right :P)
|Line 137:||Line 137:|
Alternatively you could download some "full lua" package, as long as it puts
Alternatively you could download some "full lua" package, as long as it puts .exe in your path you are good to go.
= Precompiled contribs =
= Precompiled contribs =
Revision as of 01:50, 1 December 2011
- 1 Introduction
- 2 Windows tools needed
- 3 GNU Windows Environment
- 4 Precompiled contribs
- 5 VLC sources
- 6 Last change : whoami and hostname
- 7 Build VLC
- 8 Troubleshooting
- 9 See also
MSys is a helper environment for MinGW, the compiler chain for Windows based on GCC. It is the fastest and recommended way to build VLC natively on Windows. Note that you could also cross compile VLC from Linux, if desired (it is faster).
VLC is a complex program with many dependencies, so minimal command-line experience is required. Also, don't be in a hurry (2 hours is a minimum for the whole process) and don't despair if it doesn't work first time.
On the edge vs Conservative
This update aims at building versions from the 1.1.0 branch natively in the most straightforward way.
Of course, if you want to live on the edge, feel free to select more recent versions of the proposed tools, contribs or sources, but the build has only been thoroughly validated with the versions indicated in the main text flow.
- Such alternative ways are indented, italicized and marked "Note for the brave" :-). Your mileage may vary
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
Windows tools needed
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.
- the old version of mingw GCC (3.4.5) worked with VLC, because it uses SjLj exception unwinding. Any "vanilla" version 4.0+ by default uses dwarf2 exception unwinding, so isn't compatible with the contribs. So recommend installing TDM, below.
Use the installer found at http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.2.exe/download
Go through the wizard:
- uncheck "Check for updated files..."
- Select "Create"
- install to C:\MinGW
- keep default settings
- afterwards check that C:\MinGW\bin is added to windows PATH (http://www.computerhope.com/issues/ch000549.htm)
Installing mingw-utils is recommended: http://prdownloads.sourceforge.net/mingw/mingw-utils-0.3.tar.gz
Extract contents to c:\MinGW
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 default values
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)):
Add pkg config path variable
Add the following line to the *top* of C:\MSys\1.0\msys.bat:
Fix libtool search dirs
Open C:\MSys\1.0\bin\libtool and change line 9926 by appending ' /mingw/lib' to the end of 'compiler_lib_search_dirs'. The line should then read :
compiler_lib_search_dirs="/usr/lib /usr/lib /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1 /bin/../lib/gcc-lib /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1 /bin/../lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib /usr/lib/gcc-lib/i686-pc-msys/2.95.3-1/../../../../i686-pc-msys/lib /mingw/lib"
VLC uses the LUA scripting language (See lua.org). Unfortunately, no binaries are provided so you need to compile them.
- Download the lua tools package from http://www.lua.org/ftp/lua-5.1.4.tar.gz
- Uncompress it in your home folder (C:\MSys\1.0\home\<username>)
- run MSys
- type the following commands:
cd /home/<username>/lua-5.1.4 make mingw
This should produce lua.exe, luac.exe and lua51.dll in the src directory. Put these in your /bin with the commands:
cd src cp *.exe *.dll /bin cd ..
Alternatively you could download some "full lua" package, as long as it puts a luac.exe in your path you are good to go, for instance http://code.google.com/p/luaforwindows binaries.
- Note for the brave : Alternatively, you can get the latest contrib from :http://people.videolan.org/~jb/Contribs/
- download the file http://people.videolan.org/~jb/Contribs/contrib-20100608-win32-bin-gcc-4.4.4-runtime-3.17-only.tar.bz2
- extract it to C:\MSys\1.0 but without the /usr path. For example, one of the resulting files should be:
Contribs are basically some precompiled 3rd party library (Here's a list of what they all are).
- Note for the brave : This section lists the steps for VLC version 1.1.0rc3. Alternatively, you could get the latest sources from the development tree using GIT. It's not as difficult as it looks to do so. If you want chose that route, please follow instructions on the Git Windows page (just download the VLC repository--you don't need the x264 one) then skip the next section "Last Change"
Base: VLC version 1.1.0rc3
- download the file http://download.videolan.org/pub/videolan/testing/vlc-1.1.0-rc3/vlc-1.1.0-rc3.tar.bz2
- extract it to C:\MSys\1.0\home\<username>
- rename the vlc-1.1.0rc3 dir to vlc
add missing configure-msys (1.1.x only)
- Download http://git.videolan.org/?p=vlc.git;a=blob_plain;f=extras/package/win32/configure-msys.sh;hb=HEAD
- Save it (not using proposed name) as C:\msys\1.0\home\<username>\vlc\extras\package\win32\configure-msys.sh
add missing configure-common (1.1.x only)
- Download http://git.videolan.org/?p=vlc.git;a=blob_plain;f=extras/package/win32/configure-common.sh;hb=HEAD
- Save it (not using proposed name) as C:\msys\1.0\home\<username>\vlc\extras\package\win32\configure-common.sh
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:
- 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
Create a new file containing the single line:
and save it as C:\MSys\1.0\bin\whoami (without any extension)
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])
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
cd vlc cp -v /usr/win32/share/aclocal/* m4/ cp -v /usr/share/aclocal/* m4/ PATH=/usr/win32/bin:$PATH ./bootstrap
If you want any custom options, like "--disable-lua" or anything of that nature, you'll need to edit that file directly instead of passing them in as parameters (at least currently that is required).
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 :
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:
(This will create a subdirectory named vlc-x.x.x with all the binaries "stripped" without any debugging symbols).
(Same as above but will package the directory in a zip file).
(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).
(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.
- Win32CompileMSYSOld - deprecated documentation