#!/bin/bash

folder=`dirname $0`
/usr/bin/pkgconf "$@" >> /dev/null 2>&1
if [ $? -ne 0 ]; then
    export PKG_CONFIG_PATH=${PKG_CONFIG_SYSROOT_DIR}/usr/lib/pkgconfig:${PKG_CONFIG_SYSROOT_DIR}/usr/share/pkgconfig
    if [[ $1 == "--variable="* ]]; then
        export PKG_CONFIG_SYSROOT_DIR=/
    fi
else
    export PKG_CONFIG_SYSROOT_DIR=/
fi
exec /usr/bin/pkgconf "$@"