automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PKG_CHECK_MODULES on system without pkg-config installed?


From: Jef Driesen
Subject: Re: PKG_CHECK_MODULES on system without pkg-config installed?
Date: Sun, 13 Mar 2011 10:35:13 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

On 13/03/11 09:33, Vincent Torri wrote:
On Sun, Mar 13, 2011 at 8:57 AM, Jef Driesen<address@hidden>  wrote:

On 10/03/11 11:38, Vincent Torri wrote:

You also have to support static linking.


Does pkg-config support static linking? When I tried to build my own
project, which checks for libusb using the PKG_CHECK_MODULES macro, it
doesn't seem to link statically against libusb.

My project consist of a library and a few sample applications using that
library. I ran configure as follows:

$ ./configure --disable-shared

I think that you shuld first find documentation fto understand the
difference between:

  * a statically linked library (also oftenly just named 'static library')
  * the process of linking statically a library (also oftenly just named
'static linking')

I understand the difference between the two. I just don't know how to do the static linking when autotools, libtool and pkg-config are involved.

this configure option above just disables the creation of the shared library
(yourlib.so) and builds only the static library (yourlib.a). Static linking
of a library (or program) means that you "embed" all the dependencies of
your library (or program) in your library (or program). Check out ld
documentation for more informations.

I assumed that flag would also statically link external libraries. Before my project had no dependencies on external library, so this flag did the trick and I never noticed the difference.

pkg-config supports static linking. See
http://people.freedesktop.org/~dbn/pkg-config-guide.html for example.

The question is then, how do I make use of it? I know how to use it when calling pkg-config manually (e.g. the --static option), but not in combination with autotools and libtool.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]