From b0521ec9d83f2bbf0bea9c1949fbcb7754865ea6 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 3 May 2012 19:36:47 +0000 Subject: [PATCH] main: implement support for printing fragment lists --- main.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 10c26c1..8a72c48 100644 --- a/main.c +++ b/main.c @@ -55,13 +55,27 @@ static char *required_pkgconfig_version = NULL; static char *required_module_version = NULL; static char *want_variable = NULL; +static void +print_fragment(pkg_fragment_t *frag) +{ + if (frag->type) + printf("-%c%s ", frag->type, frag->data); + else + printf("%s ", frag->data); +} + static void print_cflags(pkg_t *pkg, void *unused) { (void) unused; if (pkg->cflags != NULL) - printf("%s ", pkg->cflags); + { + pkg_fragment_t *frag; + + foreach_list_entry(pkg->cflags, frag) + print_fragment(frag); + } } static void @@ -70,10 +84,20 @@ print_libs(pkg_t *pkg, void *unused) (void) unused; if (pkg->libs != NULL) - printf("%s ", pkg->libs); + { + pkg_fragment_t *frag; + + foreach_list_entry(pkg->libs, frag) + print_fragment(frag); + } if (want_static && pkg->libs_private != NULL) - printf("%s ", pkg->libs_private); + { + pkg_fragment_t *frag; + + foreach_list_entry(pkg->libs_private, frag) + print_fragment(frag); + } } static void