#include <ccan/err/err.h>
#include <ccan/str/str.h>
#include <ccan/tal/path/path.h>
#include <ccan/err/err.h>
#include <ccan/str/str.h>
#include <ccan/tal/path/path.h>
-char *read_config_header(const char *ccan_dir,
- const char **compiler, const char **cflags,
- bool verbose)
+char *read_config_header(const char *ccan_dir, bool verbose)
lines = tal_strsplit(config_header, config_header, "\n", STR_EMPTY_OK);
for (i = 0; i < tal_count(lines) - 1; i++) {
lines = tal_strsplit(config_header, config_header, "\n", STR_EMPTY_OK);
for (i = 0; i < tal_count(lines) - 1; i++) {
if (!get_token(line, "define"))
continue;
sym = get_symbol_token(lines, line);
if (!get_token(line, "define"))
continue;
sym = get_symbol_token(lines, line);
- if (streq(sym, "CCAN_COMPILER") && !compiler) {
- *compiler = demangle_string(lines[i]);
- if (!*compiler)
+ if (streq(sym, "CCAN_COMPILER")) {
+ compiler = demangle_string(lines[i]);
+ if (!compiler)
errx(1, "%s:%u:could not parse CCAN_COMPILER",
fname, i+1);
if (verbose)
printf("%s: compiler set to '%s'\n",
errx(1, "%s:%u:could not parse CCAN_COMPILER",
fname, i+1);
if (verbose)
printf("%s: compiler set to '%s'\n",
- fname, *compiler);
- } else if (streq(sym, "CCAN_CFLAGS") && !cflags) {
- *cflags = demangle_string(lines[i]);
- if (!*cflags)
+ fname, compiler);
+ } else if (streq(sym, "CCAN_CFLAGS")) {
+ cflags = demangle_string(lines[i]);
+ if (!cflags)
errx(1, "%s:%u:could not parse CCAN_CFLAGS",
fname, i+1);
if (verbose)
printf("%s: compiler flags set to '%s'\n",
errx(1, "%s:%u:could not parse CCAN_CFLAGS",
fname, i+1);
if (verbose)
printf("%s: compiler flags set to '%s'\n",