Skip to content

Commit c9e4d80

Browse files
committed
support to build with flag CROSS_COMPILE
Signed-off-by: ningmingxiao <[email protected]>
1 parent 2bfc04a commit c9e4d80

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,10 @@ ifeq ($(GOOS),darwin)
547547
to_uname_m = $(foreach arch,$(1),$(shell echo $(arch) | sed 's/amd64/x86_64/'))
548548
else ifeq ($(GOOS),linux)
549549
# CC is required for cross-compiling on Linux.
550-
CC = $(call to_uname_m,$(GOARCH))-linux-gnu-gcc
550+
CC = gcc
551+
ifneq ($(CROSS_COMPILE),)
552+
CC = $(call to_uname_m,$(GOARCH))-linux-gnu-gcc
553+
endif
551554
else ifeq ($(GOOS),windows)
552555
# artifact in zip format also provided for Windows.
553556
ARTIFACT_FILE_EXTENSIONS += .zip

website/content/en/docs/installation/source.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ cd lima
2222
make
2323
sudo make install
2424
```
25+
Build other platform:
26+
``` bash
27+
make CROSS_COMPILE=1
28+
sudo make install
29+
```
2530

2631
> **Note:** `sudo make install` is required unless you have write permissions for `/usr/local`. Otherwise, installation may fail.
2732

0 commit comments

Comments
 (0)