mirror of https://github.com/perkeep/perkeep.git
build: let a .goroot symlink set the GOROOT environment and path.
Change-Id: I4e7d560fc4b9974af85b043e13157104894c27be
This commit is contained in:
parent
3de908e849
commit
5a0de07a47
|
@ -15,3 +15,4 @@ _embed_*.go
|
||||||
_cgo*
|
_cgo*
|
||||||
clients/go/camgsinit/camgsinit
|
clients/go/camgsinit/camgsinit
|
||||||
clients/go/camwebdav/camwebdav
|
clients/go/camwebdav/camwebdav
|
||||||
|
.goroot
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
6g version release.r60.2 9933
|
6g version release.r60.2 9925
|
||||||
|
|
12
build.pl
12
build.pl
|
@ -62,6 +62,8 @@ EOM
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_environment_from_goroot_symlink();
|
||||||
|
|
||||||
my %built; # target -> bool (was it already built?)
|
my %built; # target -> bool (was it already built?)
|
||||||
|
|
||||||
# Note: the target key is usually the directory, but may be overridden. use
|
# Note: the target key is usually the directory, but may be overridden. use
|
||||||
|
@ -629,6 +631,16 @@ sub generate_embed_file {
|
||||||
print $dest "func init() {\n\tFiles.Add(\"$base_file\", \"$escaped\");\n}\n";
|
print $dest "func init() {\n\tFiles.Add(\"$base_file\", \"$escaped\");\n}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub setup_environment_from_goroot_symlink {
|
||||||
|
return unless -e ".goroot";
|
||||||
|
my $root = readlink ".goroot";
|
||||||
|
unless (-d $root) {
|
||||||
|
die "Optional file $Findbin::Bin/.goroot points to invalid GOROOT directory $root\n";
|
||||||
|
}
|
||||||
|
$ENV{"GOROOT"} = $root;
|
||||||
|
$ENV{"PATH"} = "$root/bin:$ENV{PATH}";
|
||||||
|
}
|
||||||
|
|
||||||
__DATA__
|
__DATA__
|
||||||
|
|
||||||
TARGET: clients/go/camdbinit
|
TARGET: clients/go/camdbinit
|
||||||
|
|
Loading…
Reference in New Issue