cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// Copyright 2012 The Go Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
#include "a.h"
|
2012-02-03 18:16:42 -05:00
|
|
|
#include "arg.h"
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Initialization for any invocation.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// The usual variables.
|
|
|
|
|
char *goarch;
|
|
|
|
|
char *gobin;
|
|
|
|
|
char *gohostarch;
|
2012-02-13 22:31:51 -05:00
|
|
|
char *gohostchar;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
char *gohostos;
|
|
|
|
|
char *goos;
|
2012-10-22 14:26:36 +08:00
|
|
|
char *goarm;
|
2013-01-02 22:55:23 +01:00
|
|
|
char *go386;
|
2012-02-09 20:47:12 -02:00
|
|
|
char *goroot = GOROOT_FINAL;
|
|
|
|
|
char *goroot_final = GOROOT_FINAL;
|
2013-03-29 16:33:35 -07:00
|
|
|
char *goextlinkenabled = "";
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
char *workdir;
|
2012-04-02 22:33:38 +08:00
|
|
|
char *tooldir;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
char *gochar;
|
2012-02-03 18:16:42 -05:00
|
|
|
char *goversion;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
char *slash; // / for unix, \ for windows
|
2013-08-02 14:58:27 -04:00
|
|
|
char *defaultcc;
|
|
|
|
|
bool rebuildall;
|
|
|
|
|
bool defaultclang;
|
2012-02-13 22:31:51 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
static bool shouldbuild(char*, char*);
|
2012-02-21 16:49:30 -05:00
|
|
|
static void copy(char*, char*, int);
|
2012-02-03 18:16:42 -05:00
|
|
|
static char *findgoversion(void);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
|
|
|
|
// The known architecture letters.
|
|
|
|
|
static char *gochars = "568";
|
|
|
|
|
|
|
|
|
|
// The known architectures.
|
|
|
|
|
static char *okgoarch[] = {
|
|
|
|
|
// same order as gochars
|
|
|
|
|
"arm",
|
|
|
|
|
"amd64",
|
|
|
|
|
"386",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// The known operating systems.
|
|
|
|
|
static char *okgoos[] = {
|
|
|
|
|
"darwin",
|
|
|
|
|
"linux",
|
|
|
|
|
"freebsd",
|
|
|
|
|
"netbsd",
|
|
|
|
|
"openbsd",
|
|
|
|
|
"plan9",
|
|
|
|
|
"windows",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void rmworkdir(void);
|
|
|
|
|
|
|
|
|
|
// find reports the first index of p in l[0:n], or else -1.
|
2012-02-03 18:16:42 -05:00
|
|
|
int
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
find(char *p, char **l, int n)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
for(i=0; i<n; i++)
|
|
|
|
|
if(streq(p, l[i]))
|
|
|
|
|
return i;
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// init handles initialization of the various global state, like goroot and goarch.
|
|
|
|
|
void
|
|
|
|
|
init(void)
|
|
|
|
|
{
|
|
|
|
|
char *p;
|
|
|
|
|
int i;
|
|
|
|
|
Buf b;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
binit(&b);
|
|
|
|
|
|
|
|
|
|
xgetenv(&b, "GOROOT");
|
2012-02-17 11:29:34 -05:00
|
|
|
if(b.len > 0) {
|
|
|
|
|
// if not "/", then strip trailing path separator
|
|
|
|
|
if(b.len >= 2 && b.p[b.len - 1] == slash[0])
|
|
|
|
|
b.len--;
|
2012-02-09 20:47:12 -02:00
|
|
|
goroot = btake(&b);
|
2012-02-17 11:29:34 -05:00
|
|
|
}
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
|
|
|
|
xgetenv(&b, "GOBIN");
|
|
|
|
|
if(b.len == 0)
|
|
|
|
|
bprintf(&b, "%s%sbin", goroot, slash);
|
|
|
|
|
gobin = btake(&b);
|
|
|
|
|
|
|
|
|
|
xgetenv(&b, "GOOS");
|
|
|
|
|
if(b.len == 0)
|
|
|
|
|
bwritestr(&b, gohostos);
|
|
|
|
|
goos = btake(&b);
|
|
|
|
|
if(find(goos, okgoos, nelem(okgoos)) < 0)
|
|
|
|
|
fatal("unknown $GOOS %s", goos);
|
|
|
|
|
|
2012-10-22 14:26:36 +08:00
|
|
|
xgetenv(&b, "GOARM");
|
|
|
|
|
if(b.len == 0)
|
|
|
|
|
bwritestr(&b, xgetgoarm());
|
|
|
|
|
goarm = btake(&b);
|
|
|
|
|
|
2013-01-02 22:55:23 +01:00
|
|
|
xgetenv(&b, "GO386");
|
2013-01-04 10:59:10 -05:00
|
|
|
if(b.len == 0) {
|
2013-01-18 15:10:36 -05:00
|
|
|
if(cansse2())
|
|
|
|
|
bwritestr(&b, "sse2");
|
2013-01-04 10:59:10 -05:00
|
|
|
else
|
|
|
|
|
bwritestr(&b, "387");
|
|
|
|
|
}
|
2013-01-02 22:55:23 +01:00
|
|
|
go386 = btake(&b);
|
|
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
p = bpathf(&b, "%s/include/u.h", goroot);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(!isfile(p)) {
|
|
|
|
|
fatal("$GOROOT is not set correctly or not exported\n"
|
|
|
|
|
"\tGOROOT=%s\n"
|
|
|
|
|
"\t%s does not exist", goroot, p);
|
|
|
|
|
}
|
2012-02-03 18:16:42 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
xgetenv(&b, "GOHOSTARCH");
|
|
|
|
|
if(b.len > 0)
|
|
|
|
|
gohostarch = btake(&b);
|
|
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
i = find(gohostarch, okgoarch, nelem(okgoarch));
|
|
|
|
|
if(i < 0)
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
fatal("unknown $GOHOSTARCH %s", gohostarch);
|
2012-02-13 22:31:51 -05:00
|
|
|
bprintf(&b, "%c", gochars[i]);
|
|
|
|
|
gohostchar = btake(&b);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
|
|
|
|
xgetenv(&b, "GOARCH");
|
|
|
|
|
if(b.len == 0)
|
|
|
|
|
bwritestr(&b, gohostarch);
|
|
|
|
|
goarch = btake(&b);
|
2012-02-13 22:31:51 -05:00
|
|
|
i = find(goarch, okgoarch, nelem(okgoarch));
|
|
|
|
|
if(i < 0)
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
fatal("unknown $GOARCH %s", goarch);
|
|
|
|
|
bprintf(&b, "%c", gochars[i]);
|
|
|
|
|
gochar = btake(&b);
|
|
|
|
|
|
2013-03-29 16:33:35 -07:00
|
|
|
xgetenv(&b, "GO_EXTLINK_ENABLED");
|
|
|
|
|
if(b.len > 0) {
|
|
|
|
|
goextlinkenabled = btake(&b);
|
|
|
|
|
if(!streq(goextlinkenabled, "0") && !streq(goextlinkenabled, "1"))
|
|
|
|
|
fatal("unknown $GO_EXTLINK_ENABLED %s", goextlinkenabled);
|
|
|
|
|
}
|
2013-08-02 14:58:27 -04:00
|
|
|
|
|
|
|
|
xgetenv(&b, "CC");
|
|
|
|
|
if(b.len == 0) {
|
|
|
|
|
// Use clang on OS X, because gcc is deprecated there.
|
|
|
|
|
// Xcode for OS X 10.9 Mavericks will ship a fake "gcc" binary that
|
|
|
|
|
// actually runs clang. We prepare different command
|
|
|
|
|
// lines for the two binaries, so it matters what we call it.
|
|
|
|
|
// See golang.org/issue/5822.
|
|
|
|
|
if(defaultclang)
|
|
|
|
|
bprintf(&b, "clang");
|
|
|
|
|
else
|
|
|
|
|
bprintf(&b, "gcc");
|
|
|
|
|
}
|
|
|
|
|
defaultcc = btake(&b);
|
2013-03-29 16:33:35 -07:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
xsetenv("GOROOT", goroot);
|
|
|
|
|
xsetenv("GOARCH", goarch);
|
|
|
|
|
xsetenv("GOOS", goos);
|
2012-10-22 14:26:36 +08:00
|
|
|
xsetenv("GOARM", goarm);
|
2013-01-02 22:55:23 +01:00
|
|
|
xsetenv("GO386", go386);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// Make the environment more predictable.
|
|
|
|
|
xsetenv("LANG", "C");
|
|
|
|
|
xsetenv("LANGUAGE", "en_US.UTF8");
|
|
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
goversion = findgoversion();
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
workdir = xworkdir();
|
|
|
|
|
xatexit(rmworkdir);
|
|
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
bpathf(&b, "%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch);
|
|
|
|
|
tooldir = btake(&b);
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
bfree(&b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rmworkdir deletes the work directory.
|
|
|
|
|
static void
|
|
|
|
|
rmworkdir(void)
|
|
|
|
|
{
|
2012-02-03 18:16:42 -05:00
|
|
|
if(vflag > 1)
|
2012-07-06 15:00:18 +10:00
|
|
|
errprintf("rm -rf %s\n", workdir);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
xremoveall(workdir);
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
// Remove trailing spaces.
|
|
|
|
|
static void
|
|
|
|
|
chomp(Buf *b)
|
|
|
|
|
{
|
|
|
|
|
int c;
|
|
|
|
|
|
|
|
|
|
while(b->len > 0 && ((c=b->p[b->len-1]) == ' ' || c == '\t' || c == '\r' || c == '\n'))
|
|
|
|
|
b->len--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// findgoversion determines the Go version to use in the version string.
|
|
|
|
|
static char*
|
|
|
|
|
findgoversion(void)
|
|
|
|
|
{
|
|
|
|
|
char *tag, *rev, *p;
|
|
|
|
|
int i, nrev;
|
|
|
|
|
Buf b, path, bmore, branch;
|
|
|
|
|
Vec tags;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
binit(&b);
|
|
|
|
|
binit(&path);
|
|
|
|
|
binit(&bmore);
|
|
|
|
|
binit(&branch);
|
|
|
|
|
vinit(&tags);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
// The $GOROOT/VERSION file takes priority, for distributions
|
|
|
|
|
// without the Mercurial repo.
|
|
|
|
|
bpathf(&path, "%s/VERSION", goroot);
|
|
|
|
|
if(isfile(bstr(&path))) {
|
|
|
|
|
readfile(&b, bstr(&path));
|
|
|
|
|
chomp(&b);
|
2012-02-07 00:38:15 -02:00
|
|
|
// Commands such as "dist version > VERSION" will cause
|
|
|
|
|
// the shell to create an empty VERSION file and set dist's
|
|
|
|
|
// stdout to its fd. dist in turn looks at VERSION and uses
|
|
|
|
|
// its content if available, which is empty at this point.
|
|
|
|
|
if(b.len > 0)
|
|
|
|
|
goto done;
|
2012-02-03 18:16:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The $GOROOT/VERSION.cache file is a cache to avoid invoking
|
|
|
|
|
// hg every time we run this command. Unlike VERSION, it gets
|
|
|
|
|
// deleted by the clean command.
|
|
|
|
|
bpathf(&path, "%s/VERSION.cache", goroot);
|
|
|
|
|
if(isfile(bstr(&path))) {
|
|
|
|
|
readfile(&b, bstr(&path));
|
|
|
|
|
chomp(&b);
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Otherwise, use Mercurial.
|
|
|
|
|
// What is the current branch?
|
|
|
|
|
run(&branch, goroot, CheckExit, "hg", "identify", "-b", nil);
|
|
|
|
|
chomp(&branch);
|
|
|
|
|
|
|
|
|
|
// What are the tags along the current branch?
|
2012-09-24 21:35:20 -04:00
|
|
|
tag = "devel";
|
2012-02-03 18:16:42 -05:00
|
|
|
rev = ".";
|
2012-03-06 17:21:39 +11:00
|
|
|
run(&b, goroot, CheckExit, "hg", "log", "-b", bstr(&branch), "-r", ".:0", "--template", "{tags} + ", nil);
|
2012-02-03 18:16:42 -05:00
|
|
|
splitfields(&tags, bstr(&b));
|
|
|
|
|
nrev = 0;
|
|
|
|
|
for(i=0; i<tags.len; i++) {
|
|
|
|
|
p = tags.p[i];
|
|
|
|
|
if(streq(p, "+"))
|
|
|
|
|
nrev++;
|
2012-09-24 21:35:20 -04:00
|
|
|
// NOTE: Can reenable the /* */ code when we want to
|
|
|
|
|
// start reporting versions named 'weekly' again.
|
|
|
|
|
if(/*hasprefix(p, "weekly.") ||*/ hasprefix(p, "go")) {
|
2012-02-03 18:16:42 -05:00
|
|
|
tag = xstrdup(p);
|
|
|
|
|
// If this tag matches the current checkout
|
|
|
|
|
// exactly (no "+" yet), don't show extra
|
|
|
|
|
// revision information.
|
|
|
|
|
if(nrev == 0)
|
|
|
|
|
rev = "";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(tag[0] == '\0') {
|
|
|
|
|
// Did not find a tag; use branch name.
|
|
|
|
|
bprintf(&b, "branch.%s", bstr(&branch));
|
|
|
|
|
tag = btake(&b);
|
|
|
|
|
}
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
if(rev[0]) {
|
|
|
|
|
// Tag is before the revision we're building.
|
|
|
|
|
// Add extra information.
|
2012-09-24 21:35:20 -04:00
|
|
|
run(&bmore, goroot, CheckExit, "hg", "log", "--template", " +{node|short} {date|date}", "-r", rev, nil);
|
2012-02-03 18:16:42 -05:00
|
|
|
chomp(&bmore);
|
|
|
|
|
}
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
bprintf(&b, "%s", tag);
|
|
|
|
|
if(bmore.len > 0)
|
|
|
|
|
bwriteb(&b, &bmore);
|
|
|
|
|
|
|
|
|
|
// Cache version.
|
2012-02-21 16:49:30 -05:00
|
|
|
writefile(&b, bstr(&path), 0);
|
2012-02-03 18:16:42 -05:00
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
p = btake(&b);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
|
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
bfree(&b);
|
|
|
|
|
bfree(&path);
|
|
|
|
|
bfree(&bmore);
|
|
|
|
|
bfree(&branch);
|
|
|
|
|
vfree(&tags);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
/*
|
|
|
|
|
* Initial tree setup.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// The old tools that no longer live in $GOBIN or $GOROOT/bin.
|
|
|
|
|
static char *oldtool[] = {
|
|
|
|
|
"5a", "5c", "5g", "5l",
|
|
|
|
|
"6a", "6c", "6g", "6l",
|
|
|
|
|
"8a", "8c", "8g", "8l",
|
|
|
|
|
"6cov",
|
|
|
|
|
"6nm",
|
2012-02-13 22:31:51 -05:00
|
|
|
"6prof",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"cgo",
|
|
|
|
|
"ebnflint",
|
|
|
|
|
"goapi",
|
|
|
|
|
"gofix",
|
|
|
|
|
"goinstall",
|
|
|
|
|
"gomake",
|
|
|
|
|
"gopack",
|
|
|
|
|
"gopprof",
|
|
|
|
|
"gotest",
|
|
|
|
|
"gotype",
|
|
|
|
|
"govet",
|
|
|
|
|
"goyacc",
|
|
|
|
|
"quietgcc",
|
|
|
|
|
};
|
|
|
|
|
|
2012-02-14 00:18:30 -05:00
|
|
|
// Unreleased directories (relative to $GOROOT) that should
|
|
|
|
|
// not be in release branches.
|
|
|
|
|
static char *unreleased[] = {
|
|
|
|
|
"src/cmd/prof",
|
|
|
|
|
"src/pkg/old",
|
|
|
|
|
};
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// setup sets up the tree for the initial build.
|
|
|
|
|
static void
|
|
|
|
|
setup(void)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
Buf b;
|
|
|
|
|
char *p;
|
|
|
|
|
|
|
|
|
|
binit(&b);
|
|
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
// Create bin directory.
|
2012-02-03 18:16:42 -05:00
|
|
|
p = bpathf(&b, "%s/bin", goroot);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(!isdir(p))
|
|
|
|
|
xmkdir(p);
|
|
|
|
|
|
|
|
|
|
// Create package directory.
|
2012-02-03 18:16:42 -05:00
|
|
|
p = bpathf(&b, "%s/pkg", goroot);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(!isdir(p))
|
|
|
|
|
xmkdir(p);
|
2012-02-13 22:31:51 -05:00
|
|
|
p = bpathf(&b, "%s/pkg/%s_%s", goroot, gohostos, gohostarch);
|
|
|
|
|
if(rebuildall)
|
|
|
|
|
xremoveall(p);
|
2012-02-15 11:48:17 -05:00
|
|
|
xmkdirall(p);
|
2012-02-13 22:31:51 -05:00
|
|
|
if(!streq(goos, gohostos) || !streq(goarch, gohostarch)) {
|
|
|
|
|
p = bpathf(&b, "%s/pkg/%s_%s", goroot, goos, goarch);
|
|
|
|
|
if(rebuildall)
|
|
|
|
|
xremoveall(p);
|
2012-02-15 11:48:17 -05:00
|
|
|
xmkdirall(p);
|
2012-02-13 22:31:51 -05:00
|
|
|
}
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
// Create object directory.
|
|
|
|
|
// We keep it in pkg/ so that all the generated binaries
|
2012-02-13 22:31:51 -05:00
|
|
|
// are in one tree. If pkg/obj/libgc.a exists, it is a dreg from
|
|
|
|
|
// before we used subdirectories of obj. Delete all of obj
|
|
|
|
|
// to clean up.
|
|
|
|
|
bpathf(&b, "%s/pkg/obj/libgc.a", goroot);
|
|
|
|
|
if(isfile(bstr(&b)))
|
|
|
|
|
xremoveall(bpathf(&b, "%s/pkg/obj", goroot));
|
|
|
|
|
p = bpathf(&b, "%s/pkg/obj/%s_%s", goroot, gohostos, gohostarch);
|
|
|
|
|
if(rebuildall)
|
|
|
|
|
xremoveall(p);
|
|
|
|
|
xmkdirall(p);
|
|
|
|
|
|
|
|
|
|
// Create tool directory.
|
|
|
|
|
// We keep it in pkg/, just like the object directory above.
|
2012-02-15 11:48:17 -05:00
|
|
|
if(rebuildall)
|
|
|
|
|
xremoveall(tooldir);
|
2012-02-13 22:31:51 -05:00
|
|
|
xmkdirall(tooldir);
|
|
|
|
|
|
|
|
|
|
// Remove tool binaries from before the tool/gohostos_gohostarch
|
|
|
|
|
xremoveall(bpathf(&b, "%s/bin/tool", goroot));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
|
|
|
|
// Remove old pre-tool binaries.
|
|
|
|
|
for(i=0; i<nelem(oldtool); i++)
|
2012-02-13 22:31:51 -05:00
|
|
|
xremove(bpathf(&b, "%s/bin/%s", goroot, oldtool[i]));
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// If $GOBIN is set and has a Go compiler, it must be cleaned.
|
|
|
|
|
for(i=0; gochars[i]; i++) {
|
|
|
|
|
if(isfile(bprintf(&b, "%s%s%c%s", gobin, slash, gochars[i], "g"))) {
|
|
|
|
|
for(i=0; i<nelem(oldtool); i++)
|
|
|
|
|
xremove(bprintf(&b, "%s%s%s", gobin, slash, oldtool[i]));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-14 00:18:30 -05:00
|
|
|
// For release, make sure excluded things are excluded.
|
2012-03-27 00:17:35 -04:00
|
|
|
if(hasprefix(goversion, "release.") || hasprefix(goversion, "go")) {
|
2012-02-14 00:18:30 -05:00
|
|
|
for(i=0; i<nelem(unreleased); i++)
|
|
|
|
|
if(isdir(bpathf(&b, "%s/%s", goroot, unreleased[i])))
|
|
|
|
|
fatal("%s should not exist in release build", bstr(&b));
|
|
|
|
|
}
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
bfree(&b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* C library and tool building
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// gccargs is the gcc command line to use for compiling a single C file.
|
2012-02-08 00:22:38 -05:00
|
|
|
static char *proto_gccargs[] = {
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"-Wall",
|
2013-02-05 21:43:04 +08:00
|
|
|
// native Plan 9 compilers don't like non-standard prototypes
|
|
|
|
|
// so let gcc catch them.
|
|
|
|
|
"-Wstrict-prototypes",
|
2013-07-19 19:36:15 -04:00
|
|
|
"-Wextra",
|
|
|
|
|
"-Wunused",
|
|
|
|
|
"-Wuninitialized",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"-Wno-sign-compare",
|
|
|
|
|
"-Wno-missing-braces",
|
|
|
|
|
"-Wno-parentheses",
|
|
|
|
|
"-Wno-unknown-pragmas",
|
|
|
|
|
"-Wno-switch",
|
|
|
|
|
"-Wno-comment",
|
2013-07-19 19:36:15 -04:00
|
|
|
"-Wno-missing-field-initializers",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"-Werror",
|
|
|
|
|
"-fno-common",
|
2013-02-23 20:24:38 +08:00
|
|
|
"-ggdb",
|
2012-12-30 10:33:33 +11:00
|
|
|
"-pipe",
|
2013-03-03 06:50:17 +08:00
|
|
|
#if defined(__NetBSD__) && defined(__arm__)
|
|
|
|
|
// GCC 4.5.4 (NetBSD nb1 20120916) on ARM is known to mis-optimize gc/mparith3.c
|
|
|
|
|
// Fix available at http://patchwork.ozlabs.org/patch/64562/.
|
|
|
|
|
"-O1",
|
|
|
|
|
#else
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"-O2",
|
2013-03-03 06:50:17 +08:00
|
|
|
#endif
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
};
|
|
|
|
|
|
2012-02-08 00:22:38 -05:00
|
|
|
static Vec gccargs;
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// deptab lists changes to the default dependencies for a given prefix.
|
2012-02-28 16:18:24 -05:00
|
|
|
// deps ending in /* read the whole directory; deps beginning with -
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// exclude files with that prefix.
|
|
|
|
|
static struct {
|
|
|
|
|
char *prefix; // prefix of target
|
|
|
|
|
char *dep[20]; // dependency tweaks for targets with that prefix
|
|
|
|
|
} deptab[] = {
|
|
|
|
|
{"lib9", {
|
|
|
|
|
"$GOROOT/include/u.h",
|
|
|
|
|
"$GOROOT/include/utf.h",
|
|
|
|
|
"$GOROOT/include/fmt.h",
|
|
|
|
|
"$GOROOT/include/libc.h",
|
|
|
|
|
"fmt/*",
|
|
|
|
|
"utf/*",
|
|
|
|
|
}},
|
|
|
|
|
{"libbio", {
|
|
|
|
|
"$GOROOT/include/u.h",
|
|
|
|
|
"$GOROOT/include/utf.h",
|
|
|
|
|
"$GOROOT/include/fmt.h",
|
|
|
|
|
"$GOROOT/include/libc.h",
|
|
|
|
|
"$GOROOT/include/bio.h",
|
|
|
|
|
}},
|
|
|
|
|
{"libmach", {
|
|
|
|
|
"$GOROOT/include/u.h",
|
|
|
|
|
"$GOROOT/include/utf.h",
|
|
|
|
|
"$GOROOT/include/fmt.h",
|
|
|
|
|
"$GOROOT/include/libc.h",
|
|
|
|
|
"$GOROOT/include/bio.h",
|
|
|
|
|
"$GOROOT/include/ar.h",
|
|
|
|
|
"$GOROOT/include/bootexec.h",
|
|
|
|
|
"$GOROOT/include/mach.h",
|
|
|
|
|
"$GOROOT/include/ureg_amd64.h",
|
|
|
|
|
"$GOROOT/include/ureg_arm.h",
|
|
|
|
|
"$GOROOT/include/ureg_x86.h",
|
|
|
|
|
}},
|
|
|
|
|
{"cmd/cc", {
|
|
|
|
|
"-pgen.c",
|
|
|
|
|
"-pswt.c",
|
|
|
|
|
}},
|
|
|
|
|
{"cmd/gc", {
|
|
|
|
|
"-cplx.c",
|
|
|
|
|
"-pgen.c",
|
2013-08-12 19:14:02 -04:00
|
|
|
"-popt.c",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"-y1.tab.c", // makefile dreg
|
|
|
|
|
"opnames.h",
|
|
|
|
|
}},
|
|
|
|
|
{"cmd/5c", {
|
|
|
|
|
"../cc/pgen.c",
|
|
|
|
|
"../cc/pswt.c",
|
|
|
|
|
"../5l/enam.c",
|
2012-02-13 22:31:51 -05:00
|
|
|
"$GOROOT/pkg/obj/$GOOS_$GOARCH/libcc.a",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}},
|
|
|
|
|
{"cmd/6c", {
|
|
|
|
|
"../cc/pgen.c",
|
|
|
|
|
"../cc/pswt.c",
|
|
|
|
|
"../6l/enam.c",
|
2012-02-13 22:31:51 -05:00
|
|
|
"$GOROOT/pkg/obj/$GOOS_$GOARCH/libcc.a",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}},
|
|
|
|
|
{"cmd/8c", {
|
|
|
|
|
"../cc/pgen.c",
|
|
|
|
|
"../cc/pswt.c",
|
|
|
|
|
"../8l/enam.c",
|
2012-02-13 22:31:51 -05:00
|
|
|
"$GOROOT/pkg/obj/$GOOS_$GOARCH/libcc.a",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}},
|
|
|
|
|
{"cmd/5g", {
|
|
|
|
|
"../gc/cplx.c",
|
|
|
|
|
"../gc/pgen.c",
|
2013-08-12 19:14:02 -04:00
|
|
|
"../gc/popt.c",
|
|
|
|
|
"../gc/popt.h",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"../5l/enam.c",
|
2012-02-13 22:31:51 -05:00
|
|
|
"$GOROOT/pkg/obj/$GOOS_$GOARCH/libgc.a",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}},
|
|
|
|
|
{"cmd/6g", {
|
|
|
|
|
"../gc/cplx.c",
|
|
|
|
|
"../gc/pgen.c",
|
2013-08-12 19:14:02 -04:00
|
|
|
"../gc/popt.c",
|
|
|
|
|
"../gc/popt.h",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"../6l/enam.c",
|
2012-02-13 22:31:51 -05:00
|
|
|
"$GOROOT/pkg/obj/$GOOS_$GOARCH/libgc.a",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}},
|
|
|
|
|
{"cmd/8g", {
|
|
|
|
|
"../gc/cplx.c",
|
|
|
|
|
"../gc/pgen.c",
|
2013-08-12 19:14:02 -04:00
|
|
|
"../gc/popt.c",
|
|
|
|
|
"../gc/popt.h",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"../8l/enam.c",
|
2012-02-13 22:31:51 -05:00
|
|
|
"$GOROOT/pkg/obj/$GOOS_$GOARCH/libgc.a",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}},
|
|
|
|
|
{"cmd/5l", {
|
2012-08-07 10:09:24 +08:00
|
|
|
"../ld/*",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"enam.c",
|
|
|
|
|
}},
|
|
|
|
|
{"cmd/6l", {
|
|
|
|
|
"../ld/*",
|
|
|
|
|
"enam.c",
|
|
|
|
|
}},
|
|
|
|
|
{"cmd/8l", {
|
|
|
|
|
"../ld/*",
|
|
|
|
|
"enam.c",
|
|
|
|
|
}},
|
2013-08-02 14:58:27 -04:00
|
|
|
{"cmd/go", {
|
|
|
|
|
"zdefaultcc.go",
|
|
|
|
|
}},
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
{"cmd/", {
|
2012-02-13 22:31:51 -05:00
|
|
|
"$GOROOT/pkg/obj/$GOOS_$GOARCH/libmach.a",
|
|
|
|
|
"$GOROOT/pkg/obj/$GOOS_$GOARCH/libbio.a",
|
|
|
|
|
"$GOROOT/pkg/obj/$GOOS_$GOARCH/lib9.a",
|
2012-02-03 18:16:42 -05:00
|
|
|
}},
|
|
|
|
|
{"pkg/runtime", {
|
|
|
|
|
"zasm_$GOOS_$GOARCH.h",
|
2013-06-24 17:17:45 +10:00
|
|
|
"zsys_$GOOS_$GOARCH.s",
|
2012-02-03 18:16:42 -05:00
|
|
|
"zgoarch_$GOARCH.go",
|
|
|
|
|
"zgoos_$GOOS.go",
|
|
|
|
|
"zruntime_defs_$GOOS_$GOARCH.go",
|
|
|
|
|
"zversion.go",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// depsuffix records the allowed suffixes for source files.
|
|
|
|
|
char *depsuffix[] = {
|
|
|
|
|
".c",
|
|
|
|
|
".h",
|
|
|
|
|
".s",
|
|
|
|
|
".go",
|
2012-02-03 18:16:42 -05:00
|
|
|
".goc",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// gentab records how to generate some trivial files.
|
|
|
|
|
static struct {
|
2012-02-03 18:16:42 -05:00
|
|
|
char *nameprefix;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
void (*gen)(char*, char*);
|
|
|
|
|
} gentab[] = {
|
|
|
|
|
{"opnames.h", gcopnames},
|
|
|
|
|
{"enam.c", mkenam},
|
2012-02-03 18:16:42 -05:00
|
|
|
{"zasm_", mkzasm},
|
2013-08-02 14:58:27 -04:00
|
|
|
{"zdefaultcc.go", mkzdefaultcc},
|
2013-06-24 17:17:45 +10:00
|
|
|
{"zsys_", mkzsys},
|
2012-02-03 18:16:42 -05:00
|
|
|
{"zgoarch_", mkzgoarch},
|
|
|
|
|
{"zgoos_", mkzgoos},
|
|
|
|
|
{"zruntime_defs_", mkzruntimedefs},
|
|
|
|
|
{"zversion.go", mkzversion},
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// install installs the library, package, or binary associated with dir,
|
|
|
|
|
// which is relative to $GOROOT/src.
|
|
|
|
|
static void
|
|
|
|
|
install(char *dir)
|
|
|
|
|
{
|
2012-02-03 18:16:42 -05:00
|
|
|
char *name, *p, *elem, *prefix, *exe;
|
2013-08-02 15:13:06 -04:00
|
|
|
bool islib, ispkg, isgo, stale;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
Buf b, b1, path;
|
|
|
|
|
Vec compile, files, link, go, missing, clean, lib, extra;
|
|
|
|
|
Time ttarg, t;
|
2012-05-01 22:32:46 -07:00
|
|
|
int i, j, k, n, doclean, targ, usecpp;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
if(vflag) {
|
|
|
|
|
if(!streq(goos, gohostos) || !streq(goarch, gohostarch))
|
2012-07-06 15:00:18 +10:00
|
|
|
errprintf("%s (%s/%s)\n", dir, goos, goarch);
|
2012-02-13 22:31:51 -05:00
|
|
|
else
|
2012-07-06 15:00:18 +10:00
|
|
|
errprintf("%s\n", dir);
|
2012-02-13 22:31:51 -05:00
|
|
|
}
|
2012-02-08 15:26:47 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
binit(&b);
|
|
|
|
|
binit(&b1);
|
|
|
|
|
binit(&path);
|
|
|
|
|
vinit(&compile);
|
|
|
|
|
vinit(&files);
|
|
|
|
|
vinit(&link);
|
|
|
|
|
vinit(&go);
|
|
|
|
|
vinit(&missing);
|
|
|
|
|
vinit(&clean);
|
|
|
|
|
vinit(&lib);
|
|
|
|
|
vinit(&extra);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-05-01 22:32:46 -07:00
|
|
|
|
2012-02-14 00:18:30 -05:00
|
|
|
// path = full path to dir.
|
|
|
|
|
bpathf(&path, "%s/src/%s", goroot, dir);
|
|
|
|
|
name = lastelem(dir);
|
|
|
|
|
|
|
|
|
|
// For misc/prof, copy into the tool directory and we're done.
|
|
|
|
|
if(hasprefix(dir, "misc/")) {
|
|
|
|
|
copy(bpathf(&b, "%s/%s", tooldir, name),
|
2012-02-21 16:49:30 -05:00
|
|
|
bpathf(&b1, "%s/misc/%s", goroot, name), 1);
|
2012-02-14 00:18:30 -05:00
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-24 11:06:06 -07:00
|
|
|
// For release, cmd/prof is not included.
|
|
|
|
|
if((streq(dir, "cmd/prof")) && !isdir(bstr(&path))) {
|
2012-02-14 00:18:30 -05:00
|
|
|
if(vflag > 1)
|
2012-07-06 15:00:18 +10:00
|
|
|
errprintf("skipping %s - does not exist\n", dir);
|
2012-02-14 00:18:30 -05:00
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-08 00:22:38 -05:00
|
|
|
// set up gcc command line on first run.
|
|
|
|
|
if(gccargs.len == 0) {
|
2013-08-02 14:58:27 -04:00
|
|
|
bprintf(&b, "%s", defaultcc);
|
2012-02-08 00:22:38 -05:00
|
|
|
splitfields(&gccargs, bstr(&b));
|
|
|
|
|
for(i=0; i<nelem(proto_gccargs); i++)
|
|
|
|
|
vadd(&gccargs, proto_gccargs[i]);
|
2013-08-02 15:13:06 -04:00
|
|
|
if(contains(gccargs.p[0], "clang")) {
|
2013-07-19 19:36:15 -04:00
|
|
|
// disable ASCII art in clang errors, if possible
|
|
|
|
|
vadd(&gccargs, "-fno-caret-diagnostics");
|
2013-02-23 20:24:38 +08:00
|
|
|
// clang is too smart about unused command-line arguments
|
|
|
|
|
vadd(&gccargs, "-Qunused-arguments");
|
|
|
|
|
}
|
2013-04-16 13:30:52 -07:00
|
|
|
if(streq(gohostos, "darwin")) {
|
|
|
|
|
// golang.org/issue/5261
|
|
|
|
|
vadd(&gccargs, "-mmacosx-version-min=10.6");
|
|
|
|
|
}
|
2012-02-08 00:22:38 -05:00
|
|
|
}
|
2012-02-16 13:31:46 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
islib = hasprefix(dir, "lib") || streq(dir, "cmd/cc") || streq(dir, "cmd/gc");
|
|
|
|
|
ispkg = hasprefix(dir, "pkg");
|
2012-02-13 22:31:51 -05:00
|
|
|
isgo = ispkg || streq(dir, "cmd/go") || streq(dir, "cmd/cgo");
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
exe = "";
|
|
|
|
|
if(streq(gohostos, "windows"))
|
|
|
|
|
exe = ".exe";
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// Start final link command line.
|
2012-02-23 15:38:07 -05:00
|
|
|
// Note: code below knows that link.p[targ] is the target.
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(islib) {
|
|
|
|
|
// C library.
|
|
|
|
|
vadd(&link, "ar");
|
2012-05-01 22:32:46 -07:00
|
|
|
if(streq(gohostos, "plan9"))
|
|
|
|
|
vadd(&link, "rc");
|
|
|
|
|
else
|
|
|
|
|
vadd(&link, "rsc");
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
prefix = "";
|
|
|
|
|
if(!hasprefix(name, "lib"))
|
|
|
|
|
prefix = "lib";
|
2012-02-23 15:38:07 -05:00
|
|
|
targ = link.len;
|
2012-02-13 22:31:51 -05:00
|
|
|
vadd(&link, bpathf(&b, "%s/pkg/obj/%s_%s/%s%s.a", goroot, gohostos, gohostarch, prefix, name));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
} else if(ispkg) {
|
|
|
|
|
// Go library (package).
|
2012-02-13 22:31:51 -05:00
|
|
|
vadd(&link, bpathf(&b, "%s/pack", tooldir));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
vadd(&link, "grc");
|
2012-02-15 09:02:45 -05:00
|
|
|
p = bprintf(&b, "%s/pkg/%s_%s/%s", goroot, goos, goarch, dir+4);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
*xstrrchr(p, '/') = '\0';
|
|
|
|
|
xmkdirall(p);
|
2012-02-23 15:38:07 -05:00
|
|
|
targ = link.len;
|
2012-02-15 09:02:45 -05:00
|
|
|
vadd(&link, bpathf(&b, "%s/pkg/%s_%s/%s.a", goroot, goos, goarch, dir+4));
|
2012-02-13 22:31:51 -05:00
|
|
|
} else if(streq(dir, "cmd/go") || streq(dir, "cmd/cgo")) {
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// Go command.
|
2012-02-13 22:31:51 -05:00
|
|
|
vadd(&link, bpathf(&b, "%s/%sl", tooldir, gochar));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
vadd(&link, "-o");
|
2012-02-13 22:31:51 -05:00
|
|
|
elem = name;
|
|
|
|
|
if(streq(elem, "go"))
|
|
|
|
|
elem = "go_bootstrap";
|
2012-02-23 15:38:07 -05:00
|
|
|
targ = link.len;
|
2012-02-13 22:31:51 -05:00
|
|
|
vadd(&link, bpathf(&b, "%s/%s%s", tooldir, elem, exe));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
} else {
|
2012-02-23 15:38:07 -05:00
|
|
|
// C command. Use gccargs.
|
2012-05-01 22:32:46 -07:00
|
|
|
if(streq(gohostos, "plan9")) {
|
|
|
|
|
vadd(&link, bprintf(&b, "%sl", gohostchar));
|
|
|
|
|
vadd(&link, "-o");
|
|
|
|
|
targ = link.len;
|
|
|
|
|
vadd(&link, bpathf(&b, "%s/%s", tooldir, name));
|
|
|
|
|
} else {
|
|
|
|
|
vcopy(&link, gccargs.p, gccargs.len);
|
|
|
|
|
vadd(&link, "-o");
|
|
|
|
|
targ = link.len;
|
|
|
|
|
vadd(&link, bpathf(&b, "%s/%s%s", tooldir, name, exe));
|
|
|
|
|
if(streq(gohostarch, "amd64"))
|
|
|
|
|
vadd(&link, "-m64");
|
|
|
|
|
else if(streq(gohostarch, "386"))
|
|
|
|
|
vadd(&link, "-m32");
|
|
|
|
|
}
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}
|
2012-02-23 15:38:07 -05:00
|
|
|
ttarg = mtime(link.p[targ]);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
|
|
|
|
// Gather files that are sources for this target.
|
|
|
|
|
// Everything in that directory, and any target-specific
|
|
|
|
|
// additions.
|
|
|
|
|
xreaddir(&files, bstr(&path));
|
2012-02-06 13:33:22 -05:00
|
|
|
|
|
|
|
|
// Remove files beginning with . or _,
|
|
|
|
|
// which are likely to be editor temporary files.
|
|
|
|
|
// This is the same heuristic build.ScanDir uses.
|
|
|
|
|
// There do exist real C files beginning with _,
|
|
|
|
|
// so limit that check to just Go files.
|
|
|
|
|
n = 0;
|
|
|
|
|
for(i=0; i<files.len; i++) {
|
|
|
|
|
p = files.p[i];
|
|
|
|
|
if(hasprefix(p, ".") || (hasprefix(p, "_") && hassuffix(p, ".go")))
|
|
|
|
|
xfree(p);
|
|
|
|
|
else
|
|
|
|
|
files.p[n++] = p;
|
|
|
|
|
}
|
|
|
|
|
files.len = n;
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
for(i=0; i<nelem(deptab); i++) {
|
|
|
|
|
if(hasprefix(dir, deptab[i].prefix)) {
|
|
|
|
|
for(j=0; (p=deptab[i].dep[j])!=nil; j++) {
|
2012-02-03 18:16:42 -05:00
|
|
|
breset(&b1);
|
|
|
|
|
bwritestr(&b1, p);
|
|
|
|
|
bsubst(&b1, "$GOROOT", goroot);
|
|
|
|
|
bsubst(&b1, "$GOOS", goos);
|
|
|
|
|
bsubst(&b1, "$GOARCH", goarch);
|
|
|
|
|
p = bstr(&b1);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(hassuffix(p, ".a")) {
|
2012-05-01 22:32:46 -07:00
|
|
|
if(streq(gohostos, "plan9") && hassuffix(p, "libbio.a"))
|
|
|
|
|
continue;
|
2012-02-03 18:16:42 -05:00
|
|
|
vadd(&lib, bpathf(&b, "%s", p));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(hassuffix(p, "/*")) {
|
2012-02-03 18:16:42 -05:00
|
|
|
bpathf(&b, "%s/%s", bstr(&path), p);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
b.len -= 2;
|
|
|
|
|
xreaddir(&extra, bstr(&b));
|
|
|
|
|
bprintf(&b, "%s", p);
|
|
|
|
|
b.len -= 2;
|
2012-02-03 18:16:42 -05:00
|
|
|
for(k=0; k<extra.len; k++)
|
|
|
|
|
vadd(&files, bpathf(&b1, "%s/%s", bstr(&b), extra.p[k]));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(hasprefix(p, "-")) {
|
|
|
|
|
p++;
|
|
|
|
|
n = 0;
|
|
|
|
|
for(k=0; k<files.len; k++) {
|
|
|
|
|
if(hasprefix(files.p[k], p))
|
|
|
|
|
xfree(files.p[k]);
|
|
|
|
|
else
|
|
|
|
|
files.p[n++] = files.p[k];
|
|
|
|
|
}
|
|
|
|
|
files.len = n;
|
|
|
|
|
continue;
|
2012-02-28 16:18:24 -05:00
|
|
|
}
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
vadd(&files, p);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
vuniq(&files);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// Convert to absolute paths.
|
|
|
|
|
for(i=0; i<files.len; i++) {
|
|
|
|
|
if(!isabs(files.p[i])) {
|
2012-02-03 18:16:42 -05:00
|
|
|
bpathf(&b, "%s/%s", bstr(&path), files.p[i]);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
xfree(files.p[i]);
|
|
|
|
|
files.p[i] = btake(&b);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Is the target up-to-date?
|
2012-02-13 22:31:51 -05:00
|
|
|
stale = rebuildall;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
n = 0;
|
|
|
|
|
for(i=0; i<files.len; i++) {
|
|
|
|
|
p = files.p[i];
|
|
|
|
|
for(j=0; j<nelem(depsuffix); j++)
|
|
|
|
|
if(hassuffix(p, depsuffix[j]))
|
|
|
|
|
goto ok;
|
|
|
|
|
xfree(files.p[i]);
|
|
|
|
|
continue;
|
|
|
|
|
ok:
|
|
|
|
|
t = mtime(p);
|
2012-02-03 18:16:42 -05:00
|
|
|
if(t != 0 && !hassuffix(p, ".a") && !shouldbuild(p, dir)) {
|
|
|
|
|
xfree(files.p[i]);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(hassuffix(p, ".go"))
|
|
|
|
|
vadd(&go, p);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(t > ttarg)
|
|
|
|
|
stale = 1;
|
|
|
|
|
if(t == 0) {
|
|
|
|
|
vadd(&missing, p);
|
|
|
|
|
files.p[n++] = files.p[i];
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
files.p[n++] = files.p[i];
|
|
|
|
|
}
|
|
|
|
|
files.len = n;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-05-01 22:32:46 -07:00
|
|
|
// If there are no files to compile, we're done.
|
|
|
|
|
if(files.len == 0)
|
|
|
|
|
goto out;
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
for(i=0; i<lib.len && !stale; i++)
|
|
|
|
|
if(mtime(lib.p[i]) > ttarg)
|
|
|
|
|
stale = 1;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(!stale)
|
|
|
|
|
goto out;
|
|
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
// For package runtime, copy some files into the work space.
|
|
|
|
|
if(streq(dir, "pkg/runtime")) {
|
|
|
|
|
copy(bpathf(&b, "%s/arch_GOARCH.h", workdir),
|
2012-02-21 16:49:30 -05:00
|
|
|
bpathf(&b1, "%s/arch_%s.h", bstr(&path), goarch), 0);
|
2012-02-03 18:16:42 -05:00
|
|
|
copy(bpathf(&b, "%s/defs_GOOS_GOARCH.h", workdir),
|
2012-02-21 16:49:30 -05:00
|
|
|
bpathf(&b1, "%s/defs_%s_%s.h", bstr(&path), goos, goarch), 0);
|
2013-03-14 11:35:13 -07:00
|
|
|
p = bpathf(&b1, "%s/signal_%s_%s.h", bstr(&path), goos, goarch);
|
|
|
|
|
if(isfile(p))
|
|
|
|
|
copy(bpathf(&b, "%s/signal_GOOS_GOARCH.h", workdir), p, 0);
|
2012-02-03 18:16:42 -05:00
|
|
|
copy(bpathf(&b, "%s/os_GOOS.h", workdir),
|
2012-02-21 16:49:30 -05:00
|
|
|
bpathf(&b1, "%s/os_%s.h", bstr(&path), goos), 0);
|
2012-02-03 18:16:42 -05:00
|
|
|
copy(bpathf(&b, "%s/signals_GOOS.h", workdir),
|
2012-02-21 16:49:30 -05:00
|
|
|
bpathf(&b1, "%s/signals_%s.h", bstr(&path), goos), 0);
|
2012-02-03 18:16:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Generate any missing files; regenerate existing ones.
|
|
|
|
|
for(i=0; i<files.len; i++) {
|
|
|
|
|
p = files.p[i];
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
elem = lastelem(p);
|
|
|
|
|
for(j=0; j<nelem(gentab); j++) {
|
2012-02-03 18:16:42 -05:00
|
|
|
if(hasprefix(elem, gentab[j].nameprefix)) {
|
|
|
|
|
if(vflag > 1)
|
2012-07-06 15:00:18 +10:00
|
|
|
errprintf("generate %s\n", p);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
gentab[j].gen(bstr(&path), p);
|
2012-02-03 18:16:42 -05:00
|
|
|
// Do not add generated file to clean list.
|
|
|
|
|
// In pkg/runtime, we want to be able to
|
|
|
|
|
// build the package with the go tool,
|
|
|
|
|
// and it assumes these generated files already
|
|
|
|
|
// exist (it does not know how to build them).
|
|
|
|
|
// The 'clean' command can remove
|
|
|
|
|
// the generated files.
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
goto built;
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-02-03 18:16:42 -05:00
|
|
|
// Did not rebuild p.
|
|
|
|
|
if(find(p, missing.p, missing.len) >= 0)
|
|
|
|
|
fatal("missing file %s", p);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
built:;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
// One more copy for package runtime.
|
|
|
|
|
// The last batch was required for the generators.
|
|
|
|
|
// This one is generated.
|
|
|
|
|
if(streq(dir, "pkg/runtime")) {
|
|
|
|
|
copy(bpathf(&b, "%s/zasm_GOOS_GOARCH.h", workdir),
|
2012-02-21 16:49:30 -05:00
|
|
|
bpathf(&b1, "%s/zasm_%s_%s.h", bstr(&path), goos, goarch), 0);
|
2012-02-03 18:16:42 -05:00
|
|
|
}
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
// Generate .c files from .goc files.
|
2012-02-28 16:18:24 -05:00
|
|
|
if(streq(dir, "pkg/runtime")) {
|
2012-02-03 18:16:42 -05:00
|
|
|
for(i=0; i<files.len; i++) {
|
|
|
|
|
p = files.p[i];
|
|
|
|
|
if(!hassuffix(p, ".goc"))
|
|
|
|
|
continue;
|
2012-05-01 22:32:46 -07:00
|
|
|
// b = path/zp but with _goos_goarch.c instead of .goc
|
2012-02-03 18:16:42 -05:00
|
|
|
bprintf(&b, "%s%sz%s", bstr(&path), slash, lastelem(p));
|
|
|
|
|
b.len -= 4;
|
2012-05-01 22:32:46 -07:00
|
|
|
bwritef(&b, "_%s_%s.c", goos, goarch);
|
2012-02-03 18:16:42 -05:00
|
|
|
goc2c(p, bstr(&b));
|
|
|
|
|
vadd(&files, bstr(&b));
|
|
|
|
|
}
|
|
|
|
|
vuniq(&files);
|
|
|
|
|
}
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-22 16:29:05 -05:00
|
|
|
if((!streq(goos, gohostos) || !streq(goarch, gohostarch)) && isgo) {
|
2012-02-13 22:31:51 -05:00
|
|
|
// We've generated the right files; the go command can do the build.
|
|
|
|
|
if(vflag > 1)
|
2012-07-06 15:00:18 +10:00
|
|
|
errprintf("skip build for cross-compile %s\n", dir);
|
2012-02-13 22:31:51 -05:00
|
|
|
goto nobuild;
|
|
|
|
|
}
|
2012-02-03 18:16:42 -05:00
|
|
|
|
2012-05-01 22:32:46 -07:00
|
|
|
// The files generated by GNU Bison use macros that aren't
|
|
|
|
|
// supported by the Plan 9 compilers so we have to use the
|
|
|
|
|
// external preprocessor when compiling.
|
|
|
|
|
usecpp = 0;
|
|
|
|
|
if(streq(gohostos, "plan9")) {
|
|
|
|
|
for(i=0; i<files.len; i++) {
|
|
|
|
|
p = files.p[i];
|
|
|
|
|
if(hassuffix(p, "y.tab.c") || hassuffix(p, "y.tab.h")){
|
|
|
|
|
usecpp = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// Compile the files.
|
|
|
|
|
for(i=0; i<files.len; i++) {
|
|
|
|
|
if(!hassuffix(files.p[i], ".c") && !hassuffix(files.p[i], ".s"))
|
|
|
|
|
continue;
|
|
|
|
|
name = lastelem(files.p[i]);
|
|
|
|
|
|
|
|
|
|
vreset(&compile);
|
|
|
|
|
if(!isgo) {
|
|
|
|
|
// C library or tool.
|
2012-05-01 22:32:46 -07:00
|
|
|
if(streq(gohostos, "plan9")) {
|
|
|
|
|
vadd(&compile, bprintf(&b, "%sc", gohostchar));
|
|
|
|
|
vadd(&compile, "-FTVw");
|
|
|
|
|
if(usecpp)
|
|
|
|
|
vadd(&compile, "-Bp+");
|
|
|
|
|
vadd(&compile, bpathf(&b, "-I%s/include/plan9", goroot));
|
|
|
|
|
vadd(&compile, bpathf(&b, "-I%s/include/plan9/%s", goroot, gohostarch));
|
|
|
|
|
} else {
|
|
|
|
|
vcopy(&compile, gccargs.p, gccargs.len);
|
|
|
|
|
vadd(&compile, "-c");
|
|
|
|
|
if(streq(gohostarch, "amd64"))
|
|
|
|
|
vadd(&compile, "-m64");
|
|
|
|
|
else if(streq(gohostarch, "386"))
|
|
|
|
|
vadd(&compile, "-m32");
|
|
|
|
|
if(streq(dir, "lib9"))
|
|
|
|
|
vadd(&compile, "-DPLAN9PORT");
|
|
|
|
|
|
|
|
|
|
vadd(&compile, "-I");
|
|
|
|
|
vadd(&compile, bpathf(&b, "%s/include", goroot));
|
|
|
|
|
}
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
vadd(&compile, "-I");
|
|
|
|
|
vadd(&compile, bstr(&path));
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
// lib9/goos.c gets the default constants hard-coded.
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(streq(name, "goos.c")) {
|
2013-01-02 17:52:54 -05:00
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GOOS=\"%s\"", goos));
|
|
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GOARCH=\"%s\"", goarch));
|
2012-02-09 20:47:12 -02:00
|
|
|
bprintf(&b1, "%s", goroot_final);
|
2012-02-03 18:16:42 -05:00
|
|
|
bsubst(&b1, "\\", "\\\\"); // turn into C string
|
2013-01-02 17:52:54 -05:00
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GOROOT=\"%s\"", bstr(&b1)));
|
|
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GOVERSION=\"%s\"", goversion));
|
|
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GOARM=\"%s\"", goarm));
|
|
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GO386=\"%s\"", go386));
|
2013-03-29 16:33:35 -07:00
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GO_EXTLINK_ENABLED=\"%s\"", goextlinkenabled));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// gc/lex.c records the GOEXPERIMENT setting used during the build.
|
|
|
|
|
if(streq(name, "lex.c")) {
|
|
|
|
|
xgetenv(&b, "GOEXPERIMENT");
|
2013-01-02 17:52:54 -05:00
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b1, "GOEXPERIMENT=\"%s\"", bstr(&b)));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// Supporting files for a Go package.
|
2012-02-03 18:16:42 -05:00
|
|
|
if(hassuffix(files.p[i], ".s"))
|
2012-02-13 22:31:51 -05:00
|
|
|
vadd(&compile, bpathf(&b, "%s/%sa", tooldir, gochar));
|
2012-02-03 18:16:42 -05:00
|
|
|
else {
|
2012-02-13 22:31:51 -05:00
|
|
|
vadd(&compile, bpathf(&b, "%s/%sc", tooldir, gochar));
|
2013-01-02 17:52:54 -05:00
|
|
|
vadd(&compile, "-F");
|
|
|
|
|
vadd(&compile, "-V");
|
|
|
|
|
vadd(&compile, "-w");
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}
|
|
|
|
|
vadd(&compile, "-I");
|
|
|
|
|
vadd(&compile, workdir);
|
2013-03-11 16:50:44 -04:00
|
|
|
vadd(&compile, "-I");
|
|
|
|
|
vadd(&compile, bprintf(&b, "%s/pkg/%s_%s", goroot, goos, goarch));
|
2013-01-02 17:52:54 -05:00
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GOOS_%s", goos));
|
|
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GOARCH_%s", goarch));
|
2013-08-14 00:18:20 -04:00
|
|
|
vadd(&compile, "-D");
|
|
|
|
|
vadd(&compile, bprintf(&b, "GOOS_GOARCH_%s_%s", goos, goarch));
|
2012-02-28 16:18:24 -05:00
|
|
|
}
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
2012-02-04 01:23:54 -05:00
|
|
|
bpathf(&b, "%s/%s", workdir, lastelem(files.p[i]));
|
|
|
|
|
doclean = 1;
|
2012-02-03 18:16:42 -05:00
|
|
|
if(!isgo && streq(gohostos, "darwin")) {
|
|
|
|
|
// To debug C programs on OS X, it is not enough to say -ggdb
|
|
|
|
|
// on the command line. You have to leave the object files
|
|
|
|
|
// lying around too. Leave them in pkg/obj/, which does not
|
|
|
|
|
// get removed when this tool exits.
|
|
|
|
|
bpathf(&b1, "%s/pkg/obj/%s", goroot, dir);
|
|
|
|
|
xmkdirall(bstr(&b1));
|
|
|
|
|
bpathf(&b, "%s/%s", bstr(&b1), lastelem(files.p[i]));
|
2012-02-04 01:23:54 -05:00
|
|
|
doclean = 0;
|
|
|
|
|
}
|
2012-02-03 18:16:42 -05:00
|
|
|
|
2012-05-01 22:32:46 -07:00
|
|
|
// Change the last character of the output file (which was c or s).
|
|
|
|
|
if(streq(gohostos, "plan9"))
|
|
|
|
|
b.p[b.len-1] = gohostchar[0];
|
|
|
|
|
else
|
|
|
|
|
b.p[b.len-1] = 'o';
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
vadd(&compile, "-o");
|
|
|
|
|
vadd(&compile, bstr(&b));
|
|
|
|
|
vadd(&compile, files.p[i]);
|
2012-02-03 18:16:42 -05:00
|
|
|
bgrunv(bstr(&path), CheckExit, &compile);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
vadd(&link, bstr(&b));
|
2012-02-04 01:23:54 -05:00
|
|
|
if(doclean)
|
|
|
|
|
vadd(&clean, bstr(&b));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}
|
2012-02-03 18:16:42 -05:00
|
|
|
bgwait();
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(isgo) {
|
|
|
|
|
// The last loop was compiling individual files.
|
|
|
|
|
// Hand the Go files to the compiler en masse.
|
|
|
|
|
vreset(&compile);
|
2012-02-13 22:31:51 -05:00
|
|
|
vadd(&compile, bpathf(&b, "%s/%sg", tooldir, gochar));
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
bpathf(&b, "%s/_go_.%s", workdir, gochar);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
vadd(&compile, "-o");
|
|
|
|
|
vadd(&compile, bstr(&b));
|
|
|
|
|
vadd(&clean, bstr(&b));
|
|
|
|
|
vadd(&link, bstr(&b));
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
vadd(&compile, "-p");
|
|
|
|
|
if(hasprefix(dir, "pkg/"))
|
|
|
|
|
vadd(&compile, dir+4);
|
|
|
|
|
else
|
|
|
|
|
vadd(&compile, "main");
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
if(streq(dir, "pkg/runtime"))
|
|
|
|
|
vadd(&compile, "-+");
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
vcopy(&compile, go.p, go.len);
|
|
|
|
|
|
|
|
|
|
runv(nil, bstr(&path), CheckExit, &compile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!islib && !isgo) {
|
|
|
|
|
// C binaries need the libraries explicitly, and -lm.
|
|
|
|
|
vcopy(&link, lib.p, lib.len);
|
2012-05-01 22:32:46 -07:00
|
|
|
if(!streq(gohostos, "plan9"))
|
|
|
|
|
vadd(&link, "-lm");
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Remove target before writing it.
|
2012-02-23 15:38:07 -05:00
|
|
|
xremove(link.p[targ]);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
|
|
|
|
runv(nil, nil, CheckExit, &link);
|
|
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
nobuild:
|
2012-02-03 18:16:42 -05:00
|
|
|
// In package runtime, we install runtime.h and cgocall.h too,
|
|
|
|
|
// for use by cgo compilation.
|
|
|
|
|
if(streq(dir, "pkg/runtime")) {
|
|
|
|
|
copy(bpathf(&b, "%s/pkg/%s_%s/cgocall.h", goroot, goos, goarch),
|
2012-02-21 16:49:30 -05:00
|
|
|
bpathf(&b1, "%s/src/pkg/runtime/cgocall.h", goroot), 0);
|
2012-02-03 18:16:42 -05:00
|
|
|
copy(bpathf(&b, "%s/pkg/%s_%s/runtime.h", goroot, goos, goarch),
|
2012-02-21 16:49:30 -05:00
|
|
|
bpathf(&b1, "%s/src/pkg/runtime/runtime.h", goroot), 0);
|
2012-02-03 18:16:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
out:
|
|
|
|
|
for(i=0; i<clean.len; i++)
|
|
|
|
|
xremove(clean.p[i]);
|
|
|
|
|
|
|
|
|
|
bfree(&b);
|
|
|
|
|
bfree(&b1);
|
|
|
|
|
bfree(&path);
|
|
|
|
|
vfree(&compile);
|
|
|
|
|
vfree(&files);
|
|
|
|
|
vfree(&link);
|
|
|
|
|
vfree(&go);
|
|
|
|
|
vfree(&missing);
|
|
|
|
|
vfree(&clean);
|
|
|
|
|
vfree(&lib);
|
|
|
|
|
vfree(&extra);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// matchfield reports whether the field matches this build.
|
|
|
|
|
static bool
|
|
|
|
|
matchfield(char *f)
|
|
|
|
|
{
|
2013-03-14 19:04:47 +04:00
|
|
|
char *p;
|
|
|
|
|
bool res;
|
|
|
|
|
|
|
|
|
|
p = xstrrchr(f, ',');
|
|
|
|
|
if(p == nil)
|
|
|
|
|
return streq(f, goos) || streq(f, goarch) || streq(f, "cmd_go_bootstrap") || streq(f, "go1.1");
|
|
|
|
|
*p = 0;
|
|
|
|
|
res = matchfield(f) && matchfield(p+1);
|
|
|
|
|
*p = ',';
|
|
|
|
|
return res;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// shouldbuild reports whether we should build this file.
|
|
|
|
|
// It applies the same rules that are used with context tags
|
|
|
|
|
// in package go/build, except that the GOOS and GOARCH
|
|
|
|
|
// can appear anywhere in the file name, not just after _.
|
|
|
|
|
// In particular, they can be the entire file name (like windows.c).
|
|
|
|
|
// We also allow the special tag cmd_go_bootstrap.
|
|
|
|
|
// See ../go/bootstrap.go and package go/build.
|
|
|
|
|
static bool
|
|
|
|
|
shouldbuild(char *file, char *dir)
|
|
|
|
|
{
|
|
|
|
|
char *name, *p;
|
2012-02-03 18:16:42 -05:00
|
|
|
int i, j, ret;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
Buf b;
|
|
|
|
|
Vec lines, fields;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-05-01 22:32:46 -07:00
|
|
|
// On Plan 9, most of the libraries are already present.
|
|
|
|
|
// The main exception is libmach which has been modified
|
|
|
|
|
// in various places to support Go object files.
|
|
|
|
|
if(streq(gohostos, "plan9")) {
|
2013-01-18 15:19:51 -05:00
|
|
|
if(streq(dir, "lib9")) {
|
|
|
|
|
name = lastelem(file);
|
|
|
|
|
if(streq(name, "goos.c") || streq(name, "flag.c"))
|
|
|
|
|
return 1;
|
2013-03-11 13:34:57 -07:00
|
|
|
if(!contains(name, "plan9"))
|
|
|
|
|
return 0;
|
2013-01-18 15:19:51 -05:00
|
|
|
}
|
2012-05-01 22:32:46 -07:00
|
|
|
if(streq(dir, "libbio"))
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// Check file name for GOOS or GOARCH.
|
|
|
|
|
name = lastelem(file);
|
|
|
|
|
for(i=0; i<nelem(okgoos); i++)
|
|
|
|
|
if(contains(name, okgoos[i]) && !streq(okgoos[i], goos))
|
|
|
|
|
return 0;
|
|
|
|
|
for(i=0; i<nelem(okgoarch); i++)
|
|
|
|
|
if(contains(name, okgoarch[i]) && !streq(okgoarch[i], goarch))
|
|
|
|
|
return 0;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// Omit test files.
|
|
|
|
|
if(contains(name, "_test"))
|
|
|
|
|
return 0;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
// cmd/go/doc.go has a giant /* */ comment before
|
|
|
|
|
// it gets to the important detail that it is not part of
|
|
|
|
|
// package main. We don't parse those comments,
|
|
|
|
|
// so special case that file.
|
|
|
|
|
if(hassuffix(file, "cmd/go/doc.go") || hassuffix(file, "cmd\\go\\doc.go"))
|
|
|
|
|
return 0;
|
2012-02-13 22:31:51 -05:00
|
|
|
if(hassuffix(file, "cmd/cgo/doc.go") || hassuffix(file, "cmd\\cgo\\doc.go"))
|
|
|
|
|
return 0;
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
|
|
|
|
// Check file contents for // +build lines.
|
|
|
|
|
binit(&b);
|
|
|
|
|
vinit(&lines);
|
|
|
|
|
vinit(&fields);
|
|
|
|
|
|
|
|
|
|
ret = 1;
|
|
|
|
|
readfile(&b, file);
|
|
|
|
|
splitlines(&lines, bstr(&b));
|
|
|
|
|
for(i=0; i<lines.len; i++) {
|
|
|
|
|
p = lines.p[i];
|
|
|
|
|
while(*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
|
|
|
|
|
p++;
|
|
|
|
|
if(*p == '\0')
|
|
|
|
|
continue;
|
|
|
|
|
if(contains(p, "package documentation")) {
|
|
|
|
|
ret = 0;
|
|
|
|
|
goto out;
|
|
|
|
|
}
|
2012-02-13 22:31:51 -05:00
|
|
|
if(contains(p, "package main") && !streq(dir, "cmd/go") && !streq(dir, "cmd/cgo")) {
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
ret = 0;
|
|
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
if(!hasprefix(p, "//"))
|
|
|
|
|
break;
|
|
|
|
|
if(!contains(p, "+build"))
|
|
|
|
|
continue;
|
|
|
|
|
splitfields(&fields, lines.p[i]);
|
|
|
|
|
if(fields.len < 2 || !streq(fields.p[1], "+build"))
|
|
|
|
|
continue;
|
|
|
|
|
for(j=2; j<fields.len; j++) {
|
|
|
|
|
p = fields.p[j];
|
|
|
|
|
if((*p == '!' && !matchfield(p+1)) || matchfield(p))
|
|
|
|
|
goto fieldmatch;
|
|
|
|
|
}
|
|
|
|
|
ret = 0;
|
|
|
|
|
goto out;
|
|
|
|
|
fieldmatch:;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
out:
|
|
|
|
|
bfree(&b);
|
|
|
|
|
vfree(&lines);
|
|
|
|
|
vfree(&fields);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// copy copies the file src to dst, via memory (so only good for small files).
|
|
|
|
|
static void
|
2012-02-21 16:49:30 -05:00
|
|
|
copy(char *dst, char *src, int exec)
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
{
|
|
|
|
|
Buf b;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
if(vflag > 1)
|
2012-07-06 15:00:18 +10:00
|
|
|
errprintf("cp %s %s\n", src, dst);
|
2012-02-03 18:16:42 -05:00
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
binit(&b);
|
|
|
|
|
readfile(&b, src);
|
2012-02-21 16:49:30 -05:00
|
|
|
writefile(&b, dst, exec);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
bfree(&b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// buildorder records the order of builds for the 'go bootstrap' command.
|
|
|
|
|
static char *buildorder[] = {
|
|
|
|
|
"lib9",
|
|
|
|
|
"libbio",
|
|
|
|
|
"libmach",
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-14 00:18:30 -05:00
|
|
|
"misc/pprof",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
2012-02-28 16:18:24 -05:00
|
|
|
"cmd/addr2line",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"cmd/nm",
|
2012-02-28 16:18:24 -05:00
|
|
|
"cmd/objdump",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"cmd/pack",
|
|
|
|
|
"cmd/prof",
|
|
|
|
|
|
|
|
|
|
"cmd/cc", // must be before c
|
|
|
|
|
"cmd/gc", // must be before g
|
|
|
|
|
"cmd/%sl", // must be before a, c, g
|
|
|
|
|
"cmd/%sa",
|
|
|
|
|
"cmd/%sc",
|
|
|
|
|
"cmd/%sg",
|
|
|
|
|
|
|
|
|
|
// The dependency order here was copied from a buildscript
|
|
|
|
|
// back when there were build scripts. Will have to
|
|
|
|
|
// be maintained by hand, but shouldn't change very
|
|
|
|
|
// often.
|
|
|
|
|
"pkg/runtime",
|
|
|
|
|
"pkg/errors",
|
|
|
|
|
"pkg/sync/atomic",
|
|
|
|
|
"pkg/sync",
|
|
|
|
|
"pkg/io",
|
|
|
|
|
"pkg/unicode",
|
|
|
|
|
"pkg/unicode/utf8",
|
|
|
|
|
"pkg/unicode/utf16",
|
|
|
|
|
"pkg/bytes",
|
|
|
|
|
"pkg/math",
|
|
|
|
|
"pkg/strings",
|
|
|
|
|
"pkg/strconv",
|
|
|
|
|
"pkg/bufio",
|
|
|
|
|
"pkg/sort",
|
|
|
|
|
"pkg/container/heap",
|
|
|
|
|
"pkg/encoding/base64",
|
|
|
|
|
"pkg/syscall",
|
|
|
|
|
"pkg/time",
|
|
|
|
|
"pkg/os",
|
|
|
|
|
"pkg/reflect",
|
|
|
|
|
"pkg/fmt",
|
2013-08-14 00:18:20 -04:00
|
|
|
"pkg/encoding",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"pkg/encoding/json",
|
|
|
|
|
"pkg/flag",
|
|
|
|
|
"pkg/path/filepath",
|
|
|
|
|
"pkg/path",
|
|
|
|
|
"pkg/io/ioutil",
|
|
|
|
|
"pkg/log",
|
|
|
|
|
"pkg/regexp/syntax",
|
|
|
|
|
"pkg/regexp",
|
|
|
|
|
"pkg/go/token",
|
|
|
|
|
"pkg/go/scanner",
|
|
|
|
|
"pkg/go/ast",
|
|
|
|
|
"pkg/go/parser",
|
|
|
|
|
"pkg/os/exec",
|
2012-12-14 17:33:59 +11:00
|
|
|
"pkg/os/signal",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"pkg/net/url",
|
|
|
|
|
"pkg/text/template/parse",
|
|
|
|
|
"pkg/text/template",
|
2012-02-17 12:00:12 -08:00
|
|
|
"pkg/go/doc",
|
2012-02-28 16:18:24 -05:00
|
|
|
"pkg/go/build",
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
"cmd/go",
|
|
|
|
|
};
|
|
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
// cleantab records the directories to clean in 'go clean'.
|
|
|
|
|
// It is bigger than the buildorder because we clean all the
|
|
|
|
|
// compilers but build only the $GOARCH ones.
|
|
|
|
|
static char *cleantab[] = {
|
|
|
|
|
"cmd/5a",
|
|
|
|
|
"cmd/5c",
|
|
|
|
|
"cmd/5g",
|
|
|
|
|
"cmd/5l",
|
|
|
|
|
"cmd/6a",
|
|
|
|
|
"cmd/6c",
|
|
|
|
|
"cmd/6g",
|
|
|
|
|
"cmd/6l",
|
|
|
|
|
"cmd/8a",
|
|
|
|
|
"cmd/8c",
|
|
|
|
|
"cmd/8g",
|
|
|
|
|
"cmd/8l",
|
2012-02-28 16:18:24 -05:00
|
|
|
"cmd/addr2line",
|
2012-02-03 18:16:42 -05:00
|
|
|
"cmd/cc",
|
|
|
|
|
"cmd/gc",
|
|
|
|
|
"cmd/go",
|
|
|
|
|
"cmd/nm",
|
2012-02-28 16:18:24 -05:00
|
|
|
"cmd/objdump",
|
2012-02-03 18:16:42 -05:00
|
|
|
"cmd/pack",
|
|
|
|
|
"cmd/prof",
|
|
|
|
|
"lib9",
|
|
|
|
|
"libbio",
|
|
|
|
|
"libmach",
|
|
|
|
|
"pkg/bufio",
|
|
|
|
|
"pkg/bytes",
|
|
|
|
|
"pkg/container/heap",
|
2013-08-14 00:18:20 -04:00
|
|
|
"pkg/encoding",
|
2012-02-03 18:16:42 -05:00
|
|
|
"pkg/encoding/base64",
|
|
|
|
|
"pkg/encoding/json",
|
|
|
|
|
"pkg/errors",
|
|
|
|
|
"pkg/flag",
|
|
|
|
|
"pkg/fmt",
|
|
|
|
|
"pkg/go/ast",
|
|
|
|
|
"pkg/go/build",
|
2012-02-17 12:00:12 -08:00
|
|
|
"pkg/go/doc",
|
2012-02-03 18:16:42 -05:00
|
|
|
"pkg/go/parser",
|
|
|
|
|
"pkg/go/scanner",
|
|
|
|
|
"pkg/go/token",
|
|
|
|
|
"pkg/io",
|
|
|
|
|
"pkg/io/ioutil",
|
|
|
|
|
"pkg/log",
|
|
|
|
|
"pkg/math",
|
|
|
|
|
"pkg/net/url",
|
|
|
|
|
"pkg/os",
|
|
|
|
|
"pkg/os/exec",
|
|
|
|
|
"pkg/path",
|
|
|
|
|
"pkg/path/filepath",
|
|
|
|
|
"pkg/reflect",
|
|
|
|
|
"pkg/regexp",
|
|
|
|
|
"pkg/regexp/syntax",
|
|
|
|
|
"pkg/runtime",
|
|
|
|
|
"pkg/sort",
|
|
|
|
|
"pkg/strconv",
|
|
|
|
|
"pkg/strings",
|
|
|
|
|
"pkg/sync",
|
|
|
|
|
"pkg/sync/atomic",
|
|
|
|
|
"pkg/syscall",
|
|
|
|
|
"pkg/text/template",
|
|
|
|
|
"pkg/text/template/parse",
|
|
|
|
|
"pkg/time",
|
|
|
|
|
"pkg/unicode",
|
|
|
|
|
"pkg/unicode/utf16",
|
|
|
|
|
"pkg/unicode/utf8",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
clean(void)
|
|
|
|
|
{
|
|
|
|
|
int i, j, k;
|
|
|
|
|
Buf b, path;
|
|
|
|
|
Vec dir;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
binit(&b);
|
|
|
|
|
binit(&path);
|
|
|
|
|
vinit(&dir);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
for(i=0; i<nelem(cleantab); i++) {
|
2013-05-24 11:06:06 -07:00
|
|
|
if((streq(cleantab[i], "cmd/prof")) && !isdir(cleantab[i]))
|
2012-03-15 15:22:56 -07:00
|
|
|
continue;
|
2012-02-03 18:16:42 -05:00
|
|
|
bpathf(&path, "%s/src/%s", goroot, cleantab[i]);
|
|
|
|
|
xreaddir(&dir, bstr(&path));
|
|
|
|
|
// Remove generated files.
|
|
|
|
|
for(j=0; j<dir.len; j++) {
|
|
|
|
|
for(k=0; k<nelem(gentab); k++) {
|
|
|
|
|
if(hasprefix(dir.p[j], gentab[k].nameprefix))
|
|
|
|
|
xremove(bpathf(&b, "%s/%s", bstr(&path), dir.p[j]));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Remove generated binary named for directory.
|
|
|
|
|
if(hasprefix(cleantab[i], "cmd/"))
|
|
|
|
|
xremove(bpathf(&b, "%s/%s", bstr(&path), cleantab[i]+4));
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-04 00:58:48 +08:00
|
|
|
// remove src/pkg/runtime/z* unconditionally
|
|
|
|
|
vreset(&dir);
|
|
|
|
|
bpathf(&path, "%s/src/pkg/runtime", goroot);
|
|
|
|
|
xreaddir(&dir, bstr(&path));
|
|
|
|
|
for(j=0; j<dir.len; j++) {
|
|
|
|
|
if(hasprefix(dir.p[j], "z"))
|
|
|
|
|
xremove(bpathf(&b, "%s/%s", bstr(&path), dir.p[j]));
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
if(rebuildall) {
|
|
|
|
|
// Remove object tree.
|
|
|
|
|
xremoveall(bpathf(&b, "%s/pkg/obj/%s_%s", goroot, gohostos, gohostarch));
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
// Remove installed packages and tools.
|
|
|
|
|
xremoveall(bpathf(&b, "%s/pkg/%s_%s", goroot, gohostos, gohostarch));
|
|
|
|
|
xremoveall(bpathf(&b, "%s/pkg/%s_%s", goroot, goos, goarch));
|
|
|
|
|
xremoveall(tooldir);
|
|
|
|
|
|
|
|
|
|
// Remove cached version info.
|
|
|
|
|
xremove(bpathf(&b, "%s/VERSION.cache", goroot));
|
|
|
|
|
}
|
2012-02-03 18:16:42 -05:00
|
|
|
|
|
|
|
|
bfree(&b);
|
|
|
|
|
bfree(&path);
|
|
|
|
|
vfree(&dir);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* command implementations
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
usage(void)
|
|
|
|
|
{
|
|
|
|
|
xprintf("usage: go tool dist [command]\n"
|
|
|
|
|
"Commands are:\n"
|
|
|
|
|
"\n"
|
|
|
|
|
"banner print installation banner\n"
|
|
|
|
|
"bootstrap rebuild everything\n"
|
|
|
|
|
"clean deletes all built files\n"
|
|
|
|
|
"env [-p] print environment (-p: include $PATH)\n"
|
|
|
|
|
"install [dir] install individual directory\n"
|
|
|
|
|
"version print Go version\n"
|
|
|
|
|
"\n"
|
|
|
|
|
"All commands take -v flags to emit extra information.\n"
|
|
|
|
|
);
|
|
|
|
|
xexit(2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The env command prints the default environment.
|
|
|
|
|
void
|
|
|
|
|
cmdenv(int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
bool pflag;
|
|
|
|
|
char *sep;
|
|
|
|
|
Buf b, b1;
|
|
|
|
|
char *format;
|
|
|
|
|
|
|
|
|
|
binit(&b);
|
|
|
|
|
binit(&b1);
|
|
|
|
|
|
2012-02-04 01:23:54 -05:00
|
|
|
format = "%s=\"%s\"\n";
|
2012-02-03 18:16:42 -05:00
|
|
|
pflag = 0;
|
|
|
|
|
ARGBEGIN{
|
2012-05-01 22:32:46 -07:00
|
|
|
case '9':
|
|
|
|
|
format = "%s='%s'\n";
|
|
|
|
|
break;
|
2012-02-03 18:16:42 -05:00
|
|
|
case 'p':
|
|
|
|
|
pflag = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'v':
|
|
|
|
|
vflag++;
|
|
|
|
|
break;
|
|
|
|
|
case 'w':
|
2012-09-12 12:05:34 -04:00
|
|
|
format = "set %s=%s\r\n";
|
2012-02-03 18:16:42 -05:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
usage();
|
|
|
|
|
}ARGEND
|
|
|
|
|
|
|
|
|
|
if(argc > 0)
|
|
|
|
|
usage();
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2013-08-02 14:58:27 -04:00
|
|
|
xprintf(format, "CC", defaultcc);
|
2012-02-03 18:16:42 -05:00
|
|
|
xprintf(format, "GOROOT", goroot);
|
2012-02-05 00:35:08 -02:00
|
|
|
xprintf(format, "GOBIN", gobin);
|
2012-02-03 18:16:42 -05:00
|
|
|
xprintf(format, "GOARCH", goarch);
|
|
|
|
|
xprintf(format, "GOOS", goos);
|
2012-02-13 22:31:51 -05:00
|
|
|
xprintf(format, "GOHOSTARCH", gohostarch);
|
|
|
|
|
xprintf(format, "GOHOSTOS", gohostos);
|
|
|
|
|
xprintf(format, "GOTOOLDIR", tooldir);
|
2012-02-13 15:37:35 -05:00
|
|
|
xprintf(format, "GOCHAR", gochar);
|
2012-10-22 14:26:36 +08:00
|
|
|
if(streq(goarch, "arm"))
|
|
|
|
|
xprintf(format, "GOARM", goarm);
|
2013-01-02 22:55:23 +01:00
|
|
|
if(streq(goarch, "386"))
|
|
|
|
|
xprintf(format, "GO386", go386);
|
2012-02-13 22:31:51 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
if(pflag) {
|
|
|
|
|
sep = ":";
|
|
|
|
|
if(streq(gohostos, "windows"))
|
|
|
|
|
sep = ";";
|
|
|
|
|
xgetenv(&b, "PATH");
|
|
|
|
|
bprintf(&b1, "%s%s%s", gobin, sep, bstr(&b));
|
|
|
|
|
xprintf(format, "PATH", bstr(&b1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bfree(&b);
|
|
|
|
|
bfree(&b1);
|
|
|
|
|
}
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// The bootstrap command runs a build from scratch,
|
|
|
|
|
// stopping at having installed the go_bootstrap command.
|
|
|
|
|
void
|
|
|
|
|
cmdbootstrap(int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
Buf b;
|
2012-02-13 22:31:51 -05:00
|
|
|
char *oldgoos, *oldgoarch, *oldgochar;
|
|
|
|
|
|
|
|
|
|
binit(&b);
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
ARGBEGIN{
|
2012-02-13 22:31:51 -05:00
|
|
|
case 'a':
|
|
|
|
|
rebuildall = 1;
|
|
|
|
|
break;
|
2012-02-03 18:16:42 -05:00
|
|
|
case 'v':
|
|
|
|
|
vflag++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
usage();
|
|
|
|
|
}ARGEND
|
|
|
|
|
|
|
|
|
|
if(argc > 0)
|
|
|
|
|
usage();
|
|
|
|
|
|
2012-02-15 11:48:17 -05:00
|
|
|
if(rebuildall)
|
|
|
|
|
clean();
|
2012-02-10 22:26:36 -02:00
|
|
|
goversion = findgoversion();
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
setup();
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-03-05 16:13:33 -05:00
|
|
|
xsetenv("GOROOT", goroot);
|
|
|
|
|
xsetenv("GOROOT_FINAL", goroot_final);
|
|
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
// For the main bootstrap, building for host os/arch.
|
|
|
|
|
oldgoos = goos;
|
|
|
|
|
oldgoarch = goarch;
|
|
|
|
|
oldgochar = gochar;
|
|
|
|
|
goos = gohostos;
|
|
|
|
|
goarch = gohostarch;
|
|
|
|
|
gochar = gohostchar;
|
|
|
|
|
xsetenv("GOARCH", goarch);
|
|
|
|
|
xsetenv("GOOS", goos);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-13 22:31:51 -05:00
|
|
|
for(i=0; i<nelem(buildorder); i++) {
|
|
|
|
|
install(bprintf(&b, buildorder[i], gohostchar));
|
|
|
|
|
if(!streq(oldgochar, gohostchar) && xstrstr(buildorder[i], "%s"))
|
|
|
|
|
install(bprintf(&b, buildorder[i], oldgochar));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
goos = oldgoos;
|
|
|
|
|
goarch = oldgoarch;
|
|
|
|
|
gochar = oldgochar;
|
|
|
|
|
xsetenv("GOARCH", goarch);
|
|
|
|
|
xsetenv("GOOS", goos);
|
|
|
|
|
|
|
|
|
|
// Build pkg/runtime for actual goos/goarch too.
|
|
|
|
|
if(!streq(goos, gohostos) || !streq(goarch, gohostarch))
|
|
|
|
|
install("pkg/runtime");
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
bfree(&b);
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
static char*
|
|
|
|
|
defaulttarg(void)
|
|
|
|
|
{
|
|
|
|
|
char *p;
|
2012-02-17 11:29:34 -05:00
|
|
|
Buf pwd, src, real_src;
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
binit(&pwd);
|
|
|
|
|
binit(&src);
|
2012-02-17 11:29:34 -05:00
|
|
|
binit(&real_src);
|
2012-02-03 18:16:42 -05:00
|
|
|
|
2012-02-17 11:29:34 -05:00
|
|
|
// xgetwd might return a path with symlinks fully resolved, and if
|
|
|
|
|
// there happens to be symlinks in goroot, then the hasprefix test
|
|
|
|
|
// will never succeed. Instead, we use xrealwd to get a canonical
|
|
|
|
|
// goroot/src before the comparison to avoid this problem.
|
2012-02-03 18:16:42 -05:00
|
|
|
xgetwd(&pwd);
|
|
|
|
|
p = btake(&pwd);
|
|
|
|
|
bpathf(&src, "%s/src/", goroot);
|
2012-02-17 11:29:34 -05:00
|
|
|
xrealwd(&real_src, bstr(&src));
|
|
|
|
|
if(!hasprefix(p, bstr(&real_src)))
|
|
|
|
|
fatal("current directory %s is not under %s", p, bstr(&real_src));
|
|
|
|
|
p += real_src.len;
|
|
|
|
|
// guard againt xrealwd return the directory without the trailing /
|
|
|
|
|
if(*p == slash[0])
|
|
|
|
|
p++;
|
2012-02-03 18:16:42 -05:00
|
|
|
|
|
|
|
|
bfree(&pwd);
|
|
|
|
|
bfree(&src);
|
2012-02-17 11:29:34 -05:00
|
|
|
bfree(&real_src);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
// Install installs the list of packages named on the command line.
|
|
|
|
|
void
|
|
|
|
|
cmdinstall(int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
ARGBEGIN{
|
|
|
|
|
case 'v':
|
|
|
|
|
vflag++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
usage();
|
|
|
|
|
}ARGEND
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
if(argc == 0)
|
|
|
|
|
install(defaulttarg());
|
|
|
|
|
|
|
|
|
|
for(i=0; i<argc; i++)
|
cmd/dist: new command
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
|
|
|
install(argv[i]);
|
|
|
|
|
}
|
2012-02-03 18:16:42 -05:00
|
|
|
|
|
|
|
|
// Clean deletes temporary objects.
|
|
|
|
|
// Clean -i deletes the installed objects too.
|
|
|
|
|
void
|
|
|
|
|
cmdclean(int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
ARGBEGIN{
|
|
|
|
|
case 'v':
|
|
|
|
|
vflag++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
usage();
|
|
|
|
|
}ARGEND
|
|
|
|
|
|
|
|
|
|
if(argc > 0)
|
|
|
|
|
usage();
|
|
|
|
|
|
|
|
|
|
clean();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Banner prints the 'now you've installed Go' banner.
|
|
|
|
|
void
|
|
|
|
|
cmdbanner(int argc, char **argv)
|
|
|
|
|
{
|
2013-03-15 05:04:19 +01:00
|
|
|
char *pathsep, *pid, *ns;
|
2012-04-02 22:33:38 +08:00
|
|
|
Buf b, b1, search, path;
|
2012-02-03 18:16:42 -05:00
|
|
|
|
|
|
|
|
ARGBEGIN{
|
|
|
|
|
case 'v':
|
|
|
|
|
vflag++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
usage();
|
|
|
|
|
}ARGEND
|
|
|
|
|
|
|
|
|
|
if(argc > 0)
|
|
|
|
|
usage();
|
|
|
|
|
|
|
|
|
|
binit(&b);
|
|
|
|
|
binit(&b1);
|
|
|
|
|
binit(&search);
|
2012-04-02 22:33:38 +08:00
|
|
|
binit(&path);
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-02-03 18:16:42 -05:00
|
|
|
xprintf("\n");
|
|
|
|
|
xprintf("---\n");
|
|
|
|
|
xprintf("Installed Go for %s/%s in %s\n", goos, goarch, goroot);
|
|
|
|
|
xprintf("Installed commands in %s\n", gobin);
|
|
|
|
|
|
2013-03-15 05:04:19 +01:00
|
|
|
if(streq(gohostos, "plan9")) {
|
|
|
|
|
// Check that gobin is bound before /bin.
|
|
|
|
|
readfile(&b, "#c/pid");
|
|
|
|
|
bsubst(&b, " ", "");
|
|
|
|
|
pid = btake(&b);
|
|
|
|
|
bprintf(&b, "/proc/%s/ns", pid);
|
|
|
|
|
ns = btake(&b);
|
|
|
|
|
readfile(&b, ns);
|
|
|
|
|
bprintf(&search, "bind -b %s /bin\n", gobin);
|
|
|
|
|
if(xstrstr(bstr(&b), bstr(&search)) == nil)
|
|
|
|
|
xprintf("*** You need to bind %s before /bin.\n", gobin);
|
|
|
|
|
} else {
|
|
|
|
|
// Check that gobin appears in $PATH.
|
|
|
|
|
xgetenv(&b, "PATH");
|
|
|
|
|
pathsep = ":";
|
|
|
|
|
if(streq(gohostos, "windows"))
|
|
|
|
|
pathsep = ";";
|
|
|
|
|
bprintf(&b1, "%s%s%s", pathsep, bstr(&b), pathsep);
|
|
|
|
|
bprintf(&search, "%s%s%s", pathsep, gobin, pathsep);
|
|
|
|
|
if(xstrstr(bstr(&b1), bstr(&search)) == nil)
|
|
|
|
|
xprintf("*** You need to add %s to your PATH.\n", gobin);
|
|
|
|
|
}
|
2012-02-03 18:16:42 -05:00
|
|
|
|
|
|
|
|
if(streq(gohostos, "darwin")) {
|
2012-04-02 22:33:38 +08:00
|
|
|
if(isfile(bpathf(&path, "%s/cov", tooldir)))
|
|
|
|
|
xprintf("\n"
|
|
|
|
|
"On OS X the debuggers must be installed setgid procmod.\n"
|
|
|
|
|
"Read and run ./sudo.bash to install the debuggers.\n");
|
2012-02-03 18:16:42 -05:00
|
|
|
}
|
2012-02-28 16:18:24 -05:00
|
|
|
|
2012-10-12 13:35:05 +08:00
|
|
|
if(!xsamefile(goroot_final, goroot)) {
|
2012-02-03 18:16:42 -05:00
|
|
|
xprintf("\n"
|
|
|
|
|
"The binaries expect %s to be copied or moved to %s\n",
|
|
|
|
|
goroot, goroot_final);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bfree(&b);
|
|
|
|
|
bfree(&b1);
|
|
|
|
|
bfree(&search);
|
2012-04-02 22:33:38 +08:00
|
|
|
bfree(&path);
|
2012-02-03 18:16:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Version prints the Go version.
|
|
|
|
|
void
|
|
|
|
|
cmdversion(int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
ARGBEGIN{
|
|
|
|
|
case 'v':
|
|
|
|
|
vflag++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
usage();
|
|
|
|
|
}ARGEND
|
|
|
|
|
|
|
|
|
|
if(argc > 0)
|
|
|
|
|
usage();
|
|
|
|
|
|
2012-02-07 00:38:15 -02:00
|
|
|
xprintf("%s\n", goversion);
|
2012-02-03 18:16:42 -05:00
|
|
|
}
|