Files
kutu/compile.sh
2025-09-29 21:20:48 +01:00

24 lines
545 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
DIR="$(cd -- "$(dirname -- "$0")" && pwd)"
if ! XCB=$(pkg-config --cflags --libs xcb 2>/dev/null); then
echo "Error: lib-xcb not found. Please install lib-xcb." >&2
exit 1
fi
if ! xrandr --version >/dev/null; then
echo "Error: xrandr not found. Please install xrandr." >&2
exit 1
fi
gcc -shared -fPIC -Wall -Wextra -o "$DIR/X-kutu.so" "$DIR/X-kutu.c" $XCB
if [ ! -f "$DIR/X-kutu.so" ]; then
echo "Error: compilation failed." >&2
exit 1
else
echo "Success: $DIR/X-kutu.so is compiled."
fi