--- libpkg/pkg_elf.c.orig 2015-09-21 08:53:23 UTC +++ libpkg/pkg_elf.c @@ -85,23 +85,28 @@ static int filter_system_shlibs(const char *name, char *path, size_t pathlen) { const char *shlib_path; + bool packaging_base = pkg_object_bool(pkg_config_get("ALLOW_BASE_SHLIBS")); - shlib_path = shlib_list_find_by_name(name); - if (shlib_path == NULL) { - /* dynamic linker could not resolve */ - return (EPKG_FATAL); + if (!packaging_base) { + shlib_path = shlib_list_find_by_name(name); + if (shlib_path == NULL) { + /* dynamic linker could not resolve */ + return (EPKG_FATAL); + } } - /* match /lib, /lib32, /usr/lib and /usr/lib32 */ - if (strncmp(shlib_path, "/lib", 4) == 0 || - strncmp(shlib_path, "/usr/lib", 8) == 0) - return (EPKG_END); /* ignore libs from base */ + if (!packaging_base) { + /* match /lib, /lib32, /usr/lib and /usr/lib32 */ + if (strncmp(shlib_path, "/lib", 4) == 0 || + strncmp(shlib_path, "/usr/lib", 8) == 0) + return (EPKG_END); /* ignore libs from base */ + } if (path != NULL) strncpy(path, shlib_path, pathlen); return (EPKG_OK); -} +} /* ARGSUSED */ static int