Split libpkl libraries between shared and static libs (#1812)

This adds a `libpkl-static.pc` so pkg-config users can link either
statically or dynamically via `pkg-config --libs libpkl`, or
`pkg-config --libs libpkl-static`.

Additionally, this fixes an issue where the replace tokens wasn't
doing anything, leaving the `@version@` token intact in the archive.

Additionally, this adds an `-install_name` when building the dylib for macOS.

Co-authored-by: Islon Scherer <islonscherer@gmail.com>
This commit is contained in:
Daniel Chao
2026-08-07 15:47:16 +00:00
committed by GitHub
co-authored by Islon Scherer
parent b3698683ab
commit c5896d76d0
4 changed files with 78 additions and 19 deletions
@@ -0,0 +1,11 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: libpkl
Description: C library for calling into Pkl's message passing API.
URL: https://pkl-lang.org/main/current/libpkl/index.html
Version: @version@
Libs: ${libdir}/@static_lib_filename@@extra_static_libs@
Cflags: -I${includedir}
@@ -7,5 +7,5 @@ Name: libpkl
Description: C library for calling into Pkl's message passing API.
URL: https://pkl-lang.org/main/current/libpkl/index.html
Version: @version@
Libs: -L${libdir} -lpkl -lz -lpthread
Libs: -L${libdir}@extra_shared_libs@
Cflags: -I${includedir}