#!/bin/sh
# $Id: libspt-config.in,v 1.4 2003/01/03 06:40:10 shinra Exp $

prefix=/usr
exec_prefix_spec='${prefix}'
libdir_spec='${exec_prefix}/lib'
libexecdir_spec='${exec_prefix}/libexec'
includedir_spec='${prefix}/include'
deplibs=''

usage()
{
  cat <<EOF
Usage: libspt-config [OPTIONS]
Options:
 [--prefix[=DIR]]
 [--exec-prefix[=DIR]]
 [--libdir[=DIR]]
 [--libexecdir[=DIR]]
 [--includedir[=DIR]]
 [--agent-path]
 [--version]
 [--libs]
 [--libtool]
 [--cflags]
EOF
  exit $1
}

if test $# -eq 0; then
  usage 1 1>&2
fi

while test $# -gt 0; do
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
  --prefix=*)
    prefix=$optarg
    ;;
  --prefix)
    echo_prefix=yes
    ;;
  --exec-prefix=*)
    exec_prefix_spec=$optarg
    ;;
  --exec-prefix)
    echo_exec_prefix=yes
    ;;
  --libdir=*)
    libdir_spec=$optarg
    ;;
  --libdir)
    echo_libdir=yes
    ;;
  --libexecdir=*)
    libexecdir_spec=$optarg
    ;;
  --libexecdir)
    echo_libexecdir=yes
    ;;
  --includedir=*)
    includedir_spec=$optarg
    ;;
  --includedir)
    echo_includedir=yes
    ;;
  --agent-path)
    echo_agent_path=yes
    ;;
  --version)
    echo 0.2.1
    exit 0
    ;;
  --cflags)
    echo_cflags=yes
    ;;
  --libs)
    echo_libs=yes
    ;;
  --libtool)
    echo_libtool=yes
    ;;
  *)
    usage 1 1>&2
    ;;
  esac
  shift
done

eval exec_prefix=$exec_prefix_spec
eval libdir=$libdir_spec
eval includedir=$includedir_spec
eval libexecdir=$libexecdir_spec

if test "$echo_prefix" = "yes"; then
 echo $prefix
fi
if test "$echo_exec_prefix" = "yes"; then
 echo $exec_prefix
fi
if test "$echo_libdir" = "yes"; then
 echo $libdir
fi
if test "$echo_libexecdir" = "yes"; then
 echo $libexecdir
fi
if test "$echo_includedir" = "yes"; then
 echo $includedir
fi
if test "$echo_agent_path" = "yes"; then
 echo $libexecdir/sptagent1
fi
if test "$echo_cflags" = "yes"; then
 echo -I$includedir
fi
if test "$echo_libs" = "yes"; then
 echo "-L$libdir -lSPT $deplibs"
fi
if test "$echo_libtool" = "yes"; then
 convlib="libSPT.la"
 echo $libdir/$convlib
fi

# EOF
