Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(141)

Delta Between Two Patch Sets: src/cmd/dist/buildruntime.c

Issue 5608059: code review 5608059: build: dist-based build for Plan 9 (Closed)
Left Patch Set: Created 13 years, 2 months ago
Right Patch Set: diff -r cb5c48bccd5a https://code.google.com/p/go/ Created 12 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/dist/buildgc.c ('k') | src/cmd/dist/goc2c.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 #include "a.h" 5 #include "a.h"
6 #include <stdio.h>
7 6
8 /* 7 /*
9 * Helpers for building pkg/runtime. 8 * Helpers for building pkg/runtime.
10 */ 9 */
11 10
12 // mkzversion writes zversion.go: 11 // mkzversion writes zversion.go:
13 // 12 //
14 // package runtime 13 // package runtime
15 // const defaultGoroot = <goroot> 14 // const defaultGoroot = <goroot>
16 // const theVersion = <version> 15 // const theVersion = <version>
17 // 16 //
18 void 17 void
19 mkzversion(char *dir, char *file) 18 mkzversion(char *dir, char *file)
20 { 19 {
21 Buf b, out; 20 Buf b, out;
22 ········ 21 ········
22 USED(dir);
23
23 binit(&b); 24 binit(&b);
24 binit(&out); 25 binit(&out);
25 ········ 26 ········
26 bwritestr(&out, bprintf(&b, 27 bwritestr(&out, bprintf(&b,
27 "// auto generated by go tool dist\n" 28 "// auto generated by go tool dist\n"
28 "\n" 29 "\n"
29 "package runtime\n" 30 "package runtime\n"
30 "\n" 31 "\n"
31 "const defaultGoroot = `%s`\n" 32 "const defaultGoroot = `%s`\n"
32 "const theVersion = `%s`\n", goroot_final, goversion)); 33 "const theVersion = `%s`\n", goroot_final, goversion));
33 34
34 writefile(&out, file, 0); 35 writefile(&out, file, 0);
35 ········ 36 ········
36 bfree(&b); 37 bfree(&b);
37 bfree(&out); 38 bfree(&out);
38 } 39 }
39 40
40 // mkzgoarch writes zgoarch_$GOARCH.go: 41 // mkzgoarch writes zgoarch_$GOARCH.go:
41 // 42 //
42 // package runtime 43 // package runtime
43 // const theGoarch = <goarch> 44 // const theGoarch = <goarch>
44 // 45 //
45 void 46 void
46 mkzgoarch(char *dir, char *file) 47 mkzgoarch(char *dir, char *file)
47 { 48 {
48 Buf b, out; 49 Buf b, out;
50
51 USED(dir);
49 ········ 52 ········
50 binit(&b); 53 binit(&b);
51 binit(&out); 54 binit(&out);
52 ········ 55 ········
53 bwritestr(&out, bprintf(&b, 56 bwritestr(&out, bprintf(&b,
54 "// auto generated by go tool dist\n" 57 "// auto generated by go tool dist\n"
55 "\n" 58 "\n"
56 "package runtime\n" 59 "package runtime\n"
57 "\n" 60 "\n"
58 "const theGoarch = `%s`\n", goarch)); 61 "const theGoarch = `%s`\n", goarch));
59 62
60 writefile(&out, file, 0); 63 writefile(&out, file, 0);
61 ········ 64 ········
62 bfree(&b); 65 bfree(&b);
63 bfree(&out); 66 bfree(&out);
64 } 67 }
65 68
66 // mkzgoos writes zgoos_$GOOS.go: 69 // mkzgoos writes zgoos_$GOOS.go:
67 // 70 //
68 // package runtime 71 // package runtime
69 // const theGoos = <goos> 72 // const theGoos = <goos>
70 // 73 //
71 void 74 void
72 mkzgoos(char *dir, char *file) 75 mkzgoos(char *dir, char *file)
73 { 76 {
74 Buf b, out; 77 Buf b, out;
78
79 USED(dir);
75 ········ 80 ········
76 binit(&b); 81 binit(&b);
77 binit(&out); 82 binit(&out);
78 ········ 83 ········
79 bwritestr(&out, bprintf(&b, 84 bwritestr(&out, bprintf(&b,
80 "// auto generated by go tool dist\n" 85 "// auto generated by go tool dist\n"
81 "\n" 86 "\n"
82 "package runtime\n" 87 "package runtime\n"
83 "\n" 88 "\n"
84 "const theGoos = `%s`\n", goos)); 89 "const theGoos = `%s`\n", goos));
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 writefile(&out, file, 0); 342 writefile(&out, file, 0);
338 343
339 bfree(&in); 344 bfree(&in);
340 bfree(&b); 345 bfree(&b);
341 bfree(&out); 346 bfree(&out);
342 vfree(&argv); 347 vfree(&argv);
343 vfree(&lines); 348 vfree(&lines);
344 vfree(&fields); 349 vfree(&fields);
345 vfree(&seen); 350 vfree(&seen);
346 } 351 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b