Skip to contentSkip to conversation

alsa-lib(-1.0.10) sets wrong path for pkg-config --cflags

DISCUSSION Prakash Punnoor 2 participants 2 messages Dec 27, 2005 – Jan 2, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

pkg-config alsa --cflags returns

-I/usr/include/alsa

which is wrong, as you are supposed to include alsa in userspace via #include <alsa/asoundlib.h> and not via #include <asoundlib.h>, right?

So alsa --cflags should either return nothing or -I/usr/include. Of course above "works" with gentoo, as alsa headers are installed in standard location, so they are found via standard include.

I am also not so sure whether pkg-config alsa --libs returns way too much libs.
(-lasound -lm -ldl -lpthread)

Unless you are linking statically (-static) you really only need -lasound, unless you use explicitly use dlopen/math/pthread. But as --libs should return libs needed only by linking to alsa non-statically, I guess returning -lasound should be enough.

Signature · 3 lines
(°=                 =°)
//\ Prakash Punnoor /\\
V_/                 \_V
#1 lore raw

At Tue, 27 Dec 2005 09:25:47 +0100,

Quoted 9 lines · Prakash Punnoor

Hi,

pkg-config alsa --cflags returns

-I/usr/include/alsa

which is wrong, as you are supposed to include alsa in userspace via #include <alsa/asoundlib.h> and not via #include <asoundlib.h>, right?

Yes. But it's there just because of backward compatibility, as you can find in the comment of alsa.pc file. It will be removed in future.

Quoted 4 lines

So alsa --cflags should either return nothing or -I/usr/include. Of course above "works" with gentoo, as alsa headers are installed in standard location, so they are found via standard include.

Quoted 8 lines

I am also not so sure whether pkg-config alsa --libs returns way too much libs.
(-lasound -lm -ldl -lpthread)

Unless you are linking statically (-static) you really only need -lasound, unless you use explicitly use dlopen/math/pthread. But as --libs should return libs needed only by linking to alsa non-statically, I guess returning -lasound should be enough.

IIRC, there were problems when pkgconfig is used without the explicit listing of dependent libraries, but maybe the bug was already fixed.

However, this is no critical bug, so I'll postpone this fix after 1.0.11 release.

thanks,

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click