Finally I've successfully built VLC on WinXP! This whole build process is not as easy as I expected. So now I'm documenting the whole process here in case I forget it in the future.
In the last few days I've been researching a cross-platform DVD player alternative to replace my own YZDVD, which is Win32 only. Between Mplayer and VLC, I choose VLC to play with because I like its modular extensible architecture.
Now, why do I pick MingW over CygWin? Because I hate to make too many choices in a short period of time:-) CygWin is huge with so many packages! No, this is not a rational reason, in fact, I will be trying CygWin pretty soon.
First, install MSYS+MingW environment.
- uncheck the "TAR file smart CR/LF conversion" checkbox found in the WinZip Configuration -> Miscellaneous tab of the Options menu.
- install MSYS-1.0.10.exe to c:\msys\1.0
- unzip mingw-runtime-3.9.tar.gz to c:\msys\1.0\mingw
- unzip w32api-3.6.tar.gz to c:\msys\1.0\mingw
- unzip binutils-2.15.91-20040904-1.tar.gz to c:\msys\1.0\mingw
- unzip gcc-core-3.4.2-20040916-1.tar.gz to c:\msys\1.0\mingw
- unzip gcc-g++-3.4.2-20040916-1.tar.gz to c:\msys\1.0\mingw
- unzip mingw-utils-0.3.tar.gz to c:\msys\1.0\mingw
- install msysDTK-1.0.1.exe to c:\msys\1.0
- install gdb-5.2.1-1.exe to c:\msys\1.0
- install gettext-0.10.40-20011107.zip to c:\msys\1.0\local
- set up environment variable HOME pointing to c:\home
Second, download VLC source vlc-snapshot-20060410.tar.gz, unzip it to c:\home.
Third, download contrib-20060330-win32-bin-gcc-3.4.5-only.tar.bz2 from http://download.videolan.org/pub/, extract it in your root directory with the following command:
"tar xjvf contrib-20060330-win32-bin-gcc-3.4.5-only.tar.bz2 -C /"
Fourth, build VLC source, enter directory vlc-0.8.5-test2
- run ./bootstrap
- edit configure, go to line 29960, comment out PKG_PROG_PKG_CONFIG(), save.
- create a script named "config", save it with these lines:
#! /bin/sh
PKG_CONFIG_PATH=/usr/win32/lib/pkgconfig \
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml -I/usr/local/include" \
LDFLAGS="-L/usr/win32/lib -L/usr/local/lib" \
./configure \
--disable-gtk \
--disable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin \
--enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
--with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
--with-wx-config-path=/usr/win32/bin \
--with-freetype-config-path=/usr/win32/bin \
--with-fribidi-config-path=/usr/win32/bin \
--enable-caca --with-caca-config-path=/usr/win32/bin \
--with-xml2-config-path=/usr/win32/bin \
--with-dvdnav-config-path=/usr/win32/bin \
--disable-cddax --disable-vcdx --enable-goom \
--enable-twolame --enable-dvdread \
--disable-mkv --disable-hal \
--enable-debug
- run ./config
- edit vlc-0.8.5-test2/src/misc/charset.c file, insert "#include 'locale.h'" at line 47, save it.
- run make in directory vlc-0.8.5-test2. wait half hour and you will see vlc.exe is created in vlc-0.8.5-test2/
- open Makefile in vlc-0.8.5-test2/, comment out lines from 1629 to 1631. modify line 1667, 1668, change "sed -i" to "sed -e".
- run make package-win32-base, this creates a sub directory for installation packaging.
I believe some of the manual modifications above won't be necessary if I do the build in a CygWin environment. I will find out pretty soon.