[PATCH wayland v2 3/4] wayland-util: build/ship as separate shared library

Pekka Paalanen ppaalanen at gmail.com
Thu Mar 16 12:40:48 UTC 2017

On Tue, 21 Feb 2017 16:14:28 +0000
Emil Velikov <emil.l.velikov at gmail.com> wrote:

> From: Emil Velikov <emil.velikov at collabora.com>
> Currently both of libwayland-{client,server} export the same util
> (amongst other) symbols.
> Although not crucial this is something which should be avoided where
> possible.
> As such let's move the library to a shared one and introduce a static
> one for the purposes of wayland-scanner.
> Any old (existing) users of the new libwayland-{client,server} will be
> safe since the libwayland* libraries will pull the util one and the
> symbols will be resolved at runtime.
> Any programs building against the new libraries will have the dependency
> (both compile and link-wise) resolved automatically by the Requires
> field of the .pc file.
> Note: it's not possible to 'hide' the wl_list/wl_array API since it's
> been part for the ABI (implicitly pulled via the wayland headers) for a
> while, plus doing so will break KF5 and mpv, at least.
> v2: Rebase
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  Makefile.am                          | 18 ++++++++++++------
>  configure.ac                         |  2 ++
>  src/wayland-client-uninstalled.pc.in |  1 +
>  src/wayland-client.pc.in             |  1 +
>  src/wayland-server-uninstalled.pc.in |  1 +
>  src/wayland-server.pc.in             |  1 +
>  src/wayland-util-uninstalled.pc.in   |  8 ++++++++
>  src/wayland-util.pc.in               | 12 ++++++++++++
>  8 files changed, 38 insertions(+), 6 deletions(-)
>  create mode 100644 src/wayland-util-uninstalled.pc.in
>  create mode 100644 src/wayland-util.pc.in


since I have so much trouble making my mind on this patch, how about a
silly counter-proposal?

Let's squash libwayland-server.so and libwayland-client.so into a
single libwayland.so.

That would take care of the duplicate exported symbols issue not just
for the util functions, but also for the exported variables produced by
wayland-scanner. Since we have many programs (libEGL!) that necessarily
already link to both, there cannot be problems from linking to
everything always.

We would still need to install dummy libwayland-server.so and
libwayland-client.so just for pulling in libwayland.so, but that's no
worse than Emil's proposition.

Whether we have the existing .pc files telling to link to server/client
or just libwayland.so would be up for debate. I'm not suggesting to
merge the .pc files.

libwayland-server.so and libwayland-client.so have exactly the same set
of dependencies.

Any downsides to this approach vs. doing nothing vs. Emil's

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170316/7f870181/attachment.sig>

More information about the wayland-devel mailing list