...
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 defaultGOARM64 = `%s`\n", goarm64)
58 fmt.Fprintf(&buf, "const defaultGOMIPS = `%s`\n", gomips)
59 fmt.Fprintf(&buf, "const defaultGOMIPS64 = `%s`\n", gomips64)
60 fmt.Fprintf(&buf, "const defaultGOPPC64 = `%s`\n", goppc64)
61 fmt.Fprintf(&buf, "const defaultGORISCV64 = `%s`\n", goriscv64)
62 fmt.Fprintf(&buf, "const defaultGOEXPERIMENT = `%s`\n", goexperiment)
63 fmt.Fprintf(&buf, "const defaultGO_EXTLINK_ENABLED = `%s`\n", goextlinkenabled)
64 fmt.Fprintf(&buf, "const defaultGO_LDSO = `%s`\n", defaultldso)
65 fmt.Fprintf(&buf, "const version = `%s`\n", findgoversion())
66 fmt.Fprintf(&buf, "const defaultGOOS = runtime.GOOS\n")
67 fmt.Fprintf(&buf, "const defaultGOARCH = runtime.GOARCH\n")
68
69 writefile(buf.String(), file, writeSkipSame)
70 }
71
72
73
74
75
76
77 func mkobjabi(file string) {
78 var buf strings.Builder
79 writeHeader(&buf)
80 fmt.Fprintf(&buf, "package objabi\n")
81
82 writefile(buf.String(), file, writeSkipSame)
83 }
84
View as plain text