Am Mittwoch 27 September 2006 00:02 schrieb Marcel Holtmann:
> only because Debian thinks this is the right way, it must not be true.
> Where is the pkg-config documentation that shows this is the correct way
> to achieve this?

Just as a side note: installing the .la file creates the same problem when 
using libtool to build.

I give you an example: obexftp uses libtool and thus links against libusb:
$ readelf -d obexftp | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libopenobex.so.1]
 0x00000001 (NEEDED)                     Shared library: [libusb-0.1.so.4]
 0x00000001 (NEEDED)                     Shared library: [libbluetooth.so.2]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

However, removing the .la file prevents it from doing so:
$ readelf -d apps/obexftp | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libopenobex.so.1]
 0x00000001 (NEEDED)                     Shared library: [libbluetooth.so.2]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

And it still compiles and runs without problems. This is because all usb 
functions are wrapped by libopenobex (which correctly links to libusb).
However, with libtool, there is no way around this except not installing 
the .la file or patching it before installation (I do not propose this but do 
it in my package).
E.g. on MacOS X, the linker always needs all dependencies and thus needs 
the .la file.
Pkg-config is supposed do the right thing on both systems, even if you mark 
libusb as private. However, MacOS X has its own implementation of OBEX.

The openobex.pc.in files now could look like this (and does here):
------------------------------snip------------------------------
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@

Name: OpenOBEX
Description: Free implementation of the Object Exchange protocol
Version: @VERSION@
Requires.private: libusb
Libs: -L${libdir} -lopenobex
Cflags: -I${includedir}
------------------------------snip------------------------------
The only difference to the Libs.private is that the Libs: field from libusb.pc 
is used (with whatever -L it has).

HS

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to