src/pkg/Make.deps
src/pkg/exp/ogle/ogle
src/pkg/os/signal/unix.go
-src/pkg/runtime/cgo2c
src/pkg/runtime/*/asm.h
+src/pkg/runtime/cgo2c
+src/pkg/runtime/mkversion
src/pkg/runtime/runtime.acid.*
+src/pkg/runtime/version.go
+src/pkg/github.com/
+src/pkg/*.googlecode.com/
test/pass.out
test/run.out
test/times.out
GOFILES=\
extern.go\
type.go\
+ version.go\
GOFILES_pchw=\
pchw/io.go\
clean: clean-local
clean-local:
- rm -f cgo2c */asm.h runtime.acid.*
+ rm -f cgo2c mkversion version.go */asm.h runtime.acid.*
$(GOARCH)/asm.h: mkasmh.sh runtime.acid.$(GOARCH)
./mkasmh.sh >$@.x
cgo2c: cgo2c.c
$(QUOTED_GOBIN)/quietgcc -o $@ $<
+mkversion: mkversion.c
+ $(QUOTED_GOBIN)/quietgcc -o $@ -I "$(GOROOT)/include" $< "$(GOROOT)/lib/lib9.a"
+
+version.go: mkversion
+ mkversion >version.go
+
%.c: %.cgo cgo2c
./cgo2c $< > $@.tmp
mv -f $@.tmp $@
// TODO(rsc): allow f to have (ignored) return values
//
func SetFinalizer(x, f interface{})
+
+func getgoroot() string
+
+// GOROOT returns the root of the Go tree.
+// It uses the GOROOT environment variable, if set,
+// or else the root used during the Go build.
+func GOROOT() string {
+ s := getgoroot()
+ if s != "" {
+ return s
+ }
+ return defaultGoroot
+}
+
+// Version returns the Go tree's version string.
+// It is either a sequence number or, when possible,
+// a release tag like "release.2010-03-04".
+// A trailing + indicates that the tree had local modifications
+// at the time of the build.
+func Version() string { return defaultVersion }
--- /dev/null
+#include <u.h>
+#include <libc.h>
+
+char *template =
+ "// generated by mkversion.c; do not edit.\n"
+ "package runtime\n"
+ "const defaultGoroot = \"%s\"\n"
+ "const defaultVersion = \"%s\"\n";
+
+void
+main(void)
+{
+ print(template, getgoroot(), getgoversion());
+ exits(0);
+}
return nil;
}
+void
+·getgoroot(String out)
+{
+ byte *p;
+
+ p = getenv("GOROOT");
+ out = gostring(p);
+ FLUSH(&out);
+}
int32
atoi(byte *p)