* use new Make.$GOARCH files in gobuild.
* rename 6ar to arch-generic gopack.
* place objects in $GOROOT/pkg/$GOOS_$GOARCH
(makes cross-compiling easier, and no one
ever types these paths by hand anyway).
R=r
DELTA=29 (6 added, 8 deleted, 15 changed)
OCL=29923
CL=29967
CC=${O}c
GC=${O}g
LD=${O}l
+OS=568vq
\ No newline at end of file
CC=${O}c
GC=${O}g
LD=${O}l
+OS=568vq
\ No newline at end of file
CC=${O}c
GC=${O}g
LD=${O}l
+OS=568vq
if(access(pname, AEXIST) < 0 && LIBDIR != nil)
snprint(pname, sizeof pname, "%s/%s", LIBDIR, name);
if(access(pname, AEXIST) < 0)
- snprint(pname, sizeof pname, "%s/pkg/%s", goroot, name);
+ snprint(pname, sizeof pname, "%s/pkg/%s_%s/%s", goroot, goos, goarch, name);
strcpy(name, pname);
}
if(debug['v'])
if(access(pname, AEXIST) < 0 && LIBDIR != nil)
snprint(pname, sizeof pname, "%s/%s", LIBDIR, name);
if(access(pname, AEXIST) < 0)
- snprint(pname, sizeof pname, "%s/pkg/%s", goroot, name);
+ snprint(pname, sizeof pname, "%s/pkg/%s_%s/%s", goroot, goos, goarch, name);
strcpy(name, pname);
}
if(debug['v'])
# We call the binary 6ar to avoid confusion and because this binary
# is linked only with amd64 and x86 support.
-TARG=6ar
+TARG=gopack
OFILES=\
ar.$O\
int
findpkg(Strlit *name)
{
- static char* goroot;
- Idir* p;
+ static char *goroot, *goos, *goarch;
+ Idir *p;
if(goroot == nil) {
goroot = getenv("GOROOT");
+ goos = getenv("GOOS");
+ goarch = getenv("GOARCH");
}
// try .a before .6. important for building libraries:
if(access(namebuf, 0) >= 0)
return 1;
if(goroot != nil) {
- snprint(namebuf, sizeof(namebuf), "%s/pkg/%Z.a", goroot, name);
+ snprint(namebuf, sizeof(namebuf), "%s/pkg/%s_%s/%Z.a", goroot, goos, goarch, name);
if(access(namebuf, 0) >= 0)
return 1;
- snprint(namebuf, sizeof(namebuf), "%s/pkg/%Z.%c", goroot, name, thechar);
+ snprint(namebuf, sizeof(namebuf), "%s/pkg/%s_%s/%Z.%c", goroot, goos, goarch, name, thechar);
if(access(namebuf, 0) >= 0)
return 1;
}
"\n"
"D={.section Dir}/{@}{.end}\n"
"\n"
- "O_arm=5\n" // TODO(rsc): include something here?
- "O_amd64=6\n"
- "O_386=8\n"
- "OS=568vq\n"
- "\n"
- "O=$(O_$(GOARCH))\n"
- "GC=$(O)g -I{ObjDir}\n"
- "CC=$(O)c -FVw\n"
- "AS=$(O)a\n"
- "AR=6ar\n"
+ "include $(GOROOT)/src/Make.$(GOARCH)\n"
+ "AR=gopack\n"
"\n"
"default: packages\n"
"\n"
" 6cov -g `pwd` | grep -v '_test\\.go:'\n"
"\n"
"%.$O: %.go\n"
- " $(GC) $*.go\n"
+ " $(GC) -I{ObjDir} $*.go\n"
"\n"
"%.$O: %.c\n"
" $(CC) $*.c\n"
"{.end}\n"
"\n"
"nuke: clean\n"
- " rm -f{.repeated section Packages} $(GOROOT)/pkg$D/{Name}.a{.end}\n"
+ " rm -f{.repeated section Packages} $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/{Name}.a{.end}\n"
"\n"
"packages:{.repeated section Packages} {ObjDir}$D/{Name}.a{.end}\n"
"\n"
"install: packages\n"
- " test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg$D\n"
+ " test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D\n"
"{.repeated section Packages}\n"
- " cp {ObjDir}$D/{Name}.a $(GOROOT)/pkg$D/{Name}.a\n"
+ " cp {ObjDir}$D/{Name}.a $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/{Name}.a\n"
"{.end}\n"
func argsFmt(w io.Writer, x interface{}, format string) {
theChar + "g",
theChar + "c",
theChar + "a",
- "6ar", // sic
+ "gopack",
};
for i, v := range binaries {
}
func Archive(pkg string, files []string) {
- argv := []string{ "6ar", "grc", pkg };
+ argv := []string{ "gopack", "grc", pkg };
for i, file := range files {
PushString(&argv, file);
}