Using MingW to build VLC from the source

 
Submitted by yuz on Mon, 2006-04-10 21:46. Cross-Platform | MultiMedia | Programming

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.

  1. uncheck the "TAR file smart CR/LF conversion" checkbox found in the WinZip Configuration -> Miscellaneous tab of the Options menu.
  2. install MSYS-1.0.10.exe to c:/msys/1.0
  3. unzip mingw-runtime-3.9.tar.gz to c:/msys/1.0/mingw
  4. unzip w32api-3.6.tar.gz to c:/msys/1.0/mingw
  5. unzip binutils-2.15.91-20040904-1.tar.gz to c:/msys/1.0/mingw
  6. unzip gcc-core-3.4.2-20040916-1.tar.gz to c:/msys/1.0/mingw
  7. unzip gcc-g++-3.4.2-20040916-1.tar.gz to c:/msys/1.0/mingw
  8. unzip mingw-utils-0.3.tar.gz to c:/msys/1.0/mingw
  9. install msysDTK-1.0.1.exe to c:/msys/1.0
  10. install gdb-5.2.1-1.exe to c:/msys/1.0
  11. install gettext-0.10.40-20011107.zip to c:/msys/1.0/local
  12. 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

  1. run ./bootstrap
  2. edit configure, go to line 29960, comment out PKG_PROG_PKG_CONFIG(), save.
  3. 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

     

  4. run ./config
  5. edit vlc-0.8.5-test2/src/misc/charset.c file, insert "#include 'locale.h'" at line 47, save it.
  6. 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/
  7. 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".
  8. 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值