2012-02-03 16:16:42 -07: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.
|
|
|
|
|
2015-01-07 09:38:00 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
)
|
2012-02-03 16:16:42 -07:00
|
|
|
|
|
|
|
/*
|
2014-09-07 22:06:45 -06:00
|
|
|
* Helpers for building runtime.
|
2012-02-03 16:16:42 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
// mkzversion writes zversion.go:
|
|
|
|
//
|
|
|
|
// package runtime
|
|
|
|
// const defaultGoroot = <goroot>
|
|
|
|
// const theVersion = <version>
|
|
|
|
//
|
2015-01-07 09:38:00 -07:00
|
|
|
func mkzversion(dir, file string) {
|
|
|
|
out := fmt.Sprintf(
|
|
|
|
"// auto generated by go tool dist\n"+
|
|
|
|
"\n"+
|
|
|
|
"package runtime\n"+
|
|
|
|
"\n"+
|
|
|
|
"const defaultGoroot = `%s`\n"+
|
|
|
|
"const theVersion = `%s`\n"+
|
2015-01-18 17:04:47 -07:00
|
|
|
"\n"+
|
2015-01-07 09:38:00 -07:00
|
|
|
"var buildVersion = theVersion\n", goroot_final, goversion)
|
|
|
|
|
|
|
|
writefile(out, file, 0)
|
2012-02-03 16:16:42 -07:00
|
|
|
}
|
|
|
|
|
2013-09-16 18:26:10 -06:00
|
|
|
// mkzexperiment writes zaexperiment.h (sic):
|
|
|
|
//
|
|
|
|
// #define GOEXPERIMENT "experiment string"
|
|
|
|
//
|
2015-01-07 09:38:00 -07:00
|
|
|
func mkzexperiment(dir, file string) {
|
|
|
|
out := fmt.Sprintf(
|
|
|
|
"// auto generated by go tool dist\n"+
|
|
|
|
"\n"+
|
|
|
|
"#define GOEXPERIMENT \"%s\"\n", os.Getenv("GOEXPERIMENT"))
|
2013-09-16 18:26:10 -06:00
|
|
|
|
2015-01-07 09:38:00 -07:00
|
|
|
writefile(out, file, 0)
|
2013-09-16 18:26:10 -06:00
|
|
|
}
|