Difference between revisions of "Win32Compile"

From VideoLAN Wiki
Jump to navigation Jump to search
(copyedit)
Line 4: Line 4:
 
  INSTALL file for the Windows9x/Me/NT4/2k/XP version of the VLC media player
 
  INSTALL file for the Windows9x/Me/NT4/2k/XP version of the VLC media player
  
==Running VLC with debug==
+
==Before you start==
  
If you have already built VLC (see below) or are using a binary release, just run 'vlc.exe'.
+
One common desire that leads people to want to rebuild VLC is to "rebuild a debug version" or "add printf()s", but this is not strictly necessary, as VLC includes a debug logging feature by default.  If you are using a binary release (or have already built VLC), just run <CODE>'vlc.exe'</CODE> and select "Messages..." from the "View" menu.
  
You can also run VLC from a dos command box, in which case you'll be able to use the command line arguments. You can obtain a list of these command line arguments by typing 'vlc --help' or 'vlc --help --advanced'.
+
You can also run VLC from the Windows command-line interpreter, <CODE>cmd.exe</CODE> (a.k.a. "DOS window"), in which case you'll be able to use the command-line arguments. You can obtain a list of these command line arguments by typing <CODE>'vlc --help'</CODE> or <CODE>'vlc --help --advanced'</CODE>.
  
To store a debug log of the current VLC session, you can use 'vlc -vv --extraintf=logger'. You will end-up with a vlc-log.txt file in your current directory.
+
To store a debug log of the current VLC session, you can use <CODE>'vlc -vvv --extraintf=logger'</CODE>. You will end-up with a <CODE>vlc-log.txt</CODE> file in your current directory.
  
==Building VLC from the source code==
+
==Building VLC from source==
  
 
If you want to build VLC from source, you have several choices:
 
If you want to build VLC from source, you have several choices:
Line 38: Line 38:
 
'''Not advised.''' <P>
 
'''Not advised.''' <P>
 
Even though VLC includes some MSVC project files, this method is advised only if you just want to experiment/play with some basic functionality in VLC. VLC depends on a lot of third-party libraries and building them in MSVC is inconvenient (and in some cases, impossible). <BR>  
 
Even though VLC includes some MSVC project files, this method is advised only if you just want to experiment/play with some basic functionality in VLC. VLC depends on a lot of third-party libraries and building them in MSVC is inconvenient (and in some cases, impossible). <BR>  
If you want to run VLC under the MSVC debugger, use <PRE>--fast-mutex --win9x-cv-method=1</PRE> because the debugger usually loses signals sent by PulseEvent().
+
If you want to run VLC under the MSVC debugger, use <CODE>--fast-mutex --win9x-cv-method=1</CODE> because the debugger usually loses signals sent by PulseEvent().
 
|}
 
|}
  
==Getting the right compiler tools==
+
==Obtaining the build tools==
  
; cross-compiling with mingw32
+
Each build method requires its own toolchain:
: You first need to download a GNU/Linux cross-compiler version of mingw32.
 
: For Debian GNU/Linux users, you can use the mingw32, mingw32-binutils and mingw32-runtime packages.
 
  
; compiling natively on Windows with cygwin
+
{| class="wikitable"
:You will need to download and run the setup.exe app from cygwin's web site (www.cygwin.com). You will also need to make sure you install at least the gcc-g++, gcc-mingw, mingw-runtime and win32-api packages.
+
! Method
 +
! Notes
 +
|-
 +
| Cross-compile with mingw32 on GNU/Linux
 +
|
 +
*Debian/Ubuntu users can <CODE>apt-get install mingw32 mingw32-binutils</CODE>
 +
*Gentoo users can <CODE>emerge xmingw-gcc xmingw-binutils</CODE>
 +
*Other systems may attempt http://www.mingw.org/mingwfaq.shtml#faq-cross
 +
|-
 +
| Native-compile with [http://www.cygwin.com Cygwin]
 +
| Install Cygwin, adding the optional <CODE>gcc-g++</CODE>, <CODE>gcc-mingw</CODE>, <CODE>mingw-runtime</CODE> and <CODE>win32-api</CODE> packages from the <CODE>Devel</CODE> category.
 +
|-
 +
| Native-compile with [http://www.mingw.org MSYS+MINGW]
 +
| Download and install the latest MSYS, MSYS-DTK, and MINGW from http://www.mingw.org/download.shtml. Begin with the MSYS auto-installer, then extract MINGW into <CODE>C:\MSYS\1.0\MINGW</CODE>. You also have to remember to remove the <CODE>make</CODE> utility included with MINGW as it conflicts with the one from MSYS (just rename or remove <CODE>C:\MSYS\1.0\MINGW\BIN\MAKE.EXE</CODE>).
 +
|}
  
; compiling natively on Windows with MSYS+MINGW:
+
==Saving time by using pre-built libraries==
: You will need to download and install the latest MSYS, MSYS-DTK and MINGW. The installation is really easy. Begin with the MSYS auto-installer and once this is done, extract MINGW into c:\msys\1.0\mingw. You also have to remember to remove the make utility included with MINGW as it conflicts with the one from MSYS (just rename or remove c:\msys\1.0\mingw\bin\make.exe).
 
:* http://www.mingw.org/download.shtml
 
:* http://prdownloads.sf.net/mingw/MSYS-1.0.9.exe
 
:* http://prdownloads.sf.net/mingw/MinGW-3.1.0-1.exe
 
:* http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe
 
  
==Getting the additional libraries==
+
VLC requires other open source projects to provide some features (like AC3 audio decoding and MPEG-4 video decoding).  A complete list of required libraries from these projects can be found at http://developers.videolan.org/vlc/.  Depending on your needs, you must either build your own versions of these libraries or use VLC's convenient pre-built versions.
  
VLC depends on other libraries to provide some features like ac3 audio decoding or mpeg4 video decoding, etc...
+
If you feel you must build these libraries from source, the blessed source code may be found at http://download.videolan.org/pub/testing/contrib/.  An automated way of building the contrib libraries is provided in extra/contrib. It will download, configure, and build the libraries. See the extras/contrib/README for more info.
  
Depending on your needs you will have to compile/install some or all of these
+
If you want to save yourself time and energy by using the pre-built versions of these libraries, you may download them from http://download.videolan.org/pub/testing/win32/ . The pre-built versions will ''only work with MINGW or Cygwin''.  Note that the version you download must match that of the MINGW compiler, <CODE>i586-mingw32msvc-gcc</CODE>, which you can verify by typing <CODE>'i586-mingw32msvc-gcc --ver'</CODE>.
external libraries.
 
  
They can be found here (source code):
+
There are two installation strategies:
: http://download.videolan.org/pub/testing/contrib/
 
  
We also provide a package with all the libraries already compiled so it is actually really easy to compile a full-featured version of vlc (these compiled libraries will only work with mingw or cygwin):
+
{| class="wikitable"
:http://download.videolan.org/pub/testing/win32/contrib-20061122-win32-bin-gcc-3.4.5-only.tar.bz2 (Check out for more recent versions at the same location). The gcc version mentioned (3.4.5 in this case) is that of i586-mingw32msvc-gcc, which you can verify by typing i586-mingw32msvc-gcc --ver.
+
! Location
 
+
! Command
All you need to do is extract it in your root directory (the include files and libraries will be put in /usr/win32). You can do this with the following command:
+
! Advantages
tar -xjvf contrib-20061122-win32-bin-gcc-3.4.5-only.tar.bz2 -C /
+
! Disadvantages
Please note the "-C /".
+
|-
 
+
| Install the pre-built libraries into the Cygwin standard directories (/usr/win32/*)
An automated way of building the contrib libraries is provided in extra/contrib. It will download, configure and build the libraries. See the extras/contrib/README for more info.
+
| <CODE>tar jxf contrib-20061122-win32-bin-gcc-3.4.5-only.tar.bz2 -C /</CODE> (Note the <CODE>"-C /"</CODE>!)
 
+
|
A complete list of the libraries on which we depend can be found here:
+
*Shorter initial setup time
: http://developers.videolan.org/vlc/
+
|
 +
*May conflict with other headers/libraries in the standard directories
 +
*Difficult to get rid of if you want to free up space or to upgrade to the next version of the pre-built libraries (Installing over the top of older versions is highly discouraged!)
 +
|-
 +
| Install the pre-built libraries into a project-specific directory (e.g., <CODE>D:\VLC</CODE>)
 +
| <CODE>tar jxf contrib-20061122-win32-bin-gcc-3.4.5-only.tar.bz2 -C /cygdrive/d/VLC</CODE>
 +
|
 +
*No conflicts with other projects built under Cygwin
 +
*Easy to get rid of if you want to free up space or to upgrade to the next version of the pre-built libraries
 +
*For multi-person projects, easy to put under revision control to ensure all project members are using the correct pre-built versions
 +
|
 +
*Requires that you set <CODE>CPPFLAGS</CODE>, <CODE>LDFLAGS</CODE> appropriately
 +
|}
  
 
==Configuring the build==
 
==Configuring the build==
  
Once you've got all the files you need in place, you need to configure the build with the `./configure' script.
+
Once you've got all the files you need in place, you need to configure the build with the <CODE>configure</CODE> script. In the following examples, assume that the third-party libraries are installed in <CODE>$CONTRIBS</CODE>.  If installed in the Cygwin standard directories, use <CODE>export CONTRIBS=/usr/win32</CODE>. Otherwise use <CODE>export CONTRIBS=/cygdrive/d/VLC</CODE>.
 
 
I'll assume that you are using the pre-compiled 3rd party libraries I'm providing and that they are in /usr/win32.
 
  
If you are cross-compiling from Debian, you can use something along those lines:
+
If you are cross-compiling under GNU/Linux, you can use something along these lines:
  
 
   ./bootstrap && \
 
   ./bootstrap && \
   PKG_CONFIG_LIBDIR=/usr/win32/lib/pkgconfig \
+
   export PKG_CONFIG_PATH=$CONTRIBS/lib/pkgconfig \
   CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
+
   CPPFLAGS="-I$CONTRIBS/include -I$CONTRIBS/include/ebml" CXXCPP=$CPPFLAGS \
   LDFLAGS=-L/usr/win32/lib \
+
   LDFLAGS=-L$CONTRIBS/lib \
 
   CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ \
 
   CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ \
 
   ./configure --host=i586-mingw32msvc --build=i386-linux \
 
   ./configure --host=i586-mingw32msvc --build=i386-linux \
 
       --disable-[[gtk]] \
 
       --disable-[[gtk]] \
       --enable-[[nls]] --enable-[[sdl]] --with-sdl-config-path=/usr/win32/bin \
+
       --enable-[[nls]] --enable-[[sdl]] --with-sdl-config-path=$CONTRIBS/bin \
 
       --enable-[[ffmpeg]] --with-ffmpeg-mp3lame --with-ffmpeg-[[faac]] \
 
       --enable-[[ffmpeg]] --with-ffmpeg-mp3lame --with-ffmpeg-[[faac]] \
 
       --with-ffmpeg-[[zlib]] --enable-[[faad]] --enable-[[flac]] --enable-[[theora]] \
 
       --with-ffmpeg-[[zlib]] --enable-[[faad]] --enable-[[flac]] --enable-[[theora]] \
       --with-[[wx]]-config-path=/usr/win32/bin \
+
       --with-[[wx]]-config-path=$CONTRIBS/bin \
       --with-[[freetype]]-config-path=/usr/win32/bin \
+
       --with-[[freetype]]-config-path=$CONTRIBS/bin \
       --with-[[fribidi]]-config-path=/usr/win32/bin \
+
       --with-[[fribidi]]-config-path=$CONTRIBS/bin \
       --enable-[[live555]] --with-live555-tree=/usr/win32/live.com \
+
       --enable-[[live555]] --with-live555-tree=$CONTRIBS/live.com \
       --enable-[[caca]] --with-caca-config-path=/usr/win32/bin \
+
       --enable-[[caca]] --with-caca-config-path=$CONTRIBS/bin \
       --with-[[xml2]]-config-path=/usr/win32/bin \
+
       --with-[[xml2]]-config-path=$CONTRIBS/bin \
       --with-[[dvdnav]]-config-path=/usr/win32/bin \
+
       --with-[[dvdnav]]-config-path=$CONTRIBS/bin \
 
       --disable-[[cddax]] --disable-[[vcdx]] --enable-[[goom]] \
 
       --disable-[[cddax]] --disable-[[vcdx]] --enable-[[goom]] \
 
       --enable-[[twolame]] --enable-[[dvdread]] \
 
       --enable-[[twolame]] --enable-[[dvdread]] \
Line 111: Line 126:
  
 
   ./bootstrap && \
 
   ./bootstrap && \
   PKG_CONFIG_PATH=/usr/win32/lib/pkgconfig \
+
   export PKG_CONFIG_PATH=$CONTRIBS/lib/pkgconfig \
   CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
+
  CFLAGS=-mno-cygwin CXXFLAGS=$CFLAGS \
   LDFLAGS=-L/usr/win32/lib \
+
   CPPFLAGS="-I$CONTRIBS/include -I$CONTRIBS/include/ebml" CXXCPP=$CPPFLAGS \
  CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" \
+
   LDFLAGS=-L$CONTRIBS/lib \
 
   ./configure \
 
   ./configure \
 
       --disable-gtk \
 
       --disable-gtk \
       --enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin \
+
       --enable-nls --enable-sdl --with-sdl-config-path=$CONTRIBS/bin \
 
       --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
 
       --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
 
       --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
 
       --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
       --with-wx-config-path=/usr/win32/bin \
+
       --with-wx-config-path=$CONTRIBS/bin \
       --with-freetype-config-path=/usr/win32/bin \
+
       --with-freetype-config-path=$CONTRIBS/bin \
       --with-fribidi-config-path=/usr/win32/bin \
+
       --with-fribidi-config-path=$CONTRIBS/bin \
       --enable-live555 --with-live555-tree=/usr/win32/live.com \
+
       --enable-live555 --with-live555-tree=$CONTRIBS/live.com \
       --enable-caca --with-caca-config-path=/usr/win32/bin \
+
       --enable-caca --with-caca-config-path=$CONTRIBS/bin \
       --with-xml2-config-path=/usr/win32/bin \
+
       --with-xml2-config-path=$CONTRIBS/bin \
       --with-dvdnav-config-path=/usr/win32/bin \
+
       --with-dvdnav-config-path=$CONTRIBS/bin \
 
       --disable-cddax --disable-vcdx --enable-goom \
 
       --disable-cddax --disable-vcdx --enable-goom \
 
       --enable-twolame --enable-dvdread \
 
       --enable-twolame --enable-dvdread \
 
       --enable-debug
 
       --enable-debug
  
If you want to use the emulation layer, then just omit the CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" line. You're on your own though.
+
If you want to use the emulation layer, then just omit <CODE>CFLAGS</CODE> and <CODE>CXXFLAGS</CODE>. You're on your own, though.
  
 
If you are compiling with MSYS/MINGW, then you can use something along those lines:
 
If you are compiling with MSYS/MINGW, then you can use something along those lines:
 
   ./bootstrap && \
 
   ./bootstrap && \
   PKG_CONFIG_PATH=/usr/win32/lib/pkgconfig \
+
   export PKG_CONFIG_PATH=$CONTRIBS/lib/pkgconfig \
   CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
+
   CPPFLAGS="-I$CONTRIBS/include -I$CONTRIBS/include/ebml" CXXCPP=$CPPFLAGS \
   LDFLAGS=-L/usr/win32/lib \
+
   LDFLAGS=-L$CONTRIBS/lib \
 
   ./configure \
 
   ./configure \
 
       --disable-gtk \
 
       --disable-gtk \
       --enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin \
+
       --enable-nls --enable-sdl --with-sdl-config-path=$CONTRIBS/bin \
 
       --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
 
       --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
 
       --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
 
       --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
       --with-wx-config-path=/usr/win32/bin \
+
       --with-wx-config-path=$CONTRIBS/bin \
       --with-freetype-config-path=/usr/win32/bin \
+
       --with-freetype-config-path=$CONTRIBS/bin \
       --with-fribidi-config-path=/usr/win32/bin \
+
       --with-fribidi-config-path=$CONTRIBS/bin \
       --enable-caca --with-caca-config-path=/usr/win32/bin \
+
       --enable-caca --with-caca-config-path=$CONTRIBS/bin \
       --with-xml2-config-path=/usr/win32/bin \
+
       --with-xml2-config-path=$CONTRIBS/bin \
       --with-dvdnav-config-path=/usr/win32/bin \
+
       --with-dvdnav-config-path=$CONTRIBS/bin \
 
       --disable-cddax --disable-vcdx --enable-goom \
 
       --disable-cddax --disable-vcdx --enable-goom \
 
       --enable-twolame --enable-dvdread \
 
       --enable-twolame --enable-dvdread \
Line 154: Line 169:
 
       --enable-debug
 
       --enable-debug
  
If you have used the "extras/contrib" way, you don't need to precise the CFLAGS, LDFLAGS and --with-foo-config-path=.
+
If you have used the "extras/contrib" way, you don't need to specify <CODE>CFLAGS</CODE>, <CODE>LDFLAGS</CODE> and <CODE>--with-foo-config-path=</CODE>.
 
  ./bootstrap && \
 
  ./bootstrap && \
 
   ./configure \
 
   ./configure \
Line 165: Line 180:
 
       --enable-debug
 
       --enable-debug
  
 +
See <CODE>'./configure --help'</CODE> for more information.
  
See `./configure --help' for more information.
+
==Building VLC==
  
==Actually Compiling the VLC source==
+
Once configured, to build VLC, just run <CODE>'make'</CODE>.
  
Once configured, to build VLC, just run `make'.
+
Once the compilation is done, you can either run VLC directly from the source tree or you can build self-contained VLC packages with the following <CODE>make</CODE> rules:
  
Once the compilation is done, you can either run VLC directly from the source tree or you can build self-contained VLC packages with the following 'make' rules:
+
{| class="wikitable"
 
+
! Command
  make package-win32-base
+
  ! Description
will create a subdirectory named vlc-x.x.x with all the binaries 'stripped' (ie. without any debugging symbols).
+
|-
 
+
| <CODE>make package-win32-base</CODE>
make package-win32-zip
+
| Creates a subdirectory named <CODE>vlc-x.x.x</CODE> with all the binaries 'stripped' (that is, smallest size, unusable with a debugger)
Same as above but will package the directory in a zip file.
+
|-
 
+
| <CODE>make package-win32-zip</CODE>
make package-win32
+
| 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.
+
|-
 +
| <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.
 +
|}
  
'''''Well done, now you're ready to use VLC!'''''
+
'''''Well done&mdash;you're ready to use VLC!'''''
  
 
[[Category:Building]]
 
[[Category:Building]]

Revision as of 20:54, 9 March 2007

From http://developers.videolan.org/vlc/vlc/INSTALL.win32

$Id: INSTALL.win32 15707 2006-05-22 09:42:08Z xtophe $
INSTALL file for the Windows9x/Me/NT4/2k/XP version of the VLC media player

Before you start

One common desire that leads people to want to rebuild VLC is to "rebuild a debug version" or "add printf()s", but this is not strictly necessary, as VLC includes a debug logging feature by default. If you are using a binary release (or have already built VLC), just run 'vlc.exe' and select "Messages..." from the "View" menu.

You can also run VLC from the Windows command-line interpreter, cmd.exe (a.k.a. "DOS window"), in which case you'll be able to use the command-line arguments. You can obtain a list of these command line arguments by typing 'vlc --help' or 'vlc --help --advanced'.

To store a debug log of the current VLC session, you can use 'vlc -vvv --extraintf=logger'. You will end-up with a vlc-log.txt file in your current directory.

Building VLC from source

If you want to build VLC from source, you have several choices:

Method Documentation Notes
Cross-compile with mingw32 on GNU/Linux None Preferred cross-compilation method
Native-compile with Cygwin Win32CompileCygwin Preferred native compilation method
Native-compile with MSYS+MINGW Win32CompileMSYS MSYS is a minimal build environment to compile Unixish projects under Microsoft Windows. It provides all the commonly-required Unix tools (like sh, gmake, and so forth). Please note that the gettext utilities are not included in the default MSYS/MINGW packages so you won't be able to build VLC with i18n support.
Native-compile with Microsoft Visual C++ None Not advised.

Even though VLC includes some MSVC project files, this method is advised only if you just want to experiment/play with some basic functionality in VLC. VLC depends on a lot of third-party libraries and building them in MSVC is inconvenient (and in some cases, impossible).
If you want to run VLC under the MSVC debugger, use --fast-mutex --win9x-cv-method=1 because the debugger usually loses signals sent by PulseEvent().

Obtaining the build tools

Each build method requires its own toolchain:

Method Notes
Cross-compile with mingw32 on GNU/Linux
Native-compile with Cygwin Install Cygwin, adding the optional gcc-g++, gcc-mingw, mingw-runtime and win32-api packages from the Devel category.
Native-compile with MSYS+MINGW Download and install the latest MSYS, MSYS-DTK, and MINGW from http://www.mingw.org/download.shtml. Begin with the MSYS auto-installer, then extract MINGW into C:\MSYS\1.0\MINGW. You also have to remember to remove the make utility included with MINGW as it conflicts with the one from MSYS (just rename or remove C:\MSYS\1.0\MINGW\BIN\MAKE.EXE).

Saving time by using pre-built libraries

VLC requires other open source projects to provide some features (like AC3 audio decoding and MPEG-4 video decoding). A complete list of required libraries from these projects can be found at http://developers.videolan.org/vlc/. Depending on your needs, you must either build your own versions of these libraries or use VLC's convenient pre-built versions.

If you feel you must build these libraries from source, the blessed source code may be found at http://download.videolan.org/pub/testing/contrib/. An automated way of building the contrib libraries is provided in extra/contrib. It will download, configure, and build the libraries. See the extras/contrib/README for more info.

If you want to save yourself time and energy by using the pre-built versions of these libraries, you may download them from http://download.videolan.org/pub/testing/win32/ . The pre-built versions will only work with MINGW or Cygwin. Note that the version you download must match that of the MINGW compiler, i586-mingw32msvc-gcc, which you can verify by typing 'i586-mingw32msvc-gcc --ver'.

There are two installation strategies:

Location Command Advantages Disadvantages
Install the pre-built libraries into the Cygwin standard directories (/usr/win32/*) tar jxf contrib-20061122-win32-bin-gcc-3.4.5-only.tar.bz2 -C / (Note the "-C /"!)
  • Shorter initial setup time
  • May conflict with other headers/libraries in the standard directories
  • Difficult to get rid of if you want to free up space or to upgrade to the next version of the pre-built libraries (Installing over the top of older versions is highly discouraged!)
Install the pre-built libraries into a project-specific directory (e.g., D:\VLC) tar jxf contrib-20061122-win32-bin-gcc-3.4.5-only.tar.bz2 -C /cygdrive/d/VLC
  • No conflicts with other projects built under Cygwin
  • Easy to get rid of if you want to free up space or to upgrade to the next version of the pre-built libraries
  • For multi-person projects, easy to put under revision control to ensure all project members are using the correct pre-built versions
  • Requires that you set CPPFLAGS, LDFLAGS appropriately

Configuring the build

Once you've got all the files you need in place, you need to configure the build with the configure script. In the following examples, assume that the third-party libraries are installed in $CONTRIBS. If installed in the Cygwin standard directories, use export CONTRIBS=/usr/win32. Otherwise use export CONTRIBS=/cygdrive/d/VLC.

If you are cross-compiling under GNU/Linux, you can use something along these lines:

 ./bootstrap && \
 export PKG_CONFIG_PATH=$CONTRIBS/lib/pkgconfig \
 CPPFLAGS="-I$CONTRIBS/include -I$CONTRIBS/include/ebml" CXXCPP=$CPPFLAGS \
 LDFLAGS=-L$CONTRIBS/lib \
 CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ \
 ./configure --host=i586-mingw32msvc --build=i386-linux \
     --disable-gtk \
     --enable-nls --enable-sdl --with-sdl-config-path=$CONTRIBS/bin \
     --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
     --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
     --with-wx-config-path=$CONTRIBS/bin \
     --with-freetype-config-path=$CONTRIBS/bin \
     --with-fribidi-config-path=$CONTRIBS/bin \
     --enable-live555 --with-live555-tree=$CONTRIBS/live.com \
     --enable-caca --with-caca-config-path=$CONTRIBS/bin \
     --with-xml2-config-path=$CONTRIBS/bin \
     --with-dvdnav-config-path=$CONTRIBS/bin \
     --disable-cddax --disable-vcdx --enable-goom \
     --enable-twolame --enable-dvdread \
     --enable-debug

If you are using cygwin, you can build VLC with or without the POSIX emulation layer. Without is usually better and with POSIX emulation hasn't been tested in about a year or so. So to build without the emulation layer, use something like this:

 ./bootstrap && \
 export PKG_CONFIG_PATH=$CONTRIBS/lib/pkgconfig \
 CFLAGS=-mno-cygwin CXXFLAGS=$CFLAGS \
 CPPFLAGS="-I$CONTRIBS/include -I$CONTRIBS/include/ebml" CXXCPP=$CPPFLAGS \
 LDFLAGS=-L$CONTRIBS/lib \
 ./configure \
     --disable-gtk \
     --enable-nls --enable-sdl --with-sdl-config-path=$CONTRIBS/bin \
     --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
     --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
     --with-wx-config-path=$CONTRIBS/bin \
     --with-freetype-config-path=$CONTRIBS/bin \
     --with-fribidi-config-path=$CONTRIBS/bin \
     --enable-live555 --with-live555-tree=$CONTRIBS/live.com \
     --enable-caca --with-caca-config-path=$CONTRIBS/bin \
     --with-xml2-config-path=$CONTRIBS/bin \
     --with-dvdnav-config-path=$CONTRIBS/bin \
     --disable-cddax --disable-vcdx --enable-goom \
     --enable-twolame --enable-dvdread \
     --enable-debug

If you want to use the emulation layer, then just omit CFLAGS and CXXFLAGS. You're on your own, though.

If you are compiling with MSYS/MINGW, then you can use something along those lines:

 ./bootstrap && \
 export PKG_CONFIG_PATH=$CONTRIBS/lib/pkgconfig \
 CPPFLAGS="-I$CONTRIBS/include -I$CONTRIBS/include/ebml" CXXCPP=$CPPFLAGS \
 LDFLAGS=-L$CONTRIBS/lib \
 ./configure \
     --disable-gtk \
     --enable-nls --enable-sdl --with-sdl-config-path=$CONTRIBS/bin \
     --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
     --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
     --with-wx-config-path=$CONTRIBS/bin \
     --with-freetype-config-path=$CONTRIBS/bin \
     --with-fribidi-config-path=$CONTRIBS/bin \
     --enable-caca --with-caca-config-path=$CONTRIBS/bin \
     --with-xml2-config-path=$CONTRIBS/bin \
     --with-dvdnav-config-path=$CONTRIBS/bin \
     --disable-cddax --disable-vcdx --enable-goom \
     --enable-twolame --enable-dvdread \
     --disable-mkv \
     --enable-debug

If you have used the "extras/contrib" way, you don't need to specify CFLAGS, LDFLAGS and --with-foo-config-path=.

./bootstrap && \
 ./configure \
     --disable-gtk \
     --enable-nls --enable-sdl \
     --enable-ffmpeg --enable-faad --enable-flac --enable-theora \
     --disable-cddax --disable-vcdx --enable-goom \
     --enable-twolame --enable-dvdread \
     --enable-mkv --enable-caca --enable-live555\
     --enable-debug

See './configure --help' for more information.

Building VLC

Once configured, to build VLC, just run 'make'.

Once the compilation is done, you can either run VLC directly from the source tree or you can build self-contained VLC packages with the following make rules:

Command Description
make package-win32-base Creates a subdirectory named vlc-x.x.x with all the binaries 'stripped' (that is, smallest size, unusable with a debugger)
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!