LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 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 #include "a.h" | 5 #include "a.h" |
6 #include "arg.h" | 6 #include "arg.h" |
7 | 7 |
8 /* | 8 /* |
9 * Initialization for any invocation. | 9 * Initialization for any invocation. |
10 */ | 10 */ |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 // install installs the library, package, or binary associated with dir, | 532 // install installs the library, package, or binary associated with dir, |
533 // which is relative to $GOROOT/src. | 533 // which is relative to $GOROOT/src. |
534 static void | 534 static void |
535 install(char *dir) | 535 install(char *dir) |
536 { | 536 { |
537 char *name, *p, *elem, *prefix, *exe; | 537 char *name, *p, *elem, *prefix, *exe; |
538 bool islib, ispkg, isgo, stale; | 538 bool islib, ispkg, isgo, stale; |
539 Buf b, b1, path; | 539 Buf b, b1, path; |
540 Vec compile, files, link, go, missing, clean, lib, extra; | 540 Vec compile, files, link, go, missing, clean, lib, extra; |
541 Time ttarg, t; | 541 Time ttarg, t; |
542 » int i, j, k, n, doclean, targ; | 542 » int i, j, k, n, doclean, targ, usecpp; |
543 | 543 |
544 if(vflag) { | 544 if(vflag) { |
545 if(!streq(goos, gohostos) || !streq(goarch, gohostarch)) | 545 if(!streq(goos, gohostos) || !streq(goarch, gohostarch)) |
546 xprintf("%s (%s/%s)\n", dir, goos, goarch); | 546 xprintf("%s (%s/%s)\n", dir, goos, goarch); |
547 else | 547 else |
548 xprintf("%s\n", dir); | 548 xprintf("%s\n", dir); |
549 } | 549 } |
550 | 550 |
551 binit(&b); | 551 binit(&b); |
552 binit(&b1); | 552 binit(&b1); |
553 binit(&path); | 553 binit(&path); |
554 vinit(&compile); | 554 vinit(&compile); |
555 vinit(&files); | 555 vinit(&files); |
556 vinit(&link); | 556 vinit(&link); |
557 vinit(&go); | 557 vinit(&go); |
558 vinit(&missing); | 558 vinit(&missing); |
559 vinit(&clean); | 559 vinit(&clean); |
560 vinit(&lib); | 560 vinit(&lib); |
561 vinit(&extra); | 561 vinit(&extra); |
562 | 562 |
| 563 |
563 // path = full path to dir. | 564 // path = full path to dir. |
564 bpathf(&path, "%s/src/%s", goroot, dir); | 565 bpathf(&path, "%s/src/%s", goroot, dir); |
565 name = lastelem(dir); | 566 name = lastelem(dir); |
566 | 567 |
567 // For misc/prof, copy into the tool directory and we're done. | 568 // For misc/prof, copy into the tool directory and we're done. |
568 if(hasprefix(dir, "misc/")) { | 569 if(hasprefix(dir, "misc/")) { |
569 copy(bpathf(&b, "%s/%s", tooldir, name), | 570 copy(bpathf(&b, "%s/%s", tooldir, name), |
570 bpathf(&b1, "%s/misc/%s", goroot, name), 1); | 571 bpathf(&b1, "%s/misc/%s", goroot, name), 1); |
571 goto out; | 572 goto out; |
572 } | 573 } |
(...skipping 25 matching lines...) Expand all Loading... |
598 | 599 |
599 exe = ""; | 600 exe = ""; |
600 if(streq(gohostos, "windows")) | 601 if(streq(gohostos, "windows")) |
601 exe = ".exe"; | 602 exe = ".exe"; |
602 | 603 |
603 // Start final link command line. | 604 // Start final link command line. |
604 // Note: code below knows that link.p[targ] is the target. | 605 // Note: code below knows that link.p[targ] is the target. |
605 if(islib) { | 606 if(islib) { |
606 // C library. | 607 // C library. |
607 vadd(&link, "ar"); | 608 vadd(&link, "ar"); |
608 » » vadd(&link, "rsc"); | 609 » » if(streq(gohostos, "plan9")) |
| 610 » » » vadd(&link, "rc"); |
| 611 » » else |
| 612 » » » vadd(&link, "rsc"); |
609 prefix = ""; | 613 prefix = ""; |
610 if(!hasprefix(name, "lib")) | 614 if(!hasprefix(name, "lib")) |
611 prefix = "lib"; | 615 prefix = "lib"; |
612 targ = link.len; | 616 targ = link.len; |
613 vadd(&link, bpathf(&b, "%s/pkg/obj/%s_%s/%s%s.a", goroot, gohost
os, gohostarch, prefix, name)); | 617 vadd(&link, bpathf(&b, "%s/pkg/obj/%s_%s/%s%s.a", goroot, gohost
os, gohostarch, prefix, name)); |
614 } else if(ispkg) { | 618 } else if(ispkg) { |
615 // Go library (package). | 619 // Go library (package). |
616 vadd(&link, bpathf(&b, "%s/pack", tooldir)); | 620 vadd(&link, bpathf(&b, "%s/pack", tooldir)); |
617 vadd(&link, "grc"); | 621 vadd(&link, "grc"); |
618 p = bprintf(&b, "%s/pkg/%s_%s/%s", goroot, goos, goarch, dir+4); | 622 p = bprintf(&b, "%s/pkg/%s_%s/%s", goroot, goos, goarch, dir+4); |
619 *xstrrchr(p, '/') = '\0'; | 623 *xstrrchr(p, '/') = '\0'; |
620 xmkdirall(p); | 624 xmkdirall(p); |
621 targ = link.len; | 625 targ = link.len; |
622 vadd(&link, bpathf(&b, "%s/pkg/%s_%s/%s.a", goroot, goos, goarch
, dir+4)); | 626 vadd(&link, bpathf(&b, "%s/pkg/%s_%s/%s.a", goroot, goos, goarch
, dir+4)); |
623 } else if(streq(dir, "cmd/go") || streq(dir, "cmd/cgo")) { | 627 } else if(streq(dir, "cmd/go") || streq(dir, "cmd/cgo")) { |
624 // Go command. | 628 // Go command. |
625 vadd(&link, bpathf(&b, "%s/%sl", tooldir, gochar)); | 629 vadd(&link, bpathf(&b, "%s/%sl", tooldir, gochar)); |
626 vadd(&link, "-o"); | 630 vadd(&link, "-o"); |
627 elem = name; | 631 elem = name; |
628 if(streq(elem, "go")) | 632 if(streq(elem, "go")) |
629 elem = "go_bootstrap"; | 633 elem = "go_bootstrap"; |
630 targ = link.len; | 634 targ = link.len; |
631 vadd(&link, bpathf(&b, "%s/%s%s", tooldir, elem, exe)); | 635 vadd(&link, bpathf(&b, "%s/%s%s", tooldir, elem, exe)); |
632 } else { | 636 } else { |
633 // C command. Use gccargs. | 637 // C command. Use gccargs. |
634 » » vcopy(&link, gccargs.p, gccargs.len); | 638 » » if(streq(gohostos, "plan9")) { |
635 » » vadd(&link, "-o"); | 639 » » » vadd(&link, bprintf(&b, "%sl", gohostchar)); |
636 » » targ = link.len; | 640 » » » vadd(&link, "-o"); |
637 » » vadd(&link, bpathf(&b, "%s/%s%s", tooldir, name, exe)); | 641 » » » targ = link.len; |
638 » » if(streq(gohostarch, "amd64")) | 642 » » » vadd(&link, bpathf(&b, "%s/%s", tooldir, name)); |
639 » » » vadd(&link, "-m64"); | 643 » » } else { |
640 » » else if(streq(gohostarch, "386")) | 644 » » » vcopy(&link, gccargs.p, gccargs.len); |
641 » » » vadd(&link, "-m32"); | 645 » » » vadd(&link, "-o"); |
| 646 » » » targ = link.len; |
| 647 » » » vadd(&link, bpathf(&b, "%s/%s%s", tooldir, name, exe)); |
| 648 » » » if(streq(gohostarch, "amd64")) |
| 649 » » » » vadd(&link, "-m64"); |
| 650 » » » else if(streq(gohostarch, "386")) |
| 651 » » » » vadd(&link, "-m32"); |
| 652 » » } |
642 } | 653 } |
643 ttarg = mtime(link.p[targ]); | 654 ttarg = mtime(link.p[targ]); |
644 | 655 |
645 // Gather files that are sources for this target. | 656 // Gather files that are sources for this target. |
646 // Everything in that directory, and any target-specific | 657 // Everything in that directory, and any target-specific |
647 // additions. | 658 // additions. |
648 xreaddir(&files, bstr(&path)); | 659 xreaddir(&files, bstr(&path)); |
649 | 660 |
650 // Remove files beginning with . or _, | 661 // Remove files beginning with . or _, |
651 // which are likely to be editor temporary files. | 662 // which are likely to be editor temporary files. |
(...skipping 13 matching lines...) Expand all Loading... |
665 for(i=0; i<nelem(deptab); i++) { | 676 for(i=0; i<nelem(deptab); i++) { |
666 if(hasprefix(dir, deptab[i].prefix)) { | 677 if(hasprefix(dir, deptab[i].prefix)) { |
667 for(j=0; (p=deptab[i].dep[j])!=nil; j++) { | 678 for(j=0; (p=deptab[i].dep[j])!=nil; j++) { |
668 breset(&b1); | 679 breset(&b1); |
669 bwritestr(&b1, p); | 680 bwritestr(&b1, p); |
670 bsubst(&b1, "$GOROOT", goroot); | 681 bsubst(&b1, "$GOROOT", goroot); |
671 bsubst(&b1, "$GOOS", goos); | 682 bsubst(&b1, "$GOOS", goos); |
672 bsubst(&b1, "$GOARCH", goarch); | 683 bsubst(&b1, "$GOARCH", goarch); |
673 p = bstr(&b1); | 684 p = bstr(&b1); |
674 if(hassuffix(p, ".a")) { | 685 if(hassuffix(p, ".a")) { |
| 686 if(streq(gohostos, "plan9") && hassuffix
(p, "libbio.a")) |
| 687 continue; |
675 vadd(&lib, bpathf(&b, "%s", p)); | 688 vadd(&lib, bpathf(&b, "%s", p)); |
676 continue; | 689 continue; |
677 } | 690 } |
678 if(hassuffix(p, "/*")) { | 691 if(hassuffix(p, "/*")) { |
679 bpathf(&b, "%s/%s", bstr(&path), p); | 692 bpathf(&b, "%s/%s", bstr(&path), p); |
680 b.len -= 2; | 693 b.len -= 2; |
681 xreaddir(&extra, bstr(&b)); | 694 xreaddir(&extra, bstr(&b)); |
682 bprintf(&b, "%s", p); | 695 bprintf(&b, "%s", p); |
683 b.len -= 2; | 696 b.len -= 2; |
684 for(k=0; k<extra.len; k++) | 697 for(k=0; k<extra.len; k++) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 stale = 1; | 747 stale = 1; |
735 if(t == 0) { | 748 if(t == 0) { |
736 vadd(&missing, p); | 749 vadd(&missing, p); |
737 files.p[n++] = files.p[i]; | 750 files.p[n++] = files.p[i]; |
738 continue; | 751 continue; |
739 } | 752 } |
740 files.p[n++] = files.p[i]; | 753 files.p[n++] = files.p[i]; |
741 } | 754 } |
742 files.len = n; | 755 files.len = n; |
743 | 756 |
| 757 // If there are no files to compile, we're done. |
| 758 if(files.len == 0) |
| 759 goto out; |
| 760 ········ |
744 for(i=0; i<lib.len && !stale; i++) | 761 for(i=0; i<lib.len && !stale; i++) |
745 if(mtime(lib.p[i]) > ttarg) | 762 if(mtime(lib.p[i]) > ttarg) |
746 stale = 1; | 763 stale = 1; |
747 | 764 |
748 if(!stale) | 765 if(!stale) |
749 goto out; | 766 goto out; |
750 | 767 |
751 // For package runtime, copy some files into the work space. | 768 // For package runtime, copy some files into the work space. |
752 if(streq(dir, "pkg/runtime")) { | 769 if(streq(dir, "pkg/runtime")) { |
753 copy(bpathf(&b, "%s/arch_GOARCH.h", workdir), | 770 copy(bpathf(&b, "%s/arch_GOARCH.h", workdir), |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 copy(bpathf(&b, "%s/zasm_GOOS_GOARCH.h", workdir), | 809 copy(bpathf(&b, "%s/zasm_GOOS_GOARCH.h", workdir), |
793 bpathf(&b1, "%s/zasm_%s_%s.h", bstr(&path), goos, goarch
), 0); | 810 bpathf(&b1, "%s/zasm_%s_%s.h", bstr(&path), goos, goarch
), 0); |
794 } | 811 } |
795 | 812 |
796 // Generate .c files from .goc files. | 813 // Generate .c files from .goc files. |
797 if(streq(dir, "pkg/runtime")) { | 814 if(streq(dir, "pkg/runtime")) { |
798 for(i=0; i<files.len; i++) { | 815 for(i=0; i<files.len; i++) { |
799 p = files.p[i]; | 816 p = files.p[i]; |
800 if(!hassuffix(p, ".goc")) | 817 if(!hassuffix(p, ".goc")) |
801 continue; | 818 continue; |
802 » » » // b = path/zp but with _goarch.c instead of .goc | 819 » » » // b = path/zp but with _goos_goarch.c instead of .goc |
803 bprintf(&b, "%s%sz%s", bstr(&path), slash, lastelem(p)); | 820 bprintf(&b, "%s%sz%s", bstr(&path), slash, lastelem(p)); |
804 b.len -= 4; | 821 b.len -= 4; |
805 » » » bwritef(&b, "_%s.c", goarch); | 822 » » » bwritef(&b, "_%s_%s.c", goos, goarch); |
806 goc2c(p, bstr(&b)); | 823 goc2c(p, bstr(&b)); |
807 vadd(&files, bstr(&b)); | 824 vadd(&files, bstr(&b)); |
808 } | 825 } |
809 vuniq(&files); | 826 vuniq(&files); |
810 } | 827 } |
811 | 828 |
812 if((!streq(goos, gohostos) || !streq(goarch, gohostarch)) && isgo) { | 829 if((!streq(goos, gohostos) || !streq(goarch, gohostarch)) && isgo) { |
813 // We've generated the right files; the go command can do the bu
ild. | 830 // We've generated the right files; the go command can do the bu
ild. |
814 if(vflag > 1) | 831 if(vflag > 1) |
815 xprintf("skip build for cross-compile %s\n", dir); | 832 xprintf("skip build for cross-compile %s\n", dir); |
816 goto nobuild; | 833 goto nobuild; |
817 } | 834 } |
818 | 835 |
| 836 // The files generated by GNU Bison use macros that aren't |
| 837 // supported by the Plan 9 compilers so we have to use the |
| 838 // external preprocessor when compiling. |
| 839 usecpp = 0; |
| 840 if(streq(gohostos, "plan9")) { |
| 841 for(i=0; i<files.len; i++) { |
| 842 p = files.p[i]; |
| 843 if(hassuffix(p, "y.tab.c") || hassuffix(p, "y.tab.h")){ |
| 844 usecpp = 1; |
| 845 break; |
| 846 } |
| 847 } |
| 848 } |
| 849 |
819 // Compile the files. | 850 // Compile the files. |
820 for(i=0; i<files.len; i++) { | 851 for(i=0; i<files.len; i++) { |
821 if(!hassuffix(files.p[i], ".c") && !hassuffix(files.p[i], ".s")) | 852 if(!hassuffix(files.p[i], ".c") && !hassuffix(files.p[i], ".s")) |
822 continue; | 853 continue; |
823 name = lastelem(files.p[i]); | 854 name = lastelem(files.p[i]); |
824 | 855 |
825 vreset(&compile); | 856 vreset(&compile); |
826 if(!isgo) { | 857 if(!isgo) { |
827 // C library or tool. | 858 // C library or tool. |
828 » » » vcopy(&compile, gccargs.p, gccargs.len); | 859 » » » if(streq(gohostos, "plan9")) { |
829 » » » vadd(&compile, "-c"); | 860 » » » » vadd(&compile, bprintf(&b, "%sc", gohostchar)); |
830 » » » if(streq(gohostarch, "amd64")) | 861 » » » » vadd(&compile, "-FTVw"); |
831 » » » » vadd(&compile, "-m64"); | 862 » » » » if(usecpp) |
832 » » » else if(streq(gohostarch, "386")) | 863 » » » » » vadd(&compile, "-Bp+"); |
833 » » » » vadd(&compile, "-m32"); | 864 » » » » vadd(&compile, bpathf(&b, "-I%s/include/plan9",
goroot)); |
834 » » » if(streq(dir, "lib9")) | 865 » » » » vadd(&compile, bpathf(&b, "-I%s/include/plan9/%s
", goroot, gohostarch)); |
835 » » » » vadd(&compile, "-DPLAN9PORT"); | 866 » » » } else { |
836 | 867 » » » » vcopy(&compile, gccargs.p, gccargs.len); |
837 » » » vadd(&compile, "-I"); | 868 » » » » vadd(&compile, "-c"); |
838 » » » vadd(&compile, bpathf(&b, "%s/include", goroot)); | 869 » » » » if(streq(gohostarch, "amd64")) |
| 870 » » » » » vadd(&compile, "-m64"); |
| 871 » » » » else if(streq(gohostarch, "386")) |
| 872 » » » » » vadd(&compile, "-m32"); |
| 873 » » » » if(streq(dir, "lib9")) |
| 874 » » » » » vadd(&compile, "-DPLAN9PORT"); |
| 875 »······· |
| 876 » » » » vadd(&compile, "-I"); |
| 877 » » » » vadd(&compile, bpathf(&b, "%s/include", goroot))
; |
| 878 » » » } |
839 | 879 |
840 vadd(&compile, "-I"); | 880 vadd(&compile, "-I"); |
841 vadd(&compile, bstr(&path)); | 881 vadd(&compile, bstr(&path)); |
842 | 882 |
843 // lib9/goos.c gets the default constants hard-coded. | 883 // lib9/goos.c gets the default constants hard-coded. |
844 if(streq(name, "goos.c")) { | 884 if(streq(name, "goos.c")) { |
845 vadd(&compile, bprintf(&b, "-DGOOS=\"%s\"", goos
)); | 885 vadd(&compile, bprintf(&b, "-DGOOS=\"%s\"", goos
)); |
846 vadd(&compile, bprintf(&b, "-DGOARCH=\"%s\"", go
arch)); | 886 vadd(&compile, bprintf(&b, "-DGOARCH=\"%s\"", go
arch)); |
847 bprintf(&b1, "%s", goroot_final); | 887 bprintf(&b1, "%s", goroot_final); |
848 bsubst(&b1, "\\", "\\\\"); // turn into C strin
g | 888 bsubst(&b1, "\\", "\\\\"); // turn into C strin
g |
(...skipping 26 matching lines...) Expand all Loading... |
875 // To debug C programs on OS X, it is not enough to say
-ggdb | 915 // To debug C programs on OS X, it is not enough to say
-ggdb |
876 // on the command line. You have to leave the object fi
les | 916 // on the command line. You have to leave the object fi
les |
877 // lying around too. Leave them in pkg/obj/, which does
not | 917 // lying around too. Leave them in pkg/obj/, which does
not |
878 // get removed when this tool exits. | 918 // get removed when this tool exits. |
879 bpathf(&b1, "%s/pkg/obj/%s", goroot, dir); | 919 bpathf(&b1, "%s/pkg/obj/%s", goroot, dir); |
880 xmkdirall(bstr(&b1)); | 920 xmkdirall(bstr(&b1)); |
881 bpathf(&b, "%s/%s", bstr(&b1), lastelem(files.p[i])); | 921 bpathf(&b, "%s/%s", bstr(&b1), lastelem(files.p[i])); |
882 doclean = 0; | 922 doclean = 0; |
883 } | 923 } |
884 | 924 |
885 » » b.p[b.len-1] = 'o'; // was c or s | 925 » » // Change the last character of the output file (which was c or
s). |
| 926 » » if(streq(gohostos, "plan9")) |
| 927 » » » b.p[b.len-1] = gohostchar[0]; |
| 928 » » else |
| 929 » » » b.p[b.len-1] = 'o'; |
886 vadd(&compile, "-o"); | 930 vadd(&compile, "-o"); |
887 vadd(&compile, bstr(&b)); | 931 vadd(&compile, bstr(&b)); |
888 vadd(&compile, files.p[i]); | 932 vadd(&compile, files.p[i]); |
889 bgrunv(bstr(&path), CheckExit, &compile); | 933 bgrunv(bstr(&path), CheckExit, &compile); |
890 | 934 |
891 vadd(&link, bstr(&b)); | 935 vadd(&link, bstr(&b)); |
892 if(doclean) | 936 if(doclean) |
893 vadd(&clean, bstr(&b)); | 937 vadd(&clean, bstr(&b)); |
894 } | 938 } |
895 bgwait(); | 939 bgwait(); |
(...skipping 20 matching lines...) Expand all Loading... |
916 vadd(&compile, "-+"); | 960 vadd(&compile, "-+"); |
917 | 961 |
918 vcopy(&compile, go.p, go.len); | 962 vcopy(&compile, go.p, go.len); |
919 | 963 |
920 runv(nil, bstr(&path), CheckExit, &compile); | 964 runv(nil, bstr(&path), CheckExit, &compile); |
921 } | 965 } |
922 | 966 |
923 if(!islib && !isgo) { | 967 if(!islib && !isgo) { |
924 // C binaries need the libraries explicitly, and -lm. | 968 // C binaries need the libraries explicitly, and -lm. |
925 vcopy(&link, lib.p, lib.len); | 969 vcopy(&link, lib.p, lib.len); |
926 » » vadd(&link, "-lm"); | 970 » » if(!streq(gohostos, "plan9")) |
| 971 » » » vadd(&link, "-lm"); |
927 } | 972 } |
928 | 973 |
929 // Remove target before writing it. | 974 // Remove target before writing it. |
930 xremove(link.p[targ]); | 975 xremove(link.p[targ]); |
931 | 976 |
932 runv(nil, nil, CheckExit, &link); | 977 runv(nil, nil, CheckExit, &link); |
933 | 978 |
934 nobuild: | 979 nobuild: |
935 // In package runtime, we install runtime.h and cgocall.h too, | 980 // In package runtime, we install runtime.h and cgocall.h too, |
936 // for use by cgo compilation. | 981 // for use by cgo compilation. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 // We also allow the special tag cmd_go_bootstrap. | 1019 // We also allow the special tag cmd_go_bootstrap. |
975 // See ../go/bootstrap.go and package go/build. | 1020 // See ../go/bootstrap.go and package go/build. |
976 static bool | 1021 static bool |
977 shouldbuild(char *file, char *dir) | 1022 shouldbuild(char *file, char *dir) |
978 { | 1023 { |
979 char *name, *p; | 1024 char *name, *p; |
980 int i, j, ret; | 1025 int i, j, ret; |
981 Buf b; | 1026 Buf b; |
982 Vec lines, fields; | 1027 Vec lines, fields; |
983 | 1028 |
| 1029 // On Plan 9, most of the libraries are already present. |
| 1030 // The main exception is libmach which has been modified |
| 1031 // in various places to support Go object files. |
| 1032 if(streq(gohostos, "plan9")) { |
| 1033 if(streq(dir, "lib9") && !hassuffix(file, "lib9/goos.c")) |
| 1034 return 0; |
| 1035 if(streq(dir, "libbio")) |
| 1036 return 0; |
| 1037 } |
| 1038 ········ |
984 // Check file name for GOOS or GOARCH. | 1039 // Check file name for GOOS or GOARCH. |
985 name = lastelem(file); | 1040 name = lastelem(file); |
986 for(i=0; i<nelem(okgoos); i++) | 1041 for(i=0; i<nelem(okgoos); i++) |
987 if(contains(name, okgoos[i]) && !streq(okgoos[i], goos)) | 1042 if(contains(name, okgoos[i]) && !streq(okgoos[i], goos)) |
988 return 0; | 1043 return 0; |
989 for(i=0; i<nelem(okgoarch); i++) | 1044 for(i=0; i<nelem(okgoarch); i++) |
990 if(contains(name, okgoarch[i]) && !streq(okgoarch[i], goarch)) | 1045 if(contains(name, okgoarch[i]) && !streq(okgoarch[i], goarch)) |
991 return 0; | 1046 return 0; |
992 | 1047 |
993 // Omit test files. | 1048 // Omit test files. |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 char *sep; | 1333 char *sep; |
1279 Buf b, b1; | 1334 Buf b, b1; |
1280 char *format; | 1335 char *format; |
1281 | 1336 |
1282 binit(&b); | 1337 binit(&b); |
1283 binit(&b1); | 1338 binit(&b1); |
1284 | 1339 |
1285 format = "%s=\"%s\"\n"; | 1340 format = "%s=\"%s\"\n"; |
1286 pflag = 0; | 1341 pflag = 0; |
1287 ARGBEGIN{ | 1342 ARGBEGIN{ |
| 1343 case '9': |
| 1344 format = "%s='%s'\n"; |
| 1345 break; |
1288 case 'p': | 1346 case 'p': |
1289 pflag = 1; | 1347 pflag = 1; |
1290 break; | 1348 break; |
1291 case 'v': | 1349 case 'v': |
1292 vflag++; | 1350 vflag++; |
1293 break; | 1351 break; |
1294 case 'w': | 1352 case 'w': |
1295 format = "set %s=%s\n"; | 1353 format = "set %s=%s\n"; |
1296 break; | 1354 break; |
1297 default: | 1355 default: |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 break; | 1582 break; |
1525 default: | 1583 default: |
1526 usage(); | 1584 usage(); |
1527 }ARGEND | 1585 }ARGEND |
1528 | 1586 |
1529 if(argc > 0) | 1587 if(argc > 0) |
1530 usage(); | 1588 usage(); |
1531 | 1589 |
1532 xprintf("%s\n", goversion); | 1590 xprintf("%s\n", goversion); |
1533 } | 1591 } |
LEFT | RIGHT |