mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-22 01:41:49 +00:00
1769dece7d
Instead clone the libbpf repo at a specific hash during setup. This is to fix an issue whereby submodules are not included in the tarball and therefore won't be updated/fetched during setup after unzipping the tarball.
28 lines
518 B
Bash
Executable File
28 lines
518 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
out=$("$1" 'map(select(.["file"] | contains ("cc_cflags_probe.c"))) | first | .["command"]' < compile_commands.json)
|
|
out=${out#\"}
|
|
out=${out%\"}
|
|
args=($out)
|
|
|
|
idx=0
|
|
cc=${args[idx]}
|
|
if [ "$cc" = "ccache" ]; then
|
|
idx=$((idx+1))
|
|
cc="$cc ${args[idx]}"
|
|
fi
|
|
|
|
declare -a cflags=()
|
|
|
|
for arg in ${args[@]:(idx+1)}; do
|
|
case $arg in
|
|
-I*|-M*|-o|-c) ;;
|
|
-*) cflags+="$arg ";;
|
|
esac
|
|
done
|
|
|
|
make_out=$(env CC="$cc" CFLAGS="$cflags" BUILD_STATIC_ONLY=y DESTDIR=. "$2" install -C "$3" -j"$4")
|
|
exit $?
|