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

Static linking: pkgconfig vs libtool



Dear Debian Developers!

In the application I am taking part in, I am trying to create a
configuration script to be able to provide two deliverables:
dynamically-linked executable and statically-linked.

The first problem I faced is that it is difficult to explore what should
be the list of libraries for static linking (as I have to provide the
list of libraries which are direct dependencies as well as indirect). I
know this problem is solved with libtool (which consumes the information
from *.la) and with pkg-config (which consumes the information from
*.pc). The problems I faced:

* General question. What is the current trend: to use libtool or
pkg-config? For me it is easier to use pkg-config CLI, rather then
re-write autoconf scripts to fit libtool ideology (maybe I don't need
to, fixme).
* Some libraries (e.g. GraphicsMagick) does not provide the list of
libraries for statis linking via .pc (compare 'pkg-config --static
--libs GraphicsMagick++' and 'GraphicsMagick++-config --libs'). Should
it be fired as a bug for GraphicsMagick package?
* Some libraries (e.g.) do not follow the agreement for .NET/CLI
(http://pkg-mono.alioth.debian.org/cli-policy/ch-packaging.html#s-pkg-config-file)
which I think is also good to follow for common libraries:
- xfprint4-4.6.1 package contains xfprint-1.0.pc (expected: xfprint4.pc
or xfprint4.pc -symlink-> xfprint4-4.6.1.pc)
- libxml2-dev package contains libxml-2.0.pc (expected: libxml2.pc or
libxml2.pc -symlink-> libxml2-2.7.7.pc)

I have posted this question also to stackoverflow
(http://stackoverflow.com/questions/3932742/static-library-auto-discovery-and-linking)
but I haven't got a complete answer, so I kindly ask the Debian
community to help me.

Thank you in advance!

-- 
With best regards,
Dmitry


Reply to: