#! /bin/sh

ustr='Usage: yate-config [--cflags] [--includes] [--c-all]
                   [--ldflags] [--libs] [--ld-all]
		   [--config] [--modules] [--scripts] [--skins]
		   [--version]'
if [ "$#" = 0 ]; then
    echo "$ustr"
    exit 0
fi
prefix="/usr"
exec_prefix="${prefix}"
moddir="${exec_prefix}/lib/yate"
confdir="/etc/yate"
s1="-fno-check-new  -fno-exceptions -fPIC -DHAVE_GCC_FORMAT_CHECK"
s2="-I${prefix}/include/yate"
s3="-export-dynamic -shared -Wl,--unresolved-symbols=ignore-in-shared-libs -Wl,--retain-symbols-file,/dev/null"
s4="-lyate"

while [ "$#" != 0 ]; do
    case "$1" in
	--version)
	    echo "1.0.0"
	    ;;
	--cflags)
	    echo "$s1"
	    ;;
	--includes)
	    echo "$s2"
	    ;;
	--c-all)
	    echo "$s1 $s2"
	    ;;
	--ldflags)
	    echo "$s3"
	    ;;
	--libs)
	    echo "$s4"
	    ;;
	--ld-all)
	    echo "$s3 $s4"
	    ;;
	--config)
	    echo "$confdir"
	    ;;
	--skins)
	    echo "$moddir/modules/skin"
	    ;;
	--modules)
	    echo "$moddir/modules"
	    ;;
	--scripts)
	    echo "$moddir/scripts"
	    ;;
	*)
	    echo "I didn't understand: $1" >&2
	    echo "$ustr" >&2
	    exit 1
	    ;;
    esac
    shift
done
