Bug 1118

Summary: libunbound.pc sets strange Libs, Libs.private values
Product: unbound Reporter: Robert Edmonds <edmonds>
Component: serverAssignee: unbound team <unbound-team>
Severity: minor CC: cathya, wouter
Priority: P5    
Version: 1.5.10   
Hardware: x86_64   
OS: Linux   

Description Robert Edmonds 2016-10-02 02:20:27 CEST

When I built unbound 1.5.10 on Debian, the generated libunbound.pc file ended up containing the following lines:

    Libs: -L${libdir} -lunbound -lssl -L/usr/lib -L/usr/lib/python3.5 -lpython3.5m   -lcrypto
    Libs.private:  -Wl,--as-needed -fPIE -pie -Wl,-z,relro -Wl,-z,now

Based on the following substitutions from the libunbound.pc.in file:

    Libs: -L${libdir} -lunbound @SSLLIB@ @LIBS@
    Libs.private: @LDFLAGS@

I think this is not quite right. According to the pkg-config manpage:

       Libs:  This line should give the link flags specific to your package.  Don't add any flags for required packages; pkg-config will add those automatically.

              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. This differs from Requires.private in that it references libraries that do not have package files installed.

Probably the libunbound.pc.in file should instead specify something like:

    Libs: -L${libdir} -lunbound
    Libs.private: @SSLLIB@ @LIBS@
Comment 1 Wouter Wijngaards 2016-10-18 15:57:15 CEST
Hi Robert,

Fixed as you suggested.  Thanks for the report!
I hope this works for pkgconfig users.

Best regards, Wouter