Difference between revisions of "UnixCompile"

From VideoLAN Wiki
Jump to navigation Jump to search
m (ubuntu specific info on easy configuration for the make)
Line 1: Line 1:
==Prepare your environment==
+
== Prepare your environment ==
VLC uses gcc, automake, autoconf and friends for compilation. Make sure they are up to date and usable for your system.
 
  
==Get the source==
+
VLC uses gcc, automake, autoconf and friends for compilation. Make sure they are up to date and usable for your system.
Start by [[GetTheSource|getting the source]], using FTP for releases, or using [[Git]] for development.
+
 
 +
== Get the source ==
 +
 
 +
Start by [[GetTheSource|getting the source]], using FTP for releases, or using [[Git]] for development.
 +
 
 +
If your are using the release, download source code and extract the archive and go into your VLC directory.  
  
If your are using the release, download source code and extract the archive and go into your VLC directory.
 
 
  % cd /path/to/your/vlc/folder/
 
  % cd /path/to/your/vlc/folder/
  
If you are using the [[Git]] version, start by bootstrapping your VLC.
+
If you are using the [[Git]] version, start by bootstrapping your VLC.  
 +
 
 
  % cd /path/to/your/vlc/folder/
 
  % cd /path/to/your/vlc/folder/
 
  % ./bootstrap
 
  % ./bootstrap
  
== Get the 3rd party libs ==
+
== Get the 3rd party libs ==
Now you can start to configure VLC. Remember to first take a look at <tt>./configure --help</tt>. Take a good look at that enormous list of options.
 
  
=== General info ===
+
Now you can start to configure VLC. Remember to first take a look at <tt>./configure --help</tt>. Take a good look at that enormous list of options.  
It is very important that you install and enable all the 3rd party libraries that you will be needing and let me tell you that that are a lot. If you don't install them you will end up with an application that well..... essentially doesn't do anything.
 
See [[Contrib_Status|here]] for a complete list.
 
  
There are some very important dependencies: gettext (nls) for international support (required), libdvbpsi for mpeg files and streams support, libmad for mp3 decoding, libmpeg2 for mpeg 1 and 2 video support, ffmpeg (libavcodec, libavformats, libswscale) for support of mpeg4 and many other types of video, liba52 for dolby (AC3) sound, alsa for proper audio output, xvideo for proper video output, QT4 for proper GUI support and libdvd* for DVD support.
+
=== General info  ===
 +
 
 +
It is very important that you install and enable all the 3rd party libraries that you will be needing and let me tell you that that are a lot. If you don't install them you will end up with an application that well..... essentially doesn't do anything. See [[Contrib Status|here]] for a complete list.
 +
 
 +
There are some very important dependencies: gettext (nls) for international support (required), libdvbpsi for mpeg files and streams support, libmad for mp3 decoding, libmpeg2 for mpeg 1 and 2 video support, ffmpeg (libavcodec, libavformats, libswscale) for support of mpeg4 and many other types of video, liba52 for dolby (AC3) sound, alsa for proper audio output, xvideo for proper video output, QT4 for proper GUI support and libdvd* for DVD support.  
  
 
'''Be careful!''' Some of the libraries are better not to be installed (at all, beware of old installations) and should be linked to directly. These are mostly ffmpeg and liveMedia.  
 
'''Be careful!''' Some of the libraries are better not to be installed (at all, beware of old installations) and should be linked to directly. These are mostly ffmpeg and liveMedia.  
  
There are also some libraries that are no longer being maintained and which we advise not to use. These include the gtk, gnome and kde GUIs, the glide and mga modules.
+
There are also some libraries that are no longer being maintained and which we advise not to use. These include the gtk, gnome and kde GUIs, the glide and mga modules.
 +
 
 +
=== Get'em ===
 +
 
 +
There are a few ways to get those libs. You should use only one method at a time:
 +
 
 +
*'''The preferred way''': Using your distribution or portage system, in order to get all the needed libs.
  
===Get'em===
+
For example on Debian or Ubuntu:  
There are a few ways to get those libs. You should use only one method at a time:
 
  
* '''The preferred way''': Using your distribution or portage system, in order to get all the needed libs.
 
For example on Debian or Ubuntu:
 
 
  # apt-get build-dep vlc
 
  # apt-get build-dep vlc
  
* If your distro is really bad and doesn't provide the libs, no -dev or -devel packages: Using the contribs system in VLC's sources
+
*If your distro is really bad and doesn't provide the libs, no -dev or -devel packages: Using the contribs system in VLC's sources
  % cd extras/contrib;
+
 
  % ./bootstrap;
+
&nbsp;% cd extras/contrib;
  % make;
+
&nbsp;% ./bootstrap;
 +
&nbsp;% make;
  
This should download and build a lot of those libs for you.
+
This should download and build a lot of those libs for you.  
  
* Read the [[Contrib_Status|list]], download them and build by hand.
+
*Read the [[Contrib Status|list]], download them and build by hand.
  
== Configuration ==
+
== Configuration ==
  
You need to tweak your configure line.
+
You need to tweak your configure line.
 +
 
 +
<tt>./configure</tt> is used to check whether your system is able to compile VLC. Also you choose the functionalities of your build.  
  
<tt>./configure</tt> is used to check whether your system is able to compile VLC.
 
Also you choose the functionalities of your build.
 
 
  % ./configure --help
 
  % ./configure --help
will show you the various options
 
  
===Special libs ===
+
will show you the various options
Use <tt>--with-live555-path=path/to/livemedia/source/tree</tt> in connection with --enable-live555</tt>.
+
 
For ffmpeg, the only reliable way for VLC's configure to know how your ffmpeg's libs were compiled is to use pkg-config. So you need to set PKG_CONFIG_PATH correctly if your ffmpeg is not installed at the default place or you want to use static linking.
+
=== Special libs ===
 +
 
 +
Use <tt>--with-live555-path=path/to/livemedia/source/tree</tt> in connection with --enable-live555&lt;/tt&gt;. For ffmpeg, the only reliable way for VLC's configure to know how your ffmpeg's libs were compiled is to use pkg-config. So you need to set PKG_CONFIG_PATH correctly if your ffmpeg is not installed at the default place or you want to use static linking.  
 +
 
 +
=== Final configuration  ===
 +
 
 +
If you want to install VLC into another directory, run
  
=== Final configuration ===
 
If you want to install VLC into another directory, run
 
 
  % ./configure --prefix=/path/to/install/folder/
 
  % ./configure --prefix=/path/to/install/folder/
  
This is an example of a typical VLC configure line:
+
This is an example of a typical VLC configure line:  
 +
 
 
  % ./configure --enable-x11 --enable-xvideo --disable-gtk --enable-sdl --enable-avcodec --enable-avformat --enable-swscale --enable-mad --enable-libdvbpsi --enable-a52 --enable-libmpeg2 --enable-dvdnav --enable-faad --enable-vorbis --enable-ogg --enable-theora --enable-faac --enable-mkv --enable-freetype --enable-fribidi --enable-speex --enable-flac --enable-live555 --with-live555-tree=/usr/lib/live --enable-caca --enable-skins --enable-skins2 --enable-alsa --disable-kde --enable-qt4 --enable-ncurses --enable-release
 
  % ./configure --enable-x11 --enable-xvideo --disable-gtk --enable-sdl --enable-avcodec --enable-avformat --enable-swscale --enable-mad --enable-libdvbpsi --enable-a52 --enable-libmpeg2 --enable-dvdnav --enable-faad --enable-vorbis --enable-ogg --enable-theora --enable-faac --enable-mkv --enable-freetype --enable-fribidi --enable-speex --enable-flac --enable-live555 --with-live555-tree=/usr/lib/live --enable-caca --enable-skins --enable-skins2 --enable-alsa --disable-kde --enable-qt4 --enable-ncurses --enable-release
 
   
 
   
[[User:J-b#VLC_configure_line|Here]] is another.
 
  
== Compilation ==
+
[[User:J-b#VLC_configure_line|Here]] is another.
Compile VLC:
+
 
 +
== Ubuntu  ==
 +
 
 +
If you get continuous errors while ./configure then consider reinstalling the corresponding libraries. This will set the paths and other information correctly. Check the $PKG_CONFIG_PATH(environment variable) whether it is set to a path where the libraries like libavcodec.pc are available. Otherwise create the environment variable.
 +
 
 +
== Compilation ==
 +
 
 +
Compile VLC:  
 +
 
 
  % make
 
  % make
  
As root (type "su" to change to root account):
+
As root (type "su" to change to root account):  
 +
 
 
  # make install
 
  # make install
  
To remove files created during the compile (optional) type:
+
To remove files created during the compile (optional) type:  
 +
 
 
  % make clean
 
  % make clean
  
== Notes ==
+
== Notes ==
=== Cygwin ===
+
 
Compiling on [[Win32CompileCygwin|Cygwin]] may be broken from time to time.
+
=== Cygwin ===
 +
 
 +
Compiling on [[Win32CompileCygwin|Cygwin]] may be broken from time to time.  
 +
 
 +
=== Debian  ===
 +
 
 +
Debian users who want to compile VLC should install the packages below. Note: If you just want to ''use'' VLC media player then simply install the package vlc (<tt>sudo apt-get install vlc</tt>) - the unstable version is normally very up-to-date (and stable is, er, stable&nbsp;;-)
 +
 
 +
*[http://packages.debian.org/unstable/libdevel/libavcodec-dev libavcodec-dev]
 +
*[http://packages.debian.org/unstable/libdevel/libpostproc-dev libpostproc-dev]
 +
*[http://packages.debian.org/unstable/libdevel/libmpeg2-4-dev libmpeg2-4-dev]
  
=== Debian ===
+
== Version  ==
Debian users who want to compile VLC should install the packages below.
 
Note: If you just want to ''use'' VLC media player then simply install the package vlc (<tt>sudo apt-get install vlc</tt>) - the unstable version is normally very up-to-date (and stable is, er, stable ;-)
 
* [http://packages.debian.org/unstable/libdevel/libavcodec-dev libavcodec-dev]
 
* [http://packages.debian.org/unstable/libdevel/libpostproc-dev libpostproc-dev]
 
* [http://packages.debian.org/unstable/libdevel/libmpeg2-4-dev libmpeg2-4-dev]
 
  
== Version ==
+
This HOWTO has been originally written by [mailto:hartman_at_videolan_dot_org Derk-Jan Hartman].  
This HOWTO has been originally written by [mailto:hartman_at_videolan_dot_org Derk-Jan Hartman].
 
  
It has been modified and updated by [[User:J-b| Jean-Baptiste Kempf]].
+
It has been modified and updated by [[User:J-b|Jean-Baptiste Kempf]].  
  
It was spelled-checked and sudoed by [[User:materthron|materthron]].
+
It was spelled-checked and sudoed by [[User:Materthron|materthron]].  
  
Further spell-checking, grammar corrections, and replaced a word with "bad" by [[User:Neo_The_User|Neo_The_User]].
+
Further spell-checking, grammar corrections, and replaced a word with "bad" by [[User:Neo The User|Neo_The_User]].  
  
 
[[Category:Building]]
 
[[Category:Building]]

Revision as of 14:06, 17 March 2010

Prepare your environment

VLC uses gcc, automake, autoconf and friends for compilation. Make sure they are up to date and usable for your system.

Get the source

Start by getting the source, using FTP for releases, or using Git for development.

If your are using the release, download source code and extract the archive and go into your VLC directory.

% cd /path/to/your/vlc/folder/

If you are using the Git version, start by bootstrapping your VLC.

% cd /path/to/your/vlc/folder/
% ./bootstrap

Get the 3rd party libs

Now you can start to configure VLC. Remember to first take a look at ./configure --help. Take a good look at that enormous list of options.

General info

It is very important that you install and enable all the 3rd party libraries that you will be needing and let me tell you that that are a lot. If you don't install them you will end up with an application that well..... essentially doesn't do anything. See here for a complete list.

There are some very important dependencies: gettext (nls) for international support (required), libdvbpsi for mpeg files and streams support, libmad for mp3 decoding, libmpeg2 for mpeg 1 and 2 video support, ffmpeg (libavcodec, libavformats, libswscale) for support of mpeg4 and many other types of video, liba52 for dolby (AC3) sound, alsa for proper audio output, xvideo for proper video output, QT4 for proper GUI support and libdvd* for DVD support.

Be careful! Some of the libraries are better not to be installed (at all, beware of old installations) and should be linked to directly. These are mostly ffmpeg and liveMedia.

There are also some libraries that are no longer being maintained and which we advise not to use. These include the gtk, gnome and kde GUIs, the glide and mga modules.

Get'em

There are a few ways to get those libs. You should use only one method at a time:

  • The preferred way: Using your distribution or portage system, in order to get all the needed libs.

For example on Debian or Ubuntu:

# apt-get build-dep vlc
  • If your distro is really bad and doesn't provide the libs, no -dev or -devel packages: Using the contribs system in VLC's sources
 % cd extras/contrib;
 % ./bootstrap;
 % make;

This should download and build a lot of those libs for you.

  • Read the list, download them and build by hand.

Configuration

You need to tweak your configure line.

./configure is used to check whether your system is able to compile VLC. Also you choose the functionalities of your build.

% ./configure --help

will show you the various options

Special libs

Use --with-live555-path=path/to/livemedia/source/tree in connection with --enable-live555</tt>. For ffmpeg, the only reliable way for VLC's configure to know how your ffmpeg's libs were compiled is to use pkg-config. So you need to set PKG_CONFIG_PATH correctly if your ffmpeg is not installed at the default place or you want to use static linking.

Final configuration

If you want to install VLC into another directory, run

% ./configure --prefix=/path/to/install/folder/

This is an example of a typical VLC configure line:

% ./configure --enable-x11 --enable-xvideo --disable-gtk --enable-sdl --enable-avcodec --enable-avformat --enable-swscale --enable-mad --enable-libdvbpsi --enable-a52 --enable-libmpeg2 --enable-dvdnav --enable-faad --enable-vorbis --enable-ogg --enable-theora --enable-faac --enable-mkv --enable-freetype --enable-fribidi --enable-speex --enable-flac --enable-live555 --with-live555-tree=/usr/lib/live --enable-caca --enable-skins --enable-skins2 --enable-alsa --disable-kde --enable-qt4 --enable-ncurses --enable-release

Here is another.

Ubuntu

If you get continuous errors while ./configure then consider reinstalling the corresponding libraries. This will set the paths and other information correctly. Check the $PKG_CONFIG_PATH(environment variable) whether it is set to a path where the libraries like libavcodec.pc are available. Otherwise create the environment variable.

Compilation

Compile VLC:

% make

As root (type "su" to change to root account):

# make install

To remove files created during the compile (optional) type:

% make clean

Notes

Cygwin

Compiling on Cygwin may be broken from time to time.

Debian

Debian users who want to compile VLC should install the packages below. Note: If you just want to use VLC media player then simply install the package vlc (sudo apt-get install vlc) - the unstable version is normally very up-to-date (and stable is, er, stable ;-)

Version

This HOWTO has been originally written by Derk-Jan Hartman.

It has been modified and updated by Jean-Baptiste Kempf.

It was spelled-checked and sudoed by materthron.

Further spell-checking, grammar corrections, and replaced a word with "bad" by Neo_The_User.