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