#!/bin/sh

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

options:
	[--libs]
	[--cflags]
	[--version]
	[--prefix]
EOH
}

prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@EXEC_INSTALL_PREFIX@
libdir=@LIB_INSTALL_DIR@
includedir=@INCLUDE_INSTALL_DIR@

flags=""

if test $# -eq 0 ; then
  usage
  exit 0
fi

while test $# -gt 0
do
  case $1 in
    --libs)
	  flags="$flags -L$libdir -lindex"
	  ;;
    --cflags)
	  flags="$flags -I$includedir/index"
	  ;;
    --version)
	  echo 0.94
	  ;;
    --prefix)
	  echo $prefix
	  ;;
    --help)
          usage
	  exit 0
	  ;;
	*)
	  echo "$0: unknown option $1"
	  echo
	  usage
	  exit 1
	  ;;
  esac
  shift
done

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