#!/usr/bin/env bash
# pkg-config for the Mizu SDK: only its libraries (sdk/libc/lib/pkgconfig), always --static
# (everything links statically). PKG_CONFIG=/path/to/mizu-sdk/koi-pkg-config for configure;
# the CMake toolchain file sets it. --mizu-sdk: the SDK's version.
set -euo pipefail
SDK=$(cd "$(dirname "$(readlink -f "$0")")" && pwd)
if [ "${1:-}" = --mizu-sdk ]; then cat "$SDK/VERSION" 2>/dev/null || echo "unknown (no VERSION)"; exit 0; fi
HOST=$(command -v pkg-config || command -v pkgconf || true)
[ -n "$HOST" ] || { echo "koi-pkg-config: no pkg-config on this machine (install pkg-config or pkgconf)" >&2; exit 127; }
PKG_CONFIG_LIBDIR="$SDK/libc/lib/pkgconfig" PKG_CONFIG_PATH= PKG_CONFIG_SYSROOT_DIR= exec "$HOST" --static "$@"
