]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/module_links.c
ccanlint: recurse to get -l options.
[ccan] / tools / ccanlint / tests / module_links.c
index 66f8954f4be381d982e8068cf3917b653682e1c8..79aa7d1a872a6421c6fb8706142fe2df0c2b9e76 100644 (file)
@@ -23,13 +23,18 @@ static const char *can_build(struct manifest *m)
 
 static char *obj_list(const struct manifest *m)
 {
-       char *list = talloc_strdup(m, "");
+       char *list;
        struct manifest *i;
 
+       if (m->compiled[COMPILE_NORMAL])
+               list = talloc_strdup(m, m->compiled[COMPILE_NORMAL]);
+       else
+               list = talloc_strdup(m, "");
+
        /* Other CCAN deps. */
        list_for_each(&m->deps, i, list) {
                if (i->compiled[COMPILE_NORMAL])
-                       list = talloc_asprintf_append(list, "%s ",
+                       list = talloc_asprintf_append(list, " %s",
                                                      i->compiled
                                                      [COMPILE_NORMAL]);
        }
@@ -38,12 +43,12 @@ static char *obj_list(const struct manifest *m)
 
 static char *lib_list(const struct manifest *m)
 {
-       unsigned int i, num;
-       char **libs = get_libs(m, ".",
-                              &num, &m->info_file->compiled[COMPILE_NORMAL]);
+       unsigned int i;
+       char **libs;
        char *ret = talloc_strdup(m, "");
 
-       for (i = 0; i < num; i++)
+       libs = get_libs(m, m->dir, true, get_or_compile_info);
+       for (i = 0; libs[i]; i++)
                ret = talloc_asprintf_append(ret, "-l%s ", libs[i]);
        return ret;
 }