From: Ondřej Surý Date: Thu, 12 May 2016 13:27:44 +0000 (+0200) Subject: Allow Go modules on more architectures X-Git-Tag: v1.0.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4775ec7133bf00cd4962193140e7b256a4a2798b;p=thirdparty%2Fknot-resolver.git Allow Go modules on more architectures --- diff --git a/Makefile b/Makefile index 5263fced1..e081aa62a 100644 --- a/Makefile +++ b/Makefile @@ -28,15 +28,24 @@ $(eval $(call find_lib,socket_wrapper)) $(eval $(call find_lib,libdnssec)) $(eval $(call find_lib,libsystemd)) $(eval $(call find_gopkg,geoip,github.com/abh/geoip)) -# Find Go compiler version -# @note Go 1.5 support amd64 only, disabled for other architectures -ifeq ($(ARCH),x86_64) -E := -GO_VERSION := $(subst $(E) $(E),,$(subst go,,$(wordlist 1,2,$(subst ., ,$(word 3,$(shell $(GO) version)))))) -$(eval $(call find_ver,go,$(GO_VERSION),15)) + +GO_VERSION := $(shell $(GO) version | sed -e 's/^go version go\([0-9]\)[.]\([0-9]\)[.]\([0-9]\) .*/\1\2/') +GO_PLATFORM := $(shell $(GO) version | sed -e 's,^go version go[0-9.]* linux/,,') + +$(eval $(call find_ver,go,$(GO_VERSION),16)) + +ifeq ($(HAS_go),yes) +ifneq ($(GO_PLATFORM),$(filter $(GO_PLATFORM),amd64 386 arm arm64)) +HAS_go := no +endif else -HAS_go = no +$(eval $(call find_ver,go,$(GO_VERSION),15)) +ifeq ($HAS_go,yes) +ifneq($(GO_PLATFORM),$(filter $(GO_PLATFORM),arm amd64)) +HAS_go := no endif +endif + # Work around luajit on OS X ifeq ($(PLATFORM), Darwin) ifneq (,$(findstring luajit, $(lua_LIBS))) @@ -74,7 +83,7 @@ info: $(info Optional) $(info --------) $(info [$(HAS_doxygen)] doxygen (doc)) - $(info [$(HAS_go)] go (modules/go, Go 1.5+ on amd64)) + $(info [$(HAS_go)] go (modules/go, Go buildmode=c-shared support)) $(info [$(HAS_geoip)] geoip (modules/tinyweb, github.com/abh/geoip)) $(info [$(HAS_libmemcached)] libmemcached (modules/memcached)) $(info [$(HAS_hiredis)] hiredis (modules/redis))