]> git.ipfire.org Git - thirdparty/zstd.git/commit
[lib] Fix libzstd.pc for lib-mt builds 2659/head
authorÉrico Nogueira <erico.erc@gmail.com>
Sun, 16 May 2021 01:56:08 +0000 (22:56 -0300)
committerÉrico Nogueira <erico.erc@gmail.com>
Sat, 19 Jun 2021 20:42:24 +0000 (17:42 -0300)
commit4d0995270114e4c1f093e29bb1f734dac08b4c30
tree16054c22be6b60414e7ba2d8c47b4ef595f24a13
parent628f65b79c15051f5bddc6a374e6a70187151264
[lib] Fix libzstd.pc for lib-mt builds

Add the libzstd.pc target to the lib target in lib/Makefile, which makes
it inherit LDFLAGS_DYNLIB from the lib-mt target. This allows us to add
a Libs.private field to libzstd.pc which gets conditionally populated
with '-pthread'.

The 1.5.0 release notes mention that the static library isn't
multi-threaded by default, due to concern for people building static
binaries with libzstd:

   Now the dynamic library supports multi-threaded compression by
   default.  Note that this property is not extended to the static
   library because doing so would have impacted the build script of
   existing client applications (requiring them to add -pthread to their
   recipe), thus potentially breaking their build.

To get closer to being able to enable multi-threading for all library
builds by default, this commit makes it so that any libzstd consumer
using pkg-config gets the correct flags.

We also fix the indentation of the rule for libzstd.pc and move it
outside the if/endif block for install rules (which uses a list of OSs
where the rules were validated), so the rule is available for all users
of the 'lib*' targets.
lib/Makefile
lib/libzstd.pc.in