// 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" /* * Helpers for building runtime. */ // mkzversion writes zversion.go: // // package runtime // const defaultGoroot = // const theVersion = // void mkzversion(char *dir, char *file) { Buf b, out; USED(dir); binit(&b); binit(&out); bwritestr(&out, bprintf(&b, "// auto generated by go tool dist\n" "\n" "package runtime\n" "\n" "const defaultGoroot = `%s`\n" "const theVersion = `%s`\n" "var buildVersion = theVersion\n", goroot_final, goversion)); writefile(&out, file, 0); bfree(&b); bfree(&out); } // mkzexperiment writes zaexperiment.h (sic): // // #define GOEXPERIMENT "experiment string" // void mkzexperiment(char *dir, char *file) { Buf b, out, exp; USED(dir); binit(&b); binit(&out); binit(&exp); xgetenv(&exp, "GOEXPERIMENT"); bwritestr(&out, bprintf(&b, "// auto generated by go tool dist\n" "\n" "#define GOEXPERIMENT \"%s\"\n", bstr(&exp))); writefile(&out, file, 0); bfree(&b); bfree(&out); bfree(&exp); }