HACKING 3.11 KB
Newer Older
Sam Hocevar's avatar
Sam Hocevar committed
1
$Id$
2 3 4 5

Hacking vlc
===========

6 7 8 9 10
First
-----

 - Read this file

11
 - Read the information present on http://www.videolan.org/developers/
12 13


14
Requirements
15
____________
16

James Bond's avatar
James Bond committed
17
You will need the following tools if you plan to use the GIT version of vlc:
18

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
19 20
 - Autoconf version 2.60 or later
 - Automake version 1.9 or later
21
 - gettext version 0.16.1 or later
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
22 23
 - pkg-config
 - libgcrypt 1.2 (or compatible)
24

James Bond's avatar
James Bond committed
25
After retrieving the GIT tree, you need to run the bootstrap script to
26
generate all the files needed to build vlc. You can then run configure.
27
Run ./configure --help for a description of the available options.
28 29 30

If you do not have the correct version of these tools, or if they are
simply not available for the operating system you plan to develop on,
James Bond's avatar
James Bond committed
31
you can check out a GIT tree on an OS that provides these tools (such
32 33 34
as a recent Linux distribution), run bootstrap, and then copy the whole
tree to your retarded OS.

35 36 37 38 39 40
There is a possibility that, at some point, automake might segfault. The
reason is unsufficient stack size, and can be easily fixed with the
`ulimit` command (or an equivalent) available in most shells. For instance
on bash 2.0, the following command solves the automake crash on Mac OS X :
ulimit -s 20000

41 42 43 44 45 46

The bootstrap sequence
----------------------

The bootstrap script does the following actions:

Sam Hocevar's avatar
Sam Hocevar committed
47 48 49 50
 - parse configure.ac for all Makefiles in the modules/ directory that need
   to be generated, and look for available modules in the corresponding
   Modules.am file. A module "foo" exists if there is a Modules.am file in
   the modules/ directory which defines SOURCES_foo.
51 52 53 54 55

 - create a top-level Modules.am file (which will be included by Makefile.am)
   which contains additional build rules for modules, and includes all the
   Modules.am files that were found in modules/

Sam Hocevar's avatar
Sam Hocevar committed
56 57 58 59
 - create an m4/private.m4 from configure.ac, generating m4 macros that will
   be needed by configure.ac.

 - create a Makefile.am file for each Modules.am file found in modules/ .
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

 - run autopoint (previously gettextize) to create an intl/ directory,
   needed when libgettext is not available.

 - run the usual aclocal, autoheader, automake and autoconf, which create
   the various Makefile.in files from the corresponding Makefile.am and the
   configure script from configure.ac.

 - fix a few files in the vlc repository that may have been altered.


How to add a module
-------------------

To add a module to the repository, just add its sources to a Modules.am
75 76 77
file. If you add a new directory you will need to create a new Modules.am,
inside that directory. Do not forget to add a corresponding
Makefile line at the end of configure.ac for this new Modules.am file.
78

Sam Hocevar's avatar
Sam Hocevar committed
79 80
To have the module built, you need to add a call to VLC_ADD_PLUGINS or
VLC_ADD_BUILTINS to configure.ac with your new module name as argument.
81 82 83 84 85
Look at other modules for guidelines on how to add build and linkage options.

After changing configure.ac you will always need to rerun bootstrap and 
configure.

86 87
VLC keeps a cache of its module (in ~/.vlc/cache on Linux), so you'll have to delete it. (or use vlc --reset-plugins-cache)
Then use vlc -vvv --color --list to check that your plugin is seen by VLC.
88