From 81c7a968ed62a15be3799ee3e13b754ff3e9e45a Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Mon, 11 Feb 2019 16:00:50 +0800 Subject: [PATCH] Makefile: Set ARCH in GOPATH not set mode In GOPATH not set mode got: make: go: Command not found Makefile:38: arch/-options.mk: No such file or directory make: go: Command not found Makefile:237: *** "ERROR: No hypervisors known for architecture (looked for: firecracker qemu)". Stop. The root cause is GOPATH not set mode is not set ARCH. Set it to fix the issue. Fixes: #1224 Signed-off-by: Hui Zhu --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6d5bd6c1c3..51e5fd0f97 100644 --- a/Makefile +++ b/Makefile @@ -23,9 +23,17 @@ ifeq ($(SKIP_GO_VERSION_CHECK),) include golang.mk endif -GOARCH=$(shell go env GOARCH) -ifeq ($(ARCH),) - ARCH = $(GOARCH) +#Get ARCH. +ifneq ($(GOPATH),) + GOARCH=$(shell go env GOARCH) + ifeq ($(ARCH),) + ARCH = $(GOARCH) + endif +else + ARCH = $(shell uname -m) + ifeq ($(ARCH),x86_64) + ARCH = amd64 + endif endif ARCH_DIR = arch