[lxc-devel] [lxd/master] Honor the CC environment variable when invoking go install

freeekanayaka on Github lxc-bot at linuxcontainers.org
Mon Aug 27 08:49:36 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 720 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180827/7b4dc938/attachment.bin>
-------------- next part --------------
From af4567d9a53e3e43b2ce29f171d1091a785bd256 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Mon, 27 Aug 2018 10:46:09 +0200
Subject: [PATCH] Honor the CC environment variable when invoking go install

It seems that Go does not do that by itself, so for example if clang is
installed instead of gcc, make fails with:

free at x1:/srv/src/go/src/github.com/lxc/lxd$ make
go get -t -v -d ./...
go install -v -tags "libsqlite3"  ./...
github.com/lxc/lxd/lxd
exec: "gcc": executable file not found in $PATH

This change explicitely pass $CC to go install.

Signed-off-by: Free Ekanayaka <free.ekanayaka at canonical.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f4cb3fa62e..415f52a566 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ ifeq ($(TAG_SQLITE3),)
 endif
 
 	go get -t -v -d ./...
-	go install -v -tags "$(TAG_SQLITE3)" $(DEBUG) ./...
+	CC=$(CC) go install -v -tags "$(TAG_SQLITE3)" $(DEBUG) ./...
 	@echo "LXD built successfully"
 
 .PHONY: client
@@ -83,7 +83,7 @@ ifeq ($(TAG_SQLITE3),)
 endif
 
 	go get -t -v -d ./...
-	go install -v -tags "$(TAG_SQLITE3) logdebug" $(DEBUG) ./...
+	CC=$(CC) go install -v -tags "$(TAG_SQLITE3) logdebug" $(DEBUG) ./...
 	@echo "LXD built successfully"
 
 .PHONY: check


More information about the lxc-devel mailing list