7 #define CCAN_COMPILER "cc"
10 #define CCAN_CFLAGS "-g -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition -Werror"
13 #define IDENT_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
14 "abcdefghijklmnopqrstuvwxyz" \
17 #define SPACE_CHARS " \f\n\r\t\v"
19 #define COVERAGE_CFLAGS "-fprofile-arcs -ftest-coverage"
21 /* This actually compiles and runs the info file to get dependencies. */
22 char **get_deps(const void *ctx, const char *dir, bool recurse,
25 /* This is safer: just looks for ccan/ strings in info */
26 char **get_safe_ccan_deps(const void *ctx, const char *dir,
27 bool recurse, char **infofile);
29 /* This also needs to compile the info file. */
30 char **get_libs(const void *ctx, const char *dir,
31 unsigned int *num, char **infofile);
34 /* If set, print all commands run, all output they give and exit status. */
35 extern bool tools_verbose;
36 char *talloc_basename(const void *ctx, const char *dir);
37 char *talloc_dirname(const void *ctx, const char *dir);
38 char *talloc_getcwd(const void *ctx);
39 char *run_command(const void *ctx, unsigned int *time_ms, const char *fmt, ...);
40 char *run_with_timeout(const void *ctx, const char *cmd,
41 bool *ok, unsigned *timeout_ms);
42 char *temp_dir(const void *ctx);
43 bool move_file(const char *oldname, const char *newname);
47 * These all compile into a temporary dir, and return the filename.
48 * On failure they return NULL, and errmsg is set to compiler output.
50 /* If set, say what we're compiling to. */
51 extern bool compile_verbose;
52 /* Compile multiple object files into a single. */
53 char *link_objects(const void *ctx, const char *basename, bool in_pwd,
54 const char *objs, char **errmsg);
55 /* Compile a single C file to an object file. Returns errmsg if fails. */
56 char *compile_object(const void *ctx, const char *cfile, const char *ccandir,
57 const char *extra_cflags,
59 /* Compile and link single C file, with object files, libs, etc. NULL on
60 * success, error output on fail. */
61 char *compile_and_link(const void *ctx, const char *cfile, const char *ccandir,
62 const char *objs, const char *extra_cflags,
63 const char *libs, const char *outfile);
65 /* If in_pwd is false, return a file int temp_dir, otherwise a local file. */
66 char *maybe_temp_file(const void *ctx, const char *extension, bool in_pwd,
69 /* Default wait for run_command. Should never time out. */
70 extern const unsigned int default_timeout_ms;
72 #endif /* CCAN_TOOLS_H */