Skip to content

Commit 865187a

Browse files
authored
Readme: static compilation
Add information about compiling the aa-proxy-rs binary statically, to be able to use it everywhere.
1 parent 2eb3be4 commit 865187a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ I am using this project almost daily in my car and trying to get rid of all issu
1818
## SD card images
1919
I am using Nisarg's RaspberryPi images from [WirelessAndroidAutoDongle](https://github.com/nisargjhaveri/WirelessAndroidAutoDongle) project and replacing `aawgd` with `aa-proxy-rs`.<br>
2020
Those images are available on the [Release page](https://github.com/manio/aa-proxy-rs/releases).<br>
21-
You can also find there a pure `aa-proxy-rs` binary which you can install manually (read below: [Installing into target](#installing-into-target)).
21+
You can also find there a pure `aa-proxy-rs` binary which you can install manually on targets with similar libc versions, or build your own (read below: [Installing into target](#installing-into-target) and [Building](#building)).
2222

2323
## History and motivation
2424
There are a lot of commercial solutions like AAWireless or Motorola MA1. I even bought a clone of those on AliExpress, but it ended up not working in my car (passed to my friend which has a compatible car for this).
@@ -77,6 +77,10 @@ not ready with USB connection then we can't send data to the phone and Android w
7777
because of usb-gadget module [incompatibility](https://github.com/nisargjhaveri/WirelessAndroidAutoDongle/pull/129).
7878
To be able to properly crosscompile output binary I provided `.cargo/config.toml` with target set for this specific arch.
7979

80+
### Dependencies
81+
1. [Installing Rust](https://www.rust-lang.org/tools/install)
82+
2. `gcc-arm-linux-gnueabihf` package is needed on Debian. This is distro-depended so I recommend to RTFM.
83+
8084
To compile you need to add proper rustup target with:
8185
```
8286
rustup target add arm-unknown-linux-gnueabihf
@@ -85,7 +89,15 @@ and make sure that it is _installed_ on target list:
8589
```
8690
arm-unknown-linux-gnueabihf (installed)
8791
```
88-
Besides a `gcc-arm-linux-gnueabihf` package is needed on Debian. This is distro-depended so I recommend to RTFM.
92+
and then use:
93+
```
94+
cargo build --release
95+
```
96+
97+
To compile a STATIC `aa-proxy-rs` binary (to be able to use it on target with older OSes and different libc versions), you need to compile with:
98+
```
99+
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release
100+
```
89101

90102
## Building using Docker
91103
To build with Docker you need to have a [buildx](https://github.com/docker/buildx) and [BuildKit](https://github.com/moby/buildkit).<br>

0 commit comments

Comments
 (0)