VLC 源码编译

参考文章:

http://wiki.videolan.org/Compile_VLC

http://wiki.videolan.org/Win32Compile

http://blog.csdn.net/szu030606/article/details/7212343

 

其中,lua的安装参考:http://www.cnblogs.com/fightLonely/archive/2012/04/28/2474831.html

Building Methods

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

MethodDocumentationNotes
Cross-compile with Mingw on LinuxThis pagePreferred method (uses cross compilation). On Windows, you should do it in a virtual machine.
Native compilation withMSYS+MINGWWin32CompileMSYSNewNative compilation method. MSYS is a minimal build environment to compile Unixish projects under Microsoft Windows.
Native compilation with cygwinWin32CompileCygwinNewBuild using cygwin as your compile environment. Error prone, and slow.

 

Obtaining the toolchain

Compiler and binary toolchain

To compile VLC for Windows (32-bits or 64-bits), the Mingw-w64 toolchain is required:

  • Debian/Ubuntu: run apt-get install gcc-mingw-w64-i686

Up to versions 2.0.x, VLC was compiled with the older mingw32 toolchain, which only supports 32-bits Windows. If you have problems with mingw-w64, you can try mingw32 instead:

Development tools

You will also need:

  • lua5.1
  • all autotools: libtool, automake, autoconf, autopoint, make, gettext
  • pkg-config
  • git
  • subversion
  • cmake, cvs if you want to rebuild contribs
  • zip [for creating .zip package], p7zip [for .7z package], nsis [for .exe auto-installer].

Host triplet

A number of example commands below include the identifier of the toolchain. This value is essential: it instructs the build system to use the correct toolchain and compile the program for Windows. Without the value, the build system will perform a native compilation for Linux (or whatever your computer runs). With an incorrect value, the build will fail.

This is known as the host triplet, although it's more of a pair than a triplet in the case of Mingw. The exact value depends on your installation of the toolchain. Notably on Debian/Ubuntu, these values must be used:

  • i686-w64-mingw32 for Windows 32-bits, using the Mingw-w64 toolchain
  • x86_64-w64-mingw32 for Windows 64-bits, using the Mingw-w64 toolchain
  • i586-mingw32msvc for Windows 32-bits, using the Mingw32 toolchain

Again, you MUST substitute the value in the following command snippets.

Get the source code

$ git clone git://git.videolan.org/vlc.git

Prepare 3rd party libraries

Before compiling VLC, you need lots of other libraries. Here is how to get them:

 $ mkdir -p contrib/win32
 $ cd contrib/win32
 $ ../bootstrap --host=i586-mingw32msvc
 $ make prebuilt

or, if you want to compile the contribs yourself and are feeling adventurous and have lots of time to burn,

 $ mkdir -p contrib/win32
 $ cd contrib/win32
 $ ../bootstrap --host=i586-mingw32msvc
 $ make fetch
 $ make

Linux 64-bit

If you are on Linux 64-bit, you MUST remove some files:

 $ rm -f ../i586-mingw32msvc/bin/moc ../i586-mingw32msvc/bin/uic ../i586-mingw32msvc/bin/rcc

In addition, install the qt4-tools package.

Fix your contrib path

If your Mingw prefix is not i586-mingw32msvc (you are NOT on Debian or Ubuntu), create a symlink to contribs:

 $ ln -sf ../i586-mingw32msvc ../i486-mingw32

Go Back

Go back to the VLC source directory:

 $ cd -

Configuring the build

Bootstrap

First, prepare the tree:

 $ ./bootstrap

Configure

Then you can to configure the build with the ./configure script.

Create a subfolder:

 $ mkdir win32 && cd win32

Use the standard configuration:

$ ../extras/package/win32/configure.sh --host=i586-mingw32msvc

NB: use YOUR Xcompiling prefix here, like i486-mingw32


Alternatively, you can run configure manually:

$ ../configure --host=i586-mingw32msvc

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

Building VLC

Once configured, to build VLC, just run:

 $ make

Packaging VLC

Once the compilation is done, you can build self-contained VLC packages with the following make rules:

CommandDescription
make package-win-commonCreates a subdirectory named vlc-x.x.x with all the binaries. You can run VLC directly from this directory.
make package-win-strip (might be package-win32-strip)Same as above but will create 'stripped' binaries (that is, smallest size, unusable with a debugger).
make package-win32-7zipSame as above but will package the directory in a 7z file.
make package-win32-zipSame as above but will package the directory in a zip file.
make package-win32Same as above but will also create an auto-installer package. You must have NSIS installed in its default location for this to work.

转载于:https://www.cnblogs.com/fightLonely/archive/2012/05/16/2504227.html

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值