diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2020-09-22 19:25:24 -0700 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2020-09-22 19:25:24 -0700 |
commit | 1b8c082b800c30c480664a3822ed8f3c9aedf8df (patch) | |
tree | 734a9663a8284795d86db7fd2b6fa9dabb0b8363 /go/Makefile | |
parent | 3e43abc9c77a07b7826853b77a43985ab12133d6 (diff) | |
download | libcap2-1b8c082b800c30c480664a3822ed8f3c9aedf8df.tar.gz |
Adjust builds for golang versions that default to not supporting GOPATH.
Just to be sure, for self-contained testing purposes, force
not using Go modules when building/testing the tree.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'go/Makefile')
-rw-r--r-- | go/Makefile | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/go/Makefile b/go/Makefile index 508b380..eee379e 100644 --- a/go/Makefile +++ b/go/Makefile @@ -43,18 +43,18 @@ good-names.go: $(topdir)/libcap/cap_names.h src/$(IMPORTDIR)/cap mknames.go $(PSXGOPACKAGE): src/$(IMPORTDIR)/psx ../psx/*.go $(DEPS) mkdir -p pkg - CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH="$(GOPATH)" $(GO) install $(IMPORTDIR)/psx + GO111MODULE=off CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH="$(GOPATH)" $(GO) install $(IMPORTDIR)/psx $(CAPGOPACKAGE): src/$(IMPORTDIR)/cap ../cap/*.go good-names.go $(PSXGOPACKAGE) - CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH=$(GOPATH) $(GO) install $(IMPORTDIR)/cap + GO111MODULE=off CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH=$(GOPATH) $(GO) install $(IMPORTDIR)/cap # Compiles something with this package to compare it to libcap. This # tests more when run under sudotest (see ../progs/quicktest.sh for that). compare-cap: compare-cap.go $(CAPGOPACKAGE) - CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPATH=$(GOPATH) $(GO) build $< + GO111MODULE=off CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPATH=$(GOPATH) $(GO) build $< web: ../goapps/web/web.go $(CAPGOPACKAGE) - CGO_ENABLED="$(CGO_REQUIRED)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH=$(GOPATH) $(GO) build -o $@ $(GOBUILDTAG) $< + GO111MODULE=off CGO_ENABLED="$(CGO_REQUIRED)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH=$(GOPATH) $(GO) build -o $@ $(GOBUILDTAG) $< ifeq ($(RAISE_GO_FILECAP),yes) make -C ../progs setcap sudo ../progs/setcap cap_setpcap,cap_net_bind_service=p web @@ -62,17 +62,17 @@ ifeq ($(RAISE_GO_FILECAP),yes) endif ok: ok.go - CGO_ENABLED=0 GOPATH=$(GOPATH) $(GO) build $< + GO111MODULE=off CGO_ENABLED=0 GOPATH=$(GOPATH) $(GO) build $< try-launching: try-launching.go $(CAPGOPACKAGE) ok - CGO_ENABLED="$(CGO_REQUIRED)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH=$(GOPATH) $(GO) build $(GOBUILDTAG) $< + GO111MODULE=off CGO_ENABLED="$(CGO_REQUIRED)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH=$(GOPATH) $(GO) build $(GOBUILDTAG) $< ifeq ($(CGO_REQUIRED),0) - CGO_ENABLED="1" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH=$(GOPATH) $(GO) build -o $@-cgo $< + GO111MODULE=off CGO_ENABLED="1" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH=$(GOPATH) $(GO) build -o $@-cgo $< endif test: all - CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH="$(GOPATH)" $(GO) test $(IMPORTDIR)/psx - CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH="$(GOPATH)" $(GO) test $(IMPORTDIR)/cap + GO111MODULE=off CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH="$(GOPATH)" $(GO) test $(IMPORTDIR)/psx + GO111MODULE=off CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH="$(GOPATH)" $(GO) test $(IMPORTDIR)/cap LD_LIBRARY_PATH=../libcap ./compare-cap sudotest: test ../progs/tcapsh-static |