]> git.armaanb.net Git - asd-repo.git/blob - ccache/build
fdefd5dad4c39bce460d906a6671c8c2c35a5ca7
[asd-repo.git] / ccache / build
1 #!/bin/sh -e
2
3 export DESTDIR="$1"
4 export CFLAGS="$CFLAGS -static"
5 export CXXFLAGS="$CXXFLAGS -static"
6
7 cmake -B build \
8     -DCMAKE_INSTALL_PREFIX=/usr \
9     -DCMAKE_BUILD_TYPE=Release \
10     -DENABLE_TESTING=OFF \
11     -DZSTD_LIBRARY=/usr/lib/libzstd.a
12
13 cmake --build   build
14 cmake --install build
15
16 mkdir -p "$1/usr/lib/ccache/bin"
17 host=$(cc -dumpmachine)
18
19 for link in \
20     cc  "$host-cc"  \
21     cpp "$host-cpp" \
22     c++ "$host-c++" \
23     clang clang++
24 do
25     ln -sf /usr/bin/ccache "$1/usr/lib/ccache/bin/$link"
26 done