From e2385fe329909fd1b7d349071f46f23722a8eaff Mon Sep 17 00:00:00 2001 From: Jared Kirschner Date: Wed, 11 Aug 2021 16:47:30 -0400 Subject: [PATCH] docs: show how to cross-compile from source --- website/content/docs/install/index.mdx | 44 ++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/website/content/docs/install/index.mdx b/website/content/docs/install/index.mdx index f85405f96a..1ba04c683c 100644 --- a/website/content/docs/install/index.mdx +++ b/website/content/docs/install/index.mdx @@ -56,14 +56,44 @@ a copy of [`git`](https://www.git-scm.com/) in your `PATH`. $ make tools ``` -1. Build Consul for your current system and put the binary in `./bin/` - (relative to the git checkout). The `make dev` target is just a shortcut that - builds `consul` for only your local build environment (no cross-compiled - targets). +1. Build Consul for your target system. The binary will be placed in `./bin` + (relative to the git checkout). - ```shell - $ make dev - ``` + + + + + +```shell-session +$ make dev +``` + + + + +Specify your target system by setting the following environment variables +before building: + +- `XC_OS`: Target operating system. Valid values include: + `linux`, `darwin`, `windows`, `solaris`, `freebsd`. +- `XC_ARCH`: Target architecture. Valid values include: + `386`, `amd64`, `arm`, `arm64` + +```shell-session +$ export XC_OS=linux XC_ARCH=amd64 +$ make dev +``` + + + ## Verifying the Installation