mirror of
https://github.com/golang/go
synced 2024-11-19 01:24:39 -07:00
add -P pkgdir option to 6l to have it look first in pkgdir for a package.
this allows gotest to find the locally built package when doing make gotest without this option, one would have to say make install gotest which kinda defeats the purpose based on discussions with rsc. R=ken,rsc DELTA=12 (10 added, 1 deleted, 1 changed) OCL=27606 CL=27606
This commit is contained in:
parent
45ed7297e8
commit
bfd5ede78d
@ -288,6 +288,7 @@ EXTERN vlong INITDAT;
|
|||||||
EXTERN int32 INITRND;
|
EXTERN int32 INITRND;
|
||||||
EXTERN vlong INITTEXT;
|
EXTERN vlong INITTEXT;
|
||||||
EXTERN char* INITENTRY; /* entry point */
|
EXTERN char* INITENTRY; /* entry point */
|
||||||
|
EXTERN char* PKGDIR;
|
||||||
EXTERN Biobuf bso;
|
EXTERN Biobuf bso;
|
||||||
EXTERN int32 bsssize;
|
EXTERN int32 bsssize;
|
||||||
EXTERN int cbc;
|
EXTERN int cbc;
|
||||||
|
@ -87,6 +87,7 @@ main(int argc, char *argv[])
|
|||||||
INITDAT = -1;
|
INITDAT = -1;
|
||||||
INITRND = -1;
|
INITRND = -1;
|
||||||
INITENTRY = 0;
|
INITENTRY = 0;
|
||||||
|
PKGDIR = nil;
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
default:
|
default:
|
||||||
@ -122,6 +123,11 @@ main(int argc, char *argv[])
|
|||||||
if(a)
|
if(a)
|
||||||
INITRND = atolwhex(a);
|
INITRND = atolwhex(a);
|
||||||
break;
|
break;
|
||||||
|
case 'P':
|
||||||
|
a = ARGF();
|
||||||
|
if(a)
|
||||||
|
PKGDIR = a;
|
||||||
|
break;
|
||||||
case 'x': /* produce export table */
|
case 'x': /* produce export table */
|
||||||
doexp = 1;
|
doexp = 1;
|
||||||
if(argv[1] != nil && argv[1][0] != '-' && !isobjfile(argv[1]))
|
if(argv[1] != nil && argv[1][0] != '-' && !isobjfile(argv[1]))
|
||||||
@ -684,9 +690,10 @@ addlib(char *src, char *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(search) {
|
if(search) {
|
||||||
// try dot and then try goroot.
|
// try dot, -P "pkgdir", and then goroot.
|
||||||
// going to have to do better (probably a command line flag) later.
|
|
||||||
snprint(pname, sizeof pname, ".%s", name);
|
snprint(pname, sizeof pname, ".%s", name);
|
||||||
|
if(access(pname, AEXIST) < 0 && PKGDIR != nil)
|
||||||
|
snprint(pname, sizeof pname, "%s/%s", PKGDIR, name);
|
||||||
if(access(pname, AEXIST) < 0)
|
if(access(pname, AEXIST) < 0)
|
||||||
snprint(pname, sizeof pname, "%s/pkg/%s", goroot, name);
|
snprint(pname, sizeof pname, "%s/pkg/%s", goroot, name);
|
||||||
strcpy(name, pname);
|
strcpy(name, pname);
|
||||||
|
@ -13,6 +13,7 @@ GC=${GC:-${O}g}
|
|||||||
GL=${GL:-${O}l}
|
GL=${GL:-${O}l}
|
||||||
export GC GL
|
export GC GL
|
||||||
GC="$GC -I _obj"
|
GC="$GC -I _obj"
|
||||||
|
GL="$GL -P _obj"
|
||||||
|
|
||||||
gofiles=""
|
gofiles=""
|
||||||
loop=true
|
loop=true
|
||||||
|
Loading…
Reference in New Issue
Block a user