{
char *name, *p, *elem, *prefix, *exe;
bool islib, ispkg, isgo, stale, ispackcmd;
- Buf b, b1, path;
+ Buf b, b1, path, final_path, final_name;
Vec compile, files, link, go, missing, clean, lib, extra;
Time ttarg, t;
int i, j, k, n, doclean, targ;
binit(&b);
binit(&b1);
binit(&path);
+ binit(&final_path);
+ binit(&final_name);
vinit(&compile);
vinit(&files);
vinit(&link);
// path = full path to dir.
bpathf(&path, "%s/src/%s", goroot, dir);
+ bpathf(&final_path, "%s/src/%s", goroot_final, dir);
name = lastelem(dir);
// For misc/prof, copy into the tool directory and we're done.
continue;
// b = path/zp but with _goos_goarch.c instead of .goc
bprintf(&b, "%s%sz%s", bstr(&path), slash, lastelem(p));
+ bprintf(&final_name, "%s%s%s", bstr(&final_path), slash, lastelem(p));
b.len -= 4;
bwritef(&b, "_%s_%s.c", goos, goarch);
- goc2c(p, bstr(&b));
+ goc2c(p, bstr(&final_name), bstr(&b));
vadd(&files, bstr(&b));
}
vuniq(&files);
/* File and line number */
static const char *file;
+static const char *final_file;
static unsigned int lineno;
/* List of names and types. */
if (lastline == lineno-1)
bwritef(output, "\n");
else
- bwritef(output, "\n#line %d \"%s\"\n", lineno, file);
+ bwritef(output, "\n#line %d \"%s\"\n", lineno, final_file);
lastline = lineno;
}
bwritef(output, "%s ", token);
write_gcc_func_header(package, name, params, rets);
else
write_6g_func_header(package, name, params, paramwid, rets);
- bwritef(output, "#line %d \"%s\"\n", lineno, file);
+ bwritef(output, "#line %d \"%s\"\n", lineno, final_file);
}
/* Write out a function trailer. */
}
void
-goc2c(char *goc, char *c)
+goc2c(char *goc, char *goc_final, char *c)
{
int i;
Buf in, out;
binit(&out);
file = goc;
+ final_file = goc_final;
readfile(&in, goc);
// TODO: set gcc=1 when using gcc