bridge: go get requires arch paths
So we move it into the build phase. This makes sense, since ostensibly different archs might have different required modules.
This commit is contained in:
parent
6abfda2333
commit
aed643ff7e
|
@ -36,20 +36,25 @@ $(foreach FILE,$(UPSTREAM_FILES),$(eval $(call copy-src-to-build,../wireguard-go
|
||||||
$(foreach FILE,$(DOWNSTREAM_FILES),$(eval $(call copy-src-to-build,src/,$(FILE))))
|
$(foreach FILE,$(DOWNSTREAM_FILES),$(eval $(call copy-src-to-build,src/,$(FILE))))
|
||||||
|
|
||||||
$(BUILDDIR)/.prepared:
|
$(BUILDDIR)/.prepared:
|
||||||
cd "$(BUILDDIR)" && if ! GOPATH="$(BUILDDIR)/gopath" go get -tags ios; then chmod -fR +w "$(BUILDDIR)/gopath/pkg/mod"; rm -rf "$(BUILDDIR)/gopath/pkg/mod"; exit 1; fi
|
@touch "$@"
|
||||||
chmod -fR +w "$(BUILDDIR)/gopath/pkg/mod"
|
|
||||||
touch "$@"
|
|
||||||
|
|
||||||
define libwg-go-a
|
define libwg-go-a
|
||||||
$(BUILDDIR)/libwg-go-$(1).a: $(BUILDDIR)/.prepared
|
$(BUILDDIR)/libwg-go-$(1).a: $(BUILDDIR)/.prepared
|
||||||
cd "$(BUILDDIR)" && \
|
cd "$(BUILDDIR)" && \
|
||||||
CC="$(CC_$(1))" \
|
export CC="$(CC_$(1))" \
|
||||||
CGO_CFLAGS="$(CGO_FLAGS_$(1))" \
|
CGO_CFLAGS="$(CGO_FLAGS_$(1))" \
|
||||||
CGO_LDFLAGS="$(CGO_FLAGS_$(1))" \
|
CGO_LDFLAGS="$(CGO_FLAGS_$(1))" \
|
||||||
GOARCH="$(GOARCH_$(1))" \
|
GOARCH="$(GOARCH_$(1))" \
|
||||||
GOPATH="$(BUILDDIR)/gopath" \
|
GOPATH="$(BUILDDIR)/gopath"; \
|
||||||
go build -tags ios -v -o "$(BUILDDIR)/libwg-go-$(1).a" -buildmode c-archive
|
if ! go get -tags ios; then \
|
||||||
@rm -f "$(BUILDDIR)/libwg-go-$(1).h"
|
ret=$$$$?; \
|
||||||
|
chmod -fR +w "$(BUILDDIR)/gopath/pkg/mod"; \
|
||||||
|
rm -rf "$(BUILDDIR)/gopath/pkg/mod"; \
|
||||||
|
exit $$$$ret; \
|
||||||
|
fi; \
|
||||||
|
chmod -fR +w "$(BUILDDIR)/gopath/pkg/mod"; \
|
||||||
|
go build -tags ios -v -o "$(BUILDDIR)/libwg-go-$(1).a" -buildmode c-archive; \
|
||||||
|
rm -f "$(BUILDDIR)/libwg-go-$(1).h"
|
||||||
endef
|
endef
|
||||||
$(foreach ARCH,$(ARCHS),$(eval $(call libwg-go-a,$(ARCH))))
|
$(foreach ARCH,$(ARCHS),$(eval $(call libwg-go-a,$(ARCH))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue