| 1 |
$Id$ |
|---|
| 2 |
|
|---|
| 3 |
Hacking vlc |
|---|
| 4 |
=========== |
|---|
| 5 |
|
|---|
| 6 |
First |
|---|
| 7 |
----- |
|---|
| 8 |
|
|---|
| 9 |
- Read this file |
|---|
| 10 |
|
|---|
| 11 |
- Read the information present on http://www.videolan.org/developers/ |
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
Requirements |
|---|
| 15 |
____________ |
|---|
| 16 |
|
|---|
| 17 |
You will need the following tools if you plan to use the GIT version of vlc: |
|---|
| 18 |
|
|---|
| 19 |
- Autoconf version 2.60 or later |
|---|
| 20 |
- Automake version 1.9 or later |
|---|
| 21 |
- gettext version 0.16.1 or later |
|---|
| 22 |
- pkg-config |
|---|
| 23 |
- libgcrypt 1.2 (or compatible) |
|---|
| 24 |
|
|---|
| 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 |
If you do not have the correct version of these tools, or if they are |
|---|
| 30 |
simply not available for the operating system you plan to develop on, |
|---|
| 31 |
you can check out a GIT tree on an OS that provides these tools (such |
|---|
| 32 |
as a recent Linux distribution), run bootstrap, and then copy the whole |
|---|
| 33 |
tree to your retarded OS. |
|---|
| 34 |
|
|---|
| 35 |
There is a possibility that, at some point, automake might segfault. The |
|---|
| 36 |
reason is unsufficient stack size, and can be easily fixed with the |
|---|
| 37 |
`ulimit` command (or an equivalent) available in most shells. For instance |
|---|
| 38 |
on bash 2.0, the following command solves the automake crash on Mac OS X : |
|---|
| 39 |
ulimit -s 20000 |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
The bootstrap sequence |
|---|
| 43 |
---------------------- |
|---|
| 44 |
|
|---|
| 45 |
The bootstrap script does the following actions: |
|---|
| 46 |
|
|---|
| 47 |
- parse configure.ac for all Makefiles in the modules/ directory that need |
|---|
| 48 |
to be generated, and look for available modules in the corresponding |
|---|
| 49 |
Modules.am file. A module "foo" exists if there is a Modules.am file in |
|---|
| 50 |
the modules/ directory which defines SOURCES_foo. |
|---|
| 51 |
|
|---|
| 52 |
- create a top-level Modules.am file (which will be included by Makefile.am) |
|---|
| 53 |
which contains additional build rules for modules, and includes all the |
|---|
| 54 |
Modules.am files that were found in modules/ |
|---|
| 55 |
|
|---|
| 56 |
- create an m4/private.m4 from configure.ac, generating m4 macros that will |
|---|
| 57 |
be needed by configure.ac. |
|---|
| 58 |
|
|---|
| 59 |
- create a Makefile.am file for each Modules.am file found in modules/ . |
|---|
| 60 |
|
|---|
| 61 |
- run autopoint (previously gettextize) to create an intl/ directory, |
|---|
| 62 |
needed when libgettext is not available. |
|---|
| 63 |
|
|---|
| 64 |
- run the usual aclocal, autoheader, automake and autoconf, which create |
|---|
| 65 |
the various Makefile.in files from the corresponding Makefile.am and the |
|---|
| 66 |
configure script from configure.ac. |
|---|
| 67 |
|
|---|
| 68 |
- fix a few files in the vlc repository that may have been altered. |
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
How to add a module |
|---|
| 72 |
------------------- |
|---|
| 73 |
|
|---|
| 74 |
To add a module to the repository, just add its sources to a Modules.am |
|---|
| 75 |
file. If you add a new directory you will need to create a new Modules.am, |
|---|
| 76 |
inside that directory. Do not forget to add a corresponding |
|---|
| 77 |
Makefile line at the end of configure.ac for this new Modules.am file. |
|---|
| 78 |
|
|---|
| 79 |
To have the module built, you need to add a call to VLC_ADD_PLUGINS or |
|---|
| 80 |
VLC_ADD_BUILTINS to configure.ac with your new module name as argument. |
|---|
| 81 |
Look at other modules for guidelines on how to add build and linkage options. |
|---|
| 82 |
|
|---|
| 83 |
After changing configure.ac you will always need to rerun bootstrap and |
|---|
| 84 |
configure. |
|---|
| 85 |
|
|---|
| 86 |
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) |
|---|
| 87 |
Then use vlc -vvv --color --list to check that your plugin is seen by VLC. |
|---|
| 88 |
|
|---|