Created
February 17, 2018 19:51
-
-
Save Leandros/a6417a75e27aa64f0d21e68ec631ac9a to your computer and use it in GitHub Desktop.
Compile ccache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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