#!/bin/sh

prefix=/usr/local
exec_prefix=/usr/local
exec_prefix_set=no

usage()
{
  cat <<EOF 1>&2
Usage: lqt-config [--prefix[=DIR]] [--exec-prefix[=DIR]]
                  [--plugin-dir] [--version] [--libs | --plugin-libs] 
                  [--cflags | --plugin-cflags]

EOF
  exit 1
}

if test $# -eq 0; then
    usage
fi

the_libs="-lquicktime -lGL -pthread -lm -lz "
the_cflags=""

echo_libs=no
echo_cflags=no

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
      if test $exec_prefix_set = no ; then
        exec_prefix=$optarg
      fi
      ;;
    --prefix)
      echo $prefix
      ;;
    --exec-prefix=*)
      exec_prefix=$optarg
      exec_prefix_set=yes
      ;;
    --exec-prefix)
      echo $exec_prefix
      ;;
    --version)
      echo 1.0.2
      ;;
    --plugin-dir)
      echo /usr/local/lib/libquicktime
      ;;
    --cflags|--plugin-cflags)
      echo_cflags=yes
      ;;
    --libs|--plugin-libs)
      the_libs="-L${exec_prefix}/lib $the_libs"
      echo_libs=yes
      ;;
    *)
      usage
      ;;
  esac
  shift
done

if test x$echo_libs = xyes; then
  echo $the_libs
fi

if test x$echo_cflags = xyes; then
  echo $the_cflags
fi
