~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/go/build/build.go

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-11-18 15:12:26 UTC
  • mfrom: (14.2.12 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141118151226-zug7vn93mn3dtiz3
Tags: 2:1.3.2-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - Support co-installability with gccgo-go tool:
    - d/rules,golang-go.install: Rename bin/go -> bin/golang-go
    - d/golang-go.{postinst,prerm}: Install/remove /usr/bin/go using
      alternatives.
  - d/copyright: Amendments for full compiliance with copyright format.
  - d/control: Demote golang-go.tools to Suggests to support Ubuntu MIR.
  - dropped patches (now upstream):
    - d/p/issue27650045_40001_50001.diff
    - d/p/issue28050043_60001_70001.diff
    - d/p/issue54790044_100001_110001.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
        // say "+build go1.x", and code that should only be built before Go 1.x
293
293
        // (perhaps it is the stub to use in that case) should say "+build !go1.x".
294
294
        //
295
 
        // When we reach Go 1.3 the line will read
296
 
        //      c.ReleaseTags = []string{"go1.1", "go1.2", "go1.3"}
 
295
        // When we reach Go 1.4 the line will read
 
296
        //      c.ReleaseTags = []string{"go1.1", "go1.2", "go1.3", "go1.4"}
297
297
        // and so on.
298
 
        c.ReleaseTags = []string{"go1.1", "go1.2"}
 
298
        c.ReleaseTags = []string{"go1.1", "go1.2", "go1.3"}
299
299
 
300
300
        switch os.Getenv("CGO_ENABLED") {
301
301
        case "1":
303
303
        case "0":
304
304
                c.CgoEnabled = false
305
305
        default:
306
 
                // golang.org/issue/5141
307
 
                // cgo should be disabled for cross compilation builds
 
306
                // cgo must be explicitly enabled for cross compilation builds
308
307
                if runtime.GOARCH == c.GOARCH && runtime.GOOS == c.GOOS {
309
308
                        c.CgoEnabled = cgoEnabled[c.GOOS+"/"+c.GOARCH]
310
309
                        break
358
357
        IgnoredGoFiles []string // .go source files ignored for this build
359
358
        CFiles         []string // .c source files
360
359
        CXXFiles       []string // .cc, .cpp and .cxx source files
 
360
        MFiles         []string // .m (Objective-C) source files
361
361
        HFiles         []string // .h, .hh, .hpp and .hxx source files
362
362
        SFiles         []string // .s source files
363
363
        SwigFiles      []string // .swig files
622
622
                case ".cc", ".cpp", ".cxx":
623
623
                        p.CXXFiles = append(p.CXXFiles, name)
624
624
                        continue
 
625
                case ".m":
 
626
                        p.MFiles = append(p.MFiles, name)
 
627
                        continue
625
628
                case ".h", ".hh", ".hpp", ".hxx":
626
629
                        p.HFiles = append(p.HFiles, name)
627
630
                        continue
789
792
        }
790
793
 
791
794
        switch ext {
792
 
        case ".go", ".c", ".cc", ".cxx", ".cpp", ".s", ".h", ".hh", ".hpp", ".hxx", ".S", ".swig", ".swigcxx":
 
795
        case ".go", ".c", ".cc", ".cxx", ".cpp", ".m", ".s", ".h", ".hh", ".hpp", ".hxx", ".S", ".swig", ".swigcxx":
793
796
                // tentatively okay - read to make sure
794
797
        case ".syso":
795
798
                // binary, no reading
1207
1210
        switch goarch {
1208
1211
        case "386":
1209
1212
                return "8", nil
1210
 
        case "amd64":
 
1213
        case "amd64", "amd64p32":
1211
1214
                return "6", nil
1212
1215
        case "arm":
1213
1216
                return "5", nil