commit 9d2db0a3e18ba554613c2531d18f93cc5c54086c
parent a671626515d93dbe37b89ecb749ccf4b8c8a25f2
Author: Quentin Rameau <quinq@fifth.space>
Date: Mon, 30 May 2016 11:41:59 +0200
[driver] switch per tool in settool
We will need that later with the introduction of as and ld.
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/driver/posix/scc.c b/driver/posix/scc.c
@@ -57,7 +57,9 @@ settool(int tool, int pipeout)
int fds[2], n;
static int fdin;
- if (tool != QBE) {
+ switch (tool) {
+ case CC1:
+ case CC2:
n = snprintf(tools[tool].bin, sizeof(tools[tool].bin),
arch ? "%s-%s" : "%s", tools[tool].name, arch);
if (n < 0 || n >= sizeof(tools[tool].bin))
@@ -67,6 +69,9 @@ settool(int tool, int pipeout)
"%s/libexec/scc/%s", PREFIX, tools[tool].bin);
if (n < 0 || n >= sizeof(tools[tool].cmd))
die("scc: target tool path too long");
+ break;
+ default:
+ break;
}
tools[tool].args[0] = tools[tool].bin;