Document cross-compiling

This commit is contained in:
Gregor Riepl 2021-01-31 18:05:00 +01:00
parent d9f2166259
commit 61d1fee98a

View file

@ -99,13 +99,21 @@ Wring schema of the old vending machine.
Central controller software. Has a simple HTTP API for controlling output and Central controller software. Has a simple HTTP API for controlling output and
checking the current fill status of each slot. checking the current fill status of each slot.
Written in Go, must be compiled before use: The controller is written in Go, must be compiled before use:
```shell ```shell
cd uncanny/ cd uncanny/
go build ./cmd/uncanny go build ./cmd/uncanny
``` ```
Note that CGO is required because the source code makes use of the global
`messages.h` C header file. If you need to cross-compile, use the following
command:
```shell
GOARCH=arm GOOS=linux CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc go build -o uncanny-linux-arm ./cmd/uncanny
```
The resulting `uncanny` executable should be running on the controlling The resulting `uncanny` executable should be running on the controlling
Raspberry Pi. An example SystemD unit is provided in `server/uncanny.service`. Raspberry Pi. An example SystemD unit is provided in `server/uncanny.service`.
Copy `uncanny` to `/usr/bin`, install the service file to Copy `uncanny` to `/usr/bin`, install the service file to