]> git.armaanb.net Git - asd-repo.git/blob - extra/ccache/build
zstd: move to junk
[asd-repo.git] / extra / ccache / build
1 #!/bin/sh -e
2
3 (
4     cd zstd
5     sed -i 's/^FLAGS.*=/FLAGS = -static /' programs/Makefile
6     
7     gmake \
8         HAVE_LZMA=0 \
9         HAVE_ZLIB=0 \
10         HAVE_LZ4=0
11     
12     gmake \
13         DESTDIR="$PWD/out" \
14         PREFIX=/usr \
15         install
16 )
17
18 export DESTDIR="$1"
19 export CFLAGS="$CFLAGS -static"
20 export CXXFLAGS="$CXXFLAGS -static"
21 export LDFLAGS="$LDFLAGS -lc++ -lc++abi -lunwind -static"
22
23 cmake -B build \
24     -DCMAKE_INSTALL_PREFIX=/usr \
25     -DCMAKE_BUILD_TYPE=Release \
26     -DENABLE_TESTING=OFF \
27     -DZSTD_INCLUDE_DIR="$PWD/zstd/out/usr/include/" \
28     -DZSTD_LIBRARY="$PWD/zstd/out/usr/lib/libzstd.a"
29
30 cmake --build   build
31 cmake --install build
32
33 mkdir -p "$1/usr/lib/ccache/bin"
34
35 for link in \
36     cc      \
37     clang   \
38     clang++ \
39     cpp     \
40     c++
41 do
42     ln -sf /usr/bin/ccache "$1/usr/lib/ccache/bin/$link"
43 done