Commit Graph

9 Commits

Author SHA1 Message Date
Robert Edmonds
c93b4b3158 contrib/libunbound.pc.in: Do not use "Requires:"
This commit updates contrib/libunbound.pc.in to remove the "Requires:"
directive and move its contents to "Requires.private:".

The pkg-config manpage documents the Requires/Libs fields as follows:

   Requires:
          This is a comma-separated list of packages that are required  by
          your package. Flags from dependent packages will be merged in to
          the flags reported for your package. Optionally, you can specify
          the  version  of the required package (using the operators =, <,
          >, >=, <=); specifying a version allows  pkg-config  to  perform
          extra  sanity  checks. You may only mention the same package one
          time on the Requires: line. If the version of a package  is  un‐
          specified, any version will be used with no checking.

   Requires.private:
          A list of packages required by this package. The difference from
          Requires is that the packages listed under Requires.private  are
          not  taken into account when a flag list is computed for dynami‐
          cally linked executable (i.e., when --static was not specified).
          In  the  situation where each .pc file corresponds to a library,
          Requires.private shall be used exclusively to specify the depen‐
          dencies between the libraries.

   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.

   Libs.private:
          This line should list any private libraries in use.  Private li‐
          braries are libraries which are not  exposed  through  your  li‐
          brary,  but  are needed in the case of static linking. This dif‐
          fers from Requires.private in that it references libraries  that
          do not have package files installed.

In other words:

1) "Requires:" should specify the name of .pc packages that are required
to be installed to compile and dynamically link against libunbound. This
corresponds to needing the -dev (or -devel) package containing the .pc
file to be installed on the system. Since libunbound's header files
actually do not have any includes on any other library's headers, the
"Requires:" directive should be empty.

2) "Requires.private:" specifies the name of .pc packages that
correspond to libraries that are required to be installed to statically
link against libunbound. E.g., if libunbound.a has undefined symbols
event_* that are in libevent.a, statically linking against libunbound.a
requires statically linking libevent.a, and because libevent has a .pc
file, this means "libevent" should appear in libunbound.pc's
"Requires.private:" directive.

3) "Libs:" specifies the link flags needed to link against libunbound,
only, not including any dependencies.

4) "Libs.private:" specifies the link flags needed to statically link
against libraries that libunbound depends on that do not have .pc files.
I think it's possible for unbound's build system to actually declare
link flags under "Libs.private:" for some libraries that do have .pc
files (e.g. libcrypto/-lcrypto, libssl/-lssl, for OpenSSL) but in
practice this appears to be harmless.

Given #1 above that libunbound does not have any header dependencies
against any other packages it does not appear that "Requires:" is needed
at all. See https://bugs.debian.org/958331 for an example of a bug
report that this causes. We should not need to install the nettle-dev
package only for building binaries that compile against the libunbound
headers and link against the libunbound library.
2020-05-25 17:58:37 -04:00
Ralph Dolmans
7e200ce90e
Merge branch 'master' into edmonds/libbsd-support 2020-01-27 15:37:33 +01:00
Robert Edmonds
394f9403df contrib/libunbound.pc.in: Embed the correct crypto dependencies
This commit removes the hardcoded dependency in the libunbound
pkg-config .pc file on the libcrypto and libssl modules and instead
populates the .pc file based on which crypto library was selected at
configure time.

Note that the .pc file specifies pkg-config module names for the
"Requires" line and this can vary from the library filename (e.g. "nss"
is the pkg-config module name vs. "nss3" being the library name).
2020-01-26 22:30:31 -05:00
Robert Edmonds
36b5d74fc4 contrib/libunbound.pc.in: Only specify -lunbound for Libs
According to the pkg-config manpage, the "Libs" line in a .pc file
should give the link flags "specific to your package", and specifically
says not to include link flags for dependencies:

    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.
2020-01-26 22:06:58 -05:00
Steven Chamberlain
f6b4f2a149 Allow use of libbsd functions with configure option --with-libbsd
Add a new configure option `--with-libbsd', which allows to use libbsd's
portable implementations of:

    strlcpy strlcat arc4random arc4random_uniform reallocarray

instead of the embedded code copies in contrib/, which will be
difficult to maintain in the long term.

Also patch util/random.c so that, when building with libbsd and without
OpenSSL, arc4random can still be used as the PRNG.  Otherwise, building
with libnettle would need a kernel-specific getentropy implementation,
and libbsd does not export one.

[edmonds@debian.org: Imported patch description from BTS, refreshed
patch against Unbound 1.9.6.]
2020-01-26 19:09:43 -05:00
Wouter Wijngaards
bca54a8b25 - Patch, do not export python from pkg-config, from Petr Menšík.
git-svn-id: file:///svn/unbound/trunk@4758 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-06-27 06:07:31 +00:00
Wouter Wijngaards
f64a897cbc - Fix contrib/libunbound.pc for libssl libcrypto references,
from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226914


git-svn-id: file:///svn/unbound/trunk@4682 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-05-11 11:52:19 +00:00
Wouter Wijngaards
63d4bcde56 - Fix #1117: libunbound.pc sets strange Libs, Libs.private values.
git-svn-id: file:///svn/unbound/trunk@3889 be551aaa-1e26-0410-a405-d3ace91eadb9
2016-10-18 13:56:42 +00:00
Wouter Wijngaards
ed4aefc59e - Create a pkg-config file for libunbound in contrib.
git-svn-id: file:///svn/unbound/trunk@3800 be551aaa-1e26-0410-a405-d3ace91eadb9
2016-06-28 12:04:09 +00:00