OutOfTreeCompile

From VideoLAN Wiki
Revision as of 14:19, 16 October 2008 by Xtophe (talk | contribs) (typo)
Jump to navigation Jump to search

Aim

Being able to build a vlc module without needing to build the whole vlc source. It can be used if you develop a new module, if your module can't be distributed at the same time as VLC due to some IP issues or to reduce the number of build-dependancies for a source package

Preparation

If you're taking a module from VLC source code, you may need to modify it slightly.

Internationalization

You can't use the main VLC "domain". So you can either add your own domain declaration or disable any i18n.

#define _(str) (str)
#define N_(str) (str)

Building

The following Makefile is an example based on the x264 module of VLC. You will need to adapt to your module.

all: libx264_plugin.so


libx264_plugin.so: libx264_plugin.o
        gcc -shared -std=gnu99 $< `pkg-config  --libs vlc-plugin x264`  -Wl,-soname -Wl,$@ -Wl,-no-undefined -o $@

libx264_plugin.o: x264.c
        gcc -c -std=gnu99  $< `pkg-config  --cflags vlc-plugin x264` -D__PLUGIN__  -DMODULE_STRING=\"x264\" -o $@  

clean:
        rm -f libx264_plugin.o libx264_plugin.so

.PHONY: all clean

Then you should install the plugin with the other VLC modules