#!/bin/sh
#
# Configure script for myththemes
#

prefix="/usr/local"

for opt do
  case "$opt" in
  --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
  ;;
  esac
done

if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
cat << EOF

Usage:   configure [options]
Options: [defaults in brackets after descriptions]
Generic options:
  --prefix=PREFIX          MythTV install location PREFIX [$prefix]"
  --help                   print this message
EOF
exit 1
fi

# bring in mythtv config
if [ -e $prefix/include/mythtv/mythconfig.mak ] ; then
  rm mythconfig.mak 2> /dev/null
  ln -s $prefix/include/mythtv/mythconfig.mak mythconfig.mak
else
  echo "ERROR: mythconfig.mak not found at $prefix/include/mythtv/mythconfig.mak"
  echo "Did you make AND install MythTV first?"
  echo "Are you using the correct prefix ($prefix)?"
  echo "Bailing out!!"
  exit
fi

if test -x $QTDIR/bin/qmake; then
  $QTDIR/bin/qmake QMAKE=${QTDIR}/bin/qmake myththemes.pro
else
  qmake myththemes.pro
fi
