Page 1 of 1

Compiling VLC with librairies in non standard directorys.

Posted: 28 Jun 2007 16:44
by Nem
Hi !

I would like to compile VLC with librairies located in non standard directories (i.e : libs and .h are in MY_PATH/lib and MY_PATH/inculde).

I've manage to compile ffmpeg by adding

Code: Select all

--cflags=-I$RESULTS/include --extra-ldflags=-L$RESULTS/lib
in the ./configure line.

With VLC, i've got 2 problems.
First with pkgs, solved with this :

Code: Select all

export PKG_CONFIG_PATH=$RESULTS/lib/pkgconfig
Second with faad :

Code: Select all

checking faad.h usability... no checking faad.h presence... no checking for faad.h... no configure: error: Cannot find development headers for libfaad...
I've tryed to use CPPFLAGS

Code: Select all

CPPFLAGS=-I$RESULTS/include
and LDFLAGS

Code: Select all

LDFLAGS=-L$RESULTS/lib
But i still got the same error...

My knowledge is poor and i'm a little stuck ^^... What should i do ?
Thx !

Re: Compiling VLC with librairies in non standard directorys.

Posted: 28 Jun 2007 17:33
by kmf31
I am not sure if this is the good way of doing it and the ./configure script looks very often in /usr/include and /usr/local/include for the header files. However, for this method, if you want to link against dynamic libraries, you may want to add the lib path into the variable LD_LIBRARY_PATH, e.g.:
export LD_LIBRARY_PATH=MY_PATH/lib
or
export LD_LIBRARY_PATH=
$LD_LIBRARY_PATH:MY_PATH/lib
depending if in your configuration LD_LIBRARY_PATH is already defined and used or not. You apply this modification once in your working terminal or more permanently in ~/.bashrc, ~/.profile or similar.
You can try this and may be this resolves your last problems. I am not sure but it is worth a try.


On the other hand if you install certain libraries in non-standard directories there is another mecanism to compile vlc against them which might be better for you. First you compile your libraries in their source directories (somewhere in your home or arbitrary place) but without really installing them (you do "./configure" and "make" for these libararies but NOT "make install"). Then you can force vlc to search for these libraries using the ./configure option "--with-blabla-tree" (with "blabla" to be replaced by the proper library name of course), for example:
./configure --blabla-other-options --with-ffmpeg-tree=/home/toto/myffmpegsource ...
In this way the compilation of vlc will be done with static linking of the library in question. This may be a useful or not useful thing depending of what you want. A static link has the advantage you may test different versions of ffmpeg (or any other library) and compile different versions of VLC against different library versions. If you later switch to a newer version of the library you have to recompile vlc in order to use it but sometimes it may be just useful to keep the old vlc version compiled against the old library, e.g. in case of problems or if you want to test a newer version.

Type in the vlc-source-tree: "./configure --help | grep tree" to obtain the list and exact names of libraries which may be linked with the --with-blabla-tree option.

On 64bit-Linux installations (with 64bit-gcc/g++ compiler), the use of static libraries may be tricky (you may have to force the option "-fPIC" in CFLAGS etc. to make it work).

Re: Compiling VLC with librairies in non standard directorys.

Posted: 29 Jun 2007 00:52
by xtophe
First look at ./configure --help
and you can set CFLAGS and LDFLAGS to several values CFLAGS="-Ihere -Ithere"
same thing with PKG_CONFIG_PATH


hth,

Re: Compiling VLC with librairies in non standard directorys.

Posted: 29 Jun 2007 15:45
by Nem
Hi !
Thx for your advices.

I've tryed again using LDFLAGS and CPPFLAGS, and it works (made a supid mistake, and aven't seen it.... wrote "inlcude" and not "include" :oops: ).

And i will test your second solution kmf31, looks like it will fit exactly to my needs (almost all libs i use are available with --with-blabla-tree).

Tanks again for your answers !