2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-12-22 15:20:06 -07:00
repo/extra/ccache/build

28 lines
Plaintext
Raw Normal View History

2019-08-20 05:20:16 -06:00
#!/bin/sh -e
2020-10-18 22:57:38 -06:00
export DESTDIR="$1"
export CFLAGS="$CFLAGS -static"
export CXXFLAGS="$CXXFLAGS -static"
2019-08-20 05:20:16 -06:00
2020-10-18 22:57:38 -06:00
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=OFF \
-DZSTD_LIBRARY=/usr/lib/libzstd.a
2019-08-20 05:20:16 -06:00
2020-10-18 22:57:38 -06:00
cmake --build build
cmake --install build
2019-08-20 05:20:16 -06:00
mkdir -p "$1/usr/lib/ccache/bin"
2020-03-08 15:05:16 -06:00
host=$(cc -dumpmachine)
2019-08-20 05:20:16 -06:00
2020-10-18 22:57:38 -06:00
for link in \
cc "$host-cc" \
gcc "$host-gcc" \
g++ "$host-g++" \
cpp "$host-cpp" \
c++ "$host-c++"
do
2019-08-20 05:20:16 -06:00
ln -sf /usr/bin/ccache "$1/usr/lib/ccache/bin/$link"
done