essentia
essentia copied to clipboard
Only link against libessentia in the pc file. Fixes #340
When we want to link libessentia.so into a program we only need to specify -lessentia. Other dependencies of essentia are already correctly linked against the .so. If a user wants to also link their program against the same dependency (e.g. libav) then they should explicitly link against that themselves.
Those dependencies are required for the static version of the library. Probably two different .pc files can be generated depending on whether the shared or static libessentia was built.
One thing to think about is the location of the.pc files. On Ubuntu, to the best of my understanding, /usr/local/share/pkgconfig is automatically searched. /usr/local/lib/pkgconfig may be on the automatic search path in many other flavours of linux but requires PKG_CONFIG_PATH to be set to it on Ubuntu.
The correct way would be to specify Essentia's dependencies in Libs.private when generating the pc file.
@sildeag Here is some related info: /usr/share is for architecture-independent data, for that reason using /usr/local/lib/pkgconfig is more appropriate.
@dbogdanov thanks for the info. I was just pointing out that /usr/local/lib/pkgconfig wasn't in the automatic search path for Ubuntu. This impacts build scripts which use .pc files - since on Ubuntu not everyone has PKG_CONFIG_PATH set and/or has some out-dated .pc file on their system that is in the automatic search path.