From: Hendrik S. <sat...@gm...> - 2006-09-28 20:06:55
|
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------------------------------ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ 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 |