/* From tests/check_depends_exist.c */
struct list_head dep_dirs;
- /* From tests/check_depends_built.c */
- struct list_head dep_objs;
};
struct manifest *get_manifest(const void *ctx, const char *dir);
struct ccan_file *i;
/* Other CCAN deps. */
- list_for_each(&m->dep_objs, i, list)
- list = talloc_asprintf_append(list, "%s ", i->name);
-
+ list_for_each(&m->dep_dirs, i, list) {
+ if (i->compiled)
+ list = talloc_asprintf_append(list, "%s ", i->compiled);
+ }
return list;
}
char *report = NULL;
list_for_each(&m->dep_dirs, i, list) {
- char *objfile;
-
if (!expect_obj_file(i->fullname))
continue;
- objfile = talloc_asprintf(m, "%s.o", i->fullname);
- if (stat(objfile, &st) != 0) {
+ i->compiled = talloc_asprintf(i, "%s.o", i->fullname);
+ if (stat(i->compiled, &st) != 0) {
report = talloc_asprintf_append(report,
"object file %s\n",
- objfile);
- } else {
- struct ccan_file *f = new_ccan_file(m, "", objfile);
- list_add_tail(&m->dep_objs, &f->list);
- }
-
+ i->compiled);
+ i->compiled = NULL;
+ }
}
/* We may need libtap for testing, unless we're "tap" */
static char *add_dep(char *sofar, struct manifest *m, const char *dep)
{
- char *dir;
struct stat st;
struct ccan_file *f;
- dir = talloc_asprintf(m, "%s/%s", ccan_dir, dep);
- if (stat(dir, &st) != 0) {
+ f = new_ccan_file(m, ccan_dir, talloc_strdup(m, dep));
+ if (stat(f->fullname, &st) != 0) {
return talloc_asprintf_append(sofar,
"ccan/%s: expected it in"
" directory %s\n",
- dep, dir);
+ dep, f->fullname);
}
- f = new_ccan_file(m, "", dir);
list_add_tail(&m->dep_dirs, &f->list);
return sofar;
}
list = talloc_asprintf_append(list, " %s.o", m->dir);
/* Other ccan modules. */
- list_for_each(&m->dep_objs, i, list)
- list = talloc_asprintf_append(list, " %s", i->name);
+ list_for_each(&m->dep_dirs, i, list) {
+ if (i->compiled)
+ list = talloc_asprintf_append(list, " %s", i->compiled);
+ }
return list;
}
#include <dirent.h>
#include <ctype.h>
#include <stdarg.h>
+#include <assert.h>
const char *ccan_dir;
{
struct ccan_file *f;
+ assert(dir[0] == '/');
+
f = talloc(ctx, struct ccan_file);
f->lines = NULL;
f->line_info = NULL;
list_head_init(&m->other_test_files);
list_head_init(&m->other_files);
list_head_init(&m->dep_dirs);
- list_head_init(&m->dep_objs);
olddir = talloc_getcwd(NULL);
if (!olddir)