#!/bin/sh

usage()
{
	echo "usage: $0 [OPTIONS]"
cat << EOH

options:
	[--prefix]
	[--libs]
	[--libs_debug]
	[--ldflags]
	[--cflags]
	[--version]
EOH
	exit 1;
}

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
libecasound_version=11
libkvutils_version=6

flags=""

while test $# -gt 0
do
  case $1 in
    --prefix)
	  flags="$flags $prefix"
	  ;;
    --libs)
	  flags="$flags -L$libdir -lecasound -lkvutils"
	  ;;
    --libs_debug)
	  flags="$flags -L$libdir -lecasound_debug -lkvutils_debug"
	  ;;
    --ldflags)
	  case "$libdir" in
	      /usr/lib);;
	      *)
		  flags="$flags -Wl,--rpath -Wl,$libdir" ;;
	  esac
	  ;;
    --cflags)
	  flags="$flags -I$includedir/libecasound -I$includedir/kvutils"
	  ;;
    --version)
	  echo 2.2.4
	  ;;
	*)
	  echo "$0: unknown option $1"
	  echo 
	  usage
	  ;;
  esac
  shift
done

if test -n "$flags"
then
  echo $flags
fi
