]> git.ipfire.org Git - thirdparty/zstd.git/commit
Provide variant pkg-config file for multi-threaded static lib 4020/head
authorChristian Marangi <ansuelsmth@gmail.com>
Sat, 6 Apr 2024 12:41:54 +0000 (14:41 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 8 Apr 2024 15:44:52 +0000 (17:44 +0200)
commitf1f1ae369a4cefd3474b3528e8d1847b18750605
tree2b0680ab9f884ba7d4b1e0a9388e0a6cebd1427c
parent72c16b187d27016b7634f5c6b7290e7c66ba44b3
Provide variant pkg-config file for multi-threaded static lib

Multi-threaded static library require -pthread to correctly link and works.
The pkg-config we provide tho only works with dynamic multi-threaded library
and won't provide the correct libs and cflags values if lib-mt is used.

To handle this, introduce an env variable MT to permit advanced user to
install and generate a correct pkg-config file for lib-mt or detect if
lib-mt target is called.

With MT env set on calling make install-pc, libzstd.pc.in is a
pkg-config file for a multi-threaded static library.

On calling make lib-mt, a libzstd.pc is generated for a multi-threaded
static library as it's what asked by the user by forcing it.

libzstd.pc is changed to PHONY to force regeneration of it on calling
lib targets or install-pc to handle case where the same directory is
used for mixed compilation.

This was notice while migrating from meson to make build system where
meson generates a correct .pc file while make doesn't.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
lib/Makefile
lib/README.md
lib/libzstd.pc.in