aboutsummaryrefslogtreecommitdiff
path: root/extra/ccache/build
blob: 6ccbdbdd5248b2ab4b587819611ea875d14e6f90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh -e

export DESTDIR=$1
export LDFLAGS="$LDFLAGS -static"

TEST=OFF
[ "$CPT_TEST" ] && TEST=ON

cmake -B build \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DENABLE_DOCUMENTATION=OFF \
    -DENABLE_TESTING=$TEST \
    -DREDIS_STORAGE_BACKEND=OFF \
    -DZSTD_LIBRARY=/usr/lib/libzstd.a

cmake --build   build
cmake --install build

mkdir -p "$1/usr/lib/ccache/bin"
triplet=$(cc -dumpmachine)

for link in cc gcc g++ cpp c++ "$triplet-cc" "$triplet-gcc" \
            "$triplet-g++" "$triplet-cpp" "$triplet-c++"; do
    ln -sf /usr/bin/ccache "$1/usr/lib/ccache/bin/$link"
done