From 40fe48355bbb4e84229ae8a7b436078751ab89ca Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sat, 19 Oct 2019 00:45:49 -0500 Subject: [PATCH] cli: main: add --shared option --- cli/main.c | 6 ++++++ man/pkgconf.1 | 2 ++ 2 files changed, 8 insertions(+) diff --git a/cli/main.c b/cli/main.c index 3627818..7b1ea84 100644 --- a/cli/main.c +++ b/cli/main.c @@ -69,6 +69,7 @@ #define PKG_MSVC_SYNTAX (((uint64_t) 1) << 41) #define PKG_INTERNAL_CFLAGS (((uint64_t) 1) << 42) #define PKG_DUMP_PERSONALITY (((uint64_t) 1) << 43) +#define PKG_SHARED (((uint64_t) 1) << 44) static pkgconf_client_t pkg_client; static const pkgconf_fragment_render_ops_t *want_render_ops = NULL; @@ -664,6 +665,7 @@ usage(void) printf(" --maximum-traverse-depth maximum allowed depth for dependency graph\n"); printf(" --static be more aggressive when computing dependency graph\n"); printf(" (for static linking)\n"); + printf(" --shared use a simplified dependency graph (usually default)\n"); printf(" --pure optimize a static dependency graph as if it were a normal\n"); printf(" dependency graph\n"); printf(" --env-only look only for package entries in PKG_CONFIG_PATH\n"); @@ -827,6 +829,7 @@ main(int argc, char *argv[]) { "short-errors", no_argument, &want_flags, PKG_SHORT_ERRORS, }, { "maximum-traverse-depth", required_argument, NULL, 11, }, { "static", no_argument, &want_flags, PKG_STATIC, }, + { "shared", no_argument, &want_flags, PKG_SHARED, }, { "pure", no_argument, &want_flags, PKG_PURE, }, { "print-requires", no_argument, &want_flags, PKG_REQUIRES, }, { "print-variables", no_argument, &want_flags, PKG_VARIABLES|PKG_PRINT_ERRORS, }, @@ -1040,6 +1043,9 @@ main(int argc, char *argv[]) if ((want_flags & PKG_STATIC) == PKG_STATIC) want_client_flags |= (PKGCONF_PKG_PKGF_SEARCH_PRIVATE | PKGCONF_PKG_PKGF_MERGE_PRIVATE_FRAGMENTS); + if ((want_flags & PKG_SHARED) == PKG_SHARED) + want_client_flags &= ~(PKGCONF_PKG_PKGF_SEARCH_PRIVATE | PKGCONF_PKG_PKGF_MERGE_PRIVATE_FRAGMENTS); + /* if --static and --pure are both specified, then disable merge-back. * this allows for a --static which searches private modules, but has the same fragment behaviour as if * --static were disabled. see for rationale. diff --git a/man/pkgconf.1 b/man/pkgconf.1 index 78d29ae..2169639 100644 --- a/man/pkgconf.1 +++ b/man/pkgconf.1 @@ -58,6 +58,8 @@ dependencies of modules added to the resolver's solution. .It Fl -static Compute a deeper dependency graph and use compiler/linker flags intended for static linking. +.It Fl -shared +Compute a simple dependency graph that is only suitable for shared linking. .It Fl -pure Treats the computed dependency graph as if it were pure. This is mainly intended for use with the