LEFT | RIGHT |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 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 package build | 5 package build |
6 | 6 |
7 import ( | 7 import ( |
8 "bytes" | 8 "bytes" |
9 "errors" | 9 "errors" |
10 "fmt" | 10 "fmt" |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 return false // this one doesn't
match | 850 return false // this one doesn't
match |
851 } | 851 } |
852 } | 852 } |
853 } | 853 } |
854 } | 854 } |
855 } | 855 } |
856 return true // everything matches | 856 return true // everything matches |
857 } | 857 } |
858 | 858 |
859 // saveCgo saves the information from the #cgo lines in the import "C" comment. | 859 // saveCgo saves the information from the #cgo lines in the import "C" comment. |
860 // These lines set CPP, CFLAGS, FXXFLAGS and LDFLAGS and pkg-config directives | 860 // These lines set CPPCFLAGS, CFLAGS, CXXFLAGS and LDFLAGS and pkg-config direct
ives |
861 // that affect the way cgo's C code is built. | 861 // that affect the way cgo's C code is built. |
862 // | 862 // |
863 // TODO(rsc): This duplicates code in cgo. | 863 // TODO(rsc): This duplicates code in cgo. |
864 // Once the dust settles, remove this code from cgo. | 864 // Once the dust settles, remove this code from cgo. |
865 func (ctxt *Context) saveCgo(filename string, di *Package, cg *ast.CommentGroup)
error { | 865 func (ctxt *Context) saveCgo(filename string, di *Package, cg *ast.CommentGroup)
error { |
866 text := cg.Text() | 866 text := cg.Text() |
867 for _, line := range strings.Split(text, "\n") { | 867 for _, line := range strings.Split(text, "\n") { |
868 orig := line | 868 orig := line |
869 | 869 |
870 // Line is | 870 // Line is |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 switch goarch { | 1124 switch goarch { |
1125 case "386": | 1125 case "386": |
1126 return "8", nil | 1126 return "8", nil |
1127 case "amd64": | 1127 case "amd64": |
1128 return "6", nil | 1128 return "6", nil |
1129 case "arm": | 1129 case "arm": |
1130 return "5", nil | 1130 return "5", nil |
1131 } | 1131 } |
1132 return "", errors.New("unsupported GOARCH " + goarch) | 1132 return "", errors.New("unsupported GOARCH " + goarch) |
1133 } | 1133 } |
LEFT | RIGHT |