...
Source file
src/cmd/dist/buildruntime.go
1
2
3
4
5 package main
6
7 import (
8 "fmt"
9 "strings"
10 )
11
12
15
16
17
18
19
20
21 func mkzversion(dir, file string) {
22 var buf strings.Builder
23 writeHeader(&buf)
24 fmt.Fprintf(&buf, "package sys\n")
25 writefile(buf.String(), file, writeSkipSame)
26 }
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 func mkbuildcfg(file string) {
48 var buf strings.Builder
49 writeHeader(&buf)
50 fmt.Fprintf(&buf, "package buildcfg\n")
51 fmt.Fprintln(&buf)
52 fmt.Fprintf(&buf, "import \"runtime\"\n")
53 fmt.Fprintln(&buf)
54 fmt.Fprintf(&buf, "const defaultGO386 = `%s`\n", go386)
55 fmt.Fprintf(&buf, "const defaultGOAMD64 = `%s`\n", goamd64)
56 fmt.Fprintf(&buf, "const defaultGOARM = `%s`\n", goarm)
57 fmt.Fprintf(&buf, "const defaultGOMIPS = `%s`\n", gomips)
58 fmt.Fprintf(&buf, "const defaultGOMIPS64 = `%s`\n", gomips64)
59 fmt.Fprintf(&buf, "const defaultGOPPC64 = `%s`\n", goppc64)
60 fmt.Fprintf(&buf, "const defaultGOEXPERIMENT = `%s`\n", goexperiment)
61 fmt.Fprintf(&buf, "const defaultGO_EXTLINK_ENABLED = `%s`\n", goextlinkenabled)
62 fmt.Fprintf(&buf, "const defaultGO_LDSO = `%s`\n", defaultldso)
63 fmt.Fprintf(&buf, "const version = `%s`\n", findgoversion())
64 fmt.Fprintf(&buf, "const defaultGOOS = runtime.GOOS\n")
65 fmt.Fprintf(&buf, "const defaultGOARCH = runtime.GOARCH\n")
66
67 writefile(buf.String(), file, writeSkipSame)
68 }
69
70
71
72
73
74
75 func mkobjabi(file string) {
76 var buf strings.Builder
77 writeHeader(&buf)
78 fmt.Fprintf(&buf, "package objabi\n")
79
80 writefile(buf.String(), file, writeSkipSame)
81 }
82
View as plain text