pkg: add pkg_libs() for calculating the mergemaster set of linker flags (issue #11)
parent
b8e538ecea
commit
2ecb181fe6
25
pkg.c
25
pkg.c
|
@ -669,3 +669,28 @@ pkg_cflags(pkg_t *root, int maxdepth, unsigned int flags)
|
|||
return head;
|
||||
}
|
||||
|
||||
static void
|
||||
pkg_libs_collect(pkg_t *pkg, void *data, unsigned int flags)
|
||||
{
|
||||
pkg_fragment_t **list = data;
|
||||
pkg_fragment_t *frag;
|
||||
|
||||
PKG_FOREACH_LIST_ENTRY(pkg->libs, frag)
|
||||
*list = pkg_fragment_copy(*list, frag);
|
||||
|
||||
if (flags & PKGF_MERGE_PRIVATE_FRAGMENTS)
|
||||
{
|
||||
PKG_FOREACH_LIST_ENTRY(pkg->libs_private, frag)
|
||||
*list = pkg_fragment_copy(*list, frag);
|
||||
}
|
||||
}
|
||||
|
||||
pkg_fragment_t *
|
||||
pkg_libs(pkg_t *root, int maxdepth, unsigned int flags)
|
||||
{
|
||||
pkg_fragment_t *head = NULL;
|
||||
|
||||
pkg_traverse(root, pkg_libs_collect, &head, maxdepth, flags);
|
||||
|
||||
return head;
|
||||
}
|
||||
|
|
1
pkg.h
1
pkg.h
|
@ -133,6 +133,7 @@ int pkg_compare_version(const char *a, const char *b);
|
|||
pkg_t *pkg_verify_dependency(pkg_dependency_t *pkgdep, unsigned int flags, unsigned int *eflags);
|
||||
const char *pkg_get_comparator(pkg_dependency_t *pkgdep);
|
||||
pkg_fragment_t *pkg_cflags(pkg_t *root, int maxdepth, unsigned int flags);
|
||||
pkg_fragment_t *pkg_libs(pkg_t *root, int maxdepth, unsigned int flags);
|
||||
|
||||
/* parse.c */
|
||||
pkg_t *pkg_new_from_file(const char *path, FILE *f);
|
||||
|
|
Loading…
Reference in New Issue