windows环境vlc-1.1.10编译过程

来源:互联网 发布:公司信息采集软件 编辑:程序博客网 时间:2024/06/04 06:53

vlc常见的编译方式主要有两种:1、cygwin; 2、mingw+msys;

 

下面主要介绍第一种(windows xp系统,win7系统出现的编译错误比较多,暂未研究)

一、cygwin的安装

       cygwin安装过程中主要是要注意安装包的选择,以下为vlc编译过程中需要的安装包,安装过程中注意选择一下安装包,否则在编译过程中容易“粗线”错误;

作者使用的cygwin版本为Cygwin-new(20081208);

 
Archive        
                unzip   
                zip   
Devel        
                autoconf   
automake
                binutils   
                cvs   
                gcc   
                gcc-core   
                gcc-g++   
                gcc-mingw   
                gcc-mingw-core   
                gcc-mingw-g++   
                gdb   
                gettext   
                gettext-devel
                git   
                libiconv
                libgcrypt-devel
                libtool   
                make   
                mingw-runtime
                nasm
                patchutils
                pkg-config   
                subversion   
Editor        
                vim   
Libs        
                expat
                libgcrypt
Web        
                curl
                wget

2、下载源码及相关库

     源码下载地址:http://download.videolan.org/pub/videolan/vlc     、、各种版本,我选择的是1.1.10

     第三方库:http://download.videolan.org/pub/testing/win32/         、、vlc编译需要第三方库,相应的vlc版本要用相应的vlc第三方库,否则编译容易出现问题;

作者选择的源码及库:vlc-1.1.10.tar.bz2 + contrib-20110224-win32-bin-gcc-4.4.4-runtime-3.17-only.tar.bz2

     vlc-1.1.10编译还需要lua库:http://www.lua.org/ftp/lua-5.1.4.tar.gz

3、编译过程

     (1)启动cygwin

第一次运行Cygwin,产生如下文字表示启动成功,并且在根目录'/'下就会生成 “ /home/你的计算机名 ” 的文件夹:

Copying skeleton files.
These files are for the user to personalise
their cygwin experience.

These will never be overwritten.

`./.bashrc' -> `/home/wangwei1//.bashrc'
`./.bash_profile' -> `/home/wangwei1//.bash_profile'
`./.inputrc' -> `/home/wangwei1//.inputrc'

     (2)安装lua

将vlc-1.1.10、第三方库和lua 三个压缩包拷贝至“ /home/你的计算机名 ”

在cygwin终端运行命令:tar xzvf lua-5.1.4.tar.gz

                                        make ansi

                                        make install

如果安装成功,运行luac会出现如下文字:

c:/cygwin_new/usr/local/bin/luac.exe: no input files given
usage: d:/cygwin_new/usr/local/bin/luac.exe [options] [filenames].
Available options are:
    -                process stdin
    -l             list
    -o name    output to file 'name' (default is "luac.out")
    -p             parse only
    -s             strip debug information
    -v             show version information
    --             stop handling options

 

     (3)解压vlc-1.1.10和第三方库

              运行命令: tar xjvf  vlc-1.1.10.tar.bz2

                                 tar xjvf  contrib-20110224-win32-bin-gcc-4.4.4-runtime-3.17-only.tar.bz2 -C /

       (4) 进入vlc-1.1.10

             cd vlc-1.1.10

             执行命令 ./bootstrap

成功后会显示

Successfully bootstrapped
 
        (5)执行myvlc.sh配置文件
 
在vlc-1.1.10目录下新建文件myvlc.sh, 将下列内容拷贝至myvlc.sh保存
PATH=/usr/win32/bin:$PATH \
PKG_CONFIG_LIBDIR=/usr/win32/lib/pkgconfig \
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
LDFLAGS=-L/usr/win32/lib \
CC="gcc -mno-cygwin -Wl,--allow-multiple-definition" CXX="g++ -mno-cygwin" \
./configure \
--host=i686-pc-mingw32 \
--enable-nls --enable-sdl \
--enable-avcodec --enable-avformat --enable-swscale \
--enable-faad --enable-flac --enable-theora \
--enable-freetype \
--enable-fribidi \
--disable-fluidsynth \
--enable-live555 --with-live555-tree=/usr/win32/live.com \
--enable-caca \
--with-dvdnav-config-path=/usr/win32/bin \
--disable-vcdx --enable-goom \
--enable-twolame --enable-dvdread \
--enable-debug --enable-dca \
--disable-mkv --disable-taglib --disable-projectm \
--disable-zvbi --disable-schroedinger --disable-dirac \
--enable-mozilla --with-mozilla-sdk-path=/usr/win32/gecko-sdk \
--disable-upnp
 
保存完毕执行命令 ./myvlc.sh
 
成功后会显示
libvlc configuration
--------------------
version                             : 1.1.5
system                                : mingw32
architecture                    : i686 mmx sse sse2
build  flavour                 : debug devel
vlc  aliases                     : cvlc rvlc svlc qvlc
plugins/bindings            : activex mozilla

You can tune the compiler flags in vlc-config.
To build vlc and its plugins, type `./compile' or `make'.
 

         (6)稍加修改

       修改libtool第144行
                修改 global_symbol_pipe=""    为    global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" 
        注释掉Makefile.am文件如下三行,就是行首加入#
               #             cp "$(top_srcdir)/extras/package/win32/vlc.exe.manifest" "$(win32_destdir)/" 
               #             cp $(top_srcdir)/projects/mozilla/npvlc.dll.manifest $(win32_destdir)/mozilla/ 
               #             cp $(top_srcdir)/projects/activex/axvlc.dll.manifest $(win32_destdir)/activex/
       (7)编译
        执行命令
                  make
        成功后,执行
make package-win32-base
     

 

 

原创粉丝点击