Skip to content

Commit

Permalink
pkg_addshlib: limit the number of call to pkg_config_get
Browse files Browse the repository at this point in the history
  • Loading branch information
bapt committed Feb 10, 2025
1 parent 6f0481b commit e52dd97
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libpkg/pkg.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,10 +906,14 @@ pkg_shlib_flags_from_abi(const struct pkg_abi *shlib_abi)
enum pkg_shlib_flags flags = PKG_SHLIB_FLAGS_NONE;

if (ctx.abi.os == PKG_OS_FREEBSD) {
if (shlib_abi->os == PKG_OS_LINUX &&
pkg_object_bool(pkg_config_get("TRACK_LINUX_COMPAT_SHLIBS"))) {
flags |= PKG_SHLIB_FLAGS_COMPAT_LINUX;
static bool check_track_linux_compat_shlibs = false;
static bool track_linux_compat_shlibs = false;
if (!check_track_linux_compat_shlibs) {
track_linux_compat_shlibs = pkg_object_bool(pkg_config_get("TRACK_LINUX_COMPAT_SHLIBS"));
check_track_linux_compat_shlibs = true;
}
if (shlib_abi->os == PKG_OS_LINUX && track_linux_compat_shlibs)
flags |= PKG_SHLIB_FLAGS_COMPAT_LINUX;

switch (ctx.abi.arch) {
case PKG_ARCH_AMD64:
Expand Down

0 comments on commit e52dd97

Please sign in to comment.