#!/bin/sh -e

# Copyright (C) 2011 Stefan Weil

# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the file COPYING in the top-level directory.

# This script provides a cross pkg-config for QEMU cross compilations.
# It will use the standard pkg-config with special options for the
# cross environment which is assumed to be in /usr/{cross-prefix}.

# Installation (Debian and similar distributions):
# Simply copy or link it to /usr/bin/{cross-prefix}-pkg-config.

# Examples (Debian, Ubuntu):
# /usr/bin/amd64-mingw32msvc-pkg-config
# /usr/bin/i586-mingw32msvc-pkg-config
# /usr/bin/arm-linux-gnueabi-pkg-config
# /usr/bin/mipsel-linux-gnu-pkg-config

basename=`basename "$0"`
prefix="/usr/${basename%-pkg-config}"
export PKG_CONFIG_LIBDIR=$prefix/lib/pkgconfig
exec pkg-config --define-variable=prefix="$prefix" "$@"

# end
