[Telepathy] [Bug 15199] Broken pkg-config file

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Mar 25 09:55:52 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=15199





--- Comment #4 from Simon McVittie <simon.mcvittie at collabora.co.uk>  2008-03-25 09:55:52 PST ---
I tried your example, but for all the headers (individually) instead of just
run.h:

smcv at carbon% cat > ~/tmp/true.c
int main(int argc, char **argv) { return 0; } 
smcv at carbon% ( cd /usr/include/telepathy-1.0 && echo telepathy-glib/*.h ) |
while read -d' ' h; do gcc -o ~/tmp/true ~/tmp/true.c `pkg-config --libs
--cflags telepathy-glib` -include $h && ~/tmp/true || echo FAIL: $h; done 
In file included from <command-line>:0:
/usr/include/telepathy-1.0/telepathy-glib/defs.h:60: error: expected ‘=’,
‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘G_END_DECLS’
FAIL: telepathy-glib/defs.h

(There is indeed a minor bug here - telepathy-glib/defs.h should either
#include an appropriate header from GLib to define G_BEGIN_DECLS and
G_END_DECLS, or become entirely self-contained - but our pkg-config use appears
to be sufficient.)

I deliberately excluded the telepathy-glib/_gen/*.h hierarchy, since these
headers are not public API, and indeed are unlikely to be self-contained.

Further, examining the result from an arbitrary one of the successful runs, I
get:

smcv at carbon% ldd ~/tmp/true
        linux-gate.so.1 =>  (0xffffe000)
        libtelepathy-glib.so.0 => /usr/lib/libtelepathy-glib.so.0 (0xb7f31000)
        libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7dd6000)
        libdbus-glib-1.so.2 => /usr/lib/libdbus-glib-1.so.2 (0xb7dba000)
        libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0xb7d83000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb7d47000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7c99000)
        /lib/ld-linux.so.2 (0xb7fca000)
        libnsl.so.1 => /lib/i686/cmov/libnsl.so.1 (0xb7c80000)
        libselinux.so.1 => /lib/libselinux.so.1 (0xb7c66000)
        libpcre.so.3 => /usr/lib/libpcre.so.3 (0xb7c3f000)
        libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7c3b000)
smcv at carbon% objdump -x ~/tmp/true | grep NEEDED
  NEEDED      libtelepathy-glib.so.0
  NEEDED      libc.so.6

... which is the result we're after. Reverting the change to the .pc file as
you suggest would result in ~/tmp/true being linked against dbus-glib, libdbus,
etc. whether it actually uses them or not, which is precisely what distros want
to avoid.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Telepathy mailing list