2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-11-15 11:10:08 -07:00
repo/extra/ccache/build
2020-10-19 07:57:38 +03:00

28 lines
543 B
Bash
Executable File

#!/bin/sh -e
export DESTDIR="$1"
export CFLAGS="$CFLAGS -static"
export CXXFLAGS="$CXXFLAGS -static"
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=OFF \
-DZSTD_LIBRARY=/usr/lib/libzstd.a
cmake --build build
cmake --install build
mkdir -p "$1/usr/lib/ccache/bin"
host=$(cc -dumpmachine)
for link in \
cc "$host-cc" \
gcc "$host-gcc" \
g++ "$host-g++" \
cpp "$host-cpp" \
c++ "$host-c++"
do
ln -sf /usr/bin/ccache "$1/usr/lib/ccache/bin/$link"
done