Today I came across an issue with the pkg-config and the new Version_2. The
impact is on the people/packages using pkg-config to get automatically the
library metadata in the makefiles. For example, something like this in the
LDFLAG=`pkg-config --libs libdc1394`
The pkg-config's behavior is to search for our libdc1394.pc in the
PKG_CONFIG_PATH and to read the metadata from there. Problem is when you have
two versions of the libdc1394 installed. Than, it is impossible to
distinguish between them using this method[*]. Instead, it will retrieve the
metainformation of the first file found in the path with the name libdc1394.
This leads us to a problem, and I think that the only solution is to install
the libdc1394 v2 with a change in the file name libdc1394.pc.
Then, you could use --libs libdc1394-2 to get the correct info for v2.
If there is a better way and I don't know it (see also my footnote [*]),
please point it out, and excuse my ignorance and the waste of your time.
@@ -9,1 +9,1 @@
-pkgconfig_DATA = libdc1394.pc
+pkgconfig_DATA = libdc1394-3.pc
[*] When you have both libraries installed, it will search the PKG_CONFIG_PATH
until it finds the required file (i.e., libdc1394.pc) and when it finds the
second file it will give and error like: ignored, we already know about
As far as I can see it, there is no method to distinguish between the two
versions (1 and 2) of libdc1394 using the pkg-config as showed above. If you
read the man pages, you might think that the developer could use something
pkg-config --libs 'libdc1394 > 2.0.0'
but, as the pkg-config will not read your second found file, it will return
Requested 'libdc1394 > 2.0.0' but version of libdc1394 is 1.1.0
Using a different name will solve the problem. In this way, the developer
could make a difference between the two versions by using:
pkg-config --libs libdc1394
pkg-config --libs libdc1394-2