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?

From pkg-config manpage:
      Libs.private:
              This line should list any private libraries in use.  Private
              libraries are libraries which are not exposed through your
              library, but are needed in the case of static linking.

The purpose of this option is exactly what I mentioned. It is present since 
pkg-config 0.18 (current is 0.21).

"exposed" means that e.g. bluetooth or usb library symbols are used in macros 
or inline functions. Every foreign library symbol used in a non-inlined 
function is private to the lib.
For static linking, all of libopenobex is compiled into the program and thus 
all foreign libs must be linked, too.

The following option for ld does something similar but either needs careful 
usage or pure guessing (may break some C++ libs):
      --as-needed
       --no-as-needed
           This option affects ELF DT_NEEDED tags for dynamic  libraries  men‐
           tioned on the command line after the --as-needed option.  Normally,
           the linker will add a DT_NEEDED tag for each dynamic  library  men‐
           tioned  on  the  command line, regardless of whether the library is
           actually needed.  --as-needed causes  DT_NEEDED  tags  to  only  be
           emitted for libraries that satisfy some symbol reference from regu‐
           lar objects which is undefined at the point that  the  library  was
           linked.  --no-as-needed restores the default behaviour.

For obexftp, this will have no effect as it used libusb and libbluetooth 
symbols itself. For my own app (obexpushd), only linking 
to -lopenobex -lbluetooth is fully sufficient, -lusb is not needed.

BTW: you implicitly use this in for openobex.m4, as testing for presence only 
links with -lopenobex.

WISHLIST: get rid of openobex.m4 and advertise PKG_CONFIG_* m4 macros instead. 
As an alternative, make it a simple wrapper around pkg-config.

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