- A toolchain compatible with the target architecture and operating system.
Substitute arm-linux-gnueabihf with your toolchain's target triplet.
$ export TARGET=arm-linux-gnueabihf
$ export STATIC_ROOT=`readlink -f ~/${TARGET}-static`
$ wget https://zlib.net/zlib-1.2.11.tar.gz
$ tar xzf zlib-1.2.11.tar.gz
$ cd zlib-1.2.11
$ mkdir build
$ cd build
$ prefix="${STATIC_ROOT}" CC="${TARGET}-gcc" CFLAGS="-I${STATIC_ROOT}/include" \
LDFLAGS="-L${STATIC_ROOT}/lib" ../configure --static
$ make
$ make install