+2015-03-24 Ian Lance Taylor <iant@google.com>
+
+ PR go/65462
+ * Makefile.am (go_cmd_go_files): Add $(libgodir)/zstdpkglist.go.
+ * Makefile.in: Rebuild.
+
2015-03-12 Ian Lance Taylor <iant@google.com>
* Makefile.am (GOLINK): Add GOCFLAGS.
$(cmdsrcdir)/go/tool.go \
$(cmdsrcdir)/go/vcs.go \
$(cmdsrcdir)/go/version.go \
- $(cmdsrcdir)/go/vet.go
+ $(cmdsrcdir)/go/vet.go \
+ $(libgodir)/zstdpkglist.go
go_cmd_gofmt_files = \
$(cmdsrcdir)/gofmt/doc.go \
$(cmdsrcdir)/go/tool.go \
$(cmdsrcdir)/go/vcs.go \
$(cmdsrcdir)/go/version.go \
- $(cmdsrcdir)/go/vet.go
+ $(cmdsrcdir)/go/vet.go \
+ $(libgodir)/zstdpkglist.go
go_cmd_gofmt_files = \
$(cmdsrcdir)/gofmt/doc.go \
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-@NATIVE_FALSE@install-exec-local:
@NATIVE_FALSE@uninstall-local:
+@NATIVE_FALSE@install-exec-local:
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \
$(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
$(STAMP) $@
+noinst_DATA = zstdpkglist.go
+
+# Generate the list of go std packages that were included in libgo
+zstdpkglist.go: s-zstdpkglist; @true
+s-zstdpkglist: Makefile
+ rm -f zstdpkglist.go.tmp
+ echo 'package main' > zstdpkglist.go.tmp
+ echo "" >> zstdpkglist.go.tmp
+ echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
+ echo $(libgo_go_objs) 'unsafe.lo' | sed 's/\.lo /\": true,\n/g' | sed 's/\.lo/\": true,/' | sed 's/-go//' | grep -v _c | sed 's/^/\t\"/' | sort | uniq >> zstdpkglist.go.tmp
+ echo '}' >> zstdpkglist.go.tmp
+ $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
+ $(STAMP) $@
+
go_sort_files = \
go/sort/search.go \
go/sort/sort.go
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
-DATA = $(toolexeclibgo_DATA) $(toolexeclibgoarchive_DATA) \
- $(toolexeclibgocompress_DATA) $(toolexeclibgocontainer_DATA) \
- $(toolexeclibgocrypto_DATA) $(toolexeclibgocryptox509_DATA) \
- $(toolexeclibgodatabase_DATA) $(toolexeclibgodatabasesql_DATA) \
- $(toolexeclibgodebug_DATA) $(toolexeclibgoencoding_DATA) \
- $(toolexeclibgoexp_DATA) $(toolexeclibgogo_DATA) \
- $(toolexeclibgohash_DATA) $(toolexeclibgohtml_DATA) \
- $(toolexeclibgoimage_DATA) $(toolexeclibgoimagecolor_DATA) \
- $(toolexeclibgoindex_DATA) $(toolexeclibgoio_DATA) \
- $(toolexeclibgolog_DATA) $(toolexeclibgomath_DATA) \
- $(toolexeclibgomime_DATA) $(toolexeclibgonet_DATA) \
- $(toolexeclibgonethttp_DATA) $(toolexeclibgonetrpc_DATA) \
- $(toolexeclibgoold_DATA) $(toolexeclibgoos_DATA) \
- $(toolexeclibgopath_DATA) $(toolexeclibgoregexp_DATA) \
- $(toolexeclibgoruntime_DATA) $(toolexeclibgosync_DATA) \
- $(toolexeclibgotesting_DATA) $(toolexeclibgotext_DATA) \
- $(toolexeclibgotexttemplate_DATA) $(toolexeclibgounicode_DATA)
+DATA = $(noinst_DATA) $(toolexeclibgo_DATA) \
+ $(toolexeclibgoarchive_DATA) $(toolexeclibgocompress_DATA) \
+ $(toolexeclibgocontainer_DATA) $(toolexeclibgocrypto_DATA) \
+ $(toolexeclibgocryptox509_DATA) $(toolexeclibgodatabase_DATA) \
+ $(toolexeclibgodatabasesql_DATA) $(toolexeclibgodebug_DATA) \
+ $(toolexeclibgoencoding_DATA) $(toolexeclibgoexp_DATA) \
+ $(toolexeclibgogo_DATA) $(toolexeclibgohash_DATA) \
+ $(toolexeclibgohtml_DATA) $(toolexeclibgoimage_DATA) \
+ $(toolexeclibgoimagecolor_DATA) $(toolexeclibgoindex_DATA) \
+ $(toolexeclibgoio_DATA) $(toolexeclibgolog_DATA) \
+ $(toolexeclibgomath_DATA) $(toolexeclibgomime_DATA) \
+ $(toolexeclibgonet_DATA) $(toolexeclibgonethttp_DATA) \
+ $(toolexeclibgonetrpc_DATA) $(toolexeclibgoold_DATA) \
+ $(toolexeclibgoos_DATA) $(toolexeclibgopath_DATA) \
+ $(toolexeclibgoregexp_DATA) $(toolexeclibgoruntime_DATA) \
+ $(toolexeclibgosync_DATA) $(toolexeclibgotesting_DATA) \
+ $(toolexeclibgotext_DATA) $(toolexeclibgotexttemplate_DATA) \
+ $(toolexeclibgounicode_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
go/runtime/softfloat64.go \
version.go
+noinst_DATA = zstdpkglist.go
go_sort_files = \
go/sort/search.go \
go/sort/sort.go
$(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
$(STAMP) $@
+# Generate the list of go std packages that were included in libgo
+zstdpkglist.go: s-zstdpkglist; @true
+s-zstdpkglist: Makefile
+ rm -f zstdpkglist.go.tmp
+ echo 'package main' > zstdpkglist.go.tmp
+ echo "" >> zstdpkglist.go.tmp
+ echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
+ echo $(libgo_go_objs) 'unsafe.lo' | sed 's/\.lo /\": true,\n/g' | sed 's/\.lo/\": true,/' | sed 's/-go//' | grep -v _c | sed 's/^/\t\"/' | sort | uniq >> zstdpkglist.go.tmp
+ echo '}' >> zstdpkglist.go.tmp
+ $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
+ $(STAMP) $@
+
libcalls.go: s-libcalls; @true
s-libcalls: libcalls-list go/syscall/mksyscall.awk $(go_base_syscall_files)
rm -f libcalls.go.tmp
var buildGccgoflags []string // -gccgoflags flag
var buildRace bool // -race flag
-var reqPkgSrc bool // req src for Imports
+// Require the source for go std packages
+var reqStdPkgSrc bool
var buildContext = build.Default
var buildToolchain toolchain = noToolchain{}
cmd.Flag.BoolVar(&buildRace, "race", false, "")
switch build.Default.Compiler {
case "gc":
- reqPkgSrc = true
+ reqStdPkgSrc = true
case "gccgo":
- reqPkgSrc = false
+ reqStdPkgSrc = false
}
}
// are writing is not the cgo we need to use.
if goos == runtime.GOOS && goarch == runtime.GOARCH && !buildRace {
- if reqPkgSrc {
+ if reqStdPkgSrc {
if len(p.CgoFiles) > 0 || p.Standard && p.ImportPath == "runtime/cgo" {
var stk importStack
p1 := loadPackage("cmd/cgo", &stk)
p.ConflictDir = pp.ConflictDir
// TODO? Target
p.Goroot = pp.Goroot
- p.Standard = p.Goroot && p.ImportPath != "" && !strings.Contains(p.ImportPath, ".")
+ if buildContext.Compiler == "gccgo" {
+ p.Standard = stdpkg[p.ImportPath]
+ } else {
+ p.Standard = p.Goroot && p.ImportPath != "" && !strings.Contains(p.ImportPath, ".")
+ }
p.GoFiles = pp.GoFiles
p.CgoFiles = pp.CgoFiles
p.IgnoredGoFiles = pp.IgnoredGoFiles
continue
}
p1 := loadImport(path, p.Dir, stk, p.build.ImportPos[path])
- if !reqPkgSrc && p1.Root == "" {
+ if !reqStdPkgSrc && p1.Standard {
continue
}
if p1.local {
delete(deps, "unsafe")
all := []string{}
- if reqPkgSrc {
- for path := range deps {
- if !build.IsLocalImport(path) {
- all = append(all, path)
- }
+ for path := range deps {
+ if !build.IsLocalImport(path) {
+ all = append(all, path)
}
}
sort.Strings(all)
a := &action{}
for _, p := range packagesForBuild(all) {
+ if !reqStdPkgSrc && p.Standard {
+ continue
+ }
a.deps = append(a.deps, b.action(modeInstall, modeInstall, p))
}
b.do(a)
stk.push(p.ImportPath + " (test)")
for _, path := range p.TestImports {
p1 := loadImport(path, p.Dir, &stk, p.build.TestImportPos[path])
- if !reqPkgSrc && p1.Root == "" {
+ if !reqStdPkgSrc && p1.Standard {
continue
}
if p1.Error != nil {
continue
}
p1 := loadImport(path, p.Dir, &stk, p.build.XTestImportPos[path])
- if !reqPkgSrc && p1.Root == "" {
+ if !reqStdPkgSrc && p1.Standard {
continue
}
if p1.Error != nil {
pmain.imports = append(pmain.imports, ptest)
} else {
p1 := loadImport(dep, "", &stk, nil)
- if !reqPkgSrc && p1.Root == "" {
+ if !reqStdPkgSrc && p1.Standard {
continue
}
if p1.Error != nil {