diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-05-04 01:04:51 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-05-04 01:04:51 +0200 |
commit | 14cda8f405d55947c0a3fae0852b04af8405eae0 (patch) | |
tree | fa304ad78ef1a8166b3dcd964e1a63091d4c9db2 /src/cmd/cc/lex.c | |
parent | c1ba1a0fec4aed430709030f98a3bdb90bfeea16 (diff) | |
download | golang-upstream/57.tar.gz |
Imported Upstream version 57upstream/57
Diffstat (limited to 'src/cmd/cc/lex.c')
-rw-r--r-- | src/cmd/cc/lex.c | 58 |
1 files changed, 4 insertions, 54 deletions
diff --git a/src/cmd/cc/lex.c b/src/cmd/cc/lex.c index dba8ff634..71cc89bf0 100644 --- a/src/cmd/cc/lex.c +++ b/src/cmd/cc/lex.c @@ -88,7 +88,7 @@ void main(int argc, char *argv[]) { char **defs, *p; - int nproc, nout, i, c, ndef; + int c, ndef; ensuresymb(NSYMB); memset(debug, 0, sizeof(debug)); @@ -142,51 +142,10 @@ main(int argc, char *argv[]) print("usage: %cc [-options] files\n", thechar); errorexit(); } - if(argc > 1 && systemtype(Windows)){ - print("can't compile multiple files on windows\n"); + if(argc > 1){ + print("can't compile multiple files\n"); errorexit(); } - if(argc > 1 && !systemtype(Windows)) { - nproc = 1; - /* - * if we're writing acid to standard output, don't compile - * concurrently, to avoid interleaving output. - */ - if(((!debug['a'] && !debug['q'] && !debug['Q']) || debug['n']) && - (p = getenv("NPROC")) != nil) - nproc = atol(p); /* */ - c = 0; - nout = 0; - for(;;) { - Waitmsg *w; - - while(nout < nproc && argc > 0) { - i = fork(); - if(i < 0) { - print("cannot create a process\n"); - errorexit(); - } - if(i == 0) { - fprint(2, "%s:\n", *argv); - if (compile(*argv, defs, ndef)) - errorexit(); - exits(0); - } - nout++; - argc--; - argv++; - } - w = wait(); - if(w == nil) { - if(c) - errorexit(); - exits(0); - } - if(w->msg[0]) - c++; - nout--; - } - } if(argc == 0) c = compile("stdin", defs, ndef); @@ -201,7 +160,7 @@ main(int argc, char *argv[]) int compile(char *file, char **defs, int ndef) { - char *ofile, incfile[20]; + char *ofile; char *p, **av, opt[256]; int i, c, fd[2]; static int first = 1; @@ -236,15 +195,6 @@ compile(char *file, char **defs, int ndef) outfile = "/dev/null"; } - if(p = getenv("INCLUDE")) { - setinclude(p); - } else { - if(systemtype(Plan9)) { - sprint(incfile, "/%s/include", thestring); - setinclude(strdup(incfile)); - setinclude("/sys/include"); - } - } if (first) Binit(&diagbuf, 1, OWRITE); /* |