Handle LDLIBS as a separate thing
This commit is contained in:
parent
8ef4638018
commit
7d6af5f4c7
14
nextlang.c
14
nextlang.c
@ -112,9 +112,17 @@ int main(int argc, char *argv[])
|
|||||||
fclose(out);
|
fclose(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *flags = getenv("CFLAGS");
|
const char *cflags = getenv("CFLAGS");
|
||||||
if (!flags) flags = "-std=c11 -lm -lgc -lcord";
|
if (!cflags)
|
||||||
const char *run = heap_strf(verbose ? "tcc %s -run - | bat --file-name=output.txt" : "tcc %s -run -", flags);
|
cflags = "-std=c11";
|
||||||
|
|
||||||
|
const char *ldlibs = "-lgc -lcord -lm";
|
||||||
|
if (getenv("LDLIBS"))
|
||||||
|
ldlibs = heap_strf("%s %s", ldlibs, getenv("LDLIBS"));
|
||||||
|
|
||||||
|
const char *run = heap_strf("tcc %s %s -run -", cflags, ldlibs);
|
||||||
|
if (verbose)
|
||||||
|
run = heap_strf("%s | bat --file-name=STDOUT", run);
|
||||||
FILE *cc = popen(run, "w");
|
FILE *cc = popen(run, "w");
|
||||||
CORD_put(program, cc);
|
CORD_put(program, cc);
|
||||||
fclose(cc);
|
fclose(cc);
|
||||||
|
Loading…
Reference in New Issue
Block a user