Skip to content

Instantly share code, notes, and snippets.

@Leandros
Created February 17, 2018 19:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Leandros/a6417a75e27aa64f0d21e68ec631ac9a to your computer and use it in GitHub Desktop.
Save Leandros/a6417a75e27aa64f0d21e68ec631ac9a to your computer and use it in GitHub Desktop.
Compile ccache
#!/bin/bash
export PATH=$PATH:$HOME/x86_64-linux-musl/bin
export CC=x86_64-linux-musl-gcc
export CXX=x86_64-linux-musl-g++
# If needed
export CC="$CC -static --static"
export CXX="$CXX -static --static"
function get {
local url=$1
local suffix=$2
local filename=$(basename $url)
local dirname=$(basename $filename $suffix)
wget -nc $url
rm -rf $dirname
tar xf $filename
pushd $dirname
}
get "https://zlib.net/zlib-1.2.11.tar.xz" ".tar.xz"
zlibdir=$(pwd)
popd
get "https://www.samba.org/ftp/ccache/ccache-3.4.1.tar.xz" ".tar.xz"
cp -r ../$zlibdir .
mv $zlibdir zlib
./configure \
--with-bundled-zlib \
--prefix="$(realpath output)"
make -j$(nproc)
make install
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment