Public bug reported:

Binary package hint: curl

I'm packaging a library (libsword) which uses libcurl.

When I compile my package dpkg-shlibdeps gives me these
warnings that dependency on the following libraries (there are others but they
are irrelevant for this report) could be avoided:

libgcrypt.so.11
libtasn1.so.3
libidn.so.11
libldap_r-2.4.so.2
liblber-2.4.so.2
librt.so.1
libgnutls.so.26
libgssapi_krb5.so.2

I started investigating and found that upstream is using `curl-config --libs` to
figure out link flags. On my system it gives this:

$ curl-config --libs
-lcurl -lidn -llber -lldap -lrt -lgssapi_krb5 -lgssapi_krb5 -lz -lgnutls

(No clue why gssapi_krb5 appears twice anyhow...)

I thought that's a bit harsh if I want to link against curl I don't quite
understand why I have to recursively link against all that....

So to double check I've looked at the pc file shipped with curl:
 
$ cat /usr/lib/pkgconfig/libcurl.pc | grep Libs
Libs: -L${libdir} -lcurl 
Libs.private: -lidn -llber -lldap -lrt -lgssapi_krb5 -lgssapi_krb5 -lz -lgnutls

This got me puzzled. The output from curl-config matches the static-linking
instructions from .pc file.

So I went to look into the curl-config code to see if it is possible to get
output which matches the "Libs:" standza of the pc file (edited $cat 
/usr/bin/curl-config):

    --libs)

        if test "Xyes" = "Xyes"; then
          echo ${CURLLIBDIR}-lcurl -lidn -llber -lldap -lrt -lgssapi_krb5 
-lgssapi_krb5 -lz -lgnutls 
        else
          echo ${CURLLIBDIR}-lcurl 
        fi
        ;;

    --static-libs)
        echo ${exec_prefix}/lib/libcurl.a -lidn -llber -lldap -lrt 
-lgssapi_krb5 -lgssapi_krb5 -lz -lgnutls 
        ;;

    *)

The else condition is never executed so the output always has all those extra
libs.

So if upstream is using curl-config extra libraries are linked and
dpkg-shlibdeps yells at packagers.

If upstream is using libcurl.pc just -lcurl is linked and dpkg-shlibdeps is not
shouting.

IMHO this is a bug in curl-config. If it's not I'll try to figure out how to
switch upstream of my package to use pkg-config for curl.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: libcurl4-gnutls-dev 7.18.2-8ubuntu4
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: curl
Uname: Linux 2.6.30-020630rc5-generic i686

** Affects: curl (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386

-- 
curl-config --libs gives too many libraries
https://bugs.launchpad.net/bugs/379533
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to